@ng-zen/cli 19.0.0-alpha.5 → 19.1.0

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.
Files changed (101) hide show
  1. package/.commitlintrc +3 -0
  2. package/.editorconfig +17 -0
  3. package/.github/dependabot.yml +18 -0
  4. package/.github/workflows/ci.yml +112 -0
  5. package/.github/workflows/deploy.yml +33 -0
  6. package/.github/workflows/release.yml +65 -0
  7. package/.husky/commit-msg +1 -0
  8. package/.husky/pre-commit +1 -0
  9. package/.nanostagedrc +5 -0
  10. package/.prettierignore +3 -0
  11. package/.prettierrc +23 -0
  12. package/.releaserc.json +67 -0
  13. package/.storybook/main.ts +17 -0
  14. package/.storybook/preview.ts +13 -0
  15. package/.storybook/stories/pages/1 README.mdx +9 -0
  16. package/.storybook/stories/pages/2 License.mdx +9 -0
  17. package/.storybook/stories/pages/3 CHANGELOG.mdx +9 -0
  18. package/.storybook/tsconfig.json +10 -0
  19. package/.storybook/typings.d.ts +4 -0
  20. package/.stylelintrc.json +3 -0
  21. package/CHANGELOG.md +40 -0
  22. package/CODE_OF_CONDUCT.md +30 -0
  23. package/CONTRIBUTING.md +54 -0
  24. package/DEVELOPMENT.md +138 -0
  25. package/README.md +129 -14
  26. package/angular.json +66 -0
  27. package/eslint.config.js +40 -0
  28. package/jest.config.ts +20 -0
  29. package/package.json +108 -14
  30. package/projects/schematic-builder/builders/builders.json +9 -0
  31. package/projects/schematic-builder/builders/index.js +100 -0
  32. package/projects/schematic-builder/builders/schema.json +18 -0
  33. package/projects/schematic-builder/package.json +11 -0
  34. package/{schematics → src/schematics}/collection.json +1 -1
  35. package/{schematics → src/schematics}/components/components-generator.ts +1 -1
  36. package/{schematics → src/schematics}/components/files/avatar/avatar.component.ts +3 -3
  37. package/{schematics → src/schematics}/components/files/avatar/avatar.stories.ts +1 -1
  38. package/{schematics → src/schematics}/components/files/button/button.component.ts +2 -2
  39. package/{schematics → src/schematics}/components/files/checkbox/checkbox.component.ts +1 -1
  40. package/{schematics → src/schematics}/components/files/input/input.component.ts +1 -1
  41. package/src/schematics/components/files/switch/index.ts +1 -0
  42. package/src/schematics/components/files/switch/switch.component.scss +63 -0
  43. package/src/schematics/components/files/switch/switch.component.spec.ts +22 -0
  44. package/src/schematics/components/files/switch/switch.component.ts +105 -0
  45. package/src/schematics/components/files/switch/switch.stories.ts +40 -0
  46. package/{schematics → src/schematics}/components/files/textarea/textarea.component.ts +1 -1
  47. package/{schematics → src/schematics}/components/schema.json +1 -1
  48. package/{schematics → src/schematics}/components/templates/README.md.template +3 -3
  49. package/tsconfig.json +31 -0
  50. package/tsconfig.lib.json +11 -0
  51. package/tsconfig.schematics.json +30 -0
  52. package/tsconfig.spec.json +9 -0
  53. package/schematics/components/components-generator.js +0 -3
  54. package/schematics/components/components-generator.js.map +0 -1
  55. package/schematics/components/index.js +0 -11
  56. package/schematics/components/index.js.map +0 -1
  57. package/schematics/ng-add/index.js +0 -12
  58. package/schematics/ng-add/index.js.map +0 -1
  59. package/schematics/ng-add/ng-zen-generator.js +0 -3
  60. package/schematics/ng-add/ng-zen-generator.js.map +0 -1
  61. package/types/generator-schema-base.interface.js +0 -3
  62. package/types/generator-schema-base.interface.js.map +0 -1
  63. package/types/index.js +0 -5
  64. package/types/index.js.map +0 -1
  65. package/types/schematics-folder.type.js +0 -3
  66. package/types/schematics-folder.type.js.map +0 -1
  67. package/utils/add-path-to-tsconfig.util.js +0 -45
  68. package/utils/add-path-to-tsconfig.util.js.map +0 -1
  69. package/utils/apply-file-template.util.js +0 -23
  70. package/utils/apply-file-template.util.js.map +0 -1
  71. package/utils/index.js +0 -6
  72. package/utils/index.js.map +0 -1
  73. /package/{schematics → src/schematics}/components/files/avatar/avatar.component.scss +0 -0
  74. /package/{schematics → src/schematics}/components/files/avatar/avatar.component.spec.ts +0 -0
  75. /package/{schematics → src/schematics}/components/files/avatar/index.ts +0 -0
  76. /package/{schematics → src/schematics}/components/files/button/button.component.scss +0 -0
  77. /package/{schematics → src/schematics}/components/files/button/button.component.spec.ts +0 -0
  78. /package/{schematics → src/schematics}/components/files/button/button.stories.ts +0 -0
  79. /package/{schematics → src/schematics}/components/files/button/index.ts +0 -0
  80. /package/{schematics → src/schematics}/components/files/checkbox/checkbox.component.scss +0 -0
  81. /package/{schematics → src/schematics}/components/files/checkbox/checkbox.component.spec.ts +0 -0
  82. /package/{schematics → src/schematics}/components/files/checkbox/checkbox.stories.ts +0 -0
  83. /package/{schematics → src/schematics}/components/files/checkbox/index.ts +0 -0
  84. /package/{schematics → src/schematics}/components/files/input/index.ts +0 -0
  85. /package/{schematics → src/schematics}/components/files/input/input.component.scss +0 -0
  86. /package/{schematics → src/schematics}/components/files/input/input.component.spec.ts +0 -0
  87. /package/{schematics → src/schematics}/components/files/input/input.stories.ts +0 -0
  88. /package/{schematics → src/schematics}/components/files/textarea/index.ts +0 -0
  89. /package/{schematics → src/schematics}/components/files/textarea/textarea.component.scss +0 -0
  90. /package/{schematics → src/schematics}/components/files/textarea/textarea.component.spec.ts +0 -0
  91. /package/{schematics → src/schematics}/components/files/textarea/textarea.stories.ts +0 -0
  92. /package/{schematics → src/schematics}/components/index.ts +0 -0
  93. /package/{schematics → src/schematics}/ng-add/index.ts +0 -0
  94. /package/{schematics → src/schematics}/ng-add/ng-zen-generator.ts +0 -0
  95. /package/{schematics → src/schematics}/ng-add/schema.json +0 -0
  96. /package/{types → src/types}/generator-schema-base.interface.ts +0 -0
  97. /package/{types → src/types}/index.ts +0 -0
  98. /package/{types → src/types}/schematics-folder.type.ts +0 -0
  99. /package/{utils → src/utils}/add-path-to-tsconfig.util.ts +0 -0
  100. /package/{utils → src/utils}/apply-file-template.util.ts +0 -0
  101. /package/{utils → src/utils}/index.ts +0 -0
