@tech4good/angular-schematics 18.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.
Files changed (144) hide show
  1. package/.agents/skills/publish-npm/SKILL.md +35 -0
  2. package/.agents/skills/publish-npm/eval.yaml +17 -0
  3. package/CHANGELOG.md +22 -0
  4. package/README.md +9 -14
  5. package/changelog.config.json +19 -0
  6. package/contributing-docs/branches-and-releases.md +57 -0
  7. package/contributing-docs/commit-message.md +117 -0
  8. package/package.json +19 -10
  9. package/src/collection.json +3 -3
  10. package/src/component/files/__name@dasherize__/__name@dasherize__.component.spec.ts.template +25 -22
  11. package/src/component/files/__name@dasherize__/__name@dasherize__.component.ts.template +0 -1
  12. package/src/component/index.js +8 -15
  13. package/src/component/index.js.map +1 -1
  14. package/src/component/index_spec.js +5 -13
  15. package/src/component/index_spec.js.map +1 -1
  16. package/src/component/schema.json +1 -0
  17. package/src/entity/index.js +8 -15
  18. package/src/entity/index.js.map +1 -1
  19. package/src/entity/index_spec.js +5 -13
  20. package/src/entity/index_spec.js.map +1 -1
  21. package/src/entity/schema.json +1 -0
  22. package/src/{init → ng-add}/files/.github/workflows/angular-github-ci.yml.template +1 -1
  23. package/src/{init → ng-add}/files/angular.json.template +26 -0
  24. package/src/ng-add/files/eslint.config.js.template +97 -0
  25. package/src/ng-add/files/package.json.template +71 -0
  26. package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.spec.ts.template +37 -0
  27. package/src/{init → ng-add}/files/src/app/admin/admin-panel/admin-panel.component.ts.template +0 -1
  28. package/src/ng-add/files/src/app/app.component.spec.ts.template +39 -0
  29. package/src/{init → ng-add}/files/src/app/app.component.ts.template +0 -1
  30. package/src/{init → ng-add}/files/src/app/core/firebase/cached-listeners.service.ts.template +2 -17
  31. package/src/{init → ng-add}/files/src/app/core/firebase/firebase.mock.service.ts.template +4 -2
  32. package/src/{init → ng-add}/files/src/app/core/firebase/firebase.service.ts.template +3 -1
  33. package/src/{init → ng-add}/files/src/app/core/store/auth/auth.mock.ts.template +9 -3
  34. package/src/ng-add/files/src/app/first-time/consent/consent.component.spec.ts.template +37 -0
  35. package/src/{init → ng-add}/files/src/app/first-time/consent/consent.component.ts.template +0 -1
  36. package/src/ng-add/files/src/app/first-time/early-access/early-access.component.spec.ts.template +40 -0
  37. package/src/{init → ng-add}/files/src/app/first-time/early-access/early-access.component.ts.template +1 -3
  38. package/src/ng-add/files/src/app/first-time/landing/landing.component.spec.ts.template +37 -0
  39. package/src/{init → ng-add}/files/src/app/first-time/landing/landing.component.ts.template +0 -1
  40. package/src/ng-add/files/src/app/first-time/login/login.component.spec.ts.template +37 -0
  41. package/src/{init → ng-add}/files/src/app/first-time/login/login.component.ts.template +0 -1
  42. package/src/ng-add/files/src/app/first-time/onboarding/onboarding.component.spec.ts.template +37 -0
  43. package/src/{init → ng-add}/files/src/app/first-time/onboarding/onboarding.component.ts.template +0 -1
  44. package/src/ng-add/files/src/app/main/home/home.component.spec.ts.template +37 -0
  45. package/src/{init → ng-add}/files/src/app/main/home/home.component.ts.template +0 -1
  46. package/src/ng-add/files/src/app/shared/navbar/navbar.component.spec.ts.template +37 -0
  47. package/src/{init → ng-add}/files/src/app/shared/navbar/navbar.component.ts.template +0 -1
  48. package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.spec.ts.template +30 -0
  49. package/src/{init → ng-add}/files/src/app/shared/redeployment-warning/redeployment-warning.component.ts.template +0 -1
  50. package/src/ng-add/files/src/main.ts.template +6 -0
  51. package/src/{init → ng-add}/index.d.ts +1 -1
  52. package/src/{init → ng-add}/index.js +9 -16
  53. package/src/ng-add/index.js.map +1 -0
  54. package/src/{init → ng-add}/schema.json +3 -2
  55. package/src/shared/camelcase-formatter.js +1 -2
  56. package/src/shared/camelcase-formatter.js.map +1 -1
  57. package/src/shared/statements-adder.js +3 -4
  58. package/src/shared/statements-adder.js.map +1 -1
  59. package/tsconfig.json +10 -25
  60. package/src/init/files/.eslintrc.json.template +0 -120
  61. package/src/init/files/package.json.template +0 -68
  62. package/src/init/files/src/app/admin/admin-panel/admin-panel.component.spec.ts.template +0 -32
  63. package/src/init/files/src/app/app.component.spec.ts.template +0 -27
  64. package/src/init/files/src/app/first-time/consent/consent.component.spec.ts.template +0 -32
  65. package/src/init/files/src/app/first-time/early-access/early-access.component.spec.ts.template +0 -35
  66. package/src/init/files/src/app/first-time/landing/landing.component.spec.ts.template +0 -32
  67. package/src/init/files/src/app/first-time/login/login.component.spec.ts.template +0 -32
  68. package/src/init/files/src/app/first-time/onboarding/onboarding.component.spec.ts.template +0 -33
  69. package/src/init/files/src/app/main/home/home.component.spec.ts.template +0 -32
  70. package/src/init/files/src/app/shared/navbar/navbar.component.spec.ts.template +0 -32
  71. package/src/init/files/src/app/shared/redeployment-warning/redeployment-warning.component.spec.ts.template +0 -24
  72. package/src/init/index.js.map +0 -1
  73. /package/src/{init → ng-add}/files/.firebaserc.template +0 -0
  74. /package/src/{init → ng-add}/files/.gitattributes.template +0 -0
  75. /package/src/{init → ng-add}/files/.gitignore.template +0 -0
  76. /package/src/{init → ng-add}/files/CODE_OF_CONDUCT.md.template +0 -0
  77. /package/src/{init → ng-add}/files/CONTRIBUTING.md.template +0 -0
  78. /package/src/{init → ng-add}/files/README.md.template +0 -0
  79. /package/src/{init → ng-add}/files/contributing-docs/coding-standards.md.template +0 -0
  80. /package/src/{init → ng-add}/files/contributing-docs/using-fixup-commits.md.template +0 -0
  81. /package/src/{init → ng-add}/files/jest.config.ts.template +0 -0
  82. /package/src/{init → ng-add}/files/public/images/close-x.svg +0 -0
  83. /package/src/{init → ng-add}/files/setup-jest.ts.template +0 -0
  84. /package/src/{init → ng-add}/files/src/app/admin/admin-panel/admin-panel.animations.ts.template +0 -0
  85. /package/src/{init → ng-add}/files/src/app/admin/admin-panel/admin-panel.component.html.template +0 -0
  86. /package/src/{init → ng-add}/files/src/app/admin/admin-panel/admin-panel.component.scss.template +0 -0
  87. /package/src/{init → ng-add}/files/src/app/app.component.html.template +0 -0
  88. /package/src/{init → ng-add}/files/src/app/app.component.scss.template +0 -0
  89. /package/src/{init → ng-add}/files/src/app/app.config.ts.template +0 -0
  90. /package/src/{init → ng-add}/files/src/app/app.routes.ts.template +0 -0
  91. /package/src/{init → ng-add}/files/src/app/core/analytics/log.service.ts.template +0 -0
  92. /package/src/{init → ng-add}/files/src/app/core/analytics/time-analytics.service.ts.template +0 -0
  93. /package/src/{init → ng-add}/files/src/app/core/auth/auth.guard.ts.template +0 -0
  94. /package/src/{init → ng-add}/files/src/app/core/firebase/database.service.ts.template +0 -0
  95. /package/src/{init → ng-add}/files/src/app/core/local-storage/local-storage.service.ts.template +0 -0
  96. /package/src/{init → ng-add}/files/src/app/core/local-storage/session-local-storage.service.ts.template +0 -0
  97. /package/src/{init → ng-add}/files/src/app/core/local-storage/session.service.ts.template +0 -0
  98. /package/src/{init → ng-add}/files/src/app/core/router/routing-state.service.ts.template +0 -0
  99. /package/src/{init → ng-add}/files/src/app/core/store/app.model.ts.template +0 -0
  100. /package/src/{init → ng-add}/files/src/app/core/store/app.store.ts.template +0 -0
  101. /package/src/{init → ng-add}/files/src/app/core/store/auth/auth.store.ts.template +0 -0
  102. /package/src/{init → ng-add}/files/src/app/core/store/batch-write.firebase.service.ts.template +0 -0
  103. /package/src/{init → ng-add}/files/src/app/core/store/batch-write.mock.service.ts.template +0 -0
  104. /package/src/{init → ng-add}/files/src/app/core/store/batch-write.service.ts.template +0 -0
  105. /package/src/{init → ng-add}/files/src/app/core/store/user/user.mock.ts.template +0 -0
  106. /package/src/{init → ng-add}/files/src/app/core/store/user/user.model.ts.template +0 -0
  107. /package/src/{init → ng-add}/files/src/app/core/store/user/user.store.ts.template +0 -0
  108. /package/src/{init → ng-add}/files/src/app/core/store/user-context/user-context.mock.ts.template +0 -0
  109. /package/src/{init → ng-add}/files/src/app/core/store/user-context/user-context.model.ts.template +0 -0
  110. /package/src/{init → ng-add}/files/src/app/core/store/user-context/user-context.store.ts.template +0 -0
  111. /package/src/{init → ng-add}/files/src/app/core/utils/rand.utils.ts.template +0 -0
  112. /package/src/{init → ng-add}/files/src/app/first-time/consent/consent.animations.ts.template +0 -0
  113. /package/src/{init → ng-add}/files/src/app/first-time/consent/consent.component.html.template +0 -0
  114. /package/src/{init → ng-add}/files/src/app/first-time/consent/consent.component.scss.template +0 -0
  115. /package/src/{init → ng-add}/files/src/app/first-time/early-access/early-access.animations.ts.template +0 -0
  116. /package/src/{init → ng-add}/files/src/app/first-time/early-access/early-access.component.html.template +0 -0
  117. /package/src/{init → ng-add}/files/src/app/first-time/early-access/early-access.component.scss.template +0 -0
  118. /package/src/{init → ng-add}/files/src/app/first-time/early-access/early-access.model.ts.template +0 -0
  119. /package/src/{init → ng-add}/files/src/app/first-time/landing/landing.animations.ts.template +0 -0
  120. /package/src/{init → ng-add}/files/src/app/first-time/landing/landing.component.html.template +0 -0
  121. /package/src/{init → ng-add}/files/src/app/first-time/landing/landing.component.scss.template +0 -0
  122. /package/src/{init → ng-add}/files/src/app/first-time/login/login.component.html.template +0 -0
  123. /package/src/{init → ng-add}/files/src/app/first-time/login/login.component.scss.template +0 -0
  124. /package/src/{init → ng-add}/files/src/app/first-time/onboarding/onboarding.animations.ts.template +0 -0
  125. /package/src/{init → ng-add}/files/src/app/first-time/onboarding/onboarding.component.html.template +0 -0
  126. /package/src/{init → ng-add}/files/src/app/first-time/onboarding/onboarding.component.scss.template +0 -0
  127. /package/src/{init → ng-add}/files/src/app/main/home/home.animations.ts.template +0 -0
  128. /package/src/{init → ng-add}/files/src/app/main/home/home.component.html.template +0 -0
  129. /package/src/{init → ng-add}/files/src/app/main/home/home.component.scss.template +0 -0
  130. /package/src/{init → ng-add}/files/src/app/shared/navbar/navbar.component.html.template +0 -0
  131. /package/src/{init → ng-add}/files/src/app/shared/navbar/navbar.component.scss.template +0 -0
  132. /package/src/{init → ng-add}/files/src/app/shared/redeployment-warning/redeployment-warning.component.html.template +0 -0
  133. /package/src/{init → ng-add}/files/src/app/shared/redeployment-warning/redeployment-warning.component.scss.template +0 -0
  134. /package/src/{init → ng-add}/files/src/app/shared/redeployment-warning/redeployment-warning.service.ts.template +0 -0
  135. /package/src/{init → ng-add}/files/src/env.d.ts.template +0 -0
  136. /package/src/{init → ng-add}/files/src/environments/environment.prod.ts.template +0 -0
  137. /package/src/{init → ng-add}/files/src/environments/environment.test.ts.template +0 -0
  138. /package/src/{init → ng-add}/files/src/environments/environment.ts.template +0 -0
  139. /package/src/{init → ng-add}/files/src/index.html.template +0 -0
  140. /package/src/{init → ng-add}/files/src/styles/_variables.scss.template +0 -0
  141. /package/src/{init → ng-add}/files/src/styles.scss.template +0 -0
  142. /package/src/{init → ng-add}/files/tsconfig.app.json.template +0 -0
  143. /package/src/{init → ng-add}/files/tsconfig.json.template +0 -0
  144. /package/src/{init → ng-add}/files/tsconfig.spec.json.template +0 -0
