@o3r/core 14.0.0-next.7 → 14.0.0-next.9
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/package.json +11 -11
- package/schematics/convert-component/index.js +3 -2
- package/schematics/store/common/templates/__storeName@dasherize__-module.ts.template +21 -10
- package/schematics/store/entity-async/index.d.ts.map +1 -1
- package/schematics/store/entity-async/index.js +22 -20
- package/schematics/store/entity-sync/index.d.ts.map +1 -1
- package/schematics/store/entity-sync/index.js +22 -20
- package/schematics/store/simple-async/index.d.ts.map +1 -1
- package/schematics/store/simple-async/index.js +22 -20
- package/schematics/store/simple-sync/index.d.ts.map +1 -1
- package/schematics/store/simple-sync/index.js +22 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/core",
|
|
3
|
-
"version": "14.0.0-next.
|
|
3
|
+
"version": "14.0.0-next.9",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"@ngrx/entity": "^20.0.0",
|
|
39
39
|
"@ngrx/store": "^20.0.0",
|
|
40
40
|
"@nx/angular": "~21.6.0",
|
|
41
|
-
"@o3r/telemetry": "~14.0.0-next.
|
|
41
|
+
"@o3r/telemetry": "~14.0.0-next.9",
|
|
42
42
|
"@schematics/angular": "^20.0.0",
|
|
43
43
|
"chokidar": "^4.0.3",
|
|
44
44
|
"globby": "^11.1.0",
|
|
45
45
|
"rxjs": "^7.8.1",
|
|
46
|
-
"type-fest": "^
|
|
46
|
+
"type-fest": "^5.3.1",
|
|
47
47
|
"typescript": "^5.9.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@o3r/schematics": "~14.0.0-next.
|
|
79
|
+
"@o3r/schematics": "~14.0.0-next.9",
|
|
80
80
|
"tslib": "^2.6.2",
|
|
81
81
|
"uuid": "^11.0.5"
|
|
82
82
|
},
|
|
@@ -88,11 +88,11 @@
|
|
|
88
88
|
"@ngrx/store": "~20.1.0",
|
|
89
89
|
"@ngrx/store-devtools": "~20.1.0",
|
|
90
90
|
"@nx/eslint-plugin": "~21.6.0",
|
|
91
|
-
"@o3r/store-sync": "~14.0.0-next.
|
|
91
|
+
"@o3r/store-sync": "~14.0.0-next.9",
|
|
92
92
|
"@stylistic/eslint-plugin": "~5.6.0",
|
|
93
93
|
"@types/jest": "~30.0.0",
|
|
94
|
-
"@typescript-eslint/eslint-plugin": "~8.
|
|
95
|
-
"@typescript-eslint/parser": "~8.
|
|
94
|
+
"@typescript-eslint/eslint-plugin": "~8.51.0",
|
|
95
|
+
"@typescript-eslint/parser": "~8.51.0",
|
|
96
96
|
"angular-eslint": "~20.6.0",
|
|
97
97
|
"cpy-cli": "^6.0.0",
|
|
98
98
|
"eslint": "~9.39.0",
|
|
@@ -100,10 +100,10 @@
|
|
|
100
100
|
"eslint-import-resolver-typescript": "~4.4.0",
|
|
101
101
|
"eslint-plugin-import": "~2.32.0",
|
|
102
102
|
"eslint-plugin-import-newlines": "~1.4.0",
|
|
103
|
-
"eslint-plugin-jest": "~29.
|
|
104
|
-
"eslint-plugin-jsdoc": "~
|
|
103
|
+
"eslint-plugin-jest": "~29.11.0",
|
|
104
|
+
"eslint-plugin-jsdoc": "~61.5.0",
|
|
105
105
|
"eslint-plugin-prefer-arrow": "~1.2.3",
|
|
106
|
-
"eslint-plugin-unicorn": "~
|
|
106
|
+
"eslint-plugin-unicorn": "~62.0.0",
|
|
107
107
|
"eslint-plugin-unused-imports": "~4.3.0",
|
|
108
108
|
"globals": "^16.0.0",
|
|
109
109
|
"jest": "~30.2.0",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"jsonc-eslint-parser": "~2.4.0",
|
|
115
115
|
"nx": "~21.6.0",
|
|
116
116
|
"ts-jest": "~29.4.0",
|
|
117
|
-
"typescript-eslint": "~8.
|
|
117
|
+
"typescript-eslint": "~8.51.0",
|
|
118
118
|
"zone.js": "~0.15.0"
|
|
119
119
|
},
|
|
120
120
|
"engines": {
|
|
@@ -14,8 +14,9 @@ function convertToO3rComponentFn(options) {
|
|
|
14
14
|
const updateComponentFile = (tree) => {
|
|
15
15
|
const sourceFile = ts.createSourceFile(options.path, tree.readText(options.path), ts.ScriptTarget.ES2020, true);
|
|
16
16
|
const recorder = tree.beginUpdate(options.path);
|
|
17
|
-
const changes = [
|
|
18
|
-
|
|
17
|
+
const changes = [
|
|
18
|
+
(0, ast_utils_1.insertImport)(sourceFile, options.path, 'O3rComponent', '@o3r/core')
|
|
19
|
+
];
|
|
19
20
|
const ngComponentDeclaration = sourceFile.statements.find((s) => ts.isClassDeclaration(s) && (0, schematics_2.isNgClassComponent)(s));
|
|
20
21
|
if (!ngComponentDeclaration) {
|
|
21
22
|
throw new schematics_2.O3rCliError(`No Angular component found in ${options.path}.`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InjectionToken, ModuleWithProviders, NgModule } from '@angular/core';
|
|
1
|
+
import { InjectionToken, ModuleWithProviders, NgModule, Optional } from '@angular/core';
|
|
2
2
|
import { Action, ActionReducer, StoreModule } from '@ngrx/store';
|
|
3
3
|
<%if (isAsync) {%>
|
|
4
4
|
import { EffectsModule } from '@ngrx/effects';
|
|
@@ -6,24 +6,35 @@ import { <%= storeName %>Effect } from './<%= fileName %>.effect';<%}%>
|
|
|
6
6
|
import { <%= cStoreName %>Reducer } from './<%= fileName %>.reducer';
|
|
7
7
|
import { <%= scuStoreName %>_STORE_NAME, <%= storeName %>State } from './<%= fileName %>.state';
|
|
8
8
|
|
|
9
|
+
/** Action Reducer map for <%= storeName %> store */
|
|
10
|
+
type <%= storeName %>ActionReducer<T extends <%= storeName %>State=<%= storeName %>State, V extends Action=Action> = ActionReducer<T, V>;
|
|
11
|
+
|
|
12
|
+
/** Internal Token of the <%= storeName %> reducer */
|
|
13
|
+
const INTERNAL_<%= scuStoreName %>_REDUCER_TOKEN = new InjectionToken<<%= storeName %>ActionReducer>('Internal <%= storeName %> Reducer');
|
|
14
|
+
|
|
9
15
|
/** Token of the <%= storeName %> reducer */
|
|
10
|
-
export const <%= scuStoreName %>_REDUCER_TOKEN = new InjectionToken
|
|
16
|
+
export const <%= scuStoreName %>_REDUCER_TOKEN = new InjectionToken<<%= storeName %>ActionReducer>('Feature <%= storeName %> Reducer');
|
|
11
17
|
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Retrieve default reducer for <%= storeName %> store
|
|
20
|
+
* @param customReducer
|
|
21
|
+
*/
|
|
22
|
+
export function get<%= storeName %>Reducer(customReducer: <%= storeName %>ActionReducer = <%= cStoreName %>Reducer): <%= storeName %>ActionReducer {
|
|
23
|
+
return customReducer;
|
|
15
24
|
}
|
|
16
25
|
|
|
17
26
|
@NgModule({
|
|
18
27
|
imports: [
|
|
19
|
-
StoreModule.forFeature(<%= scuStoreName %>_STORE_NAME, <%= scuStoreName %>_REDUCER_TOKEN)<%if (isAsync) {%>, EffectsModule.forFeature([<%= storeName %>Effect])<%}%>
|
|
28
|
+
StoreModule.forFeature(<%= scuStoreName %>_STORE_NAME, INTERNAL_<%= scuStoreName %>_REDUCER_TOKEN)<%if (isAsync) {%>, EffectsModule.forFeature([<%= storeName %>Effect])<%}%>
|
|
20
29
|
],
|
|
21
|
-
providers: [
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
providers: [{
|
|
31
|
+
provide: INTERNAL_<%= scuStoreName %>_REDUCER_TOKEN,
|
|
32
|
+
useFactory: get<%= storeName %>Reducer,
|
|
33
|
+
deps: [[new Optional(), <%= scuStoreName %>_REDUCER_TOKEN]]
|
|
34
|
+
}]
|
|
24
35
|
})
|
|
25
36
|
export class <%= storeName %>StoreModule {
|
|
26
|
-
public static forRoot<T extends <%= storeName %>State>(reducerFactory: () => ActionReducer<T
|
|
37
|
+
public static forRoot<T extends <%= storeName %>State>(reducerFactory: () => <%= storeName %>ActionReducer<T>): ModuleWithProviders<<%= storeName %>StoreModule> {
|
|
27
38
|
return {
|
|
28
39
|
ngModule: <%= storeName %>StoreModule,
|
|
29
40
|
providers: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/store/entity-async/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAQL,IAAI,EAKL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/store/entity-async/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAQL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AAsFpC;;;GAGG;AACH,eAAO,MAAM,0BAA0B,wBAAqD,CAAC"}
|
|
@@ -40,26 +40,28 @@ function ngGenerateEntityAsyncStoreFn(options) {
|
|
|
40
40
|
currentStoreIndex = currentStoreIndexBuffer ? currentStoreIndexBuffer.toString() : '';
|
|
41
41
|
tree.delete(barrelPath);
|
|
42
42
|
}
|
|
43
|
-
const rules = [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
(0, schematics_1.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
43
|
+
const rules = [
|
|
44
|
+
(0, schematics_1.mergeWith)((0, schematics_1.apply)(commonTemplates, [
|
|
45
|
+
(0, schematics_1.template)({
|
|
46
|
+
...core_1.strings,
|
|
47
|
+
...options,
|
|
48
|
+
...formattedProperties,
|
|
49
|
+
currentStoreIndex
|
|
50
|
+
}),
|
|
51
|
+
(0, schematics_1.renameTemplateFiles)(),
|
|
52
|
+
(0, schematics_1.move)(`${destination}/${core_1.strings.dasherize(options.storeName)}`)
|
|
53
|
+
]), schematics_1.MergeStrategy.Overwrite),
|
|
54
|
+
(0, schematics_1.mergeWith)((0, schematics_1.apply)(asyncEntityTemplates, [
|
|
55
|
+
(0, schematics_1.template)({
|
|
56
|
+
...core_1.strings,
|
|
57
|
+
...options,
|
|
58
|
+
...formattedProperties,
|
|
59
|
+
currentStoreIndex
|
|
60
|
+
}),
|
|
61
|
+
(0, schematics_1.renameTemplateFiles)(),
|
|
62
|
+
(0, schematics_1.move)(`${destination}/${core_1.strings.dasherize(options.storeName)}`)
|
|
63
|
+
]), schematics_1.MergeStrategy.Overwrite)
|
|
64
|
+
];
|
|
63
65
|
if ((0, schematics_2.moduleHasSubEntryPoints)(tree, destination)) {
|
|
64
66
|
(0, schematics_2.writeSubEntryPointPackageJson)(tree, destination, core_1.strings.dasherize(options.storeName));
|
|
65
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/store/entity-sync/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAQL,IAAI,EAKL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/store/entity-sync/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAQL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AAuFpC;;;GAGG;AACH,eAAO,MAAM,yBAAyB,wBAAoD,CAAC"}
|
|
@@ -40,26 +40,28 @@ function ngGenerateEntitySyncStoreFn(options) {
|
|
|
40
40
|
currentStoreIndex = currentStoreIndexBuffer ? currentStoreIndexBuffer.toString() : '';
|
|
41
41
|
tree.delete(barrelPath);
|
|
42
42
|
}
|
|
43
|
-
const rules = [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
(0, schematics_1.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
43
|
+
const rules = [
|
|
44
|
+
(0, schematics_1.mergeWith)((0, schematics_1.apply)(commonTemplates, [
|
|
45
|
+
(0, schematics_1.template)({
|
|
46
|
+
...core_1.strings,
|
|
47
|
+
...options,
|
|
48
|
+
...formattedProperties,
|
|
49
|
+
currentStoreIndex
|
|
50
|
+
}),
|
|
51
|
+
(0, schematics_1.renameTemplateFiles)(),
|
|
52
|
+
(0, schematics_1.move)(`${destination}/${core_1.strings.dasherize(options.storeName)}`)
|
|
53
|
+
]), schematics_1.MergeStrategy.Overwrite),
|
|
54
|
+
(0, schematics_1.mergeWith)((0, schematics_1.apply)(syncEntityTemplates, [
|
|
55
|
+
(0, schematics_1.template)({
|
|
56
|
+
...core_1.strings,
|
|
57
|
+
...options,
|
|
58
|
+
...formattedProperties,
|
|
59
|
+
currentStoreIndex
|
|
60
|
+
}),
|
|
61
|
+
(0, schematics_1.renameTemplateFiles)(),
|
|
62
|
+
(0, schematics_1.move)(`${destination}/${core_1.strings.dasherize(options.storeName)}`)
|
|
63
|
+
]), schematics_1.MergeStrategy.Overwrite)
|
|
64
|
+
];
|
|
63
65
|
if ((0, schematics_2.moduleHasSubEntryPoints)(tree, destination)) {
|
|
64
66
|
(0, schematics_2.writeSubEntryPointPackageJson)(tree, destination, core_1.strings.dasherize(options.storeName));
|
|
65
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/store/simple-async/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAQL,IAAI,EAKL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/store/simple-async/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAQL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AAmFpC;;;GAGG;AACH,eAAO,MAAM,0BAA0B,wBAAqD,CAAC"}
|
|
@@ -36,26 +36,28 @@ function ngGenerateSimpleAsyncStoreFn(options) {
|
|
|
36
36
|
currentStoreIndex = currentStoreIndexBuffer ? currentStoreIndexBuffer.toString() : '';
|
|
37
37
|
tree.delete(barrelPath);
|
|
38
38
|
}
|
|
39
|
-
const rules = [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
(0, schematics_1.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
39
|
+
const rules = [
|
|
40
|
+
(0, schematics_1.mergeWith)((0, schematics_1.apply)(commonTemplates, [
|
|
41
|
+
(0, schematics_1.template)({
|
|
42
|
+
...core_1.strings,
|
|
43
|
+
...options,
|
|
44
|
+
...formattedProperties,
|
|
45
|
+
currentStoreIndex
|
|
46
|
+
}),
|
|
47
|
+
(0, schematics_1.renameTemplateFiles)(),
|
|
48
|
+
(0, schematics_1.move)(`${destination}/${core_1.strings.dasherize(options.storeName)}`)
|
|
49
|
+
]), schematics_1.MergeStrategy.Overwrite),
|
|
50
|
+
(0, schematics_1.mergeWith)((0, schematics_1.apply)(syncEntityTemplates, [
|
|
51
|
+
(0, schematics_1.template)({
|
|
52
|
+
...core_1.strings,
|
|
53
|
+
...options,
|
|
54
|
+
...formattedProperties,
|
|
55
|
+
currentStoreIndex
|
|
56
|
+
}),
|
|
57
|
+
(0, schematics_1.renameTemplateFiles)(),
|
|
58
|
+
(0, schematics_1.move)(`${destination}/${core_1.strings.dasherize(options.storeName)}`)
|
|
59
|
+
]), schematics_1.MergeStrategy.Overwrite)
|
|
60
|
+
];
|
|
59
61
|
if ((0, schematics_2.moduleHasSubEntryPoints)(tree, destination)) {
|
|
60
62
|
(0, schematics_2.writeSubEntryPointPackageJson)(tree, destination, core_1.strings.dasherize(options.storeName));
|
|
61
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/store/simple-sync/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAQL,IAAI,EAKL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/store/simple-sync/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAQL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AA8EpC,eAAO,MAAM,yBAAyB,wBAAoD,CAAC"}
|
|
@@ -31,26 +31,28 @@ function ngGenerateSimpleSyncStoreFn(options) {
|
|
|
31
31
|
currentStoreIndex = currentStoreIndexBuffer ? currentStoreIndexBuffer.toString() : '';
|
|
32
32
|
tree.delete(barrelPath);
|
|
33
33
|
}
|
|
34
|
-
const rules = [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
(0, schematics_1.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
34
|
+
const rules = [
|
|
35
|
+
(0, schematics_1.mergeWith)((0, schematics_1.apply)(commonTemplates, [
|
|
36
|
+
(0, schematics_1.template)({
|
|
37
|
+
...core_1.strings,
|
|
38
|
+
...options,
|
|
39
|
+
...formattedProperties,
|
|
40
|
+
currentStoreIndex
|
|
41
|
+
}),
|
|
42
|
+
(0, schematics_1.renameTemplateFiles)(),
|
|
43
|
+
(0, schematics_1.move)(`${destination}/${core_1.strings.dasherize(options.storeName)}`)
|
|
44
|
+
]), schematics_1.MergeStrategy.Overwrite),
|
|
45
|
+
(0, schematics_1.mergeWith)((0, schematics_1.apply)(syncEntityTemplates, [
|
|
46
|
+
(0, schematics_1.template)({
|
|
47
|
+
...core_1.strings,
|
|
48
|
+
...options,
|
|
49
|
+
...formattedProperties,
|
|
50
|
+
currentStoreIndex
|
|
51
|
+
}),
|
|
52
|
+
(0, schematics_1.renameTemplateFiles)(),
|
|
53
|
+
(0, schematics_1.move)(`${destination}/${core_1.strings.dasherize(options.storeName)}`)
|
|
54
|
+
]), schematics_1.MergeStrategy.Overwrite)
|
|
55
|
+
];
|
|
54
56
|
if ((0, schematics_2.moduleHasSubEntryPoints)(tree, destination)) {
|
|
55
57
|
(0, schematics_2.writeSubEntryPointPackageJson)(tree, destination, core_1.strings.dasherize(options.storeName));
|
|
56
58
|
}
|