package/DEVELOPMENT.md ADDED
@@ -0,0 +1,138 @@
1
+ # Local Development Setup
2
+
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
+
5
+ **For a step-by-step guide specifically for external contributors submitting Pull Requests, please refer to `CONTRIBUTING.md`.**
6
+
7
+ **Key Technologies & Concepts:**
8
+
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.
16
+
17
+ ## Table of Contents
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`**.
43
+
44
+ **General Flow:** `Feature/Fix Branch` -> **`develop`** -> `next` -> `master`
45
+
46
+ ## Commit Messages (Crucial!)
47
+
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:
66
+
67
+ ```bash
68
+ git fetch origin --prune
69
+ ```
70
+
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`.
77
+
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)
86
+
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`.
89
+
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
+ ```
94
+
95
+ _(Note: Resolve conflicts before pushing.)_
96
+
97
+ ---
98
+
99
+ Contributors should regularly update their local `develop` branch (`git switch develop && git pull origin develop`).
100
+
101
+ ## Working with Storybook
102
+
103
+ Develop and visualize components using Storybook.
104
+
105
+ - **Start Storybook:**
106
+ ```bash
107
+ pnpm run storybook
108
+ ```
109
+ - **Build Static Storybook:**
110
+ ```bash
111
+ pnpm run storybook:build
112
+ ```
113
+
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
122
+
123
+ Build the distributable library files:
124
+
125
+ ```bash
126
+ pnpm run build
127
+ ```
128
+
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.
134
+
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,40 +1,155 @@
1
1
  # @ng-zen/cli
