@eui/tools 6.21.108 → 6.21.110

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 (44) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +20 -0
  3. package/package.json +1 -1
  4. package/scripts/csdr/cli/skeletons/package/frontend/19.x/default/src/lib/components/main.component.ts +6 -2
  5. package/scripts/csdr/cli/skeletons/package/frontend/19.x/default/src/lib/module.ts +0 -3
  6. package/scripts/csdr/cli/skeletons/package/frontend/19.x/default/tsconfig.lib.json +9 -3
  7. package/scripts/csdr/cli/skeletons/package/frontend/19.x/default-sdlc/src/lib/components/main.component.ts +6 -2
  8. package/scripts/csdr/cli/skeletons/package/frontend/19.x/default-sdlc/src/lib/module.ts +0 -3
  9. package/scripts/csdr/cli/skeletons/package/frontend/19.x/default-sdlc/tsconfig.lib.json +9 -3
  10. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-default/src/lib/components/participant/participant.component.ts +6 -11
  11. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-default/src/lib/module.ts +0 -10
  12. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-default/tsconfig.lib.json +9 -3
  13. package/scripts/csdr/init/standalone/18.x/tsconfig.lib.standalone.json +9 -3
  14. package/scripts/utils/migrate/skeleton/package/.gitignore_TO_REPLACE +2 -0
  15. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/.eslintrc.json +0 -79
  16. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/assets/i18n/en.json +0 -6
  17. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/assets/i18n/fr.json +0 -6
  18. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/dependencies-base.json +0 -2
  19. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/dependencies-composite.json +0 -3
  20. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/gitignore_TO_REPLACE +0 -46
  21. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/karma.conf.js +0 -7
  22. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/ng-package.json +0 -7
  23. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/package.json +0 -4
  24. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/dummy.spec.ts.TO_REPLACE +0 -5
  25. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/index.ts +0 -4
  26. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/lib/blocks/sample/components/sample.component.html +0 -1
  27. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/lib/blocks/sample/components/sample.component.ts +0 -14
  28. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/lib/blocks/sample/containers/container.component.ts +0 -36
  29. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/lib/blocks/sample/models/block.model.ts +0 -5
  30. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/lib/blocks/sample/models/index.ts +0 -1
  31. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/lib/blocks/sample/module.ts +0 -37
  32. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/lib/main/components/sample.component.html +0 -1
  33. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/lib/main/components/sample.component.ts +0 -11
  34. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/lib/main/containers/block-store.service.ts +0 -26
  35. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/lib/main/containers/container.component.ts +0 -42
  36. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/lib/main/models/block.model.ts +0 -4
  37. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/lib/main/models/index.ts +0 -1
  38. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/lib/main/module.ts +0 -56
  39. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/lib/main/store/block.actions.ts +0 -11
  40. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/lib/main/store/block.feature.ts +0 -48
  41. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/lib/module.ts +0 -17
  42. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/src/test.ts.TO_REPLACE +0 -21
  43. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/tsconfig.lib.json +0 -33
  44. package/scripts/csdr/cli/skeletons/package/frontend/19.x/participant-ngrx/tsconfig.spec.json +0 -17
@@ -1 +1 @@
1
- 6.21.108
1
+ 6.21.110
package/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## 6.21.110 (2025-08-26)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * set strict = true and strictTemplates = true. This is just a future proof change for new packages considering is coming soon: https://github.com/microsoft/TypeScript/issues/62333. In general, it helps developers to write better code and costs nothing for new packages. [EUI-11268](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-11268) ([f404b964](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/f404b96410331d177b8c383ae33833eabf42a22c))
7
+
8
+ * * *
9
+ * * *
10
+ ## 6.21.109 (2025-08-26)
11
+
12
+ ##### Chores
13
+
14
+ * **other:**
15
+ * adapt gitignore for sdlc migrate script - EUI-10199 [EUI-10199](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-10199) ([d2d59f68](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/d2d59f6806a84ae9dfc9e6aa02d88e9dd5f4efb3))
16
+ * minor changes EUI-11268 [EUI-11268](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-11268) ([1eff34e4](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/1eff34e42bb9525b590f728c42c1ab9aac529941))
17
+ * modernisation and cleanup of the skeleton for newly created packages (v19); removal of participant-ngrx from the setup: this should not be promoted anymore cause it makes no sense in a world of signals. EUI-11268 [EUI-11268](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-11268) ([c13be923](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/c13be9235c5963b8ef4bdb3f68ef2eefd4a5771f))
18
+
19
+ * * *
20
+ * * *
1
21
  ## 6.21.108 (2025-08-12)
