@ng-zen/cli 19.1.0-next.1 → 19.2.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/deploy.yml +13 -5
- package/.github/workflows/release.yml +1 -0
- package/.storybook/stories/pages/{1 Welcome.mdx → 1 README.mdx } +1 -1
- package/.storybook/stories/pages/2 License.mdx +1 -1
- package/.storybook/stories/pages/3 CHANGELOG.mdx +9 -0
- package/CHANGELOG.md +42 -0
- package/CONTRIBUTING.md +48 -21
- package/DEVELOPMENT.md +104 -46
- package/README.md +72 -51
- package/angular.json +2 -2
- package/eslint.config.js +34 -1
- package/package.json +45 -50
- package/src/schematics/components/components-generator.ts +1 -1
- package/src/schematics/components/files/button/button.component.scss +6 -5
- package/src/schematics/components/files/button/button.stories.ts +1 -0
- package/src/schematics/components/files/checkbox/checkbox.component.scss +1 -1
- package/src/schematics/components/files/checkbox/checkbox.component.ts +1 -1
- package/src/schematics/components/files/checkbox/checkbox.stories.ts +1 -0
- package/src/schematics/components/files/divider/divider.component.scss +52 -0
- package/src/schematics/components/files/divider/divider.component.spec.ts +22 -0
- package/src/schematics/components/files/divider/divider.component.ts +58 -0
- package/src/schematics/components/files/divider/divider.stories.ts +69 -0
- package/src/schematics/components/files/divider/index.ts +1 -0
- package/src/schematics/components/files/input/input.component.scss +1 -1
- package/src/schematics/components/files/input/input.stories.ts +1 -0
- package/src/schematics/components/files/switch/switch.component.scss +2 -2
- package/src/schematics/components/files/switch/switch.stories.ts +1 -0
- package/src/schematics/components/files/textarea/textarea.component.scss +1 -1
- package/src/schematics/components/files/textarea/textarea.stories.ts +1 -0
- package/src/schematics/components/schema.json +1 -1
- package/src/schematics/ng-add/index.ts +4 -6
- package/src/schematics/ng-add/ng-zen-generator.ts +3 -3
- package/src/utils/apply-file-template.util.ts +1 -0
- package/src/utils/index.ts +0 -1
- package/projects/schematic-builder/builders/builders.json +0 -9
- package/projects/schematic-builder/builders/index.js +0 -100
- package/projects/schematic-builder/builders/schema.json +0 -18
- package/projects/schematic-builder/package.json +0 -11
- package/src/utils/add-path-to-tsconfig.util.ts +0 -50
|
@@ -2,7 +2,8 @@ name: Deploy Storybook to github pages
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
-
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*.*.*'
|
|
6
7
|
workflow_dispatch:
|
|
7
8
|
|
|
8
9
|
env:
|
|
@@ -18,14 +19,21 @@ jobs:
|
|
|
18
19
|
deploy:
|
|
19
20
|
runs-on: ubuntu-latest
|
|
20
21
|
steps:
|
|
21
|
-
-
|
|
22
|
-
|
|
22
|
+
- name: Checkout code
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
- name: Enable Corepack
|
|
25
|
+
run: corepack enable
|
|
26
|
+
- name: Setup pnpm
|
|
27
|
+
uses: pnpm/action-setup@v4
|
|
23
28
|
with:
|
|
24
29
|
version: ${{ env.PNPM_VERSION }}
|
|
25
|
-
-
|
|
30
|
+
- name: Setup Node.js
|
|
31
|
+
uses: actions/setup-node@v4
|
|
26
32
|
with:
|
|
27
33
|
node-version: ${{ env.NODE_VERSION }}
|
|
28
|
-
|
|
34
|
+
cache: 'pnpm'
|
|
35
|
+
- name: Build and deploy Storybook
|
|
36
|
+
id: build-publish
|
|
29
37
|
uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
|
|
30
38
|
with:
|
|
31
39
|
install_command: pnpm install --frozen-lockfile
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,45 @@
|
|
|
1
|
+
## 19.2.0-next.1 (2025-05-23)
|
|
2
|
+
|
|
3
|
+
* chore(dependencies): update dependencies (#187) ([7028a9e](https://github.com/kstepien3/ng-zen/commit/7028a9e)), closes [#187](https://github.com/kstepien3/ng-zen/issues/187)
|
|
4
|
+
* chore(dependencies): update ngx-schematic-builder to v0.2.0 (#183) ([5ea0cea](https://github.com/kstepien3/ng-zen/commit/5ea0cea)), closes [#183](https://github.com/kstepien3/ng-zen/issues/183)
|
|
5
|
+
* chore(workflow): update deploy workflow for tag-based triggering (#166) ([0fea522](https://github.com/kstepien3/ng-zen/commit/0fea522)), closes [#166](https://github.com/kstepien3/ng-zen/issues/166) [#165](https://github.com/kstepien3/ng-zen/issues/165)
|
|
6
|
+
* chore(workflows): disable persist-credentials in release workflow (#188) ([b784e47](https://github.com/kstepien3/ng-zen/commit/b784e47)), closes [#188](https://github.com/kstepien3/ng-zen/issues/188)
|
|
7
|
+
* feat(divider): add zen-divider component (#186) ([c021773](https://github.com/kstepien3/ng-zen/commit/c021773)), closes [#186](https://github.com/kstepien3/ng-zen/issues/186)
|
|
8
|
+
* style(components): update outline styles (#184) ([5737a15](https://github.com/kstepien3/ng-zen/commit/5737a15)), closes [#184](https://github.com/kstepien3/ng-zen/issues/184)
|
|
9
|
+
* fix(schematics/ng-add): run other schematics after installation (#177) ([5cb1be4](https://github.com/kstepien3/ng-zen/commit/5cb1be4)), closes [#177](https://github.com/kstepien3/ng-zen/issues/177)
|
|
10
|
+
* ci(eslint): fix plugins and configure linting rules (#176) ([5e93a09](https://github.com/kstepien3/ng-zen/commit/5e93a09)), closes [#176](https://github.com/kstepien3/ng-zen/issues/176)
|
|
11
|
+
* build(deps-dev): bump typescript from 5.7.3 to 5.8.3 (#154) ([3ebe49f](https://github.com/kstepien3/ng-zen/commit/3ebe49f)), closes [#154](https://github.com/kstepien3/ng-zen/issues/154)
|
|
12
|
+
* build(ngx-schematic-builder): migrate the custom builder (#175) ([c7d19eb](https://github.com/kstepien3/ng-zen/commit/c7d19eb)), closes [#175](https://github.com/kstepien3/ng-zen/issues/175)
|
|
13
|
+
* Merge remote-tracking branch 'origin/next' into develop ([f581d01](https://github.com/kstepien3/ng-zen/commit/f581d01))
|
|
14
|
+
|
|
15
|
+
## [19.1.0](https://github.com/kstepien3/ng-zen/compare/v19.0.0...v19.1.0) (2025-04-27)
|
|
16
|
+
|
|
17
|
+
### 🚀 New Features
|
|
18
|
+
|
|
19
|
+
* **switch:** add missing css variables ([0481ac7](https://github.com/kstepien3/ng-zen/commit/0481ac7d735eba4ee47fbc6a69cdee643f5b9b4c))
|
|
20
|
+
|
|
21
|
+
### 🏗️ Build Changes
|
|
22
|
+
|
|
23
|
+
* **deps-dev:** bump @angular-devkit/architect from 0.1902.6 to 0.1902.9 ([#160](https://github.com/kstepien3/ng-zen/issues/160)) ([e8fa092](https://github.com/kstepien3/ng-zen/commit/e8fa092e8aefcd15f4fb5755e150b2834d359fb4))
|
|
24
|
+
* **deps-dev:** bump angular-eslint from 19.0.2 to 19.3.0 ([#136](https://github.com/kstepien3/ng-zen/issues/136)) ([ccad1a9](https://github.com/kstepien3/ng-zen/commit/ccad1a903bbd8edf37571f764dded81ea5fe29aa))
|
|
25
|
+
* **deps-dev:** bump eslint-plugin-storybook from 0.11.6 to 0.12.0 ([#137](https://github.com/kstepien3/ng-zen/issues/137)) ([e8d63f3](https://github.com/kstepien3/ng-zen/commit/e8d63f3ec9d7f0af1a4cb7e2ceb3ff2843af43ad))
|
|
26
|
+
* **deps-dev:** bump typescript-eslint from 8.24.0 to 8.29.0 ([#135](https://github.com/kstepien3/ng-zen/issues/135)) ([89d371f](https://github.com/kstepien3/ng-zen/commit/89d371f73f711848c548c32e8c1d5201f80c3073))
|
|
27
|
+
|
|
28
|
+
### 🧹 Chore
|
|
29
|
+
|
|
30
|
+
* add conventional-changelog-conventionalcommits dependency ([c6d2342](https://github.com/kstepien3/ng-zen/commit/c6d23422c5866645b520f55dc3c10700fc268d06))
|
|
31
|
+
* change version alpha -> next ([aa5482c](https://github.com/kstepien3/ng-zen/commit/aa5482cd504a89e60eae07f6a3ea343ca8886e57))
|
|
32
|
+
* change version to v19.0.0-next.0 [skip ci] ([7ee3dbd](https://github.com/kstepien3/ng-zen/commit/7ee3dbd6d22a3d24c85fba0978c127f28c9248d4))
|
|
33
|
+
* fix problems with release ([a54af7a](https://github.com/kstepien3/ng-zen/commit/a54af7aa33259bb904df707f8450b39a1f8e00c9))
|
|
34
|
+
* **release:** 19.1.0-next.1 [skip ci] ([7ca3b5c](https://github.com/kstepien3/ng-zen/commit/7ca3b5c989121b41c95c261236b5c89409c83210))
|
|
35
|
+
|
|
36
|
+
### 📚 Documentation
|
|
37
|
+
|
|
38
|
+
* **readme.md:** update links in badges ([#146](https://github.com/kstepien3/ng-zen/issues/146)) ([667f71c](https://github.com/kstepien3/ng-zen/commit/667f71c3891764f12d7b025e4b0c7e9ea872d00b))
|
|
39
|
+
* **README:** improve documentation ([#149](https://github.com/kstepien3/ng-zen/issues/149)) ([bbbfd4e](https://github.com/kstepien3/ng-zen/commit/bbbfd4e592907c6c544e9004d104842df5475fab))
|
|
40
|
+
* **storybook:** load CHANGELOG.md ([#145](https://github.com/kstepien3/ng-zen/issues/145)) ([f7df739](https://github.com/kstepien3/ng-zen/commit/f7df739ba88d4ffc1a63dea6bdec2bb3112933d0))
|
|
41
|
+
* update development information ([#148](https://github.com/kstepien3/ng-zen/issues/148)) ([981a998](https://github.com/kstepien3/ng-zen/commit/981a9981385d22d763fe63bfcf075970bec4495d))
|
|
42
|
+
|
|
1
43
|
## [19.1.0-next.1](https://github.com/kstepien3/ng-zen/compare/v19.0.0...v19.1.0-next.1) (2025-04-06)
|
|
2
44
|
|
|
3
45
|
### 🚀 New Features
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,27 +1,54 @@
|
|
|
1
1
|
# Contributing to @ng-zen/cli
|
|
2
2
|
|
|
3
|
-
Thank you for
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
3
|
+
Thank you for your interest in contributing! This document outlines the essential steps and requirements for submitting contributions.
|
|
4
|
+
|
|
5
|
+
**For detailed information on project setup, the full branching strategy, specific tool usage (Storybook, Verdaccio), and the reasoning behind our workflows, please refer to the [DEVELOPMENT.md](DEVELOPMENT.md) file.**
|
|
6
|
+
|
|
7
|
+
## Key Requirements for Contributors
|
|
8
|
+
|
|
9
|
+
1. **Conventional Commits (Mandatory):** All commit messages **must** adhere to the Conventional Commits specification (https://www.conventionalcommits.org/). This is critical for automated releases. Invalid messages will block commits. See [Commit Messages](DEVELOPMENT.md#commit-messages-crucial) for details on commit types and their impact.
|
|
10
|
+
2. **Target Branch:** Pull Requests **must target the `develop` branch.** PRs targeting `master` or `next` directly will generally be closed unless specifically requested for hotfixes.
|
|
11
|
+
3. **Automated Checks:**
|
|
12
|
+
|
|
13
|
+
- Code formatting and basic lint fixes are applied automatically on commit via `husky` and `nano-staged`.
|
|
14
|
+
- Full CI checks (linting, testing, building) run automatically on Pull Requests via GitHub Actions (`ci.yml`). **Your PR must pass all CI checks to be eligible for merging.**
|
|
15
|
+
|
|
16
|
+
## Contribution Steps
|
|
17
|
+
|
|
18
|
+
1. **Fork & Clone:** Fork the [ng-zen repository](https://github.com/kstepien3/ng-zen) and clone your fork locally. _(See [Prerequisites & Setup](DEVELOPMENT.md#prerequisites--setup) if needed)_.
|
|
19
|
+
2. **Sync `develop`:** Ensure your local `develop` branch is up-to-date:
|
|
20
|
+
```bash
|
|
21
|
+
git switch develop
|
|
22
|
+
git pull origin develop
|
|
23
|
+
```
|
|
24
|
+
3. **Create Branch:** Create your working branch **from `develop`**:
|
|
25
|
+
```bash
|
|
26
|
+
# Use format: <type>/<short-description>
|
|
27
|
+
git switch -c feat/add-hover-effect develop
|
|
28
|
+
```
|
|
29
|
+
4. **Develop:** Implement your code changes. Remember to add or update relevant unit tests (`*.spec.ts`) and documentation/Storybook stories (`*.stories.ts`, etc.) as necessary. _(See [Working with Storybook](DEVELOPMENT.md#working-with-storybook) section for more details)_.
|
|
30
|
+
5. **Commit:** Commit your work using **Conventional Commit** messages.
|
|
31
|
+
```bash
|
|
32
|
+
git add .
|
|
33
|
+
git commit -m "feat(button): add configurable hover effect"
|
|
34
|
+
```
|
|
35
|
+
6. **Verify Locally:** Before pushing, ensure all local checks pass:
|
|
36
|
+
```bash
|
|
37
|
+
pnpm run lint
|
|
38
|
+
pnpm run test
|
|
39
|
+
```
|
|
40
|
+
_(See [Running Tests and Linting](DEVELOPMENT.md#running-tests-and-linting) for details on these commands)_.
|
|
41
|
+
7. **Push:** Push your branch to your fork: `git push origin feat/add-hover-effect`
|
|
42
|
+
8. **Create Pull Request:** Open a Pull Request on GitHub from **your branch** to the **`kstepien3/ng-zen:develop`** branch. Provide a clear title and description.
|
|
43
|
+
|
|
44
|
+
## After Your PR is Submitted
|
|
45
|
+
|
|
46
|
+
- Wait for the automated CI checks to complete. Address any failures.
|
|
47
|
+
- Respond to code review comments and feedback from maintainers.
|
|
48
|
+
- Once approved and CI passes, a maintainer will merge your PR into `develop`. Your changes will then be included in future pre-releases (from `next`) and stable releases (from `master`).
|
|
19
49
|
|
|
20
50
|
## Communication
|
|
21
51
|
|
|
22
|
-
-
|
|
23
|
-
- **Pull Request Reviews**: Be prepared to address feedback from maintainers during the review process.
|
|
24
|
-
|
|
25
|
-
## Acknowledgments
|
|
52
|
+
- Use [GitHub Issues](https://github.com/kstepien3/ng-zen/issues) for bug reports, feature proposals, or questions _before_ starting significant work.
|
|
26
53
|
|
|
27
|
-
|
|
54
|
+
Thank you for contributing to **@ng-zen/cli**
|
package/DEVELOPMENT.md
CHANGED
|
@@ -1,80 +1,138 @@
|
|
|
1
1
|
# Local Development Setup
|
|
2
2
|
|
|
3
|
-
This guide
|
|
3
|
+
This guide details setting up a local development environment for **@ng-zen/cli**. It covers the necessary tools, the project's branching strategy, and the automated workflows in place.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**For a step-by-step guide specifically for external contributors submitting Pull Requests, please refer to `CONTRIBUTING.md`.**
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- pnpm
|
|
9
|
-
- Angular CLI installed globally
|
|
10
|
-
- verdaccio
|
|
7
|
+
**Key Technologies & Concepts:**
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
- **pnpm:** The required package manager (version in `package.json`). Use Corepack (`corepack enable`).
|
|
10
|
+
- **Storybook:** For UI component development and visualization.
|
|
11
|
+
- **Conventional Commits:** **Mandatory format** for commit messages (https://www.conventionalcommits.org/). Crucial for automation.
|
|
12
|
+
- **Automated Formatting/Linting:** `husky` + `nano-staged` apply formatting and basic fixes on commit.
|
|
13
|
+
- **Automated CI:** GitHub Actions (`ci.yml`) validate Pull Requests.
|
|
14
|
+
- **Automated Releases:** `semantic-release` manages releases based on commits.
|
|
15
|
+
- **Branching Strategy:** Detailed below.
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
## Table of Contents
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
- [Prerequisites & Setup](#prerequisites--setup)
|
|
20
|
+
- [Branching Strategy & Workflow](#branching-strategy--workflow)
|
|
21
|
+
- [Commit Messages (Crucial!)](#commit-messages-crucial)
|
|
22
|
+
- [Branch Synchronization (Maintainer Task)](#branch-synchronization-maintainer-task)
|
|
23
|
+
- [Working with Storybook](#working-with-storybook)
|
|
24
|
+
- [Running Tests and Linting](#running-tests-and-linting)
|
|
25
|
+
- [Building the Library](#building-the-library)
|
|
26
|
+
- [Optional: Local Testing with Verdaccio](#optional-local-testing-with-verdaccio)
|
|
27
|
+
|
|
28
|
+
## Prerequisites & Setup
|
|
29
|
+
|
|
30
|
+
1. Ensure **Node.js** is installed (use a version compatible with the project's Angular version; check CI workflows for reference).
|
|
31
|
+
2. Enable **Corepack**: `corepack enable`.
|
|
32
|
+
3. Clone the repository.
|
|
33
|
+
4. Install dependencies using **pnpm**: `pnpm install`.
|
|
34
|
+
|
|
35
|
+
## Branching Strategy & Workflow
|
|
36
|
+
|
|
37
|
+
This project employs a branching model designed for stability and automated releases:
|
|
38
|
+
|
|
39
|
+
- **`master`**: Contains only **stable, production-ready** code. Receives merges only from `next` during official releases or for critical hotfixes. Automated stable releases (`vX.Y.Z`) are triggered from here. **Direct work is forbidden.**
|
|
40
|
+
- **`next`**: The **pre-release / release candidate** branch. Code merged here from `develop` should be stable enough for final testing. Merges trigger automated pre-releases (`vX.Y.Z-next.N`) published to NPM under the `next` dist-tag.
|
|
41
|
+
- **`develop`**: The main **integration branch**. All feature branches are merged here first. This branch collects changes intended for the _next_ release cycle. **Target Pull Requests here.**
|
|
42
|
+
- **Feature/Fix Branches (`feature/*`, `fix/*`, etc.)**: Used for individual tasks. Always branch **off `develop`**.
|
|
19
43
|
|
|
20
|
-
|
|
44
|
+
**General Flow:** `Feature/Fix Branch` -> **`develop`** -> `next` -> `master`
|
|
21
45
|
|
|
22
|
-
|
|
46
|
+
## Commit Messages (Crucial!)
|
|
23
47
|
|
|
24
|
-
|
|
48
|
+
Strict adherence to the **Conventional Commits** specification (https://www.conventionalcommits.org/) is **required**.
|
|
49
|
+
|
|
50
|
+
- **Why?** Commit messages directly control automatic version bumping (`semantic-release`) and `CHANGELOG.md` generation.
|
|
51
|
+
- **Format:** `<type>(<scope>): <subject>` (e.g., `feat(button): add loading spinner`).
|
|
52
|
+
- **Key Types & Impact (on Stable Release):**
|
|
53
|
+
- `feat`: New feature -> `minor` version bump.
|
|
54
|
+
- `fix`: Bug fix -> `patch` version bump.
|
|
55
|
+
- `!` (e.g., `refactor(core)!:`) or `BREAKING CHANGE:` footer -> `major` version bump.
|
|
56
|
+
- Other types (`docs`, `chore`, `style`, `test`, `ci`, `build`, `refactor`, `perf`) document changes but don't trigger version bumps alone.
|
|
57
|
+
- **Validation:** `husky` + `commitlint` automatically check message format upon commit. Invalid messages will fail the commit.
|
|
58
|
+
|
|
59
|
+
_(See `CONTRIBUTING.md` for a concise summary focused on the commit action itself)._
|
|
60
|
+
|
|
61
|
+
## Branch Synchronization (Maintainer Task)
|
|
62
|
+
|
|
63
|
+
Maintain consistency across `master`, `next`, and `develop` by merging release commits and hotfixes. **Performed by maintainers.**
|
|
64
|
+
|
|
65
|
+
**General Update Step:** Fetch latest remote state:
|
|
25
66
|
|
|
26
67
|
```bash
|
|
27
|
-
|
|
68
|
+
git fetch origin --prune
|
|
28
69
|
```
|
|
29
70
|
|
|
30
|
-
|
|
71
|
+
### 1. Sync `next` with `master` (After Stable Release or Hotfix)
|
|
72
|
+
|
|
73
|
+
This is the most comprehensive synchronization, ensuring all development branches are aligned with the latest production code.
|
|
74
|
+
|
|
75
|
+
- **Purpose:** Incorporate stable changes into the release candidate branch.
|
|
76
|
+
- **Flow:** `master` -> `next`.
|
|
31
77
|
|
|
32
|
-
|
|
33
|
-
|
|
78
|
+
```bash
|
|
79
|
+
# Update local 'next', merge 'origin/master', push 'next'
|
|
80
|
+
git switch next && git pull origin next && git merge origin/master && git push origin next
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
_(Note: Merge conflicts might occur at either merge step and need manual resolution before continuing/pushing.)_
|
|
84
|
+
|
|
85
|
+
### 2. Sync `develop` with `next` (After Pre-release on next OR after syncing next with master)
|
|
34
86
|
|
|
35
|
-
|
|
36
|
-
|
|
87
|
+
- **Purpose:** Keep `develop` aligned with the latest pre-release state or the latest stable code propagated through next. Includes release commits (`chore(release): ...`).
|
|
88
|
+
- **Flow:** `next` -> `develop`.
|
|
37
89
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
90
|
+
```bash
|
|
91
|
+
# Update local 'next', merge 'origin/master', push 'next'
|
|
92
|
+
git switch develop && git pull origin develop && git merge origin/next && git push origin develop
|
|
93
|
+
```
|
|
41
94
|
|
|
42
|
-
|
|
43
|
-
Follow the prompts from Verdaccio to configure npm to use the local registry.
|
|
95
|
+
_(Note: Resolve conflicts before pushing.)_
|
|
44
96
|
|
|
45
|
-
|
|
97
|
+
---
|
|
46
98
|
|
|
47
|
-
|
|
48
|
-
Use the following command to publish the package to your local registry:
|
|
49
|
-
```bash
|
|
50
|
-
pnpm run publish:local
|
|
51
|
-
```
|
|
52
|
-
2. **Test in Angular Project**:
|
|
53
|
-
Add the package to an Angular project using the local registry:
|
|
54
|
-
```bash
|
|
55
|
-
ng add @ng-zen/cli --registry http://localhost:4873/
|
|
56
|
-
```
|
|
99
|
+
Contributors should regularly update their local `develop` branch (`git switch develop && git pull origin develop`).
|
|
57
100
|
|
|
58
|
-
##
|
|
101
|
+
## Working with Storybook
|
|
59
102
|
|
|
60
|
-
|
|
103
|
+
Develop and visualize components using Storybook.
|
|
104
|
+
|
|
105
|
+
- **Start Storybook:**
|
|
61
106
|
```bash
|
|
62
|
-
pnpm run
|
|
107
|
+
pnpm run storybook
|
|
63
108
|
```
|
|
64
|
-
- **
|
|
109
|
+
- **Build Static Storybook:**
|
|
65
110
|
```bash
|
|
66
|
-
pnpm run
|
|
67
|
-
pnpm run lint:fix
|
|
111
|
+
pnpm run storybook:build
|
|
68
112
|
```
|
|
69
113
|
|
|
70
|
-
##
|
|
114
|
+
## Running Tests and Linting
|
|
115
|
+
|
|
116
|
+
`nano-staged` auto-formats/fixes on commit, but manual verification is recommended before creating a PR. The CI (`ci.yml`) runs these checks automatically on PRs.
|
|
117
|
+
|
|
118
|
+
- **Lint:** `pnpm run lint` (checks for errors not auto-fixed)
|
|
119
|
+
- **Test:** `pnpm run test` (runs unit tests)
|
|
120
|
+
|
|
121
|
+
## Building the Library
|
|
71
122
|
|
|
72
|
-
|
|
123
|
+
Build the distributable library files:
|
|
73
124
|
|
|
74
125
|
```bash
|
|
75
126
|
pnpm run build
|
|
76
127
|
```
|
|
77
128
|
|
|
78
|
-
|
|
129
|
+
Output artifacts are placed in the `dist/` directory
|
|
130
|
+
|
|
131
|
+
## Optional: Local Testing with Verdaccio
|
|
132
|
+
|
|
133
|
+
Test your local build in a separate project before submitting a PR to develop.
|
|
79
134
|
|
|
80
|
-
|
|
135
|
+
1. Install & Run Verdaccio: `npm install -g verdaccio` (or `pnpm add -g`), then `verdaccio`.\
|
|
136
|
+
2. Build Library: `pnpm run build`.
|
|
137
|
+
3. Publish Locally: `pnpm run publish:verdaccio`.
|
|
138
|
+
4. Install in Test Project: `ng add @ng-zen/cli --registry http://localhost:4873/` (or pnpm add ...).
|
package/README.md
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
# @ng-zen/cli
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[](https://github.com/kstepien3/ng-zen/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/kstepien3/ng-zen/actions/workflows/ci.yml)
|
|
5
|
+
[](https://www.npmjs.com/package/@ng-zen/cli)
|
|
6
|
+
[](https://www.npmjs.com/package/@ng-zen/cli)
|
|
7
|
+
[](https://github.com/kstepien3/ng-zen/blob/master/LICENSE)
|
|
8
8
|
|
|
9
9
|
[](https://github.com/kstepien3/ng-zen)
|
|
10
|
-
[](https://kstepien3.github.io/ng-zen/)
|
|
11
|
+
|
|
12
|
+
Generate modern, customizable Angular UI components and elements directly into your project 🚀
|
|
13
|
+
|
|
14
|
+
Built with the best practices and developer experience in mind 💡
|
|
12
15
|
|
|
13
16
|
## Table of Contents
|
|
14
17
|
|
|
15
18
|
1. [Features](#features)
|
|
16
19
|
2. [Ideal for](#ideal-for)
|
|
17
20
|
3. [Quick Start](#quick-start)
|
|
18
|
-
4. [Installation](#
|
|
21
|
+
4. [Installation](#installation)
|
|
19
22
|
5. [Usage](#usage)
|
|
20
23
|
6. [Why @ng-zen/cli?](#why-ng-zencli)
|
|
21
24
|
7. [Examples](#examples)
|
|
@@ -24,46 +27,60 @@ Angular library that helps you build better applications faster 🚀 Built with
|
|
|
24
27
|
10. [Contributing](#contributing)
|
|
25
28
|
11. [License](#license)
|
|
26
29
|
12. [Author](#author)
|
|
27
|
-
13. [
|
|
30
|
+
13. [See also](#see-also)
|
|
31
|
+
14. [FAQ](#faq)
|
|
28
32
|
|
|
29
33
|
## Features
|
|
30
34
|
|
|
31
|
-
- 🧩 **Component
|
|
32
|
-
- 🎨 **Fully Customizable
|
|
33
|
-
- 📱 **Responsive Design
|
|
34
|
-
- 📚 **Comprehensive Documentation
|
|
35
|
-
- ✅ **Test Coverage
|
|
36
|
-
- 🚀 **Modern Angular
|
|
35
|
+
- 🧩 **Component Schematics:** Generates ready-to-use UI component code (`.ts`, `.html`, `.scss`).
|
|
36
|
+
- 🎨 **Fully Customizable:** Easily theme and modify components via CSS variables and editable SCSS.
|
|
37
|
+
- 📱 **Responsive Design:** Components designed to adapt across various screen sizes.
|
|
38
|
+
- 📚 **Comprehensive Documentation:** Includes Storybook examples, JSDoc annotations, and `README.md` per component.
|
|
39
|
+
- ✅ **Test Coverage:** Generated components include unit tests (`.spec.ts`).
|
|
40
|
+
- 🚀 **Modern Angular:** Leverages standalone components, `OnPush` change detection, signals, and current best practices.
|
|
41
|
+
- 🛠 **Extensible:** Planned support for generating directives, pipes, services, and more.
|
|
37
42
|
|
|
38
43
|
## Ideal for
|
|
39
44
|
|
|
40
|
-
- 🏢 **
|
|
41
|
-
- 📈 **
|
|
42
|
-
- 👩💻 **Developers
|
|
45
|
+
- 🏢 **Enterprise UI Kits:** A great starting point for building consistent, internal component libraries.
|
|
46
|
+
- 📈 **Custom Projects:** Accelerates development when custom UI elements are needed, avoiding vendor lock-in.
|
|
47
|
+
- 👩💻 **Developers:** Speeds up UI creation and ensures adherence to modern Angular patterns.
|
|
43
48
|
|
|
44
49
|
## Quick Start
|
|
45
50
|
|
|
46
|
-
|
|
51
|
+
The easiest way to add `@ng-zen/cli` and its schematics to your project:
|
|
47
52
|
|
|
48
53
|
```bash
|
|
49
54
|
ng add @ng-zen/cli
|
|
50
55
|
```
|
|
51
56
|
|
|
52
|
-
This command
|
|
57
|
+
This command installs the package and performs initial setup.
|
|
58
|
+
|
|
59
|
+
## Installation
|
|
60
|
+
|
|
61
|
+
Alternatively, you can install it manually:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# For the latest stable version
|
|
65
|
+
pnpm add -D @ng-zen/cli
|
|
66
|
+
|
|
67
|
+
# For the latest pre-release version (includes newest features/fixes)
|
|
68
|
+
pnpm add -D @ng-zen/cli@next
|
|
69
|
+
```
|
|
53
70
|
|
|
54
71
|
## Usage
|
|
55
72
|
|
|
56
73
|
### Generating Components
|
|
57
74
|
|
|
58
|
-
Use the Angular CLI
|
|
75
|
+
Use the Angular CLI schematic:
|
|
59
76
|
|
|
60
77
|
```bash
|
|
61
78
|
ng generate @ng-zen/cli:component
|
|
62
79
|
```
|
|
63
80
|
|
|
64
|
-
This interactive
|
|
81
|
+
This interactive prompt guides you through selecting and configuring the desired component(s) 📊.
|
|
65
82
|
|
|
66
|
-
|
|
83
|
+
To see available options without running interactively:
|
|
67
84
|
|
|
68
85
|
```bash
|
|
69
86
|
ng generate @ng-zen/cli:component --help
|
|
@@ -71,55 +88,54 @@ ng generate @ng-zen/cli:component --help
|
|
|
71
88
|
|
|
72
89
|
### Future Generators
|
|
73
90
|
|
|
74
|
-
|
|
91
|
+
Support for generating other Angular building blocks is planned:
|
|
75
92
|
|
|
76
93
|
- 📝 Directives
|
|
77
|
-
-
|
|
94
|
+
- 💧 Pipes
|
|
78
95
|
- 🛠 Services
|
|
79
|
-
-
|
|
96
|
+
- ... and more!
|
|
80
97
|
|
|
81
98
|
## Why @ng-zen/cli?
|
|
82
99
|
|
|
83
|
-
Unlike
|
|
100
|
+
Unlike pre-compiled UI libraries, `@ng-zen/cli`:
|
|
84
101
|
|
|
85
|
-
- Generates actual code in your project
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
- Focuses on
|
|
102
|
+
- **Generates Source Code:** You get actual, editable component code in your project, not opaque `<library-button>` tags.
|
|
103
|
+
- **Full Control:** Modify the generated code and styles freely to perfectly match your application's needs.
|
|
104
|
+
- **Modern Foundation:** Built on current Angular features (standalone, signals, etc.).
|
|
105
|
+
- **Transparency:** Understand exactly how components work and evolve them with your project.
|
|
106
|
+
- **Developer Experience:** Focuses on ease of use, customization, and maintainability.
|
|
90
107
|
|
|
91
108
|
## Examples
|
|
92
109
|
|
|
93
|
-
Each generated
|
|
110
|
+
Each generated component set includes:
|
|
94
111
|
|
|
95
112
|
- Angular component code (`.ts`, `.html`, `.scss`)
|
|
96
113
|
- Unit tests (`.spec.ts`)
|
|
97
|
-
- Storybook stories (`.stories.ts`)
|
|
98
|
-
-
|
|
99
|
-
-
|
|
114
|
+
- Storybook stories (`.stories.ts`) for visual development and documentation.
|
|
115
|
+
- An `index.ts` for easy exporting.
|
|
116
|
+
- A component-specific `README.md` (generated from a template).
|
|
100
117
|
|
|
101
118
|
## Documentation
|
|
102
119
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
- Storybook integration for visual examples 📊
|
|
108
|
-
- Compodoc for full API documentation 📚
|
|
120
|
+
- **Storybook:** The primary source for visual examples and interactive demos: [View Storybook Demo](https://kstepien3.github.io/ng-zen/)
|
|
121
|
+
- **JSDoc:** Code includes documentation comments.
|
|
122
|
+
- **READMEs:** Project-level (`README.md`, `DEVELOPMENT.md`, `CONTRIBUTING.md`) and component-level READMEs.
|
|
123
|
+
- **Changelog:** Automatically generated history of changes: [CHANGELOG.md](https://github.com/kstepien3/ng-zen/blob/master/CHANGELOG.md)
|
|
109
124
|
|
|
110
125
|
## Project Status
|
|
111
126
|
|
|
112
|
-
🚧 **
|
|
127
|
+
🚧 **Actively Developed** 🚧
|
|
113
128
|
|
|
114
|
-
|
|
115
|
-
|
|
129
|
+
- The core schematics and existing components are functional but continuously improved.
|
|
130
|
+
- New generators (directives, pipes, etc.) are planned.
|
|
131
|
+
- The `master` branch represents the latest **stable** release.
|
|
132
|
+
- The `next` branch contains **pre-release** versions with the newest features and fixes – use `@ng-zen/cli@next` to try them out.
|
|
116
133
|
|
|
117
|
-
|
|
118
|
-
Just the code I have created is still being developed with new functionalities.
|
|
134
|
+
Since the tool generates code directly into your project, you own and control that code. Updates to `@ng-zen/cli` itself primarily bring new generator features or improvements to the generation process, not breaking changes to already generated components.
|
|
119
135
|
|
|
120
136
|
## Contributing
|
|
121
137
|
|
|
122
|
-
Contributions are welcome!
|
|
138
|
+
Contributions are highly welcome! If you'd like to help improve `@ng-zen/cli`, please read our **[Contribution Guidelines (CONTRIBUTING.md)](https://github.com/kstepien3/ng-zen/blob/master/CONTRIBUTING.md)** for details on the workflow, commit message requirements, and setup. 🤝
|
|
123
139
|
|
|
124
140
|
## License
|
|
125
141
|
|
|
@@ -127,13 +143,18 @@ This project is licensed under the [BSD 2-Clause License](https://github.com/kst
|
|
|
127
143
|
|
|
128
144
|
## Author
|
|
129
145
|
|
|
130
|
-
|
|
146
|
+
Maintained by Konrad Stępień.
|
|
131
147
|
|
|
132
|
-
-
|
|
148
|
+
- GitHub: [@kstepien3](https://github.com/kstepien3)
|
|
133
149
|
- LinkedIn: [Konrad Stępień](https://www.linkedin.com/in/konradstepien/) 👥
|
|
150
|
+
- Email: [kord.stp@gmail.com](mailto:kord.stp@gmail.com?subject=%5BNG-ZEN%5D%20Query) 📨
|
|
151
|
+
|
|
152
|
+
## See also
|
|
153
|
+
|
|
154
|
+
- [ngx-schematic-builder](https://github.com/kstepien3/ngx-schematic-builder) - A custom Angular builder for compiling and bundling Angular schematics.
|
|
134
155
|
|
|
135
156
|
## FAQ
|
|
136
157
|
|
|
137
158
|
### How do I customize a generated component?
|
|
138
159
|
|
|
139
|
-
|
|
160
|
+
Generated components reside entirely within your project's source code. You can directly edit the `.ts`, `.html`, and `.scss` files. Components are structured to use CSS variables and SCSS for easier theming and modification.
|
package/angular.json
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"prefix": "zen",
|
|
21
21
|
"architect": {
|
|
22
22
|
"build": {
|
|
23
|
-
"builder": "
|
|
23
|
+
"builder": "ngx-schematic-builder:build",
|
|
24
24
|
"options": {
|
|
25
|
-
"files": ["src/**", "README.md", "
|
|
25
|
+
"files": ["src/**", "README.md", "LICENSE", "CHANGELOG.md"],
|
|
26
26
|
"tsConfig": "tsconfig.schematics.json"
|
|
27
27
|
}
|
|
28
28
|
},
|