2
2
 
3
- ## Overview
3
+ [![Build Status (master)](https://img.shields.io/github/actions/workflow/status/kstepien3/ng-zen/ci.yml?branch=master&label=build-master)](https://github.com/kstepien3/ng-zen/actions/workflows/ci.yml)
4
+ [![Build Status (next)](https://img.shields.io/github/actions/workflow/status/kstepien3/ng-zen/ci.yml?branch=next&label=build-next)](https://github.com/kstepien3/ng-zen/actions/workflows/ci.yml)
5
+ [![NPM Version (latest)](https://img.shields.io/npm/v/@ng-zen/cli/latest?label=npm%40latest)](https://www.npmjs.com/package/@ng-zen/cli)
6
+ [![NPM Version (next)](https://img.shields.io/npm/v/@ng-zen/cli/next?label=npm%40next)](https://www.npmjs.com/package/@ng-zen/cli)
7
+ [![License](https://img.shields.io/github/license/kstepien3/ng-zen)](https://github.com/kstepien3/ng-zen/blob/master/LICENSE)
4
8
 
5
- The ng-zen CLI is a command-line tool designed to facilitate the generation of UI-kit elements for Angular applications using Angular schematics. It provides out-of-the-box components that can be quickly integrated into Angular projects.
9
+ [![](https://img.shields.io/badge/-Repository-181818?style=flat&logo=github&logoColor=white)](https://github.com/kstepien3/ng-zen)
10
+ [![](https://img.shields.io/badge/-Storybook%20Demo-FF4785?style=flat&logo=storybook&logoColor=white)](https://kstepien3.github.io/ng-zen/)
6
11
 
7
- ## Installation
12
+ Generate modern, customizable Angular UI components and elements directly into your project 🚀
13
+
14
+ Built with best practices and developer experience in mind 💡
15
+
16
+ ## Table of Contents
17
+
18
+ 1. [Features](#features)
19
+ 2. [Ideal for](#ideal-for)
20
+ 3. [Quick Start](#quick-start)
21
+ 4. [Installation](#installation)
22
+ 5. [Usage](#usage)
23
+ 6. [Why @ng-zen/cli?](#why-ng-zencli)
24
+ 7. [Examples](#examples)
25
+ 8. [Documentation](#documentation)
26
+ 9. [Project Status](#project-status)
27
+ 10. [Contributing](#contributing)
28
+ 11. [License](#license)
29
+ 12. [Author](#author)
30
+ 13. [FAQ](#faq)
31
+
32
+ ## Features
33
+
34
+ - 🧩 **Component Schematics:** Generates ready-to-use UI component code (`.ts`, `.html`, `.scss`).
35
+ - 🎨 **Fully Customizable:** Easily theme and modify components via CSS variables and editable SCSS.
36
+ - 📱 **Responsive Design:** Components designed to adapt across various screen sizes.
37
+ - 📚 **Comprehensive Documentation:** Includes Storybook examples, JSDoc annotations, and `README.md` per component.
38
+ - ✅ **Test Coverage:** Generated components include unit tests (`.spec.ts`).
39
+ - 🚀 **Modern Angular:** Leverages standalone components, `OnPush` change detection, signals, and current best practices.
40
+ - 🛠 **Extensible:** Planned support for generating directives, pipes, services, and more.
8
41
 
9
- To install ng-zen CLI, use the following command:
42
+ ## Ideal for
43
+
44
+ - 🏢 **Enterprise UI Kits:** A great starting point for building consistent, internal component libraries.
45
+ - 📈 **Custom Projects:** Accelerates development when custom UI elements are needed, avoiding vendor lock-in.
46
+ - 👩‍💻 **Developers:** Speeds up UI creation and ensures adherence to modern Angular patterns.
47
+
48
+ ## Quick Start
49
+
50
+ The easiest way to add `@ng-zen/cli` and its schematics to your project:
10
51
 
11
52
  ```bash
12
53
  ng add @ng-zen/cli
13
54
  ```
14
55
 
15
- This command will add the necessary dependencies and configurations to your Angular project.
56
+ This command installs the package and performs initial setup.
16
57
 
17
- ## Generating
58
+ ## Installation
18
59
 
19
- You can generate code using the ng-zen CLI.
60
+ Alternatively, you can install it manually:
20
61
 
21
- #### Components
62
+ ```bash
63
+ # For the latest stable version
64
+ pnpm add -D @ng-zen/cli
65
+
66
+ # For the latest pre-release version (includes newest features/fixes)
67
+ pnpm add -D @ng-zen/cli@next
68
+ ```
69
+
70
+ ## Usage
71
+
72
+ ### Generating Components
73
+
74
+ Use the Angular CLI schematic:
22
75
 
23
76
  ```bash
24
77
  ng generate @ng-zen/cli:component
25
78
  ```
26
79
 
80
+ This interactive prompt guides you through selecting and configuring the desired component(s) 📊.
81
+
82
+ To see available options without running interactively:
83
+
84
+ ```bash
85
+ ng generate @ng-zen/cli:component --help
86
+ ```
87
+
88
+ ### Future Generators
89
+
90
+ Support for generating other Angular building blocks is planned:
91
+
92
+ - 📝 Directives
93
+ - 💧 Pipes
94
+ - 🛠 Services
95
+ - ... and more!
96
+
97
+ ## Why @ng-zen/cli?
98
+
99
+ Unlike pre-compiled UI libraries, `@ng-zen/cli`:
100
+
101
+ - **Generates Source Code:** You get actual, editable component code in your project, not opaque `<library-button>` tags.
102
+ - **Full Control:** Modify the generated code and styles freely to perfectly match your application's needs.
103
+ - **Modern Foundation:** Built on current Angular features (standalone, signals, etc.).
104
+ - **Transparency:** Understand exactly how components work and evolve them with your project.
105
+ - **Developer Experience:** Focuses on ease of use, customization, and maintainability.
106
+
107
+ ## Examples
108
+
109
+ Each generated component set includes:
110
+
111
+ - Angular component code (`.ts`, `.html`, `.scss`)
112
+ - Unit tests (`.spec.ts`)
113
+ - Storybook stories (`.stories.ts`) for visual development and documentation.
114
+ - An `index.ts` for easy exporting.
115
+ - A component-specific `README.md` (generated from a template).
116
+
117
+ ## Documentation
118
+
119
+ - **Storybook:** The primary source for visual examples and interactive demos: [View Storybook Demo](https://kstepien3.github.io/ng-zen/)
120
+ - **JSDoc:** Code includes documentation comments.
121
+ - **READMEs:** Project-level (`README.md`, `DEVELOPMENT.md`, `CONTRIBUTING.md`) and component-level READMEs.
122
+ - **Changelog:** Automatically generated history of changes: [CHANGELOG.md](https://github.com/kstepien3/ng-zen/blob/master/CHANGELOG.md)
123
+
124
+ ## Project Status
125
+
126
+ 🚧 **Actively Developed** 🚧
127
+
128
+ - The core schematics and existing components are functional but continuously improved.
129
+ - New generators (directives, pipes, etc.) are planned.
130
+ - The `master` branch represents the latest **stable** release.
131
+ - The `next` branch contains **pre-release** versions with the newest features and fixes – use `@ng-zen/cli@next` to try them out.
132
+
133
+ 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.
134
+
135
+ ## Contributing
136
+
137
+ 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. 🤝
138
+
27
139
  ## License
28
140
 
29
- This project is licensed under the BSD 2-Clause License. For more details, refer to the LICENSE file in the repository.
141
+ This project is licensed under the [BSD 2-Clause License](https://github.com/kstepien3/ng-zen/blob/master/LICENSE) 📜.
30
142
 
31
143
  ## Author
32
144
 
33
- **@ng-zen/cli** is maintained by Konrad Stępień.
145
+ Maintained by Konrad Stępień.
34
146
 
35
- - Email: kord.stp@gmail.com
36
- - LinkedIn: [Konrad Stępień](https://www.linkedin.com/in/konradstepien/)
147
+ - GitHub: [@kstepien3](https://github.com/kstepien3)
148
+ - LinkedIn: [Konrad Stępień](https://www.linkedin.com/in/konradstepien/) 👥
149
+ - Email: [kord.stp@gmail.com](mailto:kord.stp@gmail.com?subject=%5BNG-ZEN%5D%20Query) 📨
37
150
 
38
- ## Documentation
151
+ ## FAQ
152
+
153
+ ### How do I customize a generated component?
39
154
 
40
- The ng-zen CLI is documented using Storybook for component examples and JSDoc, as well as Compodoc for Angular project documentation.
155
+ 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 ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
+ "version": 1,
4
+ "cli": {
5
+ "packageManager": "pnpm",
6
+ "schematicCollections": ["angular-eslint"]
7
+ },
8
+ "newProjectRoot": "projects",
9
+ "schematics": {
10
+ "@schematics/angular:component": {
11
+ "style": "scss",
12
+ "changeDetection": "OnPush"
13
+ }
14
+ },
15
+ "projects": {
16
+ "cli": {
17
+ "projectType": "library",
18
+ "root": "",
19
+ "sourceRoot": "src",
20
+ "prefix": "zen",
21
+ "architect": {
22
+ "build": {
23
+ "builder": "./projects/schematic-builder:build",
24
+ "options": {
25
+ "files": ["src/**", "README.md", "package.json", "LICENSE", "CHANGELOG.md"],
26
+ "tsConfig": "tsconfig.schematics.json"
27
+ }
28
+ },
29
+ "test": {
30
+ "builder": "@angular-builders/jest:run",
31
+ "options": {
32
+ "configPath": "./jest.config.ts",
33
+ "tsConfig": "tsconfig.spec.json"
34
+ }
35
+ },
36
+ "lint": {
37
+ "builder": "@angular-eslint/builder:lint",
38
+ "options": {
39
+ "lintFilePatterns": ["src/**/*.ts", "src/**/*.html"],
40
+ "eslintConfig": "eslint.config.js"
41
+ }
42
+ },
43
+ "storybook": {
44
+ "builder": "@storybook/angular:start-storybook",
45
+ "options": {
46
+ "configDir": ".storybook",
47
+ "browserTarget": "cli:build",
48
+ "compodoc": true,
49
+ "compodocArgs": ["-e", "json", "-d", "./documentation/"],
50
+ "port": 6006
51
+ }
52
+ },
53
+ "build-storybook": {
54
+ "builder": "@storybook/angular:build-storybook",
55
+ "options": {
56
+ "configDir": ".storybook",
57
+ "browserTarget": "cli:build",
58
+ "compodoc": true,
59
+ "compodocArgs": ["-e", "json", "-d", "./documentation/"],
60
+ "outputDir": "dist/storybook"
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,40 @@
1
+ // @ts-check
2
+ const eslint = require('@eslint/js');
3
+ const tseslint = require('typescript-eslint');
4
+ const angular = require('angular-eslint');
5
+
6
+ module.exports = tseslint.config(
7
+ {
8
+ files: ['**/*.ts'],
9
+ extends: [
10
+ eslint.configs.recommended,
11
+ ...tseslint.configs.recommended,
12
+ ...tseslint.configs.stylistic,
13
+ ...angular.configs.tsRecommended,
14
+ ],
15
+ processor: angular.processInlineTemplates,
16
+ rules: {
17
+ '@angular-eslint/directive-selector': [
18
+ 'error',
19
+ {
20
+ type: 'attribute',
21
+ prefix: 'zen',
22
+ style: 'camelCase',
23
+ },
24
+ ],
25
+ '@angular-eslint/component-selector': [
26
+ 'error',
27
+ {
28
+ type: 'element',
29
+ prefix: 'zen',
30
+ style: 'kebab-case',
31
+ },
32
+ ],
33
+ },
34
+ },
35
+ {
36
+ files: ['**/*.html'],
37
+ extends: [...angular.configs.templateRecommended, ...angular.configs.templateAccessibility],
38
+ rules: {},
39
+ }
40
+ );
package/jest.config.ts ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * For a detailed explanation regarding each configuration property, visit:
3
+ * https://jestjs.io/docs/configuration
4
+ */
5
+
6
+ import type { Config } from 'jest';
7
+
8
+ export default {
9
+ clearMocks: true,
10
+ collectCoverage: true,
11
+ coverageDirectory: 'coverage',
12
+ coverageProvider: 'v8',
13
+ moduleNameMapper: {
14
+ '^@ng-zen/cli/(.*)': '<rootDir>/src/$1',
15
+ '^ng-zen/components/(.*)': '<rootDir>/src/schematics/components/files/$1',
16
+ '^ng-zen/directives/(.*)': '<rootDir>/src/schematics/directives/files/$1',
17
+ },
18
+ preset: 'jest-preset-angular',
19
+ testEnvironment: 'jsdom',
20
+ } satisfies Config;
package/package.json CHANGED
@@ -1,37 +1,131 @@
1
1
  {
2
2
  "name": "@ng-zen/cli",
3
- "version": "19.0.0-alpha.5",
4
- "description": "A blank schematics",
3
+ "version": "19.1.0",
4
+ "description": "A CLI tool for generating customizable, modern Angular UI components using schematics.",
5
+ "scripts": {
6
+ "ng": "ng",
7
+ "start": "ng serve",
8
+ "build": "ng build",
9
+ "test": "ng test",
10
+ "lint": "ng lint",
11
+ "lint:fix": "ng lint --fix",
12
+ "prepare": "husky",
13
+ "storybook": "ng run cli:storybook",
14
+ "storybook:build": "ng run cli:build-storybook",
15
+ "storybook:doc": "compodoc -e json -p .storybook/tsconfig.json -t",
16
+ "verdaccio": "verdaccio",
17
+ "prepublish:verdaccio": "pnpm unpublish @ng-zen/cli --registry http://localhost:4873 --force && pnpm run build",
18
+ "publish:verdaccio": "cd dist/@ng-zen/cli && npm publish --registry http://localhost:4873/",
19
+ "semantic-release": "semantic-release"
20
+ },
5
21
  "license": "BSD-2-Clause",
6
22
  "private": false,
7
- "builders": "./builders/builders.json",
8
23
  "repository": {
9
- "url": "https://github.com/Kordrad/ng-zen",
10
- "directory": "projects/cli"
24
+ "url": "https://github.com/kstepien3/ng-zen"
11
25
  },
12
26
  "bugs": {
13
- "url": "https://github.com/Kordrad/ng-zen/issues"
27
+ "url": "https://github.com/kstepien3/ng-zen/issues"
14
28
  },
15
29
  "author": {
16
30
  "name": "Konrad Stępień",
17
31
  "email": "kord.stp@gmail.com",
18
32
  "url": "https://www.linkedin.com/in/KonradStepien/"
19
33
  },
34
+ "homepage": "https://kstepien3.github.io/ng-zen/",
20
35
  "keywords": [
21
- "schematics"
36
+ "angular",
37
+ "schematics",
38
+ "ui-components",
39
+ "angular-cli",
40
+ "storybook",
41
+ "customizable-components",
42
+ "avatar",
43
+ "button",
44
+ "checkbox",
45
+ "input",
46
+ "textarea"
22
47
  ],
23
48
  "ng-add": {
24
49
  "save": "devDependencies"
25
50
  },
26
51
  "schematics": "./schematics/collection.json",
52
+ "packageManager": "pnpm@10.0.0",
27
53
  "peerDependencies": {
28
- "@angular/common": "^19.1.6",
29
- "@angular/core": "^19.1.6"
54
+ "@angular/common": ">=19.0.0",
55
+ "@angular/core": ">=19.0.0"
30
56
  },
31
57
  "dependencies": {
32
- "@angular-devkit/core": "^19.1.6",
33
- "@angular-devkit/schematics": "^19.1.6",
34
- "tslib": "^2.3.0"
58
+ "@angular-devkit/core": "^19.1.7",
59
+ "@angular-devkit/schematics": "^19.1.7",
60
+ "tslib": "^2.8.1"
61
+ },
62
+ "devDependencies": {
63
+ "@angular-builders/jest": "^19.0.0",
64
+ "@angular-devkit/architect": "^0.1902.6",
65
+ "@angular-devkit/build-angular": "^19.1.5",
66
+ "@angular-devkit/core": "^19.1.7",
67
+ "@angular/animations": "^19.1.5",
68
+ "@angular/cli": "^19.1.7",
69
+ "@angular/common": "^19.1.5",
70
+ "@angular/compiler": "^19.1.5",
71
+ "@angular/compiler-cli": "^19.1.5",
72
+ "@angular/core": "^19.1.5",
73
+ "@angular/forms": "^19.1.5",
74
+ "@angular/platform-browser": "^19.1.5",
75
+ "@angular/platform-browser-dynamic": "^19.1.5",
76
+ "@angular/router": "^19.1.5",
77
+ "@chromatic-com/storybook": "^3.2.6",
78
+ "@commitlint/cli": "^19.7.1",
79
+ "@commitlint/config-conventional": "^19.8.0",
80
+ "@compodoc/compodoc": "^1.1.26",
81
+ "@eslint/js": "^9.22.0",
82
+ "@semantic-release/changelog": "^6.0.3",
83
+ "@semantic-release/commit-analyzer": "^13.0.1",
84
+ "@semantic-release/git": "^10.0.1",
85
+ "@semantic-release/github": "^11.0.1",
86
+ "@semantic-release/npm": "^12.0.1",
87
+ "@semantic-release/release-notes-generator": "^14.0.3",
88
+ "@storybook/addon-docs": "^8.5.5",
89
+ "@storybook/addon-essentials": "^8.5.5",
90
+ "@storybook/addon-interactions": "^8.5.5",
91
+ "@storybook/addon-links": "^8.6.12",
92
+ "@storybook/addon-onboarding": "^8.5.5",
93
+ "@storybook/angular": "^8.5.3",
94
+ "@storybook/blocks": "^8.5.3",
95
+ "@storybook/test": "^8.5.5",
96
+ "@types/jest": "29.5.14",
97
+ "angular-eslint": "19.3.0",
98
+ "conventional-changelog-conventionalcommits": "^8.0.0",
99
+ "copyfiles": "^2.4.1",
100
+ "cpy": "^11.1.0",
101
+ "eslint": "^9.20.0",
102
+ "eslint-config-prettier": "^10.0.1",
103
+ "eslint-plugin-import": "^2.31.0",
104
+ "eslint-plugin-prettier": "^5.2.3",
105
+ "eslint-plugin-simple-import-sort": "^12.1.1",
106
+ "eslint-plugin-storybook": "^0.12.0",
107
+ "eslint-plugin-unicorn": "^57.0.0",
108
+ "eslint-plugin-unused-imports": "^4.1.4",
109
+ "execa": "^9.5.2",
110
+ "fs-extra": "^11.3.0",
111
+ "husky": "^9.1.7",
112
+ "jasmine-core": "~5.6.0",
113
+ "jest": "^29.7.0",
114
+ "jest-preset-angular": "^14.5.4",
115
+ "nano-staged": "^0.8.0",
116
+ "prettier": "^3.5.3",
117
+ "prettier-plugin-organize-attributes": "^1.0.0",
118
+ "rxjs": "~7.8.1",
119
+ "semantic-release": "^24.2.3",
120
+ "storybook": "^8.5.5",
121
+ "stylelint": "^16.17.0",
122
+ "stylelint-config-standard-scss": "^14.0.0",
123
+ "typescript": "~5.7.3",
124
+ "typescript-eslint": "8.29.1"
35
125
  },
36
- "sideEffects": false
37
- }
126
+ "eslintConfig": {
127
+ "extends": [
128
+ "plugin:storybook/recommended"
129
+ ]
130
+ }
131
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "builders": {
3
+ "build": {
4
+ "implementation": "./index.js",
5
+ "schema": "./schema.json",
6
+ "description": "Custom builder for angular schematics"
7
+ }
8
+ }
9
+ }