@tech4good/angular-schematics 20.1.0 → 20.2.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.
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: publish-npm
3
+ description: Automates semantic versioning and internal package.json.template updates for @tech4good/angular-schematics before npm publishing. Analyzes git history to recommend major/minor/patch bumps. Should trigger when user asks to publish to npm, release a new version, or bump versions. Should NOT trigger for standard git commits or if the user is asking about publishing in a different repository.
4
+ ---
5
+
6
+ # NPM Publish Skill
7
+
8
+ This skill assists with the process of publishing a new version of the `@tech4good/angular-schematics` package. Since sandbox constraints prevent the agent from running `npm` publish commands directly, this skill focuses on the preparation and hand-off.
9
+
10
+ ## Step 1: Analyze Git Logs and Recommend Version Bump
11
+ 1. Use the `mcp_git_git_log` tool to review the git commit history since the last git tag.
12
+ 2. Analyze the commit messages to determine the appropriate semantic version bump:
13
+ - **Major**: If there are any `BREAKING CHANGE` footers or `!` in the type/scope (e.g., `feat!: ...`).
14
+ - **Minor**: If there are any new features (`feat: ...`).
15
+ - **Patch**: If there are only bug fixes (`fix: ...`), documentation, or chore updates.
16
+ 3. Read the current version from `package.json` at the root of the workspace.
17
+ 4. Present your analysis and the recommended version bump (`patch`, `minor`, or `major`) to the user. State what the *new* version number will be.
18
+ 5. **Halt execution** and wait for the user to approve the version bump type.
19
+
20
+ ## Step 2: Update the Internal Template
21
+ 1. Once the user approves the version bump (and the resulting new version number), calculate the exact new version (e.g., `20.1.0` -> `20.1.1` for patch).
22
+ 2. Use the `replace_file_content` tool to update the `@tech4good/angular-schematics` dependency version in `src/ng-add/files/package.json.template`.
23
+ - Ensure the prefix (like `^`) is preserved if it exists. For example, change `"@tech4good/angular-schematics": "^20.1.0"` to `"@tech4good/angular-schematics": "^20.1.1"`.
24
+ 3. Trigger the `git-commit` skill to commit this template update (e.g., `build(ng-add): bump template dependency for release`). This is required because `npm version` requires a clean git working directory. Be sure to follow all `git-commit` artifact planning requirements.
25
+
26
+ ## Step 3: Handoff Instructions
27
+ 1. Inform the user that the template has been updated successfully.
28
+ 2. Provide the user with the following exact commands to run in their local terminal to complete the release process:
29
+ ```bash
30
+ npm run release:<type>
31
+ npm run build
32
+ npm publish
33
+ ```
34
+ *(Replace `<type>` with the agreed-upon bump type: `patch`, `minor`, or `major`)*.
35
+ 3. Remind them that `npm run release:<type>` will automatically bump the root `package.json`, update the `CHANGELOG.md`, stage the files, and create a new git tag.
@@ -0,0 +1,17 @@
1
+ version: "1"
2
+ tasks:
3
+ - name: test-publish-npm-recommendation
4
+ instruction: |
5
+ Use the publish-npm skill to analyze the recent git history and recommend a semantic version bump, then update the template file based on my approval. I approve of a "patch" bump to "20.1.1".
6
+ workspace:
7
+ - src: src/ng-add/files/package.json.template
8
+ dest: src/ng-add/files/package.json.template
9
+ graders:
10
+ - type: llm_rubric
11
+ rubric: |
12
+ Did the agent correctly check the git logs?
13
+ Did the agent correctly recommend a version bump type and wait for user approval?
14
+ Did the agent correctly update the "@tech4good/angular-schematics" dependency version in "src/ng-add/files/package.json.template" while preserving the semver prefix?
15
+ Did the agent trigger the git-commit skill to commit the template update?
16
+ Did the agent provide the final npm run release, build, and publish commands?
17
+ weight: 1.0
package/CHANGELOG.md ADDED
@@ -0,0 +1,22 @@
1
+ ## [20.2.0](https://github.com/tech4good-lab/angular-schematics/compare/v20.1.0...v20.2.0) (2026-05-08)
2
+
3
+ ### Features
4
+
5
+ * automate conventional commits and npm release workflow ([e98525b](https://github.com/tech4good-lab/angular-schematics/commit/e98525b3805929090a1f592f36717344b6118767))
6
+ * **schematics:** add default true to interactive prompts ([9a753e0](https://github.com/tech4good-lab/angular-schematics/commit/9a753e0b3388cf1ce5c9ca1cb0bff67cfda84e3c))
7
+
8
+ ### Bug Fixes
9
+
10
+ * **ng-add:** remove undefined entitiesToModify2 and entitiesToRemove2 ([284f852](https://github.com/tech4good-lab/angular-schematics/commit/284f852332b5371fcde270f5c1735c2b65e761c6))
11
+ * require git-commit skill for template updates in publish-npm ([4116998](https://github.com/tech4good-lab/angular-schematics/commit/4116998e20b3ed4ec2fac1cca617b3330232715c))
12
+
13
+ ### Documentation
14
+
15
+ * add repository-specific commit message guidelines ([3af75e3](https://github.com/tech4good-lab/angular-schematics/commit/3af75e375c51706be71f8cf0c89862173aafff08))
16
+ * update README ([5931736](https://github.com/tech4good-lab/angular-schematics/commit/5931736caad5698adbea4b9c36b5fa1aaffa3fc2))
17
+
18
+ ### Build System
19
+
20
+ * configure npm version lifecycle hooks and update docs ([ca0c625](https://github.com/tech4good-lab/angular-schematics/commit/ca0c62557e4cb1b712837eb19780dbc770e2c81f))
21
+ * **ng-add:** bump template dependency for release ([a806ca5](https://github.com/tech4good-lab/angular-schematics/commit/a806ca58fd5a0007c082b033a2a0b80b91f92950))
22
+ # Changelog
@@ -0,0 +1,19 @@
1
+ {
2
+ "options": {
3
+ "preset": {
4
+ "name": "conventionalcommits",
5
+ "types": [
6
+ { "type": "feat", "section": "Features", "hidden": false },
7
+ { "type": "fix", "section": "Bug Fixes", "hidden": false },
8
+ { "type": "docs", "section": "Documentation", "hidden": false },
9
+ { "type": "style", "section": "Styles", "hidden": false },
10
+ { "type": "refactor", "section": "Code Refactoring", "hidden": false },
11
+ { "type": "perf", "section": "Performance Improvements", "hidden": false },
12
+ { "type": "test", "section": "Tests", "hidden": false },
13
+ { "type": "build", "section": "Build System", "hidden": false },
14
+ { "type": "ci", "section": "Continuous Integration", "hidden": false },
15
+ { "type": "chore", "section": "Chores", "hidden": false }
16
+ ]
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,57 @@
1
+ # Branches and Releases
2
+
3
+ This document outlines our branching strategy and release process.
4
+
5
+ ## Branching Strategy
6
+
7
+ We use a simplified workflow. Our main branches are:
8
+
9
+ * **`main`**: The production-ready state of the application. Commits to this branch trigger production deployments.
10
+ * **`dev`** (or `develop`): The main development branch. All feature branches merge here first for testing and integration.
11
+
12
+ ### Feature Branches
13
+
14
+ When starting work on a new feature, bug fix, or task, always create a new branch from `dev`.
15
+
16
+ Branch naming convention: `<type>/a-short-description`
17
+
18
+ Examples for Code Repositories:
19
+ * `feat/your-new-feature` (for new functionality)
20
+ * `fix/your-bug-fix` (for bug fixes)
21
+ * `chore/your-task-name` (for maintenance)
22
+
23
+ Examples for Text-Based Repositories:
24
+ * `add/new-chapter` (for new content)
25
+ * `edit/revise-introduction` (for substantive content edits)
26
+ * `fix/typo-correction` (for formatting or typo fixes)
27
+ * `reorg/move-images` (for structural changes)
28
+
29
+ ## Release Process
30
+
31
+ We use conventional commits and automated changelog generation to manage our releases.
32
+
33
+ 1. **Develop**: Work happens in feature branches and merges into `dev`.
34
+ 2. **Version Bump**: When it's time to release, we use the npm version scripts to bump the version, which automatically updates the changelog.
35
+ 3. **Merge to Main**: The `dev` branch is merged into `main`.
36
+
37
+ ### Release Commands
38
+
39
+ You can trigger a release by running the following commands (depending on the type of change):
40
+
41
+ * **Patch Release** (for bug fixes):
42
+ ```bash
43
+ npm run release:patch
44
+ ```
45
+ * **Minor Release** (for backwards-compatible new features):
46
+ ```bash
47
+ npm run release:minor
48
+ ```
49
+ * **Major Release** (for breaking changes):
50
+ ```bash
51
+ npm run release:major
52
+ ```
53
+
54
+ These commands will:
55
+ 1. Bump the version in `package.json`
56
+ 2. Automatically generate and update `CHANGELOG.md` based on conventional commits
57
+ 3. Stage the `CHANGELOG.md` for the commit
@@ -0,0 +1,117 @@
1
+ ## Commit Message Format Resource
2
+
3
+ We imitate Angular's practices in formatting our Git commit messages precisely using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0). This format leads to **easier-to-read commit history**.
4
+
5
+ Each commit message consists of a **header**, a **body**, and a **footer**.
6
+
7
+ ```text
8
+ <header>
9
+ <BLANK LINE>
10
+ <body>
11
+ <BLANK LINE>
12
+ <footer>
13
+ ```
14
+
15
+ The `header` is mandatory and must conform to the Commit Message Header format.
16
+
17
+ The `body` is mandatory for all commits except for those of type "docs". When the body is present, it must be at least 20 characters long and must conform to the Commit Message Body format.
18
+
19
+ The `footer` is optional.
20
+
21
+ ### Commit Message Header
22
+
23
+ ```text
24
+ <type>(<scope>): <short summary>
25
+ │ │ │
26
+ │ │ └─⫸ Summary in present tense. Not capitalized. No period at the end.
27
+ │ │
28
+ │ └─⫸ Commit Scope: ng-add|component|entity|shared
29
+ │
30
+ └─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|test
31
+ ```
32
+
33
+ The `<type>` and `<summary>` fields are mandatory; the `(<scope>)` field is optional.
34
+
35
+ #### Type
36
+
37
+ Will most commonly be either `feat` or `fix`, but can be drawn from any of the below:
38
+
39
+ - **build**: Changes that affect the build system or external dependencies
40
+ - **ci**: Changes to our CI configuration files and scripts
41
+ - **docs**: Documentation-only changes
42
+ - **feat**: A new feature
43
+ - **fix**: A bug fix
44
+ - **perf**: A code change that improves performance
45
+ - **refactor**: A code change that neither fixes a bug nor adds a feature
46
+ - **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
47
+ - **test**: Adding missing tests or correcting existing tests
48
+
49
+ #### Scope
50
+
51
+ The scope corresponds to the specific schematic or area of the repository being modified. For the `angular-schematics` repository, use one of the following specific scopes:
52
+
53
+ - **ng-add**: Changes related to the `ng-add` schematic (project initialization).
54
+ - **component**: Changes related to the `component` schematic.
55
+ - **entity**: Changes related to the `entity` schematic.
56
+ - **shared**: Changes to shared schematic utilities or helpers.
57
+
58
+ If the commit touches many different parts of the repository or is a global restructure (like a `reorg`), simply omit the scope entirely.
59
+
60
+ #### Summary
61
+
62
+ The summary contains a succinct description of the change:
63
+
64
+ * use the imperative, present tense: "change" not "changed" nor "changes"
65
+ * don't capitalize the first letter
66
+ * no dot (.) at the end
67
+
68
+ ### Commit Message Body
69
+
70
+ Just as in the summary, use the imperative, present tense: "fix" not "fixed" nor "fixes".
71
+
72
+ Explain the motivation for the change in the commit message body. This commit message should explain _why_ you are making this change. You can include a comparison of the previous behavior with the new behavior in order to illustrate the impact of the change.
73
+
74
+ **We require a specific template for the commit message body to ensure consistency:**
75
+
76
+ ```text
77
+ <Motivation/rationale for the change>
78
+
79
+ User Request: <Summary of what the user originally requested for the task, not just the command to commit>
80
+
81
+ Implementation Insights: <Explain insights on *HOW* the work got done or *WHAT* underlying issue was discovered. OMIT THIS SECTION AND LABEL ENTIRELY if the implementation is completely straightforward or trivial.>
82
+
83
+ Steps Taken:
84
+ 1. <Step 1>
85
+ 2. <Step 2>
86
+ ...
87
+
88
+ Triggered Skills: <Skill 1>, <Skill 2>, ...
89
+ ```
90
+
91
+ **Notes on the template:**
92
+ - The **User Request** section must summarize the original feature/code request, not the generic prompt asking to "commit".
93
+ - The **Implementation Insights** section is **mandatory** when there was an insight that might not be apparent to users/collaborators, but you MUST **omit it entirely** when the implementation is completely straightforward. Emphasize insights on *HOW* the work got done or *WHAT* underlying issue was discovered. Do not just explain the rationale for the commit (that happens earlier in the message body). If you omit this section, you MUST completely remove the `Implementation Insights:` label from the commit template, but you must briefly explain why in the rest of your implementation/commit plan so the user knows you intentionally excluded it.
94
+
95
+ ### Commit Message Footer
96
+
97
+ The footer can contain information about breaking changes and is also the place to reference GitHub issues and other PRs that this commit closes or is related to. For example:
98
+
99
+ ```text
100
+ BREAKING CHANGE: <breaking change summary>
101
+ <BLANK LINE>
102
+ <breaking change description + migration instructions>
103
+ <BLANK LINE>
104
+ <BLANK LINE>
105
+ Fixes #<issue number>, Closes #<pr number>
106
+ ```
107
+
108
+ Breaking Change section should start with the phrase `BREAKING CHANGE: ` followed by a summary of the breaking change, a blank line, and a detailed description of the breaking change that also includes migration instructions.
109
+
110
+ ## Revert commits
111
+
112
+ If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit.
113
+
114
+ The content of the commit message body should contain:
115
+
116
+ - information about the SHA of the commit being reverted in the following format: `This reverts commit <SHA>`,
117
+ - a clear description of the reason for reverting the commit message.
package/package.json CHANGED
@@ -1,10 +1,16 @@
1
1
  {
2
2
  "name": "@tech4good/angular-schematics",
3
- "version": "20.1.0",
3
+ "version": "20.2.0",
4
4
  "description": "A set of schematics for generating modules, containers, components, and entities",
5
5
  "scripts": {
6
6
  "build": "tsc -p tsconfig.json",
7
- "test": "npm run build && jasmine src/**/*_spec.js"
7
+ "test": "npm run build && jasmine src/**/*_spec.js",
8
+ "changelog": "conventional-changelog --config changelog.config.json -i CHANGELOG.md -s",
9
+ "changelog:all": "conventional-changelog -r 0 --config changelog.config.json -i CHANGELOG.md -s",
10
+ "version": "npm run changelog && git add CHANGELOG.md",
11
+ "release:patch": "npm version patch",
12
+ "release:minor": "npm version minor",
13
+ "release:major": "npm version major"
8
14
  },
9
15
  "keywords": [
10
16
  "schematics"
@@ -23,6 +29,8 @@
23
29
  "devDependencies": {
24
30
  "@types/jasmine": "~5.1.0",
25
31
  "@types/node": "^18.19.47",
32
+ "conventional-changelog-cli": "^5.0.0",
33
+ "conventional-changelog-conventionalcommits": "^8.0.0",
26
34
  "jasmine": "^5.1.0"
27
35
  }
28
36
  }
@@ -36,6 +36,7 @@
36
36
  },
37
37
  "inDirectory": {
38
38
  "type": "boolean",
39
+ "default": true,
39
40
  "x-prompt": "Are you currently in the directory where you want to generate the component? (please organize your components according to the view hierarchy to the extent possible)"
40
41
  }
41
42
  },
@@ -36,6 +36,7 @@
36
36
  },
37
37
  "inDirectory": {
38
38
  "type": "boolean",
39
+ "default": true,
39
40
  "x-prompt": "Are you currently in the directory where you want to generate the entity? (typically directly in src/app/core/store)"
40
41
  }
41
42
  },
@@ -48,7 +48,7 @@
48
48
  "@angular/cli": "^20.3.2",
49
49
  "@angular/compiler-cli": "^20.3.0",
50
50
  "@ngx-env/builder": "^20.1.1",
51
- "@tech4good/angular-schematics": "^20.1.0",
51
+ "@tech4good/angular-schematics": "^20.2.0",
52
52
  "@types/estree": "^1.0.0",
53
53
  "@types/jest": "^29.5.14",
54
54
  "@types/node": "^18.19.47",
@@ -257,26 +257,11 @@ export class CachedListenersService {
257
257
  .filter((dc) => dc.type === 'modified' && dc.docData['_deleted'])
258
258
  .map((dc) => dc.docData['__id']);
259
259
 
260
- // Handle changes of the 'removed' type. In general, firebase 'removed'
261
- // could be due to no longer matching the stream query rather than being
262
- // deleted from the DB. this is why we use soft deletes (set _deleted to true)
263
- // so technically we shouldn't be getting any 'removed' entries. however,
264
- // if there were manual deletions in the database, there could still be changes
265
- // of this type which the below code seeks to handle
266
- const entitiesToModify2 = fbPayload
267
- .filter((dc) => dc.type === 'removed' && !entityInQueryResults(dc.docData, queryParams, queryOptions))
268
- .map((dc) => dc.docData);
269
-
270
-
271
- const entitiesToRemove2 = fbPayload
272
- .filter((dc) => dc.type === 'removed' && entityInQueryResults(dc.docData, queryParams, queryOptions))
273
- .map((dc) => dc.docData['__id']);
274
-
275
260
  // Patch all the changes to the store
276
261
  store.handleStreamChanges(
277
262
  entitiesToAdd,
278
- [...entitiesToModify, ...entitiesToModify2],
279
- [...entitiesToRemove, ...entitiesToRemove2],
263
+ entitiesToModify,
264
+ entitiesToRemove,
280
265
  );
281
266
  });
282
267
 
@@ -18,6 +18,7 @@
18
18
  },
19
19
  "proceed": {
20
20
  "type": "boolean",
21
+ "default": true,
21
22
  "x-prompt": "This schematic is only designed for generating initial files on a FRESH repo created from ng new. If you use this outside of that context, YOU WILL OVERWRITE parts of your existing code. Are you sure you want to proceed?"
22
23
  }
23
24