@tech4good/angular-schematics 20.3.1 โ 21.0.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.
- package/.agents/skills/publish-npm/SKILL.md +1 -1
- package/.agents/skills/publish-npm/eval.yaml +15 -0
- package/.agents/skills/publish-npm/fixtures/package-v21.json.template +8 -0
- package/.t4g/agent-memory.db +0 -0
- package/CHANGELOG.md +62 -0
- package/contributing-docs/commit-message.md +3 -6
- package/package.json +5 -5
- package/src/collection.json +8 -0
- package/src/component/files/__name@dasherize__/__name@dasherize__.component.ts.template +1 -3
- package/src/component/index_spec.js +57 -4
- package/src/component/index_spec.js.map +1 -1
- package/src/entity/index.js +7 -1
- package/src/entity/index.js.map +1 -1
- package/src/entity/index_spec.js +108 -4
- package/src/entity/index_spec.js.map +1 -1
- package/src/guard/files/__name@dasherize__.guard.spec.ts.template +45 -0
- package/src/guard/files/__name@dasherize__.guard.ts.template +32 -0
- package/src/guard/index.d.ts +2 -0
- package/src/guard/index.js +38 -0
- package/src/guard/index.js.map +1 -0
- package/src/guard/index_spec.d.ts +1 -0
- package/src/guard/index_spec.js +64 -0
- package/src/guard/index_spec.js.map +1 -0
- package/src/guard/schema.json +46 -0
- package/src/ng-add/files/.firebaserc.template +3 -2
- package/src/ng-add/files/.github/workflows/angular-github-ci.yml.template +105 -39
- package/src/ng-add/files/.gitignore.template +1 -2
- package/src/ng-add/files/angular.json.template +1 -5
- package/src/ng-add/files/docs-infra/infrastructure-guide.md.template +390 -0
- package/src/ng-add/files/docs-infra/load-system-architecture.md.template +166 -0
- package/src/ng-add/files/docs-infra/querying-strategy.md.template +157 -0
- package/src/ng-add/files/docs-infra/stream-system-architecture.md.template +283 -0
- package/src/ng-add/files/eslint.config.js.template +4 -1
- package/src/ng-add/files/firebase.json.template +37 -0
- package/src/ng-add/files/firestore.rules.spec.ts.template +221 -0
- package/src/ng-add/files/firestore.rules.template +67 -0
- package/src/ng-add/files/jest.config.ts.template +6 -1
- package/src/ng-add/files/package.json.template +41 -31
- package/src/ng-add/files/setup-jest.ts.template +13 -5
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.spec.ts.template +76 -12
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.ts.template +1 -3
- package/src/ng-add/files/src/app/admin/admin-panel/admin-settings/admin-settings.component.spec.ts.template +90 -0
- package/src/ng-add/files/src/app/admin/admin-panel/admin-settings/admin-settings.component.ts.template +1 -1
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-counts/admin-count-pill/admin-count-pill.component.spec.ts.template +12 -17
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-counts/admin-count-pill/admin-count-pill.component.ts.template +2 -4
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-counts/admin-user-counts.component.spec.ts.template +40 -19
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-counts/admin-user-counts.component.ts.template +3 -5
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-list.component.html.template +2 -2
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-list.component.spec.ts.template +108 -0
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-list.component.ts.template +11 -11
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-table/admin-user-table.component.html.template +6 -2
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-table/admin-user-table.component.spec.ts.template +136 -19
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-table/admin-user-table.component.ts.template +8 -5
- package/src/ng-add/files/src/app/app.component.html.template +1 -1
- package/src/ng-add/files/src/app/app.component.scss.template +10 -0
- package/src/ng-add/files/src/app/app.component.ts.template +1 -1
- package/src/ng-add/files/src/app/app.config.ts.template +11 -11
- package/src/ng-add/files/src/app/auth-routing.spec.ts.template +101 -0
- package/src/ng-add/files/src/app/core/analytics/log.service.ts.template +5 -8
- package/src/ng-add/files/src/app/core/analytics/time-analytics.service.spec.ts.template +140 -0
- package/src/ng-add/files/src/app/core/analytics/time-analytics.service.ts.template +25 -7
- package/src/ng-add/files/src/app/core/auth/guards/redirect-if-authenticated.guard.ts.template +1 -1
- package/src/ng-add/files/src/app/core/auth/guards/require-admin.guard.ts.template +1 -1
- package/src/ng-add/files/src/app/core/auth/guards/require-auth-and-consent.guard.ts.template +1 -1
- package/src/ng-add/files/src/app/core/auth/guards/require-auth.guard.ts.template +1 -1
- package/src/ng-add/files/src/app/core/firebase/cached-listeners.service.ts.template +229 -14
- package/src/ng-add/files/src/app/core/firebase/database.service.ts.template +1 -1
- package/src/ng-add/files/src/app/core/firebase/firebase.mock.service.ts.template +34 -9
- package/src/ng-add/files/src/app/core/firebase/firebase.service.ts.template +4 -4
- package/src/ng-add/files/src/app/core/firebase/query-logger.ts.template +11 -0
- package/src/ng-add/files/src/app/core/firebase/simulate-load.spec.ts.template +104 -0
- package/src/ng-add/files/src/app/core/firebase/simulate-stream.spec.ts.template +127 -0
- package/src/ng-add/files/src/app/core/firebase/simulation.mock.ts.template +38 -0
- package/src/ng-add/files/src/app/core/firebase/stream-multiplexer.ts.template +443 -0
- package/src/ng-add/files/src/app/core/store/app.store.spec.ts.template +920 -0
- package/src/ng-add/files/src/app/core/store/app.store.ts.template +303 -137
- package/src/ng-add/files/src/app/core/store/auth/auth.mock.ts.template +65 -23
- package/src/ng-add/files/src/app/core/store/auth/auth.store.ts.template +68 -67
- package/src/ng-add/files/src/app/core/store/user/user.mock.ts.template +46 -0
- package/src/ng-add/files/src/app/core/store/user-context/user-context.mock.ts.template +17 -0
- package/src/ng-add/files/src/app/core/testing/test-utils.ts.template +26 -0
- package/src/ng-add/files/src/app/first-time/consent/consent.component.html.template +3 -3
- package/src/ng-add/files/src/app/first-time/consent/consent.component.spec.ts.template +89 -13
- package/src/ng-add/files/src/app/first-time/consent/consent.component.ts.template +46 -17
- package/src/ng-add/files/src/app/first-time/consent/consent.guard.ts.template +1 -1
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.html.template +5 -63
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.scss.template +1 -94
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.spec.ts.template +150 -14
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.ts.template +15 -42
- package/src/ng-add/files/src/app/first-time/early-access/early-access.guard.ts.template +2 -2
- package/src/ng-add/files/src/app/first-time/early-access/early-access.model.ts.template +5 -0
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.html.template +42 -0
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.scss.template +96 -0
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.spec.ts.template +37 -0
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.ts.template +63 -0
- package/src/ng-add/files/src/app/first-time/early-access/waitlist-view/waitlist-view.component.html.template +16 -0
- package/src/ng-add/files/src/app/first-time/early-access/waitlist-view/waitlist-view.component.scss.template +7 -0
- package/src/ng-add/files/src/app/first-time/early-access/waitlist-view/waitlist-view.component.spec.ts.template +41 -0
- package/src/ng-add/files/src/app/first-time/early-access/waitlist-view/waitlist-view.component.ts.template +26 -0
- package/src/ng-add/files/src/app/first-time/first-time-routing.spec.ts.template +123 -0
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.component.html.template +11 -4
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.component.scss.template +17 -4
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.component.ts.template +5 -5
- package/src/ng-add/files/src/app/first-time/landing/landing.component.html.template +1 -1
- package/src/ng-add/files/src/app/first-time/landing/landing.component.scss.template +0 -1
- package/src/ng-add/files/src/app/first-time/landing/landing.component.spec.ts.template +25 -17
- package/src/ng-add/files/src/app/first-time/landing/landing.component.ts.template +4 -12
- package/src/ng-add/files/src/app/first-time/landing/rotating-quotes/rotating-quotes.component.ts.template +1 -1
- package/src/ng-add/files/src/app/first-time/login/login.component.spec.ts.template +36 -16
- package/src/ng-add/files/src/app/first-time/login/login.component.ts.template +1 -1
- package/src/ng-add/files/src/app/first-time/onboarding/onboarding.component.spec.ts.template +11 -15
- package/src/ng-add/files/src/app/first-time/onboarding/onboarding.component.ts.template +1 -3
- package/src/ng-add/files/src/app/main/home/home.component.ts.template +1 -3
- package/src/ng-add/files/src/app/shared/dev-status-bar/dev-status-bar.component.spec.ts.template +98 -0
- package/src/ng-add/files/src/app/shared/dev-status-bar/dev-status-bar.component.ts.template +9 -3
- package/src/ng-add/files/src/app/shared/hint-visibility/hint-visibility.directive.spec.ts.template +164 -0
- package/src/ng-add/files/src/app/shared/hint-visibility/hint-visibility.directive.ts.template +20 -18
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.spec.ts.template +38 -17
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.ts.template +1 -1
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.html.template +1 -1
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.spec.ts.template +49 -10
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.ts.template +5 -5
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.service.spec.ts.template +86 -0
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.service.ts.template +11 -9
- package/src/ng-add/files/src/environments/environment.prod.ts.template +1 -0
- package/src/ng-add/files/src/environments/environment.test.ts.template +1 -0
- package/src/ng-add/files/src/environments/environment.ts.template +2 -8
- package/src/ng-add/files/src/styles.scss.template +29 -1
- package/src/ng-add/files/tsconfig.app.json.template +6 -6
- package/src/ng-add/files/tsconfig.json.template +13 -8
- package/src/ng-add/files/tsconfig.spec.json.template +6 -5
- package/src/ng-add/index.js +19 -1
- package/src/ng-add/index.js.map +1 -1
- package/src/component/files/__name@dasherize__/__name@dasherize__.animations.ts.template +0 -4
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.animations.ts.template +0 -4
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-counts/admin-count-pill/admin-count-pill.animations.ts.template +0 -4
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-counts/admin-user-counts.animations.ts.template +0 -4
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-table/admin-user-table.animations.ts.template +0 -4
- package/src/ng-add/files/src/app/first-time/consent/consent.animations.ts.template +0 -4
- package/src/ng-add/files/src/app/first-time/early-access/early-access.animations.ts.template +0 -10
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.animations.ts.template +0 -15
- package/src/ng-add/files/src/app/first-time/landing/landing.animations.ts.template +0 -4
- package/src/ng-add/files/src/app/first-time/onboarding/onboarding.animations.ts.template +0 -4
- package/src/ng-add/files/src/app/main/home/home.animations.ts.template +0 -4
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const testing_1 = require("@angular-devkit/schematics/testing");
|
|
6
|
+
const path = tslib_1.__importStar(require("path"));
|
|
7
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
8
|
+
/**
|
|
9
|
+
* Creates a minimal workspace tree with angular.json to satisfy
|
|
10
|
+
* getWorkspace() and buildDefaultPath() calls in the schematic.
|
|
11
|
+
*/
|
|
12
|
+
function createWorkspaceTree() {
|
|
13
|
+
const tree = new testing_1.UnitTestTree(schematics_1.Tree.empty());
|
|
14
|
+
tree.create('/angular.json', JSON.stringify({
|
|
15
|
+
version: 1,
|
|
16
|
+
projects: {
|
|
17
|
+
'test-app': {
|
|
18
|
+
projectType: 'application',
|
|
19
|
+
root: '',
|
|
20
|
+
sourceRoot: 'src',
|
|
21
|
+
prefix: 'app',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
}));
|
|
25
|
+
return tree;
|
|
26
|
+
}
|
|
27
|
+
describe('guard', () => {
|
|
28
|
+
const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
|
|
29
|
+
it('should generate guard files when given a name', async () => {
|
|
30
|
+
const tree = await runner.runSchematic('guard', {
|
|
31
|
+
name: 'require-profile',
|
|
32
|
+
project: 'test-app',
|
|
33
|
+
inDirectory: true,
|
|
34
|
+
path: 'src/app',
|
|
35
|
+
}, createWorkspaceTree());
|
|
36
|
+
// Verify the expected guard files are generated
|
|
37
|
+
expect(tree.files).toContain('/src/app/require-profile.guard.ts');
|
|
38
|
+
expect(tree.files).toContain('/src/app/require-profile.guard.spec.ts');
|
|
39
|
+
});
|
|
40
|
+
it('should use the camelized name in the guard export and handleAccess in spec', async () => {
|
|
41
|
+
const tree = await runner.runSchematic('guard', {
|
|
42
|
+
name: 'require-profile',
|
|
43
|
+
project: 'test-app',
|
|
44
|
+
inDirectory: true,
|
|
45
|
+
path: 'src/app',
|
|
46
|
+
}, createWorkspaceTree());
|
|
47
|
+
const guardContent = tree.readContent('/src/app/require-profile.guard.ts');
|
|
48
|
+
expect(guardContent).toContain('export const requireProfile: CanActivateFn');
|
|
49
|
+
expect(guardContent).toContain('export function handleAccess');
|
|
50
|
+
const specContent = tree.readContent('/src/app/require-profile.guard.spec.ts');
|
|
51
|
+
expect(specContent).toContain("describe('requireProfile (handleAccess)'");
|
|
52
|
+
});
|
|
53
|
+
it('should abort when inDirectory is false', async () => {
|
|
54
|
+
const tree = await runner.runSchematic('guard', {
|
|
55
|
+
name: 'require-profile',
|
|
56
|
+
project: 'test-app',
|
|
57
|
+
inDirectory: false,
|
|
58
|
+
path: 'src/app',
|
|
59
|
+
}, createWorkspaceTree());
|
|
60
|
+
// When inDirectory is false, the schematic returns noop โ no files generated
|
|
61
|
+
expect(tree.files).not.toContain('/src/app/require-profile.guard.ts');
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=index_spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index_spec.js","sourceRoot":"","sources":["index_spec.ts"],"names":[],"mappings":";;;AAAA,2DAAkD;AAClD,gEAAuF;AACvF,mDAA6B;AAE7B,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAElE;;;GAGG;AACH,SAAS,mBAAmB;IAC1B,MAAM,IAAI,GAAG,IAAI,sBAAY,CAAC,iBAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IAC5C,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC;QAC1C,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE;YACR,UAAU,EAAE;gBACV,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,EAAE;gBACR,UAAU,EAAE,KAAK;gBACjB,MAAM,EAAE,KAAK;aACd;SACF;KACF,CAAC,CAAC,CAAC;IACJ,OAAO,IAAI,CAAC;AACd,CAAC;AAED,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,MAAM,MAAM,GAAG,IAAI,6BAAmB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;IAErE,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC7D,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE;YAC9C,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE,UAAU;YACnB,WAAW,EAAE,IAAI;YACjB,IAAI,EAAE,SAAS;SAChB,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAE1B,gDAAgD;QAChD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,mCAAmC,CAAC,CAAC;QAClE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,wCAAwC,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4EAA4E,EAAE,KAAK,IAAI,EAAE;QAC1F,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE;YAC9C,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE,UAAU;YACnB,WAAW,EAAE,IAAI;YACjB,IAAI,EAAE,SAAS;SAChB,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAE1B,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,mCAAmC,CAAC,CAAC;QAC3E,MAAM,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,4CAA4C,CAAC,CAAC;QAC7E,MAAM,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,8BAA8B,CAAC,CAAC;QAE/D,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,wCAAwC,CAAC,CAAC;QAC/E,MAAM,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,0CAA0C,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;QACtD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE;YAC9C,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE,UAAU;YACnB,WAAW,EAAE,KAAK;YAClB,IAAI,EAAE,SAAS;SAChB,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAE1B,6EAA6E;QAC7E,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,mCAAmC,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "GuardSchema",
|
|
4
|
+
"title": "Guard Schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"description": "Creates a new route guard in the default project.",
|
|
7
|
+
"properties": {
|
|
8
|
+
"index": {
|
|
9
|
+
"type": "number",
|
|
10
|
+
"default": 1
|
|
11
|
+
},
|
|
12
|
+
"path": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"format": "path",
|
|
15
|
+
"description": "The path at which to create the guard file, relative to the current workspace.",
|
|
16
|
+
"visible": false,
|
|
17
|
+
"$default": {
|
|
18
|
+
"$source": "workingDirectory"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"project": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "The name of the project.",
|
|
24
|
+
"$default": {
|
|
25
|
+
"$source": "projectName"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"name": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "The name of the guard.",
|
|
31
|
+
"$default": {
|
|
32
|
+
"$source": "argv",
|
|
33
|
+
"index": 0
|
|
34
|
+
},
|
|
35
|
+
"x-prompt": "What name would you like to use for the guard?"
|
|
36
|
+
},
|
|
37
|
+
"inDirectory": {
|
|
38
|
+
"type": "boolean",
|
|
39
|
+
"default": true,
|
|
40
|
+
"x-prompt": "Are you currently in the directory where you want to generate the guard?"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"required": [
|
|
44
|
+
"name"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"projects": {
|
|
3
|
-
"default": "<%= dasherize(project)
|
|
4
|
-
"dev": "<%= dasherize(project) %>-dev"
|
|
3
|
+
"default": "<%= dasherize(project) %>-dev",
|
|
4
|
+
"dev": "<%= dasherize(project) %>-dev",
|
|
5
|
+
"prod": "<%= dasherize(project) %>-prod"
|
|
5
6
|
},
|
|
6
7
|
"targets": {},
|
|
7
8
|
"etags": {}
|
|
@@ -1,59 +1,125 @@
|
|
|
1
1
|
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run the linter on the relevant version of node
|
|
2
2
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
3
3
|
|
|
4
|
-
name: Angular Github CI
|
|
4
|
+
name: โก Angular Github CI
|
|
5
5
|
|
|
6
6
|
on:
|
|
7
|
+
workflow_dispatch:
|
|
7
8
|
push:
|
|
8
|
-
branches: [
|
|
9
|
+
branches: [master, main, develop]
|
|
9
10
|
pull_request:
|
|
11
|
+
types: [opened, synchronize]
|
|
10
12
|
|
|
11
13
|
jobs:
|
|
12
14
|
build:
|
|
13
|
-
|
|
14
15
|
runs-on: ubuntu-latest
|
|
16
|
+
timeout-minutes: 15
|
|
15
17
|
|
|
16
18
|
strategy:
|
|
17
19
|
matrix:
|
|
18
20
|
node-version: [22.x]
|
|
19
21
|
|
|
20
22
|
steps:
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- name:
|
|
25
|
-
uses: actions/checkout@
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
- name: ๐ Start Job
|
|
24
|
+
run: echo "Job triggered by ${{ github.event_name }} event on ${{ github.ref }}"
|
|
25
|
+
|
|
26
|
+
- name: ๐ Checkout Repository
|
|
27
|
+
uses: actions/checkout@v4
|
|
28
|
+
with:
|
|
29
|
+
fetch-depth: 0
|
|
30
|
+
|
|
31
|
+
- name: ๐ง Setup Node.js ${{ matrix.node-version }}
|
|
32
|
+
uses: actions/setup-node@v4
|
|
30
33
|
with:
|
|
31
34
|
node-version: ${{ matrix.node-version }}
|
|
32
35
|
cache: 'npm'
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- name:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
36
|
+
|
|
37
|
+
- name: ๐ Environment Info
|
|
38
|
+
run: |
|
|
39
|
+
echo "๐ฅ๏ธ Node version: $(node -v)"
|
|
40
|
+
echo "๐ฆ NPM version: $(npm -v)"
|
|
41
|
+
echo "๐ Working directory: $(pwd)"
|
|
42
|
+
|
|
43
|
+
- name: โก Cache Dependencies
|
|
44
|
+
uses: actions/cache@v4
|
|
45
|
+
id: npm-cache
|
|
46
|
+
with:
|
|
47
|
+
path: node_modules
|
|
48
|
+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
49
|
+
restore-keys: |
|
|
50
|
+
${{ runner.os }}-node-
|
|
51
|
+
|
|
52
|
+
- name: ๐ฆ Install Dependencies
|
|
53
|
+
if: steps.npm-cache.outputs.cache-hit != 'true'
|
|
54
|
+
run: npm ci
|
|
55
|
+
|
|
56
|
+
- name: ๐ Lint Code
|
|
57
|
+
run: npm run lint
|
|
58
|
+
|
|
59
|
+
- name: ๐งช Test Code
|
|
60
|
+
run: npm run test
|
|
61
|
+
|
|
62
|
+
- name: ๐ก๏ธ Test Firestore Rules
|
|
63
|
+
run: npm run test:rules
|
|
64
|
+
|
|
65
|
+
- name: ๐๏ธ Build Project
|
|
66
|
+
run: npm run build
|
|
67
|
+
|
|
68
|
+
- name: ๐ List Distribution Files
|
|
69
|
+
run: ls -la ./dist
|
|
70
|
+
|
|
71
|
+
- name: ๐พ Cache Build
|
|
72
|
+
uses: actions/cache@v4
|
|
73
|
+
with:
|
|
74
|
+
path: ./dist
|
|
75
|
+
key: ${{ runner.os }}-build-${{ github.sha }}
|
|
76
|
+
restore-keys: |
|
|
77
|
+
${{ runner.os }}-build-
|
|
78
|
+
|
|
79
|
+
- name: ๐ Generate Build Report
|
|
80
|
+
run: |
|
|
81
|
+
echo "### ๐๏ธ Build Summary" > build-report.md
|
|
82
|
+
echo "- ๐ Branch: ${{ github.ref_name }}" >> build-report.md
|
|
83
|
+
echo "- ๐ Commit: ${{ github.sha }}" >> build-report.md
|
|
84
|
+
echo "- ๐ค Author: ${{ github.actor }}" >> build-report.md
|
|
85
|
+
echo "- โฑ๏ธ Time: $(date)" >> build-report.md
|
|
86
|
+
|
|
87
|
+
- name: ๐ Upload Build Artifacts
|
|
88
|
+
uses: actions/upload-artifact@v4
|
|
89
|
+
with:
|
|
90
|
+
name: production-build
|
|
91
|
+
path: dist/
|
|
92
|
+
retention-days: 1
|
|
93
|
+
|
|
94
|
+
- name: โ
Notify Success
|
|
95
|
+
if: success()
|
|
96
|
+
uses: sarisia/actions-status-discord@v1
|
|
97
|
+
with:
|
|
98
|
+
webhook: ${{ secrets.DISCORD_WEBHOOK }}
|
|
99
|
+
title: โ
Build Succeeded
|
|
100
|
+
description: |
|
|
101
|
+
PR: ${{ github.event.pull_request.number || 'N/A' }}
|
|
102
|
+
Title: ${{ github.event.pull_request.title || github.ref_name }}
|
|
103
|
+
Triggered by: ${{ github.actor }}
|
|
104
|
+
Link: ${{ github.event.pull_request.html_url || 'N/A' }}
|
|
105
|
+
color: 0x36a64f
|
|
106
|
+
username: ๐ค Github Actions
|
|
107
|
+
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
|
|
108
|
+
|
|
109
|
+
- name: โ Notify Failure
|
|
110
|
+
if: failure()
|
|
111
|
+
uses: sarisia/actions-status-discord@v1
|
|
112
|
+
with:
|
|
113
|
+
webhook: ${{ secrets.DISCORD_WEBHOOK }}
|
|
114
|
+
title: โ Build Failed
|
|
115
|
+
description: |
|
|
116
|
+
PR: ${{ github.event.pull_request.number || 'N/A' }}
|
|
117
|
+
Title: ${{ github.event.pull_request.title || github.ref_name }}
|
|
118
|
+
Triggered by: ${{ github.actor }}
|
|
119
|
+
Link: ${{ github.event.pull_request.html_url || 'N/A' }}
|
|
120
|
+
color: 0xff0000
|
|
121
|
+
username: ๐ค Github Actions
|
|
122
|
+
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
|
|
123
|
+
|
|
124
|
+
- name: ๐ Job Status
|
|
125
|
+
run: echo "๐ Job status is ${{ job.status }}"
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"index": "src/index.html",
|
|
32
32
|
"browser": "src/main.ts",
|
|
33
33
|
"polyfills": [
|
|
34
|
-
"zone.js",
|
|
35
34
|
"core-js/stable",
|
|
36
35
|
"globalthis",
|
|
37
36
|
"cross-fetch",
|
|
@@ -104,10 +103,7 @@
|
|
|
104
103
|
"test": {
|
|
105
104
|
"builder": "@ngx-env/builder-angular:jest",
|
|
106
105
|
"options": {
|
|
107
|
-
"polyfills": [
|
|
108
|
-
"zone.js",
|
|
109
|
-
"zone.js/testing"
|
|
110
|
-
],
|
|
106
|
+
"polyfills": [],
|
|
111
107
|
"tsConfig": "tsconfig.spec.json",
|
|
112
108
|
"inlineStyleLanguage": "scss",
|
|
113
109
|
"assets": [
|