@o3r/store-sync 10.2.0-prerelease.13 → 10.2.0-prerelease.15
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/store-sync",
|
|
3
|
-
"version": "10.2.0-prerelease.
|
|
3
|
+
"version": "10.2.0-prerelease.15",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
"otter-module"
|
|
14
14
|
],
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"@ama-sdk/core": "^10.2.0-prerelease.
|
|
16
|
+
"@ama-sdk/core": "^10.2.0-prerelease.15",
|
|
17
17
|
"@angular-devkit/core": "~17.2.0",
|
|
18
18
|
"@angular-devkit/schematics": "~17.2.0",
|
|
19
19
|
"@ngrx/entity": "~17.1.0",
|
|
20
20
|
"@ngrx/store": "~17.1.0",
|
|
21
|
-
"@o3r/core": "^10.2.0-prerelease.
|
|
22
|
-
"@o3r/logger": "^10.2.0-prerelease.
|
|
23
|
-
"@o3r/schematics": "^10.2.0-prerelease.
|
|
21
|
+
"@o3r/core": "^10.2.0-prerelease.15",
|
|
22
|
+
"@o3r/logger": "^10.2.0-prerelease.15",
|
|
23
|
+
"@o3r/schematics": "^10.2.0-prerelease.15",
|
|
24
24
|
"fast-deep-equal": "^3.1.3",
|
|
25
25
|
"rxjs": "^7.8.1"
|
|
26
26
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAsEtD;;;GAGG;AACH,eAAO,MAAM,KAAK,YAAa,qBAAqB,KAAG,IAGtD,CAAC"}
|
|
@@ -2,66 +2,66 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ngAdd = void 0;
|
|
4
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
-
const schematics_2 = require("@o3r/schematics");
|
|
6
5
|
const path = require("node:path");
|
|
7
6
|
const dependencies_1 = require("@schematics/angular/utility/dependencies");
|
|
8
7
|
const devDependenciesToInstall = [
|
|
9
8
|
'fast-deep-equal'
|
|
10
9
|
];
|
|
10
|
+
const reportMissingSchematicsDep = (logger) => (reason) => {
|
|
11
|
+
logger.error(`[ERROR]: Adding store-sync has failed.
|
|
12
|
+
If the error is related to missing @o3r dependencies you need to install '@o3r/core' to be able to use the store-sync package. Please run 'ng add @o3r/core' .
|
|
13
|
+
Otherwise, use the error message as guidance.`);
|
|
14
|
+
throw reason;
|
|
15
|
+
};
|
|
11
16
|
/**
|
|
12
17
|
* Add Otter store-sync to an Otter Project
|
|
13
18
|
* @param options
|
|
14
19
|
*/
|
|
15
20
|
function ngAddFn(options) {
|
|
16
|
-
return async (tree
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
]);
|
|
52
|
-
}
|
|
53
|
-
catch (e) {
|
|
54
|
-
// If the installation is initialized in a non-Otter application, mandatory packages will be missing. We need to notify the user
|
|
55
|
-
context.logger.error(`[ERROR]: Adding store-sync has failed.
|
|
56
|
-
If the error is related to missing @o3r dependencies you need to install '@o3r/core' to be able to use the store-sync package. Please run 'ng add @o3r/core' .
|
|
57
|
-
Otherwise, use the error message as guidance.`);
|
|
58
|
-
throw (e);
|
|
59
|
-
}
|
|
21
|
+
return async (tree) => {
|
|
22
|
+
// use dynamic import to properly raise an exception if it is not an Otter project.
|
|
23
|
+
const { getPackageInstallConfig, applyEsLintFix, setupDependencies, getO3rPeerDeps, getProjectNewDependenciesTypes, getWorkspaceConfig, getExternalDependenciesVersionRange } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
24
|
+
const workspaceProject = options.projectName ? getWorkspaceConfig(tree)?.projects[options.projectName] : undefined;
|
|
25
|
+
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
|
26
|
+
const depsInfo = getO3rPeerDeps(packageJsonPath);
|
|
27
|
+
const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
|
|
28
|
+
acc[dep] = {
|
|
29
|
+
inManifest: [{
|
|
30
|
+
range: `${options.exactO3rVersion ? '' : '~'}${depsInfo.packageVersion}`,
|
|
31
|
+
types: getProjectNewDependenciesTypes(workspaceProject)
|
|
32
|
+
}],
|
|
33
|
+
ngAddOptions: { exactO3rVersion: options.exactO3rVersion }
|
|
34
|
+
};
|
|
35
|
+
return acc;
|
|
36
|
+
}, getPackageInstallConfig(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
|
|
37
|
+
Object.entries(getExternalDependenciesVersionRange(devDependenciesToInstall, packageJsonPath))
|
|
38
|
+
.forEach(([dep, range]) => {
|
|
39
|
+
dependencies[dep] = {
|
|
40
|
+
inManifest: [{
|
|
41
|
+
range,
|
|
42
|
+
types: [dependencies_1.NodeDependencyType.Dev]
|
|
43
|
+
}]
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
return (0, schematics_1.chain)([
|
|
47
|
+
// optional custom action dedicated to this module
|
|
48
|
+
options.skipLinter ? (0, schematics_1.noop)() : applyEsLintFix(),
|
|
49
|
+
// add the missing Otter modules in the current project
|
|
50
|
+
setupDependencies({
|
|
51
|
+
projectName: options.projectName,
|
|
52
|
+
dependencies,
|
|
53
|
+
ngAddToRun: depsInfo.o3rPeerDeps
|
|
54
|
+
})
|
|
55
|
+
]);
|
|
60
56
|
};
|
|
61
57
|
}
|
|
62
58
|
/**
|
|
63
59
|
* Add Otter store-sync to an Otter Project
|
|
64
60
|
* @param options
|
|
65
61
|
*/
|
|
66
|
-
|
|
62
|
+
const ngAdd = (options) => async (_, { logger }) => {
|
|
63
|
+
const { createSchematicWithMetricsIfInstalled } = await Promise.resolve().then(() => require('@o3r/schematics')).catch(reportMissingSchematicsDep(logger));
|
|
64
|
+
return createSchematicWithMetricsIfInstalled(ngAddFn)(options);
|
|
65
|
+
};
|
|
66
|
+
exports.ngAdd = ngAdd;
|
|
67
67
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,2DAA+D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,2DAA+D;AAE/D,kCAAkC;AAClC,2EAA8E;AAE9E,MAAM,wBAAwB,GAAG;IAC/B,iBAAiB;CAClB,CAAC;AAGF,MAAM,0BAA0B,GAAG,CAAC,MAA2C,EAAE,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE;IAClG,MAAM,CAAC,KAAK,CAAC;;8CAE+B,CAAC,CAAC;IAC9C,MAAM,MAAM,CAAC;AACf,CAAC,CAAC;AAEF;;;GAGG;AACH,SAAS,OAAO,CAAC,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