@@ -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
package/README.md CHANGED
@@ -1,20 +1,15 @@
1
1
  # Angular Schematics
2
2
 
3
- This repository is used to generate modules, containers, components, and entities for Angular projects.
3
+ This repository is used to generate components and entities for Angular projects.
4
4
 
5
5
  ### Usage
6
6
 
7
- 1. Run `npm install @tech4good/angular-schematics`.
8
- 2. Set the schematics to be the default using: `ng config cli.defaultCollection @tech4good/angular-schematics`
9
- 3. Change directories to the directory you want to generate the files and run `ng generate <schematic> <name>`, where `schematic` = module, container, component, or entity (or if you did not make it the default, use `ng generate @tech4good/angular-schematics:<schematic> <name>`)
10
-
11
- ### Setting up a new repository
12
-
13
- 1. Create a new Angular repo using the CLI,
14
- 2. Use `ng generate init` to add our base files to the new repo,
15
- 3. Then add database configuration parameters:
16
- * Update the environments files with your firebase configs
17
- * Update .firebaserc with the firebase projects you're deploying to
7
+ First set up a new repository:
8
+ 1. Create a new Angular repo using the CLI
9
+ 2. Add @techgood/angular-schematics using `ng add @tech4good/angular-schematics`
10
+ 3. Add the newly generated base files and `git commit -am "build: install @tech4good/angular-schematics"`
11
+ 4. Finally, add database configuration parameters, updating the environments files with your firebase configs and .firebaserc with the firebase projects you're deploying to
12
+ 5. Change directories to the directory you want to generate the files and run `ng generate <schematic> <name>`, where `schematic` = component or entity (you could also use `ng generate @tech4good/angular-schematics:<schematic> <name>`)
18
13
 
