@o3r/apis-manager 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/apis-manager",
|
|
3
|
-
"version": "10.2.0-prerelease.
|
|
3
|
+
"version": "10.2.0-prerelease.15",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"otter-module"
|
|
12
12
|
],
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@ama-sdk/core": "^10.2.0-prerelease.
|
|
14
|
+
"@ama-sdk/core": "^10.2.0-prerelease.15",
|
|
15
15
|
"@angular-devkit/schematics": "~17.2.0",
|
|
16
16
|
"@angular/common": "~17.2.0",
|
|
17
17
|
"@angular/core": "~17.2.0",
|
|
18
|
-
"@o3r/schematics": "^10.2.0-prerelease.
|
|
18
|
+
"@o3r/schematics": "^10.2.0-prerelease.15",
|
|
19
19
|
"@schematics/angular": "~17.2.0",
|
|
20
20
|
"rxjs": "^7.8.1",
|
|
21
21
|
"typescript": "~5.3.3"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAiDtD;;;GAGG;AACH,eAAO,MAAM,KAAK,YAAa,qBAAqB,KAAG,IAGtD,CAAC"}
|
|
@@ -2,56 +2,57 @@
|
|
|
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");
|
|
6
|
+
const reportMissingSchematicsDep = (logger) => (reason) => {
|
|
7
|
+
logger.error(`[ERROR]: Adding @o3r/apis-manager has failed.
|
|
8
|
+
You need to install '@o3r/schematics' to be able to use the o3r apis-manager package. Please run 'ng add @o3r/schematics'.`);
|
|
9
|
+
throw reason;
|
|
10
|
+
};
|
|
7
11
|
/**
|
|
8
12
|
* Add Otter apis manager to an Angular Project
|
|
9
13
|
* @param options
|
|
10
14
|
*/
|
|
11
15
|
function ngAddFn(options) {
|
|
12
|
-
return async (tree
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
|
|
25
|
-
acc[dep] = {
|
|
26
|
-
inManifest: [{
|
|
27
|
-
range: `${options.exactO3rVersion ? '' : '~'}${depsInfo.packageVersion}`,
|
|
28
|
-
types: getProjectNewDependenciesTypes(workspaceProject)
|
|
29
|
-
}],
|
|
30
|
-
ngAddOptions: { exactO3rVersion: options.exactO3rVersion }
|
|
31
|
-
};
|
|
32
|
-
return acc;
|
|
33
|
-
}, (0, schematics_2.getPackageInstallConfig)(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
|
|
34
|
-
return () => (0, schematics_1.chain)([
|
|
35
|
-
...rulesToExecute,
|
|
36
|
-
options.skipLinter ? schematics_1.noop : applyEsLintFix(),
|
|
37
|
-
setupDependencies({
|
|
38
|
-
projectName: options.projectName,
|
|
39
|
-
dependencies,
|
|
40
|
-
ngAddToRun: depsInfo.o3rPeerDeps
|
|
41
|
-
})
|
|
42
|
-
])(tree, context);
|
|
43
|
-
}
|
|
44
|
-
catch (e) {
|
|
45
|
-
// o3r apis-manager needs o3r/schematics as peer dep.
|
|
46
|
-
context.logger.error(`[ERROR]: Adding @o3r/apis-manager has failed.
|
|
47
|
-
You need to install '@o3r/schematics' to be able to use the o3r apis-manager package. Please run 'ng add @o3r/schematics' .`);
|
|
48
|
-
throw (e);
|
|
16
|
+
return async (tree) => {
|
|
17
|
+
const { getPackageInstallConfig } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
18
|
+
const { setupDependencies, getO3rPeerDeps, applyEsLintFix, getWorkspaceConfig, getProjectNewDependenciesTypes } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
19
|
+
const { updateApiDependencies } = await Promise.resolve().then(() => require('../helpers/update-api-deps'));
|
|
20
|
+
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
|
21
|
+
const depsInfo = getO3rPeerDeps(packageJsonPath);
|
|
22
|
+
const rulesToExecute = [];
|
|
23
|
+
const workspaceProject = options.projectName ? getWorkspaceConfig(tree)?.projects[options.projectName] : undefined;
|
|
24
|
+
const projectType = workspaceProject?.projectType || 'application';
|
|
25
|
+
if (projectType === 'application') {
|
|
26
|
+
rulesToExecute.push(updateApiDependencies(options));
|
|
49
27
|
}
|
|
28
|
+
const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
|
|
29
|
+
acc[dep] = {
|
|
30
|
+
inManifest: [{
|
|
31
|
+
range: `${options.exactO3rVersion ? '' : '~'}${depsInfo.packageVersion}`,
|
|
32
|
+
types: getProjectNewDependenciesTypes(workspaceProject)
|
|
33
|
+
}],
|
|
34
|
+
ngAddOptions: { exactO3rVersion: options.exactO3rVersion }
|
|
35
|
+
};
|
|
36
|
+
return acc;
|
|
37
|
+
}, getPackageInstallConfig(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
|
|
38
|
+
return () => (0, schematics_1.chain)([
|
|
39
|
+
...rulesToExecute,
|
|
40
|
+
options.skipLinter ? schematics_1.noop : applyEsLintFix(),
|
|
41
|
+
setupDependencies({
|
|
42
|
+
projectName: options.projectName,
|
|
43
|
+
dependencies,
|
|
44
|
+
ngAddToRun: depsInfo.o3rPeerDeps
|
|
45
|
+
})
|
|
46
|
+
]);
|
|
50
47
|
};
|
|
51
48
|
}
|
|
52
49
|
/**
|
|
53
50
|
* Add Otter apis manager to an Angular Project
|
|
54
51
|
* @param options
|
|
55
52
|
*/
|
|
56
|
-
|
|
53
|
+
const ngAdd = (options) => async (_, { logger }) => {
|
|
54
|
+
const { createSchematicWithMetricsIfInstalled } = await Promise.resolve().then(() => require('@o3r/schematics')).catch(reportMissingSchematicsDep(logger));
|
|
55
|
+
return createSchematicWithMetricsIfInstalled(ngAddFn)(options);
|
|
56
|
+
};
|
|
57
|
+
exports.ngAdd = ngAdd;
|
|
57
58
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,2DAAoE;AACpE,kCAAkC;AAGlC,MAAM,0BAA0B,GAAG,CAAC,MAA2C,EAAE,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE;IAClG,MAAM,CAAC,KAAK,CAAC;2HAC4G,CAAC,CAAC;IAC3H,MAAM,MAAM,CAAC;AACf,CAAC,CAAC;AAEF;;;GAGG;AACH,SAAS,OAAO,CAAC,OAA8B;IAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,EAAE;QACpB,MAAM,EAAE,uBAAuB,EAAE,GAAG,2CAAa,iBAAiB,EAAC,CAAC;QACpE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,8BAA8B,EAAE,GAAG,2CAAa,iBAAiB,EAAC,CAAC;QAClJ,MAAM,EAA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