@tech4good/angular-schematics 17.0.4 → 18.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/package.json +4 -4
- package/src/collection.json +0 -16
- package/src/component/files/__name@dasherize__/__name@dasherize__.component.ts.template +22 -8
- package/src/component/index.js +2 -45
- package/src/component/index.js.map +1 -1
- package/src/component/schema.json +0 -5
- package/src/entity/files/__name@dasherize__/__name@dasherize__.mock.ts.template +12 -0
- package/src/entity/files/__name@dasherize__/__name@dasherize__.model.ts.template +1 -0
- package/src/entity/files/__name@dasherize__/__name@dasherize__.store.ts.template +41 -0
- package/src/entity/index.js +29 -50
- package/src/entity/index.js.map +1 -1
- package/src/init/files/.eslintrc.json.template +1 -1
- package/src/init/files/.firebaserc.template +8 -0
- package/src/init/files/.github/workflows/angular-github-ci.yml.template +1 -1
- package/src/init/files/README.md.template +13 -10
- package/src/init/files/angular.json.template +18 -11
- package/src/init/files/package.json.template +29 -30
- package/src/init/files/src/app/admin/{waitlist/waitlist.animations.ts.template → admin-panel/admin-panel.animations.ts.template} +1 -1
- package/src/init/files/src/app/admin/{waitlist/waitlist.component.html.template → admin-panel/admin-panel.component.html.template} +3 -3
- package/src/init/files/src/app/admin/{waitlist/waitlist.component.scss.template → admin-panel/admin-panel.component.scss.template} +1 -1
- package/src/init/files/src/app/admin/admin-panel/admin-panel.component.spec.ts.template +25 -0
- package/src/init/files/src/app/admin/admin-panel/admin-panel.component.ts.template +99 -0
- package/src/init/files/src/app/app.component.ts.template +12 -8
- package/src/init/files/src/app/app.config.ts.template +65 -0
- package/src/init/files/src/app/app.routes.ts.template +32 -0
- package/src/init/files/src/app/core/analytics/log.service.ts.template +122 -89
- package/src/init/files/src/app/core/analytics/time-analytics.service.ts.template +9 -17
- package/src/init/files/src/app/core/auth/auth.guard.ts.template +26 -23
- package/src/init/files/src/app/core/firebase/cached-listeners.service.ts.template +291 -0
- package/src/init/files/src/app/core/firebase/database.service.ts.template +56 -0
- package/src/init/files/src/app/core/firebase/firebase.mock.service.ts.template +276 -0
- package/src/init/files/src/app/core/firebase/firebase.service.ts.template +265 -215
- package/src/init/files/src/app/core/local-storage/session.service.ts.template +3 -4
- package/src/init/files/src/app/core/store/app.model.ts.template +19 -0
- package/src/init/files/src/app/core/store/app.store.ts.template +1074 -0
- package/src/init/files/src/app/core/store/auth/auth.mock.ts.template +20 -0
- package/src/init/files/src/app/core/store/auth/auth.store.ts.template +136 -0
- package/src/init/files/src/app/core/store/batch-write.firebase.service.ts.template +58 -0
- package/src/init/files/src/app/core/store/batch-write.mock.service.ts.template +105 -0
- package/src/init/files/src/app/core/store/batch-write.service.ts.template +126 -0
- package/src/init/files/src/app/core/store/user/user.mock.ts.template +24 -0
- package/src/init/files/src/app/core/store/user/user.model.ts.template +3 -6
- package/src/init/files/src/app/core/store/user/user.store.ts.template +41 -0
- package/src/init/files/src/app/core/store/user-context/user-context.mock.ts.template +24 -0
- package/src/init/files/src/app/core/store/user-context/user-context.model.ts.template +1 -0
- package/src/init/files/src/app/core/store/user-context/user-context.store.ts.template +41 -0
- package/src/init/files/src/app/core/utils/rand.utils.ts.template +13 -0
- package/src/init/files/src/app/{onboarding → first-time}/consent/consent.component.html.template +10 -14
- package/src/init/files/src/app/{onboarding → first-time}/consent/consent.component.scss.template +2 -2
- package/src/init/files/src/app/first-time/consent/consent.component.ts.template +95 -0
- package/src/init/files/src/app/first-time/early-access/early-access.animations.ts.template +4 -0
- package/src/init/files/src/app/first-time/early-access/early-access.component.html.template +65 -0
- package/src/init/files/src/app/{onboarding/waiting/waiting.component.scss.template → first-time/early-access/early-access.component.scss.template} +10 -3
- package/src/init/files/src/app/first-time/early-access/early-access.component.spec.ts.template +25 -0
- package/src/init/files/src/app/first-time/early-access/early-access.component.ts.template +254 -0
- package/src/init/files/src/app/first-time/early-access/early-access.model.ts.template +7 -0
- package/src/init/files/src/app/{general → first-time}/landing/landing.component.html.template +1 -1
- package/src/init/files/src/app/first-time/landing/landing.component.ts.template +44 -0
- package/src/init/files/src/app/first-time/login/login.component.html.template +10 -0
- package/src/init/files/src/app/first-time/login/login.component.ts.template +45 -0
- package/src/init/files/src/app/first-time/onboarding/onboarding.animations.ts.template +4 -0
- package/src/init/files/src/app/first-time/onboarding/onboarding.component.html.template +2 -0
- package/src/init/files/src/app/first-time/onboarding/onboarding.component.scss.template +5 -0
- package/src/init/files/src/app/{admin/waitlist/waitlist.component.spec.ts.template → first-time/onboarding/onboarding.component.spec.ts.template} +6 -6
- package/src/init/files/src/app/first-time/onboarding/onboarding.component.ts.template +41 -0
- package/src/init/files/src/app/main/home/home.component.html.template +6 -0
- package/src/init/files/src/app/{general → main}/home/home.component.scss.template +1 -0
- package/src/init/files/src/app/main/home/home.component.ts.template +55 -0
- package/src/init/files/src/app/shared/navbar/navbar.component.html.template +15 -0
- package/src/init/files/src/app/shared/navbar/navbar.component.scss.template +41 -0
- package/src/init/files/src/app/shared/navbar/navbar.component.spec.ts.template +25 -0
- package/src/init/files/src/app/shared/navbar/navbar.component.ts.template +40 -0
- package/src/init/files/src/app/shared/redeployment-warning/redeployment-warning.component.html.template +9 -0
- package/src/init/files/src/app/shared/{components/redeployment-warning → redeployment-warning}/redeployment-warning.component.ts.template +17 -6
- package/src/init/files/src/app/shared/{components/redeployment-warning → redeployment-warning}/redeployment-warning.service.ts.template +2 -2
- package/src/init/files/src/assets/images/close-x.svg +3 -0
- package/src/init/files/src/environments/environment.prod.ts.template +6 -2
- package/src/init/files/src/environments/environment.ts.template +4 -2
- package/src/init/files/src/index.html.template +1 -1
- package/src/init/files/src/styles.scss.template +4 -0
- package/src/init/files/tsconfig.json.template +0 -1
- package/src/container/files/__name@dasherize__/+state/__name@dasherize__.actions.ts.template +0 -26
- package/src/container/files/__name@dasherize__/+state/__name@dasherize__.effects.ts.template +0 -48
- package/src/container/files/__name@dasherize__/+state/__name@dasherize__.model.ts.template +0 -0
- package/src/container/files/__name@dasherize__/+state/__name@dasherize__.selectors.ts.template +0 -20
- package/src/container/files/__name@dasherize__/+state/__name@dasherize__.state.ts.template +0 -13
- package/src/container/files/__name@dasherize__/__name@dasherize__.animations.ts.template +0 -4
- package/src/container/files/__name@dasherize__/__name@dasherize__.component.html.template +0 -3
- package/src/container/files/__name@dasherize__/__name@dasherize__.component.scss.template +0 -5
- package/src/container/files/__name@dasherize__/__name@dasherize__.component.spec.ts.template +0 -25
- package/src/container/files/__name@dasherize__/__name@dasherize__.component.ts.template +0 -90
- package/src/container/index.d.ts +0 -2
- package/src/container/index.js +0 -127
- package/src/container/index.js.map +0 -1
- package/src/container/index_spec.d.ts +0 -1
- package/src/container/index_spec.js +0 -23
- package/src/container/index_spec.js.map +0 -1
- package/src/container/schema.json +0 -50
- package/src/entity/files/__name@dasherize__/__name@dasherize__.actions.ts.template +0 -249
- package/src/entity/files/__name@dasherize__/__name@dasherize__.effects.ts.template +0 -131
- package/src/entity/files/__name@dasherize__/__name@dasherize__.reducer.spec.ts.template +0 -13
- package/src/entity/files/__name@dasherize__/__name@dasherize__.reducer.ts.template +0 -51
- package/src/entity/files/__name@dasherize__/__name@dasherize__.service.ts.template +0 -50
- package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.actions.ts.template +0 -270
- package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.effects.ts.template +0 -131
- package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.model.ts.template +0 -3
- package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.reducer.spec.ts.template +0 -13
- package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.reducer.ts.template +0 -51
- package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.service.ts.template +0 -50
- package/src/entity-in-example/index.d.ts +0 -2
- package/src/entity-in-example/index.js +0 -141
- package/src/entity-in-example/index.js.map +0 -1
- package/src/entity-in-example/index_spec.d.ts +0 -1
- package/src/entity-in-example/index_spec.js +0 -23
- package/src/entity-in-example/index_spec.js.map +0 -1
- package/src/entity-in-example/schema.json +0 -45
- package/src/init/files/CHANGELOG.md.template +0 -10
- package/src/init/files/src/app/admin/admin-routing.module.ts.template +0 -17
- package/src/init/files/src/app/admin/admin.module.spec.ts.template +0 -13
- package/src/init/files/src/app/admin/admin.module.ts.template +0 -28
- package/src/init/files/src/app/admin/waitlist/+state/waitlist.actions.ts.template +0 -23
- package/src/init/files/src/app/admin/waitlist/+state/waitlist.effects.ts.template +0 -50
- package/src/init/files/src/app/admin/waitlist/+state/waitlist.model.ts.template +0 -0
- package/src/init/files/src/app/admin/waitlist/+state/waitlist.selectors.ts.template +0 -39
- package/src/init/files/src/app/admin/waitlist/+state/waitlist.state.ts.template +0 -13
- package/src/init/files/src/app/admin/waitlist/waitlist.component.ts.template +0 -141
- package/src/init/files/src/app/app-routing.module.ts.template +0 -26
- package/src/init/files/src/app/app.module.ts.template +0 -34
- package/src/init/files/src/app/core/core.module.ts.template +0 -75
- package/src/init/files/src/app/core/setup/firebase-setup.ts.template +0 -25
- package/src/init/files/src/app/core/setup/module-import-guard.ts.template +0 -5
- package/src/init/files/src/app/core/snackbar/snackbar.actions.ts.template +0 -24
- package/src/init/files/src/app/core/snackbar/snackbar.effects.ts.template +0 -41
- package/src/init/files/src/app/core/store/app-state/app-state.actions.ts.template +0 -249
- package/src/init/files/src/app/core/store/app-state/app-state.effects.ts.template +0 -131
- package/src/init/files/src/app/core/store/app-state/app-state.model.ts.template +0 -8
- package/src/init/files/src/app/core/store/app-state/app-state.reducer.spec.ts.template +0 -13
- package/src/init/files/src/app/core/store/app-state/app-state.reducer.ts.template +0 -51
- package/src/init/files/src/app/core/store/app-state/app-state.service.ts.template +0 -50
- package/src/init/files/src/app/core/store/app.actions.ts.template +0 -92
- package/src/init/files/src/app/core/store/app.effects.ts.template +0 -175
- package/src/init/files/src/app/core/store/app.reducer.ts.template +0 -36
- package/src/init/files/src/app/core/store/app.selectors.ts.template +0 -42
- package/src/init/files/src/app/core/store/auth/auth.actions.ts.template +0 -77
- package/src/init/files/src/app/core/store/auth/auth.effects.ts.template +0 -163
- package/src/init/files/src/app/core/store/auth/auth.reducer.spec.ts.template +0 -13
- package/src/init/files/src/app/core/store/auth/auth.reducer.ts.template +0 -26
- package/src/init/files/src/app/core/store/auth/auth.selectors.ts.template +0 -25
- package/src/init/files/src/app/core/store/cached-load-connections.service.ts.template +0 -405
- package/src/init/files/src/app/core/store/cached-selectors.service.ts.template +0 -376
- package/src/init/files/src/app/core/store/effects.helpers.ts.template +0 -66
- package/src/init/files/src/app/core/store/user/user.actions.ts.template +0 -248
- package/src/init/files/src/app/core/store/user/user.effects.ts.template +0 -148
- package/src/init/files/src/app/core/store/user/user.reducer.spec.ts.template +0 -13
- package/src/init/files/src/app/core/store/user/user.reducer.ts.template +0 -50
- package/src/init/files/src/app/core/store/user/user.service.ts.template +0 -50
- package/src/init/files/src/app/core/store/user-context/user-context.actions.ts.template +0 -248
- package/src/init/files/src/app/core/store/user-context/user-context.effects.ts.template +0 -131
- package/src/init/files/src/app/core/store/user-context/user-context.reducer.spec.ts.template +0 -13
- package/src/init/files/src/app/core/store/user-context/user-context.reducer.ts.template +0 -51
- package/src/init/files/src/app/core/store/user-context/user-context.service.ts.template +0 -50
- package/src/init/files/src/app/core/utils/string-case.utils.ts.template +0 -96
- package/src/init/files/src/app/general/general-routing.module.ts.template +0 -25
- package/src/init/files/src/app/general/general.module.spec.ts.template +0 -13
- package/src/init/files/src/app/general/general.module.ts.template +0 -36
- package/src/init/files/src/app/general/home/+state/home.actions.ts.template +0 -26
- package/src/init/files/src/app/general/home/+state/home.effects.ts.template +0 -48
- package/src/init/files/src/app/general/home/+state/home.model.ts.template +0 -0
- package/src/init/files/src/app/general/home/+state/home.selectors.ts.template +0 -20
- package/src/init/files/src/app/general/home/+state/home.state.ts.template +0 -13
- package/src/init/files/src/app/general/home/home.component.html.template +0 -5
- package/src/init/files/src/app/general/home/home.component.ts.template +0 -88
- package/src/init/files/src/app/general/landing/+state/landing.actions.ts.template +0 -26
- package/src/init/files/src/app/general/landing/+state/landing.effects.ts.template +0 -48
- package/src/init/files/src/app/general/landing/+state/landing.model.ts.template +0 -0
- package/src/init/files/src/app/general/landing/+state/landing.selectors.ts.template +0 -20
- package/src/init/files/src/app/general/landing/+state/landing.state.ts.template +0 -13
- package/src/init/files/src/app/general/landing/landing.component.ts.template +0 -98
- package/src/init/files/src/app/general/login/login.component.html.template +0 -11
- package/src/init/files/src/app/general/login/login.component.ts.template +0 -80
- package/src/init/files/src/app/onboarding/consent/+state/consent.actions.ts.template +0 -23
- package/src/init/files/src/app/onboarding/consent/+state/consent.effects.ts.template +0 -47
- package/src/init/files/src/app/onboarding/consent/+state/consent.model.ts.template +0 -0
- package/src/init/files/src/app/onboarding/consent/+state/consent.selectors.ts.template +0 -20
- package/src/init/files/src/app/onboarding/consent/+state/consent.state.ts.template +0 -13
- package/src/init/files/src/app/onboarding/consent/consent.component.ts.template +0 -151
- package/src/init/files/src/app/onboarding/onboarding-routing.module.ts.template +0 -19
- package/src/init/files/src/app/onboarding/onboarding.module.spec.ts.template +0 -13
- package/src/init/files/src/app/onboarding/onboarding.module.ts.template +0 -32
- package/src/init/files/src/app/onboarding/waiting/+state/waiting.actions.ts.template +0 -26
- package/src/init/files/src/app/onboarding/waiting/+state/waiting.effects.ts.template +0 -52
- package/src/init/files/src/app/onboarding/waiting/+state/waiting.model.ts.template +0 -9
- package/src/init/files/src/app/onboarding/waiting/+state/waiting.selectors.ts.template +0 -42
- package/src/init/files/src/app/onboarding/waiting/+state/waiting.state.ts.template +0 -13
- package/src/init/files/src/app/onboarding/waiting/waiting.animations.ts.template +0 -4
- package/src/init/files/src/app/onboarding/waiting/waiting.component.html.template +0 -57
- package/src/init/files/src/app/onboarding/waiting/waiting.component.spec.ts.template +0 -25
- package/src/init/files/src/app/onboarding/waiting/waiting.component.ts.template +0 -281
- package/src/init/files/src/app/shared/components/redeployment-warning/redeployment-warning.component.html.template +0 -10
- package/src/init/files/src/app/shared/shared.module.ts.template +0 -87
- package/src/init/files/src/main.ts.template +0 -12
- package/src/module/files/__name@dasherize__/__name@dasherize__-routing.module.ts.template +0 -15
- package/src/module/files/__name@dasherize__/__name@dasherize__.module.spec.ts.template +0 -13
- package/src/module/files/__name@dasherize__/__name@dasherize__.module.ts.template +0 -24
- package/src/module/index.d.ts +0 -2
- package/src/module/index.js +0 -97
- package/src/module/index.js.map +0 -1
- package/src/module/index_spec.d.ts +0 -1
- package/src/module/index_spec.js +0 -23
- package/src/module/index_spec.js.map +0 -1
- package/src/module/schema.json +0 -38
- /package/src/init/files/src/app/{onboarding → first-time}/consent/consent.animations.ts.template +0 -0
- /package/src/init/files/src/app/{onboarding → first-time}/consent/consent.component.spec.ts.template +0 -0
- /package/src/init/files/src/app/{general → first-time}/landing/landing.animations.ts.template +0 -0
- /package/src/init/files/src/app/{general → first-time}/landing/landing.component.scss.template +0 -0
- /package/src/init/files/src/app/{general → first-time}/landing/landing.component.spec.ts.template +0 -0
- /package/src/init/files/src/app/{general → first-time}/login/login.component.scss.template +0 -0
- /package/src/init/files/src/app/{general → first-time}/login/login.component.spec.ts.template +0 -0
- /package/src/init/files/src/app/{general → main}/home/home.animations.ts.template +0 -0
- /package/src/init/files/src/app/{general → main}/home/home.component.spec.ts.template +0 -0
- /package/src/init/files/src/app/shared/{components/redeployment-warning → redeployment-warning}/redeployment-warning.component.scss.template +0 -0
- /package/src/init/files/src/app/shared/{components/redeployment-warning → redeployment-warning}/redeployment-warning.component.spec.ts.template +0 -0
package/README.md
CHANGED
|
@@ -8,6 +8,14 @@ This repository is used to generate modules, containers, components, and entitie
|
|
|
8
8
|
2. Set the schematics to be the default using: `ng config cli.defaultCollection @tech4good/angular-schematics`
|
|
9
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
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
|
|
18
|
+
|
|
11
19
|
### Developing
|
|
12
20
|
|
|
13
21
|
1. Clone this repository.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tech4good/angular-schematics",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.1",
|
|
4
4
|
"description": "A set of schematics for generating modules, containers, components, and entities",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc -p tsconfig.json",
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"schematics": "./src/collection.json",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@angular-devkit/core": "^
|
|
17
|
-
"@angular-devkit/schematics": "^
|
|
16
|
+
"@angular-devkit/core": "^18.1.0",
|
|
17
|
+
"@angular-devkit/schematics": "^18.1.0",
|
|
18
18
|
"@angular-devkit/schematics-cli": "^17.3.2",
|
|
19
|
-
"@schematics/angular": "^
|
|
19
|
+
"@schematics/angular": "^18.1.0",
|
|
20
20
|
"typescript": "~4.5.5"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
package/src/collection.json
CHANGED
|
@@ -6,16 +6,6 @@
|
|
|
6
6
|
"factory": "./init/index#init",
|
|
7
7
|
"schema": "./init/schema.json"
|
|
8
8
|
},
|
|
9
|
-
"module": {
|
|
10
|
-
"description": "Generate a new module.",
|
|
11
|
-
"factory": "./module/index#module",
|
|
12
|
-
"schema": "./module/schema.json"
|
|
13
|
-
},
|
|
14
|
-
"container": {
|
|
15
|
-
"description": "Generate a new container.",
|
|
16
|
-
"factory": "./container/index#container",
|
|
17
|
-
"schema": "./container/schema.json"
|
|
18
|
-
},
|
|
19
9
|
"component": {
|
|
20
10
|
"description": "Generate a new component.",
|
|
21
11
|
"factory": "./component/index#component",
|
|
@@ -25,12 +15,6 @@
|
|
|
25
15
|
"description": "Generate a new entity.",
|
|
26
16
|
"factory": "./entity/index#entity",
|
|
27
17
|
"schema": "./entity/schema.json"
|
|
28
|
-
},
|
|
29
|
-
"entity-in-example": {
|
|
30
|
-
"description": "Generate a new entity within the example repository (with a mock DB).",
|
|
31
|
-
"factory": "./entity-in-example/index#entity",
|
|
32
|
-
"schema": "./entity-in-example/schema.json"
|
|
33
18
|
}
|
|
34
|
-
|
|
35
19
|
}
|
|
36
20
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { Component, OnInit, ChangeDetectionStrategy,
|
|
1
|
+
import { Component, OnInit, ChangeDetectionStrategy, input, output, inject, WritableSignal, Signal, signal, computed, Inject, Injector } from '@angular/core';
|
|
2
2
|
import { <%= classify(name) %>Animations } from './<%= dasherize(name) %>.animations';
|
|
3
|
+
import { User } from 'src/app/core/store/user/user.model';
|
|
4
|
+
import { AuthStore } from 'src/app/core/store/auth/auth.store';
|
|
5
|
+
import { BatchWriteService, BATCH_WRITE_SERVICE } from 'src/app/core/store/batch-write.service';
|
|
3
6
|
|
|
4
7
|
@Component({
|
|
5
8
|
selector: 'app-<%= dasherize(name) %>',
|
|
@@ -7,24 +10,35 @@ import { <%= classify(name) %>Animations } from './<%= dasherize(name) %>.animat
|
|
|
7
10
|
styleUrls: ['./<%= dasherize(name) %>.component.scss'],
|
|
8
11
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
12
|
animations: <%= classify(name) %>Animations,
|
|
13
|
+
standalone: true,
|
|
14
|
+
imports: [
|
|
15
|
+
],
|
|
10
16
|
})
|
|
11
17
|
export class <%= classify(name) %>Component implements OnInit {
|
|
18
|
+
readonly authStore = inject(AuthStore);
|
|
12
19
|
// --------------- INPUTS AND OUTPUTS ------------------
|
|
13
20
|
|
|
21
|
+
/** The current signed in user. */
|
|
22
|
+
currentUser: Signal<User> = this.authStore.user;
|
|
14
23
|
|
|
15
|
-
// --------------- LOCAL
|
|
24
|
+
// --------------- LOCAL UI STATE ----------------------
|
|
16
25
|
|
|
26
|
+
/** Loading icon. */
|
|
27
|
+
loading: WritableSignal<boolean> = signal(false);
|
|
17
28
|
|
|
18
|
-
// --------------- DATA
|
|
29
|
+
// --------------- COMPUTED DATA -----------------------
|
|
19
30
|
|
|
31
|
+
// --------------- EVENT HANDLING ----------------------
|
|
20
32
|
|
|
21
|
-
// ---------------
|
|
33
|
+
// --------------- OTHER -------------------------------
|
|
22
34
|
|
|
35
|
+
constructor(
|
|
36
|
+
private injector: Injector,
|
|
37
|
+
@Inject(BATCH_WRITE_SERVICE) private batch: BatchWriteService,
|
|
38
|
+
) { }
|
|
23
39
|
|
|
24
|
-
// ---------------
|
|
25
|
-
|
|
26
|
-
constructor() { }
|
|
27
|
-
|
|
40
|
+
// --------------- LOAD AND CLEANUP --------------------
|
|
41
|
+
|
|
28
42
|
ngOnInit(): void {
|
|
29
43
|
}
|
|
30
44
|
}
|
package/src/component/index.js
CHANGED
|
@@ -11,52 +11,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.component = void 0;
|
|
13
13
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
14
|
-
const change_1 = require("@schematics/angular/utility/change");
|
|
15
|
-
const find_module_1 = require("@schematics/angular/utility/find-module");
|
|
16
14
|
const parse_name_1 = require("@schematics/angular/utility/parse-name");
|
|
17
15
|
const validation_1 = require("@schematics/angular/utility/validation");
|
|
18
16
|
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
19
17
|
const core_1 = require("@angular-devkit/core");
|
|
20
|
-
const statements_adder_1 = require("../shared/statements-adder");
|
|
21
|
-
function addInserts(options) {
|
|
22
|
-
return (host, context) => {
|
|
23
|
-
if (!options.module) {
|
|
24
|
-
return host;
|
|
25
|
-
}
|
|
26
|
-
const modulePath = options.module;
|
|
27
|
-
const sourceText = (0, statements_adder_1.getSourceText)(host, modulePath);
|
|
28
|
-
context.logger.info(`modulePath: ${modulePath}`);
|
|
29
|
-
// Get parameters for adding declaration to module (including import)
|
|
30
|
-
context.logger.info(`options.path: ${options.path}`);
|
|
31
|
-
const componentPath = `/${options.path}/` +
|
|
32
|
-
core_1.strings.dasherize(options.name) + '/' +
|
|
33
|
-
core_1.strings.dasherize(options.name) + '.component';
|
|
34
|
-
context.logger.info(`componentPath: ${componentPath}`);
|
|
35
|
-
const relativePath = (0, find_module_1.buildRelativePath)(modulePath, componentPath);
|
|
36
|
-
context.logger.info(`relativePath: ${relativePath}`);
|
|
37
|
-
const classifiedName = core_1.strings.classify(options.name) + 'Component';
|
|
38
|
-
context.logger.info(`classifiedName: ${classifiedName}`);
|
|
39
|
-
const isSharedModule = options.module.startsWith('/src/app/shared');
|
|
40
|
-
let insertChanges = (0, statements_adder_1.simpleInsert)(sourceText, modulePath, [
|
|
41
|
-
'// Components',
|
|
42
|
-
'// Components',
|
|
43
|
-
// If the module is shared, then add an export too
|
|
44
|
-
...isSharedModule ? ['// Components'] : [],
|
|
45
|
-
], [
|
|
46
|
-
`import { ${classifiedName} } from '${relativePath}';`,
|
|
47
|
-
` ${classifiedName},`,
|
|
48
|
-
...isSharedModule ? [` ${classifiedName},`] : [],
|
|
49
|
-
]);
|
|
50
|
-
const declarationRecorder = host.beginUpdate(modulePath);
|
|
51
|
-
for (const change of insertChanges) {
|
|
52
|
-
if (change instanceof change_1.InsertChange) {
|
|
53
|
-
declarationRecorder.insertLeft(change.pos, change.toAdd);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
host.commitUpdate(declarationRecorder);
|
|
57
|
-
return host;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
18
|
function component(options) {
|
|
61
19
|
return (tree, context) => __awaiter(this, void 0, void 0, function* () {
|
|
62
20
|
// Make sure the command is executed in the directory where the component should be generated
|
|
@@ -74,18 +32,17 @@ function component(options) {
|
|
|
74
32
|
options.path = (0, workspace_1.buildDefaultPath)(project);
|
|
75
33
|
}
|
|
76
34
|
context.logger.info(`options.path: ${options.path}`);
|
|
77
|
-
options.module = (0, find_module_1.findModuleFromOptions)(tree, options);
|
|
78
|
-
context.logger.info(`options.module: ${options.module}`);
|
|
79
35
|
const parsedPath = (0, parse_name_1.parseName)(options.path, options.name);
|
|
36
|
+
context.logger.info(`parsedPath: ${parsedPath.name} ${parsedPath.path}`);
|
|
80
37
|
options.name = parsedPath.name;
|
|
81
38
|
options.path = parsedPath.path;
|
|
39
|
+
context.logger.info(`options.selector: ${options.selector}`);
|
|
82
40
|
(0, validation_1.validateHtmlSelector)(options.selector);
|
|
83
41
|
const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
|
|
84
42
|
(0, schematics_1.applyTemplates)(Object.assign(Object.assign({}, core_1.strings), options)),
|
|
85
43
|
(0, schematics_1.move)(parsedPath.path),
|
|
86
44
|
]);
|
|
87
45
|
return (0, schematics_1.chain)([
|
|
88
|
-
addInserts(options),
|
|
89
46
|
(0, schematics_1.mergeWith)(templateSource)
|
|
90
47
|
]);
|
|
91
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAIoC;AACpC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAIoC;AACpC,uEAAmE;AACnE,uEAA8E;AAC9E,qEAAuF;AAEvF,+CAA+C;AAE/C,SAAgB,SAAS,CAAC,OAAY;IACpC,OAAO,CAAO,IAAU,EAAE,OAAyB,EAAE,EAAE;QAErD,6FAA6F;QAC7F,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;YACxB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,4EAA4E,CAAC,CAAC;YAClG,OAAO,IAAA,iBAAI,GAAE,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C,CAAC;QAEH,OAAO,IAAA,kBAAK,EAAC;YACX,IAAA,sBAAS,EAAC,cAAc,CAAC;SAC1B,CAAC,CAAC;IACL,CAAC,CAAA,CAAC;AACJ,CAAC;AA1CD,8BA0CC"}
|
|
@@ -34,11 +34,6 @@
|
|
|
34
34
|
},
|
|
35
35
|
"x-prompt": "What name would you like to use for the component?"
|
|
36
36
|
},
|
|
37
|
-
"module": {
|
|
38
|
-
"type": "string",
|
|
39
|
-
"description": "The declaring NgModule.",
|
|
40
|
-
"alias": "m"
|
|
41
|
-
},
|
|
42
37
|
"inDirectory": {
|
|
43
38
|
"type": "boolean",
|
|
44
39
|
"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)"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Timestamp } from '@angular/fire/firestore';
|
|
2
|
+
import { <%= classify(name) %> } from './<%= dasherize(name) %>.model';
|
|
3
|
+
import { withEntitiesForMockDB } from '../app.store';
|
|
4
|
+
import { signalStore } from '@ngrx/signals';
|
|
5
|
+
|
|
6
|
+
export const <%= classify(name) %>MockDB = signalStore(
|
|
7
|
+
{ providedIn: 'root' },
|
|
8
|
+
withEntitiesForMockDB<<%= classify(name) %>>(),
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
export const <%= classify(name).toUpperCase() %>_DB = [
|
|
12
|
+
];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { inject, effect, WritableSignal } from '@angular/core';
|
|
2
|
+
import { signalStore, patchState, withState, withMethods } from '@ngrx/signals';
|
|
3
|
+
import { withEntities, removeEntity, updateEntity, setEntity, removeEntities, setEntities } from '@ngrx/signals/entities';
|
|
4
|
+
import { EntityLoadQuery, EntityStreamQuery, selectEntities, processLoadQueries, withEntitiesAndDBMethods } from 'src/app/core/store/app.store';
|
|
5
|
+
import { QueryParams, QueryOptions, AnyEntity } from 'src/app/core/store/app.model';
|
|
6
|
+
import { <%= classify(name) %> } from './<%= dasherize(name) %>.model';
|
|
7
|
+
|
|
8
|
+
export class Load<%= classify(name) %> extends EntityLoadQuery<<%= classify(name) %>> {
|
|
9
|
+
constructor(
|
|
10
|
+
store,
|
|
11
|
+
queryParams: QueryParams,
|
|
12
|
+
queryOptions: QueryOptions,
|
|
13
|
+
loadQueries?: (entity: <%= classify(name) %>) => EntityLoadQuery<AnyEntity>[],
|
|
14
|
+
) {
|
|
15
|
+
super('<%= camelize(name) %>s', store, queryParams, queryOptions, loadQueries);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static create(store, queryParams: QueryParams, queryOptions: QueryOptions, loadQueries?: (entity: <%= classify(name) %>) => EntityLoadQuery<AnyEntity>[]): Load<%= classify(name) %> {
|
|
19
|
+
return new Load<%= classify(name) %>(store, queryParams, queryOptions, loadQueries);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class Stream<%= classify(name) %> extends EntityStreamQuery<<%= classify(name) %>> {
|
|
24
|
+
constructor(
|
|
25
|
+
store,
|
|
26
|
+
queryParams: QueryParams,
|
|
27
|
+
queryOptions: QueryOptions,
|
|
28
|
+
streamQueries?: (entity: <%= classify(name) %>) => EntityStreamQuery<AnyEntity>[],
|
|
29
|
+
) {
|
|
30
|
+
super('<%= camelize(name) %>s', store, queryParams, queryOptions, streamQueries);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static create(store, queryParams: QueryParams, queryOptions: QueryOptions, streamQueries?: (entity: <%= classify(name) %>) => EntityStreamQuery<AnyEntity>[]): Stream<%= classify(name) %> {
|
|
34
|
+
return new Stream<%= classify(name) %>(store, queryParams, queryOptions, streamQueries);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const <%= classify(name) %>Store = signalStore(
|
|
39
|
+
{ providedIn: 'root' },
|
|
40
|
+
withEntitiesAndDBMethods<<%= classify(name) %>>('<%= camelize(name) %>s'),
|
|
41
|
+
);
|
package/src/entity/index.js
CHANGED
|
@@ -21,64 +21,44 @@ function addInserts(options) {
|
|
|
21
21
|
return (host, context) => {
|
|
22
22
|
const classifiedName = core_1.strings.classify(options.name);
|
|
23
23
|
const camelizedName = core_1.strings.camelize(options.name);
|
|
24
|
+
const dasherizedName = core_1.strings.dasherize(options.name);
|
|
25
|
+
const allcapsName = core_1.strings.classify(options.name).toUpperCase();
|
|
24
26
|
context.logger.info(`names: ${classifiedName}, ${camelizedName}`);
|
|
25
|
-
//
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
context.logger.info(`
|
|
29
|
-
const
|
|
27
|
+
// app.model.ts changes
|
|
28
|
+
const appModelPath = '//src/app/core/store/app.model.ts';
|
|
29
|
+
const appModelText = (0, statements_adder_1.getSourceText)(host, appModelPath);
|
|
30
|
+
context.logger.info(`appModelPath: ${appModelPath}`);
|
|
31
|
+
const entityModelPath = `/${options.path}/` +
|
|
30
32
|
core_1.strings.dasherize(options.name) + '/' +
|
|
31
|
-
core_1.strings.dasherize(options.name) + '.
|
|
32
|
-
context.logger.info(`
|
|
33
|
-
const
|
|
34
|
-
context.logger.info(`
|
|
35
|
-
let
|
|
36
|
-
'// Entity
|
|
37
|
-
'
|
|
33
|
+
core_1.strings.dasherize(options.name) + '.model';
|
|
34
|
+
context.logger.info(`entityModelPath: ${entityModelPath}`);
|
|
35
|
+
const appToEntityModelPath = (0, find_module_1.buildRelativePath)(appModelPath, entityModelPath);
|
|
36
|
+
context.logger.info(`appToEntityPath: ${appToEntityModelPath}`);
|
|
37
|
+
let insertChangesInAppModel = (0, statements_adder_1.simpleInsert)(appModelText, appModelPath, [
|
|
38
|
+
'// Entity Models',
|
|
39
|
+
'export type AnyEntity =',
|
|
38
40
|
], [
|
|
39
|
-
`import { ${classifiedName}
|
|
40
|
-
`
|
|
41
|
+
`import { ${classifiedName} } from '${appToEntityModelPath}';`,
|
|
42
|
+
` ${classifiedName} |`
|
|
41
43
|
]);
|
|
42
|
-
//
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
context.logger.info(`
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const appToEntityReducerPath = (0, find_module_1.buildRelativePath)(appReducerPath, entityReducerPath);
|
|
51
|
-
let insertChangesInAppReducer = (0, statements_adder_1.simpleInsert)(appReducerText, appReducerPath, [
|
|
52
|
-
'// Entity Reducers',
|
|
53
|
-
'// Entity State',
|
|
54
|
-
'// Entity Reducers'
|
|
55
|
-
], [
|
|
56
|
-
`import * as from${classifiedName} from '${appToEntityReducerPath}';`,
|
|
57
|
-
` ${camelizedName}: from${classifiedName}.State;`,
|
|
58
|
-
` ${camelizedName}: from${classifiedName}.reducer,`
|
|
59
|
-
]);
|
|
60
|
-
// Add app selector changes
|
|
61
|
-
const appSelectorPath = '//src/app/core/store/app.selectors.ts';
|
|
62
|
-
const appSelectorText = (0, statements_adder_1.getSourceText)(host, appSelectorPath);
|
|
63
|
-
const entityServicePath = `/${options.path}/` +
|
|
64
|
-
core_1.strings.dasherize(options.name) + '/' +
|
|
65
|
-
core_1.strings.dasherize(options.name) + '.service';
|
|
66
|
-
const appToEntityServicePath = (0, find_module_1.buildRelativePath)(appSelectorPath, entityServicePath);
|
|
67
|
-
let insertChangesInAppSelector = (0, statements_adder_1.simpleInsert)(appSelectorText, appSelectorPath, [
|
|
68
|
-
'// Entity Selectors',
|
|
69
|
-
'// Entity Selectors',
|
|
70
|
-
'// Entity Selectors'
|
|
44
|
+
// firebase.mock.service.ts changes
|
|
45
|
+
const fbMockPath = '//src/app/core/firebase/firebase.mock.service.ts';
|
|
46
|
+
const fbMockText = (0, statements_adder_1.getSourceText)(host, fbMockPath);
|
|
47
|
+
context.logger.info(`fbMockPath: ${fbMockPath}`);
|
|
48
|
+
let insertChangesInFbMock = (0, statements_adder_1.simpleInsert)(fbMockText, fbMockPath, [
|
|
49
|
+
'// Entity Model DB Data',
|
|
50
|
+
'readonly DB = {',
|
|
51
|
+
'// Init Entity Models',
|
|
71
52
|
], [
|
|
72
|
-
`import { ${classifiedName}
|
|
73
|
-
`
|
|
74
|
-
`
|
|
53
|
+
`import { ${classifiedName}MockDB, ${allcapsName}_DB } from '../store/${dasherizedName}/${dasherizedName}.mock';`,
|
|
54
|
+
` '${camelizedName}s': inject(${classifiedName}MockDB),`,
|
|
55
|
+
` patchState(this.DB['${camelizedName}s'], setAllEntities(${allcapsName}_DB, { selectId }));`
|
|
75
56
|
]);
|
|
76
57
|
context.logger.info(`about to start committing`);
|
|
77
58
|
// For each of the files and corresponding set of changes, commit to the tree
|
|
78
59
|
[
|
|
79
|
-
[
|
|
80
|
-
[
|
|
81
|
-
[appSelectorPath, insertChangesInAppSelector]
|
|
60
|
+
[appModelPath, insertChangesInAppModel],
|
|
61
|
+
[fbMockPath, insertChangesInFbMock],
|
|
82
62
|
].map(([filePath, insertChanges]) => {
|
|
83
63
|
const declarationRecorder = host.beginUpdate(filePath);
|
|
84
64
|
for (const change of insertChanges) {
|
|
@@ -106,7 +86,6 @@ function entity(options) {
|
|
|
106
86
|
if (options.path === undefined) {
|
|
107
87
|
options.path = (0, workspace_1.buildDefaultPath)(project);
|
|
108
88
|
}
|
|
109
|
-
options.module = (0, find_module_1.findModuleFromOptions)(tree, options);
|
|
110
89
|
const parsedPath = (0, parse_name_1.parseName)(options.path, options.name);
|
|
111
90
|
options.name = parsedPath.name;
|
|
112
91
|
options.path = parsedPath.path;
|
package/src/entity/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAIoC;AAEpC,+DAA0E;AAC1E,
|
|
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,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/*.service.ts",
|
|
102
|
-
"src/app/core/firebase
|
|
102
|
+
"src/app/core/firebase/*.service.ts",
|
|
103
103
|
"src/app/core/analytics/time-analytics.service.ts",
|
|
104
104
|
"src/app/core/setup/module-import-guard.ts"
|
|
105
105
|
],
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
# <%= classify(project) %>
|
|
2
2
|
|
|
3
|
-
This project was initialized by using [Tech4Good's Angular Schematics](https://github.com/tech4good-lab/angular-schematics) after a base project repository was generated with [Angular CLI](https://github.com/angular/angular-cli).
|
|
3
|
+
This project was initialized by using [Tech4Good's Angular Schematics](https://github.com/tech4good-lab/angular-schematics) after a base project repository was generated with [Angular CLI](https://github.com/angular/angular-cli).
|
|
4
4
|
|
|
5
5
|
## Development server
|
|
6
6
|
|
|
7
7
|
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
|
|
8
8
|
Run `ng serve --configuration production` to run a prod server locally. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
|
|
9
9
|
|
|
10
|
-
## Code scaffolding
|
|
11
|
-
|
|
12
|
-
Run `ng generate component component-name` to generate a new component. You can also use `ng generate container|module|entity`.
|
|
13
|
-
|
|
14
10
|
## Build
|
|
15
11
|
|
|
16
12
|
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
+
Run `firebase deploy` to deploy to production and `firebase deploy -P dev` to deploy to dev
|
|
14
|
+
|
|
15
|
+
## Code generation
|
|
16
|
+
|
|
17
|
+
* Run `ng g component component-name` inside the folder where you want a new component to generate it.
|
|
18
|
+
* Run `ng g entity entity-name` inside `src/app/core/store` to generate a new entity and add appropriate lines in app.model.ts and firebase.mock.service.ts.
|
|
19
|
+
* We ran `ng g init` on a newly generated Angular V18 repo to set up the core infrastructure. This should not be run again as it will rewrite several app-wide files like package.json, app.routes.ts, app.model.ts, firebase.mock.service.ts, etc. where you will have likely added new code since creation of the repository.
|
|
20
|
+
|
|
17
21
|
|
|
18
22
|
## Version number
|
|
19
23
|
|
|
20
|
-
We use the syntax `
|
|
21
|
-
* `
|
|
22
|
-
* `
|
|
23
|
-
* `
|
|
24
|
-
* `PATCH` contains low risk bug fixes that do not require any updates to the database.
|
|
24
|
+
We use the syntax `MAJOR.MINOR.PATCH` for versioning, where
|
|
25
|
+
* `MAJOR` contains significant new features or overhauls of the user experience requiring user adaptation, removal of features, or data migration that could result in data loss
|
|
26
|
+
* `MINOR` contains performance improvements, non-disruptive ui enhancements, and new smaller features that enhance the application but don't interfere with existing features
|
|
27
|
+
* `PATCH` contains bug fixes, minor usability and performance fixes that don't add new capabilities
|
|
@@ -31,16 +31,23 @@
|
|
|
31
31
|
"index": "src/index.html",
|
|
32
32
|
"browser": "src/main.ts",
|
|
33
33
|
"polyfills": [
|
|
34
|
-
"zone.js"
|
|
34
|
+
"zone.js",
|
|
35
|
+
"core-js/stable",
|
|
36
|
+
"globalthis",
|
|
37
|
+
"cross-fetch",
|
|
38
|
+
"proxy-polyfill"
|
|
35
39
|
],
|
|
36
40
|
"tsConfig": "tsconfig.app.json",
|
|
37
41
|
"inlineStyleLanguage": "scss",
|
|
38
42
|
"assets": [
|
|
39
|
-
|
|
43
|
+
{
|
|
44
|
+
"glob": "**/*",
|
|
45
|
+
"input": "public"
|
|
46
|
+
},
|
|
40
47
|
"src/assets"
|
|
41
48
|
],
|
|
42
49
|
"styles": [
|
|
43
|
-
"
|
|
50
|
+
"@angular/material/prebuilt-themes/azure-blue.css",
|
|
44
51
|
"src/styles.scss"
|
|
45
52
|
],
|
|
46
53
|
"scripts": [],
|
|
@@ -55,8 +62,8 @@
|
|
|
55
62
|
"budgets": [
|
|
56
63
|
{
|
|
57
64
|
"type": "initial",
|
|
58
|
-
"maximumWarning": "
|
|
59
|
-
"maximumError": "
|
|
65
|
+
"maximumWarning": "1mb",
|
|
66
|
+
"maximumError": "2mb"
|
|
60
67
|
},
|
|
61
68
|
{
|
|
62
69
|
"type": "anyComponentStyle",
|
|
@@ -93,10 +100,7 @@
|
|
|
93
100
|
"defaultConfiguration": "development"
|
|
94
101
|
},
|
|
95
102
|
"extract-i18n": {
|
|
96
|
-
"builder": "@angular-devkit/build-angular:extract-i18n"
|
|
97
|
-
"options": {
|
|
98
|
-
"buildTarget": "<%= dasherize(project) %>:build"
|
|
99
|
-
}
|
|
103
|
+
"builder": "@angular-devkit/build-angular:extract-i18n"
|
|
100
104
|
},
|
|
101
105
|
"test": {
|
|
102
106
|
"builder": "@angular-devkit/build-angular:karma",
|
|
@@ -108,11 +112,14 @@
|
|
|
108
112
|
"tsConfig": "tsconfig.spec.json",
|
|
109
113
|
"inlineStyleLanguage": "scss",
|
|
110
114
|
"assets": [
|
|
111
|
-
|
|
115
|
+
{
|
|
116
|
+
"glob": "**/*",
|
|
117
|
+
"input": "public"
|
|
118
|
+
},
|
|
112
119
|
"src/assets"
|
|
113
120
|
],
|
|
114
121
|
"styles": [
|
|
115
|
-
"
|
|
122
|
+
"@angular/material/prebuilt-themes/azure-blue.css",
|
|
116
123
|
"src/styles.scss"
|
|
117
124
|
],
|
|
118
125
|
"scripts": []
|