19
14
  ### Developing
20
15
 
@@ -22,7 +17,7 @@ This repository is used to generate modules, containers, components, and entitie
22
17
  2. Run `npm install -g @angular-devkit/schematics-cli` to install globally
23
18
  3. Run `npm install`, `npm run build` & `npm link`
24
19
  4. Run `npm link @tech4good/angular-schematics` in the Angular project directory
25
- 5. Run `ng generate @tech4good/angular-schematics:<schematic>` to generate files (`schematic` = module, container, component, or entity)
20
+ 5. Run `ng generate @tech4good/angular-schematics:<schematic>` to generate files
26
21
  6. To test/debug new changes, run `npm run build` again before `ng generate ...`
27
22
 
28
23
  ### Testing
@@ -51,4 +46,4 @@ npm publish # will ask for a OTP (see Google Authenticator: npm)
51
46
  That's it!
52
47
 
53
48
  You can also use `npm version <version>` to update the version before publishing.
54
- * Don't forget to also update `src/init/files/package.json.template` so that the latest version of `@tech4good/anguar-schematics` is being used in the dependencies.
49
+ * Don't forget to also update `src/ng-add/files/package.json.template` so that the latest version of `@tech4good/anguar-schematics` is being used in the dependencies.
@@ -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": "18.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"
@@ -13,15 +19,18 @@
13
19
  "license": "MIT",
