@o3r/schematics 11.6.0-prerelease.37 → 11.6.0-prerelease.39
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +12 -12
- package/src/rule-factories/ng-add/dependencies.d.ts +15 -0
- package/src/rule-factories/ng-add/dependencies.d.ts.map +1 -1
- package/src/rule-factories/ng-add/dependencies.js +13 -1
- package/src/rule-factories/ng-add/dependencies.js.map +1 -1
- package/src/utility/matching-peers.d.ts +3 -1
- package/src/utility/matching-peers.d.ts.map +1 -1
- package/src/utility/matching-peers.js +5 -3
- package/src/utility/matching-peers.js.map +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@o3r/schematics",
|
3
|
-
"version": "11.6.0-prerelease.
|
3
|
+
"version": "11.6.0-prerelease.39",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -26,16 +26,16 @@
|
|
26
26
|
"o3r-environment": "./cli/environment.js"
|
27
27
|
},
|
28
28
|
"peerDependencies": {
|
29
|
-
"@angular-devkit/architect": "
|
30
|
-
"@angular-devkit/core": "
|
31
|
-
"@angular-devkit/schematics": "
|
32
|
-
"@angular/cli": "
|
33
|
-
"@o3r/telemetry": "^11.6.0-prerelease.
|
34
|
-
"@schematics/angular": "
|
35
|
-
"eslint": "
|
29
|
+
"@angular-devkit/architect": "^0.1802.0",
|
30
|
+
"@angular-devkit/core": "^18.2.0",
|
31
|
+
"@angular-devkit/schematics": "^18.2.0",
|
32
|
+
"@angular/cli": "^18.2.0",
|
33
|
+
"@o3r/telemetry": "^11.6.0-prerelease.39",
|
34
|
+
"@schematics/angular": "^18.2.0",
|
35
|
+
"eslint": "^9.14.0",
|
36
36
|
"rxjs": "^7.8.1",
|
37
37
|
"type-fest": "^4.10.2",
|
38
|
-
"typescript": "
|
38
|
+
"typescript": "^5.5.4"
|
39
39
|
},
|
40
40
|
"peerDependenciesMeta": {
|
41
41
|
"@angular-devkit/architect": {
|
@@ -88,9 +88,9 @@
|
|
88
88
|
"@nx/eslint-plugin": "~19.5.0",
|
89
89
|
"@nx/jest": "~19.5.0",
|
90
90
|
"@nx/js": "~19.5.0",
|
91
|
-
"@o3r/build-helpers": "^11.6.0-prerelease.
|
92
|
-
"@o3r/eslint-plugin": "^11.6.0-prerelease.
|
93
|
-
"@o3r/telemetry": "^11.6.0-prerelease.
|
91
|
+
"@o3r/build-helpers": "^11.6.0-prerelease.39",
|
92
|
+
"@o3r/eslint-plugin": "^11.6.0-prerelease.39",
|
93
|
+
"@o3r/telemetry": "^11.6.0-prerelease.39",
|
94
94
|
"@schematics/angular": "~18.2.0",
|
95
95
|
"@stylistic/eslint-plugin": "~2.7.0",
|
96
96
|
"@types/inquirer": "~8.2.10",
|
@@ -34,6 +34,11 @@ export interface DependencyToAdd {
|
|
34
34
|
ngAddOptions?: NgAddSchematicOptions;
|
35
35
|
/** Determine if the dependency require to be installed */
|
36
36
|
requireInstall?: boolean;
|
37
|
+
/**
|
38
|
+
* Enforce the usage of tilde instead of caret in a dependency range
|
39
|
+
* If not specified, the context option value will be used
|
40
|
+
*/
|
41
|
+
enforceTildeRange?: boolean;
|
37
42
|
}
|
38
43
|
export interface SetupDependenciesOptions {
|
39
44
|
/** Map of dependencies to install */
|
@@ -61,6 +66,11 @@ export interface SetupDependenciesOptions {
|
|
61
66
|
scheduleTaskCallback?: (taskIds?: TaskId[]) => void;
|
62
67
|
/** Working directory for the installation process only */
|
63
68
|
workingDirectory?: string;
|
69
|
+
/**
|
70
|
+
* Enforce the usage of tilde instead of caret in a dependency range
|
71
|
+
* @default true
|
72
|
+
*/
|
73
|
+
enforceTildeRange?: boolean;
|
64
74
|
}
|
65
75
|
/** Result of the Setup Dependencies task scheduling process */
|
66
76
|
export interface SetupDependenciesResult {
|
@@ -84,6 +94,11 @@ export declare const hasSetupInformation: (context: SchematicContext) => context
|
|
84
94
|
* @param exactO3rVersion Use a pinned version of the o3r package
|
85
95
|
*/
|
86
96
|
export declare const getPackageInstallConfig: (packageJsonPath: string, tree: Tree, projectName?: string, devDependencyOnly?: boolean, exactO3rVersion?: boolean) => Record<string, DependencyToAdd>;
|
97
|
+
/**
|
98
|
+
* Replace the caret ranges by tilde ranges
|
99
|
+
* @param range Range to replace
|
100
|
+
*/
|
101
|
+
export declare const enforceTildeRange: (range?: string) => string | undefined;
|
87
102
|
/**
|
88
103
|
* Setup dependency to a repository.
|
89
104
|
* Will run manually the ngAdd schematics according to the parameters and install the packages if required
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/ng-add/dependencies.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,IAAI,EAEJ,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,IAAI,EACL,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EACL,kBAAkB,EACnB,MAAM,0CAA0C,CAAC;AAKlD,OAAO,KAAK,EACV,wBAAwB,EACzB,MAAM,eAAe,CAAC;AASvB;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,gCAAgC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iDAAiD;IACjD,UAAU,EAAE,oBAAoB,EAAE,CAAC;IACnC,uDAAuD;IACvD,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,0DAA0D;IAC1D,cAAc,CAAC,EAAE,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/ng-add/dependencies.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,IAAI,EAEJ,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,IAAI,EACL,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EACL,kBAAkB,EACnB,MAAM,0CAA0C,CAAC;AAKlD,OAAO,KAAK,EACV,wBAAwB,EACzB,MAAM,eAAe,CAAC;AASvB;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,gCAAgC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iDAAiD;IACjD,UAAU,EAAE,oBAAoB,EAAE,CAAC;IACnC,uDAAuD;IACvD,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,0DAA0D;IAC1D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACvC,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC9C;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACjC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,sCAAsC;IACtC,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C,2DAA2D;IAC3D,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,sDAAsD;IACtD,oBAAoB,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpD,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,+DAA+D;AAC/D,MAAM,WAAW,uBAAuB;IACtC,2DAA2D;IAC3D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,YAAa,gBAAgB,KAAG,OAAO,IAAI,gBAAgB,GAAG;IAAE,iBAAiB,EAAE,uBAAuB,CAAA;CAEzI,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,oBAAqB,MAAM,QAAQ,IAAI,gBAAgB,MAAM,sBAAsB,OAAO,oBAAoB,OAAO,KAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAiBzL,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,WAAY,MAAM,uBAE/C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,YAAa,wBAAwB,KAAG,IAwIrE,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.setupDependencies = exports.getPackageInstallConfig = exports.hasSetupInformation = void 0;
|
3
|
+
exports.setupDependencies = exports.enforceTildeRange = exports.getPackageInstallConfig = exports.hasSetupInformation = void 0;
|
4
4
|
const node_fs_1 = require("node:fs");
|
5
5
|
const path = require("node:path");
|
6
6
|
const schematics_1 = require("@angular-devkit/schematics");
|
@@ -44,6 +44,14 @@ const getPackageInstallConfig = (packageJsonPath, tree, projectName, devDependen
|
|
44
44
|
};
|
45
45
|
};
|
46
46
|
exports.getPackageInstallConfig = getPackageInstallConfig;
|
47
|
+
/**
|
48
|
+
* Replace the caret ranges by tilde ranges
|
49
|
+
* @param range Range to replace
|
50
|
+
*/
|
51
|
+
const enforceTildeRange = (range) => {
|
52
|
+
return range?.replace(/\^/g, '~');
|
53
|
+
};
|
54
|
+
exports.enforceTildeRange = enforceTildeRange;
|
47
55
|
/**
|
48
56
|
* Setup dependency to a repository.
|
49
57
|
* Will run manually the ngAdd schematics according to the parameters and install the packages if required
|
@@ -63,6 +71,10 @@ const setupDependencies = (options) => {
|
|
63
71
|
}
|
64
72
|
const packageJsonContent = tree.readJson(packageJsonPath);
|
65
73
|
dependency.inManifest.forEach(({ range, types }) => {
|
74
|
+
const isTildeRangeEnforced = dependency.enforceTildeRange === undefined ? (options.enforceTildeRange === undefined || options.enforceTildeRange) : dependency.enforceTildeRange;
|
75
|
+
if (isTildeRangeEnforced) {
|
76
|
+
range = (0, exports.enforceTildeRange)(range);
|
77
|
+
}
|
66
78
|
(types || [dependencies_1.NodeDependencyType.Default]).forEach((depType) => {
|
67
79
|
if (packageJsonContent[depType]?.[packageToInstall]) {
|
68
80
|
if (range && semver.validRange(range)) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../../src/rule-factories/ng-add/dependencies.ts"],"names":[],"mappings":";;;AAAA,qCAEiB;AACjB,kCAAkC;AAClC,2DAOoC;AACpC,4DAG0C;AAC1C,2EAEkD;AAClD,iCAAiC;AAOjC,mDAG+B;AAC/B,iFAE8C;
|
1
|
+
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../../src/rule-factories/ng-add/dependencies.ts"],"names":[],"mappings":";;;AAAA,qCAEiB;AACjB,kCAAkC;AAClC,2DAOoC;AACpC,4D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EAAE,CAAC,CAAC,CAAC,CAAC;YAE/D,IAAI,IAAA,2BAAmB,EAAC,OAAO,CAAC,EAAE,CAAC;gBACjC,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;YAC1D,CAAC;iBAAM,CAAC;gBACL,OAAe,CAAC,iBAAiB,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;YACjE,CAAC;YAED,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;gBACjC,OAAO,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC,CAAC;QAEF,OAAO,IAAA,kBAAK,EAAC;YACX,eAAe;YACf,kBAAkB;SACnB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,CAAC;AAxIW,QAAA,iBAAiB,qBAwI5B"}
|
@@ -1,9 +1,11 @@
|
|
1
|
+
import * as fs from 'node:fs';
|
1
2
|
/**
|
2
3
|
* Retrieve the peer dependencies with the given pattern from the given package json file
|
3
4
|
* @param packageJsonPath
|
4
5
|
* @param pattern
|
6
|
+
* @param readFileSync
|
5
7
|
*/
|
6
|
-
export declare function getPeerDepWithPattern(packageJsonPath: string, pattern?: RegExp | string[]): {
|
8
|
+
export declare function getPeerDepWithPattern(packageJsonPath: string, pattern?: RegExp | string[], readFileSync?: typeof fs.readFileSync): {
|
7
9
|
packageName: string | undefined;
|
8
10
|
packageVersion: string | undefined;
|
9
11
|
matchingPackages: string[];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"matching-peers.d.ts","sourceRoot":"","sources":["../../../src/utility/matching-peers.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"matching-peers.d.ts","sourceRoot":"","sources":["../../../src/utility/matching-peers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAK9B;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,GAAE,MAAM,GAAG,MAAM,EAA4B,EAAE,YAAY,yBAAkB;;;;;;;EAgBlJ;AASD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,eAAe,EAAE,MAAM,EAAE,YAAY,UAAO,EAAE,cAAc,SAAsB,EAAE,kBAAkB,SAAK;;;;EASzI;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,cAAc,SAAsB;;;;EAYhG"}
|
@@ -8,16 +8,18 @@ const fs = require("node:fs");
|
|
8
8
|
* Retrieve the peer dependencies with the given pattern from the given package json file
|
9
9
|
* @param packageJsonPath
|
10
10
|
* @param pattern
|
11
|
+
* @param readFileSync
|
11
12
|
*/
|
12
|
-
function getPeerDepWithPattern(packageJsonPath, pattern = /^@(otter|o3r|ama-sdk)
|
13
|
-
const packageJsonContent = JSON.parse(
|
13
|
+
function getPeerDepWithPattern(packageJsonPath, pattern = /^@(otter|o3r|ama-sdk)/, readFileSync = fs.readFileSync) {
|
14
|
+
const packageJsonContent = JSON.parse(readFileSync(packageJsonPath, { encoding: 'utf8' }));
|
14
15
|
const packageName = packageJsonContent.name;
|
15
16
|
const packageVersion = packageJsonContent.version;
|
16
17
|
const optionalPackages = Object.entries(packageJsonContent.peerDependenciesMeta || {})
|
17
18
|
.filter(([, dep]) => dep?.optional)
|
18
19
|
.map(([depName]) => depName);
|
19
20
|
const matchingPackagesVersions = Object.fromEntries(Object.entries(packageJsonContent.peerDependencies || {})
|
20
|
-
.filter(([peerDep]) => (Array.isArray(pattern) ? pattern.includes(peerDep) : pattern.test(peerDep)) && !optionalPackages.includes(peerDep))
|
21
|
+
.filter(([peerDep]) => (Array.isArray(pattern) ? pattern.includes(peerDep) : pattern.test(peerDep)) && !optionalPackages.includes(peerDep))
|
22
|
+
.map(([peerDep, range]) => ([peerDep, packageJsonContent.generatorDependencies?.[peerDep] || range])));
|
21
23
|
const matchingPackages = Object.keys(matchingPackagesVersions);
|
22
24
|
return { packageName, packageVersion, matchingPackages, matchingPackagesVersions };
|
23
25
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"matching-peers.js","sourceRoot":"","sources":["../../../src/utility/matching-peers.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"matching-peers.js","sourceRoot":"","sources":["../../../src/utility/matching-peers.ts"],"names":[],"mappings":";;AAWA,sDAgBC;AAgBD,wCASC;AAOD,kDAYC;AAvED,8BAA8B;AAK9B;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,eAAuB,EAAE,UAA6B,uBAAuB,EAAE,YAAY,GAAG,EAAE,CAAC,YAAY;IACjJ,MAAM,kBAAkB,GAAqE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IAC7J,MAAM,WAAW,GAAG,kBAAkB,CAAC,IAAI,CAAC;IAC5C,MAAM,cAAc,GAAG,kBAAkB,CAAC,OAAO,CAAC;IAClD,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,oBAAoB,IAAI,EAAE,CAAC;SACnF,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC;SAClC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC;IAE/B,MAAM,wBAAwB,GAAG,MAAM,CAAC,WAAW,CACjD,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,gBAAgB,IAAI,EAAE,CAAC;SACtD,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI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