2
22
 
3
23
  ##### Chores
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.21.108",
3
+ "version": "6.21.110",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -1,16 +1,20 @@
1
- import { Component, Input } from '@angular/core';
1
+ import { ChangeDetectionStrategy, Component } from '@angular/core';
2
+
2
3
  import { TranslateModule } from '@ngx-translate/core';
4
+
3
5
  import { EuiButtonModule } from '@eui/components/eui-button';
4
6
  import { EuiPageModule } from '@eui/components/eui-page';
5
7
 
6
8
  @Component({
7
9
  selector: '@module.scope-name@-cp',
8
- templateUrl: './main.component.html',
9
10
  imports: [
10
11
  TranslateModule,
11
12
  EuiButtonModule,
12
13
  EuiPageModule,
13
14
  ],
15
+ changeDetection: ChangeDetectionStrategy.OnPush,
16
+ templateUrl: './main.component.html',
14
17
  })
15
18
  export class @module.class.name@Component {
19
+ // make sure to use angular-signals and follow https://angular.dev/style-guide
16
20
  }
@@ -1,5 +1,4 @@
1
1
  import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
2
  import { RouterModule, Routes } from '@angular/router';
4
3
 
5
4
  // -- main component --
@@ -16,11 +15,9 @@ export const routes: Routes = [
16
15
 
17
16
  @NgModule({
18
17
  imports: [
19
- CommonModule,
20
18
  RouterModule.forChild(routes),
21
19
  @module.class.name@Component,
22
20
  ],
23
- exports: [],
24
21
  })
25
22
  export class @module.class.name@Module {
26
23
  }
@@ -5,6 +5,11 @@
5
5
  "target": "ES2022",
6
6
  "module": "ES2022",
7
7
  "moduleResolution": "node",
8
+ "strict": true,
9
+ "noImplicitOverride": true,
10
+ "noPropertyAccessFromIndexSignature": true,
11
+ "noImplicitReturns": true,
12
+ "noFallthroughCasesInSwitch": true,
8
13
  "declaration": true,
9
14
  "sourceMap": true,
10
15
  "inlineSources": true,
@@ -20,11 +25,12 @@
20
25
  },
21
26
  "angularCompilerOptions": {
22
27
  "annotateForClosureCompiler": true,
23
- "skipTemplateCodegen": true,
24
- "strictMetadataEmit": true,
28
+ "enableResourceInlining": true,
25
29
  "fullTemplateTypeCheck": true,
30
+ "skipTemplateCodegen": true,
26
31
  "strictInjectionParameters": true,
27
- "enableResourceInlining": true
32
+ "strictMetadataEmit": true,
33
+ "strictTemplates": true
28
34
  },