14
20
  "schematics": "./src/collection.json",
15
21
  "dependencies": {
16
- "@angular-devkit/core": "^18.1.0",
17
- "@angular-devkit/schematics": "^18.1.0",
18
- "@angular-devkit/schematics-cli": "^17.3.2",
19
- "@schematics/angular": "^18.1.0",
20
- "typescript": "~4.5.5"
22
+ "@angular-devkit/core": "^20.3.2",
23
+ "@angular-devkit/schematics": "^20.3.2",
24
+ "@angular-devkit/schematics-cli": "^20.3.2",
25
+ "@schematics/angular": "^20.3.0",
26
+ "inquirer": "^13.2.5",
27
+ "typescript": "~5.8.3"
21
28
  },
22
29
  "devDependencies": {
23
- "@types/node": "^12.11.1",
24
- "@types/jasmine": "~3.6.0",
25
- "jasmine": "^3.5.0"
30
+ "@types/jasmine": "~5.1.0",
31
+ "@types/node": "^18.19.47",
32
+ "conventional-changelog-cli": "^5.0.0",
33
+ "conventional-changelog-conventionalcommits": "^8.0.0",
34
+ "jasmine": "^5.1.0"
26
35
  }
27
36
  }
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
3
3
  "schematics": {
4
- "init": {
4
+ "ng-add": {
5
5
  "description": "Setup initial lab infrastructure files.",
6
- "factory": "./init/index#init",
7
- "schema": "./init/schema.json"
6
+ "factory": "./ng-add/index#ngAdd",
7
+ "schema": "./ng-add/schema.json"
8
8
  },
9
9
  "component": {
10
10
  "description": "Generate a new component.",
@@ -1,4 +1,5 @@
1
- import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
1
+ import { render } from '@testing-library/angular';
2
+ import userEvent from '@testing-library/user-event';
2
3
 
3
4
  import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
4
5
  import { DATABASE_SERVICE } from 'src/app/core/firebase/database.service';
@@ -6,29 +7,31 @@ import { FirebaseMockService } from 'src/app/core/firebase/firebase.mock.service
6
7
  import { BatchWriteMockService } from 'src/app/core/store/batch-write.mock.service';
7
8
  import { BATCH_WRITE_SERVICE } from 'src/app/core/store/batch-write.service';
8
9
 
10
+ /** Sets up the testing environment for <%= classify(name) %>Component using render.*/
11
+ async function setup() {
12
+ const user = userEvent.setup();
13
+ const checkedSpy = jest.fn();
9
14
 
10
- describe('<%= classify(name) %>Component', () => {
11
- let component: <%= classify(name) %>Component;
12
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
13
-
14
- beforeEach(waitForAsync(() => {
15
- TestBed.configureTestingModule({
16
- imports: [<%= classify(name) %>Component],
17
- providers: [
18
- { provide: DATABASE_SERVICE, useClass: FirebaseMockService },
19
- { provide: BATCH_WRITE_SERVICE, useClass: BatchWriteMockService },
20
- ],
21
- })
22
- .compileComponents();
23
- }));
24
-
25
- beforeEach(() => {
26
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
27
- component = fixture.componentInstance;
28
- fixture.detectChanges();
15
+ const view = await render(<%= classify(name) %>Component, {
16
+ imports: [],
17
+ providers: [
18
+ { provide: DATABASE_SERVICE, useClass: FirebaseMockService },
19
+ { provide: BATCH_WRITE_SERVICE, useClass: BatchWriteMockService },
20
+ ],
21
+ componentInputs: {},
22
+ on: {},
29
23
  });
30
24
 
31
- it('should create', () => {
32
- expect(component).toBeTruthy();
25
+ return {
26
+ user,
27
+ fixture: view.fixture,
28
+ rerender: () => view.rerender(), // add component inputs if needed
29
+ };
30
+ }
31
+
32
+ describe('<%= classify(name) %>Component', () => {
33
+ it('should create', async () => {
34
+ const { fixture } = await setup();
35
+ expect(fixture.componentInstance).toBeTruthy();
33
36
  });
34
37
  });
@@ -10,7 +10,6 @@ import { BatchWriteService, BATCH_WRITE_SERVICE } from 'src/app/core/store/batch
10
10
  styleUrls: ['./<%= dasherize(name) %>.component.scss'],
11
11
  changeDetection: ChangeDetectionStrategy.OnPush,
12
12
  animations: <%= classify(name) %>Animations,
13
- standalone: true,
14
13
  imports: [
15
14
  ],
16
15
  })
@@ -1,28 +1,19 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.component = void 0;
3
+ exports.component = component;
13
4
  const schematics_1 = require("@angular-devkit/schematics");
14
5
  const parse_name_1 = require("@schematics/angular/utility/parse-name");
15
6
  const validation_1 = require("@schematics/angular/utility/validation");
16
7
  const workspace_1 = require("@schematics/angular/utility/workspace");
17
8
  const core_1 = require("@angular-devkit/core");
18
9
  function component(options) {
19
- return (tree, context) => __awaiter(this, void 0, void 0, function* () {
10
+ return async (tree, context) => {
20
11
  // Make sure the command is executed in the directory where the component should be generated
21
12
  if (!options.inDirectory) {
22
13
  context.logger.info("Please navigate to the directory where you want to generate the component.");
23
14
  return (0, schematics_1.noop)();
24
15
  }
25
- const workspace = yield (0, workspace_1.getWorkspace)(tree);
16
+ const workspace = await (0, workspace_1.getWorkspace)(tree);
26
17
  const project = workspace.projects.get(options.project);
27
18
  if (!project) {
28
19
  throw new schematics_1.SchematicsException(`Project "${options.project}" does not exist.`);
@@ -39,13 +30,15 @@ function component(options) {
39
30
  context.logger.info(`options.selector: ${options.selector}`);
40
31
  (0, validation_1.validateHtmlSelector)(options.selector);
41
32
  const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
42
- (0, schematics_1.applyTemplates)(Object.assign(Object.assign({}, core_1.strings), options)),
33
+ (0, schematics_1.applyTemplates)({
34
+ ...core_1.strings,
35
+ ...options,
36
+ }),
43
37
  (0, schematics_1.move)(parsedPath.path),
44
38
  ]);
45
39
  return (0, schematics_1.chain)([
46
40
  (0, schematics_1.mergeWith)(templateSource)
47
41
  ]);
48
- });
42
+ };
49
43
  }
50
- exports.component = component;
51
44
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;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,CAAC;QACrD,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC/B,OAAO,CAAC,IAAI,GAAG,IAAA,4BAAgB,EAAC,OAAO,CAAC,CAAC;QAC3C,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAErD,MAAM,UAAU,GAAG,IAAA,sBAAS,EAAC,OAAO,CAAC,IAAc,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACnE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAC/B,OAAO,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAE/B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC7D,IAAA,iCAAoB,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAEvC,MAAM,cAAc,GAAG,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,SAAS,CAAC,EAAE;YAC3C,IAAA,2BAAc,EAAC;gBACb,GAAG,cAAO;gBACV,GAAG,OAAO;aACX,CAAC;YACF,IAAA,iBAAI,EAAC,UAAU,CAAC,IAAI,CAAC;SACtB,CAAC,CAAC;QAEH,OAAO,IAAA,kBAAK,EAAC;YACX,IAAA,sBAAS,EAAC,cAAc,CAAC;SAC1B,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -1,23 +1,15 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
12
4
  const schematics_1 = require("@angular-devkit/schematics");
13
5
  const testing_1 = require("@angular-devkit/schematics/testing");
14
- const path = require("path");
6
+ const path = tslib_1.__importStar(require("path"));
15
7
  const collectionPath = path.join(__dirname, '../collection.json');
16
8
  describe('component', () => {
17
- it('works', () => __awaiter(void 0, void 0, void 0, function* () {
9
+ it('works', async () => {
18
10
  const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
19
- const tree = yield runner.runSchematic('component', {}, schematics_1.Tree.empty());
11
+ const tree = await runner.runSchematic('component', {}, schematics_1.Tree.empty());
20
12
  expect(tree.files).toEqual([]);
21
- }));
13
+ });
22
14
  });
23
15
  //# sourceMappingURL=index_spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index_spec.js","sourceRoot":"","sources":["index_spec.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2DAAkD;AAClD,gEAAyE;AACzE,6BAA6B;AAG7B,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAGlE,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,OAAO,EAAE,GAAS,EAAE;QACrB,MAAM,MAAM,GAAG,IAAI,6BAAmB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;QACrE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,EAAE,EAAE,iBAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAEtE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"index_spec.js","sourceRoot":"","sources":["index_spec.ts"],"names":[],"mappings":";;;AAAA,2DAAkD;AAClD,gEAAyE;AACzE,mDAA6B;AAG7B,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAGlE,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;QACrB,MAAM,MAAM,GAAG,IAAI,6BAAmB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;QACrE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,EAAE,EAAE,iBAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAEtE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -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
  },
@@ -1,15 +1,6 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.entity = void 0;
3
+ exports.entity = entity;
13
4
  const schematics_1 = require("@angular-devkit/schematics");
14
5
  const change_1 = require("@schematics/angular/utility/change");
15
6
  const find_module_1 = require("@schematics/angular/utility/find-module");
@@ -76,13 +67,13 @@ function addInserts(options) {
76
67
  };
77
68
  }
78
69
  function entity(options) {
79
- return (tree, context) => __awaiter(this, void 0, void 0, function* () {
70
+ return async (tree, context) => {
80
71
  // Make sure the command is executed in the directory where the component should be generated
81
72
  if (!options.inDirectory) {
82
73
  context.logger.info("Please navigate to the directory where you want to generate the entity.");
83
74
  return (0, schematics_1.noop)();
84
75
  }
85
- const workspace = yield (0, workspace_1.getWorkspace)(tree);
76
+ const workspace = await (0, workspace_1.getWorkspace)(tree);
86
77
  const project = workspace.projects.get(options.project);
87
78
  if (!project) {
88
79
  throw new schematics_1.SchematicsException(`Project "${options.project}" does not exist.`);
@@ -94,14 +85,16 @@ function entity(options) {
94
85
  options.name = parsedPath.name;
95
86
  options.path = parsedPath.path;
96
87
  const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
97
- (0, schematics_1.applyTemplates)(Object.assign(Object.assign({}, core_1.strings), options)),
88
+ (0, schematics_1.applyTemplates)({
89
+ ...core_1.strings,
90
+ ...options,
91
+ }),
98
92
  (0, schematics_1.move)(parsedPath.path),
99
93
  ]);
100
94
  return (0, schematics_1.chain)([
101
95
  addInserts(options),
102
96
  (0, schematics_1.mergeWith)(templateSource)
103
97
  ]);
104
- });
98
+ };
105
99
  }
106
- exports.entity = entity;
107
100
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAIoC;AAEpC,+DAA0E;AAC1E,yEAA4E;AAC5E,uEAAmE;AACnE,qEAAuF;AACvF,+CAA+C;AAE/C,iEAAyE;AAEzE,SAAS,UAAU,CAAC,OAAY;IAC9B,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAE/C,MAAM,cA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