29
35
  "exclude": [
30
36
  "src/test.ts",
@@ -1,16 +1,20 @@
1
- import { Component, Input } from '@angular/core';
1
+ import { ChangeDetectionStrategy, Component } from '@angular/core';
2
+
2
3
  import { TranslateModule } from '@ngx-translate/core';
4
+
3
5
  import { EuiButtonModule } from '@eui/components/eui-button';
4
6
  import { EuiPageModule } from '@eui/components/eui-page';
5
7
 
6
8
  @Component({
7
9
  selector: '@module.scope-name@-cp',
8
- templateUrl: './main.component.html',
9
10
  imports: [
10
11
  TranslateModule,
11
12
  EuiButtonModule,
12
13
  EuiPageModule,
13
14
  ],
15
+ changeDetection: ChangeDetectionStrategy.OnPush,
16
+ templateUrl: './main.component.html',
14
17
  })
15
18
  export class @module.class.name@Component {
19
+ // make sure to use angular-signals and follow https://angular.dev/style-guide
16
20
  }
@@ -1,5 +1,4 @@
1
1
  import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
2
  import { RouterModule, Routes } from '@angular/router';
4
3
 
5
4
  // -- main component --
@@ -16,11 +15,9 @@ export const routes: Routes = [
16
15
 
17
16
  @NgModule({
18
17
  imports: [
19
- CommonModule,
20
18
  RouterModule.forChild(routes),
21
19
  @module.class.name@Component,
22
20
  ],
23
- exports: [],
24
21
  })
25
22
  export class @module.class.name@Module {
26
23
  }
@@ -5,6 +5,11 @@
5
5
  "target": "ES2022",
6
6
  "module": "ES2022",
7
7
  "moduleResolution": "node",
8
+ "strict": true,
9
+ "noImplicitOverride": true,
10
+ "noPropertyAccessFromIndexSignature": true,
11
+ "noImplicitReturns": true,
12
+ "noFallthroughCasesInSwitch": true,
8
13
  "declaration": true,
9
14
  "sourceMap": true,
10
15
  "inlineSources": true,
@@ -20,11 +25,12 @@
20
25
  },
21
26
  "angularCompilerOptions": {
22
27
  "annotateForClosureCompiler": true,
23
- "skipTemplateCodegen": true,
24
- "strictMetadataEmit": true,
28
+ "enableResourceInlining": true,
25
29
  "fullTemplateTypeCheck": true,
30
+ "skipTemplateCodegen": true,
26
31
  "strictInjectionParameters": true,
27
- "enableResourceInlining": true
32
+ "strictMetadataEmit": true,
33
+ "strictTemplates": true
28
34
  },
29
35
  "exclude": [
30
36
  "src/test.ts",
@@ -1,19 +1,14 @@
1
- import { Component, OnInit, Input } from '@angular/core';
1
+ import { Component, ChangeDetectionStrategy, input } from '@angular/core';
2
2
 
3
- import { BlockComponent, ParticipantBlock } from '@cc/shared/block';
3
+ import { ParticipantBlock } from '@cc/shared/block';
4
4
 
5
5
  @Component({
6
6
  selector: '@module.scope.string@-participant-cp',
7
+ changeDetection: ChangeDetectionStrategy.OnPush,
7
8
  templateUrl: './participant.component.html',
8
9
  })
9
- export class @module.class.name@Component implements BlockComponent, OnInit {
10
- @Input() readonly block: ParticipantBlock; // it should be an extension of ParticipantBlock
10
+ export class @module.class.name@Component {
11
+ readonly block = input.required<ParticipantBlock>();
11
12
 
12
- constructor() {
13
- // constructor
14
- }
15
-
16
- ngOnInit(): void {
17
- console.log('init');
18
- }
13
+ // make sure to use angular-signals and follow https://angular.dev/style-guide
19
14
  }
@@ -1,19 +1,9 @@
1
1
  import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
-
4
- import { TranslateModule } from '@ngx-translate/core';
5
-
6
- import { CcBlockModule } from '@cc/shared/block';
7
2
 
8
3
  import { @module.class.name@Component } from './components/participant/participant.component';
9
4
 
10
5
  @NgModule({
11
6
  imports: [
12
- CommonModule,
13
- TranslateModule,
14
- CcBlockModule,
15
- ],
16
- declarations: [
17
7
  @module.class.name@Component,
18
8
  ],
19
9
  exports: [
@@ -5,6 +5,11 @@
5
5
  "target": "ES2022",
6
6
  "module": "ES2022",
7
7
  "moduleResolution": "node",
8
+ "strict": true,
9
+ "noImplicitOverride": true,
10
+ "noPropertyAccessFromIndexSignature": true,
11
+ "noImplicitReturns": true,
12
+ "noFallthroughCasesInSwitch": true,
8
13
  "declaration": true,
9
14
  "sourceMap": true,
10
15
  "inlineSources": true,
@@ -20,11 +25,12 @@
20
25
  },
21
26
  "angularCompilerOptions": {
22
27
  "annotateForClosureCompiler": true,
23
- "skipTemplateCodegen": true,
24
- "strictMetadataEmit": true,
28
+ "enableResourceInlining": true,
25
29
  "fullTemplateTypeCheck": true,
30
+ "skipTemplateCodegen": true,
26
31
  "strictInjectionParameters": true,
27
- "enableResourceInlining": true
32
+ "strictMetadataEmit": true,
33
+ "strictTemplates": true
28
34
  },
29
35
  "exclude": [
30
36
  "src/test.ts",
@@ -5,6 +5,11 @@
5
5
  "target": "ES2022",
6
6
  "module": "ES2022",
7
7
  "moduleResolution": "node",
8
+ "strict": true,
9
+ "noImplicitOverride": true,
10
+ "noPropertyAccessFromIndexSignature": true,
11
+ "noImplicitReturns": true,
12
+ "noFallthroughCasesInSwitch": true,
8
13
  "declaration": true,
9
14
  "sourceMap": true,
10
15
  "inlineSources": true,
@@ -20,11 +25,12 @@
20
25
  },
21
26
  "angularCompilerOptions": {
22
27
  "annotateForClosureCompiler": true,
23
- "skipTemplateCodegen": true,
24
- "strictMetadataEmit": true,
28
+ "enableResourceInlining": true,
25
29
  "fullTemplateTypeCheck": true,
30
+ "skipTemplateCodegen": true,
26
31
  "strictInjectionParameters": true,
27
- "enableResourceInlining": true,
32
+ "strictMetadataEmit": true,
33
+ "strictTemplates": true,
28
34
  "compilationMode": "partial"
29
35
  },
30
36
  "exclude": [
@@ -9,6 +9,7 @@
9
9
  **/tmp
10
10
  /test
11
11
  /.config
12
+ /.scannerwork
12
13
 
13
14
  # IDEs and editors
14
15
  /.idea
@@ -56,6 +57,7 @@ version.properties
56
57
  audit.json
57
58
  angular.json
58
59
  .eslintrc.eui19.standalone.json
60
+ .eslintrc.eui18.standalone.json
59
61
  .eslintrc.standalone.json
60
62
  tsconfig.standalone.json
61
63
  tsconfig.lib.standalone.json
@@ -1,79 +0,0 @@
1
- {
2
- "extends": "../../.eslintrc-eui19.json",
3
- "ignorePatterns": [
4
- "!**/*",
5
- "**/*.d.ts",
6
- "dist"
7
- ],
8
- "overrides": [
9
- {
10
- "files": [
11
- "*.ts"
12
- ],
13
- "parserOptions": {
14
- "createDefaultProgram": true
15
- },
16
- "rules": {
17
- "@angular-eslint/component-selector": [
18
- "error",
19
- {
20
- "type": "element",
21
- "prefix": "@module.scope.string@",
22
- "style": "kebab-case"
23
- }
24
- ],
25
- "@angular-eslint/directive-selector": [
26
- "error",
27
- {
28
- "type": "attribute",
29
- "prefix": "@module.scope.string@",
30
- "style": "camelCase"
31
- }
32
- ],
33
- "@typescript-eslint/ban-ts-comment": "off",
34
- "@typescript-eslint/ban-types": "error",
35
- "@typescript-eslint/consistent-type-definitions": "off",
36
- "@typescript-eslint/dot-notation": "off",
37
- "@typescript-eslint/explicit-member-accessibility": [
38
- "off",
39
- {
40
- "accessibility": "explicit"
41
- }
42
- ],
43
- "@typescript-eslint/no-inferrable-types": "off",
44
- "@typescript-eslint/no-unused-vars": "off",
45
- "@typescript-eslint/no-var-requires": "error",
46
- "@typescript-eslint/require-await": "error",
47
- "id-blacklist": "off",
48
- "id-match": "off",
49
- "max-len": [
50
- "error",
51
- {
52
- "code": 160
53
- }
54
- ],
55
- "no-duplicate-case": "error",
56
- "no-duplicate-imports": "off",
57
- "no-invalid-this": "error",
58
- "no-multiple-empty-lines": [
59
- "error",
60
- {
61
- "max": 1
62
- }
63
- ],
64
- "no-new-func": "error",
65
- "no-template-curly-in-string": "error",
66
- "no-underscore-dangle": "off",
67
- "no-var": "off",
68
- "prefer-const": "off",
69
- "comma-dangle": "off"
70
- }
71
- },
72
- {
73
- "files": [
74
- "*.html"
75
- ],
76
- "rules": {}
77
- }
78
- ]
79
- }
@@ -1,6 +0,0 @@
1
- {
2
- "@module.scope-name@.TITLE": "@module.scope-name@",
3
- "@module.scope-name@.FILTER": "Search filter",
4
- "@module.scope-name@.QUICK_SECTION": "Quick filter",
5
- "@module.scope-name@.SEARCH_RESULT": "Filter results"
6
- }
@@ -1,6 +0,0 @@
1
- {
2
- "@module.scope-name@.TITLE": "**fr** @module.scope-name@ **fr**",
3
- "@module.scope-name@.FILTER": "**fr** Search filter **fr**",
4
- "@module.scope-name@.QUICK_SECTION": "**fr** Quick filter **fr**",
5
- "@module.scope-name@.SEARCH_RESULT": "**fr** Filter results **fr**"
6
- }
@@ -1,46 +0,0 @@
1
- # See http://help.github.com/ignore-files/ for more about ignoring files.
2
-
3
- # compiled output
4
- **/node_modules
5
- **/target
6
- **/build
7
- **/dist
8
- **/out-tsc
9
- **/tmp
10
- **/test/reports
11
-
12
- # IDEs and editors
13
- /.idea
14
- .project
15
- .classpath
16
- .c9/
17
- *.launch
18
- .settings/
19
- *.sublime-workspace
20
-
21
- # IDE - VSCode
22
- .vscode/*
23
- !.vscode/settings.json
24
- !.vscode/tasks.json
25
- !.vscode/launch.json
26
- !.vscode/extensions.json
27
-
28
- # misc
29
- /.sass-cache
30
- /connect.lock
31
- /coverage
32
- /libpeerconnection.log
33
- npm-debug.log
34
- testem.log
35
- /typings
36
- yarn-error.log
37
-
38
- # e2e
39
- /e2e/*.js
40
- /e2e/*.map
41
- **/src/**/*.js
42
- **/src/**/*.map
43
-
44
- # System Files
45
- .DS_Store
46
- Thumbs.db
@@ -1,7 +0,0 @@
1
- const karmaConfig = require('@eui/tools/karma/karma.conf.pkg');
2
-
3
- module.exports = function (config) {
4
- config.set(
5
- karmaConfig.get(config, '@module.full.name@', {})
6
- );
7
- };
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
- "dest": "./dist",
4
- "lib": {
5
- "entryFile": "src/index.ts"
6
- }
7
- }
@@ -1,4 +0,0 @@
1
- {
2
- "name": "@module.scope@/@module.name@",
3
- "version": "1.0.0"
4
- }
@@ -1,5 +0,0 @@
1
- describe('First test', () => {
2
- it('should work', () => {
3
- expect(true).toBe(true);
4
- });
5
- });
@@ -1,4 +0,0 @@
1
- export { @module.class.name@Module } from './lib/module';
2
-
3
- export { MainParticipantModule } from './lib/main/module';
4
- export { @module.class.name@ContainerComponent } from './lib/main/containers/container.component';
@@ -1,14 +0,0 @@
1
- import { Component, Input } from '@angular/core';
2
-
3
- import { Block } from '../models';
4
-
5
- @Component({
6
- selector: '@module.scope-name@-cp',
7
- templateUrl: './sample.component.html',
8
- })
9
- export class SampleComponent {
10
- @Input() block: Block;
11
-
12
- constructor() {
13
- }
14
- }
@@ -1,36 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, Input, OnInit, OnDestroy } from '@angular/core';
2
-
3
- import { Observable } from 'rxjs';
4
-
5
- import { BlockComponent } from '@cc/shared/block';
6
-
7
- import { Block } from '../models';
8
-
9
- @Component({
10
- selector: '@module.scope-name@-ct',
11
- changeDetection: ChangeDetectionStrategy.OnPush,
12
- template: `
13
- <@module.scope-name@-cp
14
- [block]="block$ | async">
15
- </@module.scope-name@-cp>`,
16
- })
17
- export class ContainerComponent implements BlockComponent, OnInit, OnDestroy {
18
- @Input() readonly block: Block;
19
-
20
- block$: Observable<Block>;
21
-
22
- constructor() {
23
- }
24
-
25
- ngOnInit(): void {
26
- this.asyncPipeObs();
27
- }
28
-
29
- ngOnDestroy(): void {
30
- }
31
-
32
- private asyncPipeObs(): void {
33
- // todo: retrieve block$ from the store
34
- // this.block$
35
- }
36
- }
@@ -1,5 +0,0 @@
1
- import { ParticipantBlock } from '@cc/shared/block';
2
-
3
- export interface Block extends ParticipantBlock {
4
-
5
- }
@@ -1,37 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
-
4
- import { TranslateModule } from '@ngx-translate/core';
5
-
6
- import { CcBlockModule } from '@cc/shared/block';
7
-
8
- // -- Components --
9
- import { SampleComponent } from './components/sample.component';
10
-
11
- const COMPONENTS = [
12
- SampleComponent,
13
- ];
14
-
15
- // -- Containers --
16
- import { ContainerComponent } from './containers/container.component';
17
-
18
- const CONTAINERS = [
19
- ContainerComponent,
20
- ];
21
-
22
- @NgModule({
23
- imports: [
24
- CommonModule,
25
- TranslateModule,
26
- CcBlockModule,
27
- ],
28
- declarations: [
29
- ...COMPONENTS,
30
- ...CONTAINERS,
31
- ],
32
- exports: [
33
- ContainerComponent,
34
- ],
35
- })
36
- export class @module.class.name@BlockSampleModule {
37
- }
@@ -1,11 +0,0 @@
1
- import { Component, Input } from '@angular/core';
2
-
3
- import { Block } from '../models';
4
-
5
- @Component({
6
- selector: '@module.scope-name@-cp',
7
- templateUrl: './sample.component.html',
8
- })
9
- export class @module.class.name@Component {
10
- @Input() block: Block;
11
- }
@@ -1,26 +0,0 @@
1
- import { Injectable, inject } from '@angular/core';
2
- import { Store, select } from '@ngrx/store';
3
-
4
- import { Observable } from 'rxjs';
5
-
6
- import { Block } from '../models';
7
-
8
- import { actions } from '../store/block.actions';
9
- import { feature } from '../store/block.feature';
10
-
11
- @Injectable()
12
- export class BlockStoreService {
13
- private store$ = inject(Store);
14
-
15
- getBlockById(id: string): Observable<Block> {
16
- return this.store$.pipe(select(feature.getBlock(id)));
17
- }
18
-
19
- upsertBlock(b: Block): void {
20
- this.store$.dispatch(actions.upsertBlock({ block: b }));
21
- }
22
-
23
- removeBlock(id: string): void {
24
- this.store$.dispatch(actions.removeBlock({ id }));
25
- }
26
- }
@@ -1,42 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, Input, OnInit, OnDestroy } from '@angular/core';
2
-
3
- import { Observable } from 'rxjs';
4
-
5
- import { BlockComponent } from '@cc/shared/block';
6
-
7
- import { Block } from '../models';
8
-
9
- import { BlockStoreService } from './block-store.service';
10
-
11
- @Component({
12
- selector: '@module.scoe-name@-ct',
13
- changeDetection: ChangeDetectionStrategy.OnPush,
14
- providers: [
15
- BlockStoreService,
16
- ],
17
- template: `
18
- <@module.scope-name@-cp
19
- [block]="block$ | async">
20
- </@module.scope-name@-cp>`,
21
- })
22
- export class @module.class.name@ContainerComponent implements BlockComponent, OnInit, OnDestroy {
23
- @Input() readonly block: Block;
24
-
25
- block$: Observable<Block>;
26
-
27
- constructor(private blockStore: BlockStoreService) {
28
- }
29
-
30
- ngOnInit(): void {
31
- this.asyncPipeObs();
32
-
33
- this.blockStore.upsertBlock(this.block);
34
- }
35
-
36
- ngOnDestroy(): void {
37
- }
38
-
39
- private asyncPipeObs(): void {
40
- this.block$ = this.blockStore.getBlockById(this.block.id);
41
- }
42
- }
@@ -1,4 +0,0 @@
1
- import { ParticipantBlock } from '@cc/shared/block';
2
-
3
- export interface Block extends ParticipantBlock {
4
- }
@@ -1,56 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { StoreModule } from '@ngrx/store';
4
- import { EffectsModule } from '@ngrx/effects';
5
-
6
- import { TranslateModule } from '@ngx-translate/core';
7
-
8
- import { CcBlockModule } from '@cc/shared/block';
9
-
10
- // -- Components --
11
- import { @module.class.name@Component } from './components/sample.component';
12
-
13
- const COMPONENTS = [
14
- @module.class.name@Component,
15
- ];
16
-
17
- // -- Containers --
18
- import { @module.class.name@ContainerComponent } from './containers/container.component';
19
-
20
- const CONTAINERS = [
21
- @module.class.name@ContainerComponent,
22
- ];
23
-
24
- // -- Effects --
25
- const EFFECTS = [
26
- ];
27
-
28
- // -- Feature --
29
- import { feature } from './store/block.feature';
30
-
31
- // -- Services --
32
- const SERVICES = [
33
- ];
34
-
35
- @NgModule({
36
- imports: [
37
- CommonModule,
38
- StoreModule.forFeature(feature),
39
- EffectsModule.forFeature(EFFECTS),
40
- TranslateModule,
41
-
42
- CcBlockModule,
43
- ],
44
- declarations: [
45
- ...COMPONENTS,
46
- ...CONTAINERS,
47
- ],
48
- providers: [
49
- ...SERVICES,
50
- ],
51
- exports: [
52
- @module.class.name@ContainerComponent,
53
- ],
54
- })
55
- export class MainParticipantModule {
56
- }
@@ -1,11 +0,0 @@
1
- import { createActionGroup, props } from '@ngrx/store';
2
-
3
- import { Block } from '../models';
4
-
5
- export const actions = createActionGroup({
6
- source: `@module.class.name@_block`,
7
- events: {
8
- upsertBlock: props<{ block: Block }>(),
9
- removeBlock: props<{ id: string }>(),
10
- },
11
- });
@@ -1,48 +0,0 @@
1
- import { createFeature, createReducer, on, createSelector } from '@ngrx/store';
2
- import { createEntityAdapter, EntityState } from '@ngrx/entity';
3
-
4
- import { Block } from '../models';
5
-
6
- import { actions } from './block.actions';
7
-
8
- const adapter = createEntityAdapter<Block>({
9
- selectId: block => block.id,
10
- });
11
-
12
- interface State {
13
- blocks: EntityState<Block>;
14
- }
15
-
16
- const initialState: State = {
17
- blocks: adapter.getInitialState(),
18
- };
19
-
20
- export const feature = createFeature({
21
- name: `@module.class.name@_block`,
22
- reducer: createReducer(
23
- initialState,
24
- on(actions.upsertBlock, (state, action) => ({
25
- ...state,
26
- blocks: adapter.upsertOne(action.block, state.blocks),
27
- })),
28
- on(actions.removeBlock, (state, action) => ({
29
- ...state,
30
- blocks: adapter.removeOne(action.id, state.blocks),
31
- })),
32
- ),
33
- extraSelectors: ({
34
- selectBlocks,
35
- }) => {
36
- const getBlockEntities = createSelector(
37
- selectBlocks,
38
- adapter.getSelectors().selectEntities,
39
- );
40
- const getBlock = (id: string) => createSelector(
41
- getBlockEntities,
42
- entities => entities[id],
43
- );
44
- return {
45
- getBlock,
46
- };
47
- },
48
- });
@@ -1,17 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
-
3
- import { MainParticipantModule } from './main/module';
4
-
5
- import { @module.class.name@BlockSampleModule } from './blocks/sample/module';
6
-
7
- @NgModule({
8
- imports: [
9
- MainParticipantModule,
10
- @module.class.name@BlockSampleModule,
11
- ],
12
- exports: [
13
- MainParticipantModule,
14
- ],
15
- })
16
- export class @module.class.name@Module {
17
- }
@@ -1,21 +0,0 @@
1
- // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2
-
3
- import 'zone.js/dist/zone';
4
- import 'zone.js/dist/zone-testing';
5
- import { getTestBed } from '@angular/core/testing';
6
- import {
7
- BrowserDynamicTestingModule,
8
- platformBrowserDynamicTesting,
9
- } from '@angular/platform-browser-dynamic/testing';
10
-
11
- declare const require: any;
12
-
13
- // First, initialize the Angular testing environment.
14
- getTestBed().initTestEnvironment(
15
- BrowserDynamicTestingModule,
16
- platformBrowserDynamicTesting(),
17
- );
18
- // Then we find all the tests.
19
- const context = require.context('./', true, /\.spec\.ts$/);
20
- // And load the modules.
21
- context.keys().map(context);
@@ -1,33 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.build.json",
3
- "compilerOptions": {
4
- "outDir": "./out-tsc/lib",
5
- "target": "ES2022",
6
- "module": "ES2022",
7
- "moduleResolution": "node",
8
- "declaration": true,
9
- "sourceMap": true,
10
- "inlineSources": true,
11
- "emitDecoratorMetadata": true,
12
- "experimentalDecorators": true,
13
- "useDefineForClassFields": false,
14
- "importHelpers": true,
15
- "types": [],
16
- "lib": [
17
- "ES2022",
18
- "dom"
19
- ]
20
- },
21
- "angularCompilerOptions": {
22
- "annotateForClosureCompiler": true,
23
- "skipTemplateCodegen": true,
24
- "strictMetadataEmit": true,
25
- "fullTemplateTypeCheck": true,
26
- "strictInjectionParameters": true,
27
- "enableResourceInlining": true
28
- },
29
- "exclude": [
30
- "src/test.ts",
31
- "**/*.spec.ts"
32
- ]
33
- }
@@ -1,17 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.build.json",
3
- "compilerOptions": {
4
- "outDir": "./out-tsc/spec",
5
- "types": [
6
- "jasmine",
7
- "node"
8
- ]
9
- },
10
- "files": [
11
- "src/test.ts"
12
- ],
13
- "include": [
14
- "**/*.spec.ts",
15
- "**/*.d.ts"
16
- ]
17
- }