@o3r/schematics 10.3.0 → 10.3.6
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +5 -5
- package/src/utility/index.d.ts +1 -0
- package/src/utility/index.d.ts.map +1 -1
- package/src/utility/index.js +1 -0
- package/src/utility/index.js.map +1 -1
- package/src/utility/migration/migration.d.ts +32 -0
- package/src/utility/migration/migration.d.ts.map +1 -0
- package/src/utility/migration/migration.js +35 -0
- package/src/utility/migration/migration.js.map +1 -0
- package/src/utility/monorepo.js +1 -1
- package/src/utility/monorepo.js.map +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@o3r/schematics",
|
3
|
-
"version": "10.3.
|
3
|
+
"version": "10.3.6",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -30,7 +30,7 @@
|
|
30
30
|
"@angular-devkit/core": "~17.3.0",
|
31
31
|
"@angular-devkit/schematics": "~17.3.0",
|
32
32
|
"@angular/cli": "~17.3.0",
|
33
|
-
"@o3r/telemetry": "^10.3.
|
33
|
+
"@o3r/telemetry": "^10.3.6",
|
34
34
|
"@schematics/angular": "~17.3.0",
|
35
35
|
"eslint": "^8.42.0",
|
36
36
|
"rxjs": "^7.8.1",
|
@@ -82,9 +82,9 @@
|
|
82
82
|
"@nx/eslint-plugin": "~18.3.0",
|
83
83
|
"@nx/jest": "~18.3.0",
|
84
84
|
"@nx/js": "~18.3.0",
|
85
|
-
"@o3r/build-helpers": "^10.3.
|
86
|
-
"@o3r/eslint-plugin": "^10.3.
|
87
|
-
"@o3r/telemetry": "^10.3.
|
85
|
+
"@o3r/build-helpers": "^10.3.6",
|
86
|
+
"@o3r/eslint-plugin": "^10.3.6",
|
87
|
+
"@o3r/telemetry": "^10.3.6",
|
88
88
|
"@schematics/angular": "~17.3.0",
|
89
89
|
"@stylistic/eslint-plugin-ts": "^1.5.4",
|
90
90
|
"@types/inquirer": "~8.2.10",
|
package/src/utility/index.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utility/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utility/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,uBAAuB,CAAC"}
|
package/src/utility/index.js
CHANGED
@@ -25,4 +25,5 @@ tslib_1.__exportStar(require("./update-imports"), exports);
|
|
25
25
|
tslib_1.__exportStar(require("./update-pipes"), exports);
|
26
26
|
tslib_1.__exportStar(require("./builder"), exports);
|
27
27
|
tslib_1.__exportStar(require("./wrapper"), exports);
|
28
|
+
tslib_1.__exportStar(require("./migration/migration"), exports);
|
28
29
|
//# sourceMappingURL=index.js.map
|
package/src/utility/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utility/index.ts"],"names":[],"mappings":";;;AAAA,gDAAsB;AACtB,uDAA6B;AAC7B,sDAA4B;AAC5B,yDAA+B;AAC/B,wDAA8B;AAC9B,kDAAwB;AACxB,sDAA4B;AAC5B,uDAA6B;AAC7B,sDAA4B;AAC5B,oDAA0B;AAC1B,iDAAuB;AACvB,2DAAiC;AACjC,oDAA0B;AAC1B,qDAA2B;AAC3B,mEAAyC;AACzC,4DAAkC;AAClC,qDAA2B;AAC3B,mDAAyB;AACzB,sDAA4B;AAC5B,qEAA2C;AAC3C,2DAAiC;AACjC,yDAA+B;AAC/B,oDAA0B;AAC1B,oDAA0B"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utility/index.ts"],"names":[],"mappings":";;;AAAA,gDAAsB;AACtB,uDAA6B;AAC7B,sDAA4B;AAC5B,yDAA+B;AAC/B,wDAA8B;AAC9B,kDAAwB;AACxB,sDAA4B;AAC5B,uDAA6B;AAC7B,sDAA4B;AAC5B,oDAA0B;AAC1B,iDAAuB;AACvB,2DAAiC;AACjC,oDAA0B;AAC1B,qDAA2B;AAC3B,mEAAyC;AACzC,4DAAkC;AAClC,qDAA2B;AAC3B,mDAAyB;AACzB,sDAA4B;AAC5B,qEAA2C;AAC3C,2DAAiC;AACjC,yDAA+B;AAC/B,oDAA0B;AAC1B,oDAA0B;AAC1B,gEAAsC"}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import type { LoggerApi } from '@angular-devkit/core/src/logger';
|
2
|
+
import { type Rule } from '@angular-devkit/schematics';
|
3
|
+
/** Create the migration */
|
4
|
+
interface MigrateRuleRunnerOptions {
|
5
|
+
/** The original version from which to execute the rules */
|
6
|
+
from: string;
|
7
|
+
/**
|
8
|
+
* The last version for which to execute the rule.
|
9
|
+
* If not specified, all the versions from the "from" parameter will be considered.
|
10
|
+
*/
|
11
|
+
to?: string;
|
12
|
+
}
|
13
|
+
/** Mapping of rules to apply to its specific range */
|
14
|
+
export interface MigrationRulesMap {
|
15
|
+
/** Rules to apply to a specific semver range */
|
16
|
+
[range: string]: Rule | Rule[];
|
17
|
+
}
|
18
|
+
/**
|
19
|
+
* Option for migration rule runner factory
|
20
|
+
*/
|
21
|
+
interface MigrationRuleRunnerOptions {
|
22
|
+
/** Logger */
|
23
|
+
logger?: LoggerApi;
|
24
|
+
}
|
25
|
+
/**
|
26
|
+
* Generate the Migration Rule Schematic runner to execute rules according to the range
|
27
|
+
* @param rulesMapping Mapping of rules to execute based on its semver range
|
28
|
+
* @param options Additional options
|
29
|
+
*/
|
30
|
+
export declare function getMigrationRuleRunner(rulesMapping: MigrationRulesMap, options?: MigrationRuleRunnerOptions): (config: MigrateRuleRunnerOptions) => Rule;
|
31
|
+
export {};
|
32
|
+
//# sourceMappingURL=migration.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../../../src/utility/migration/migration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAS,KAAK,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAG9D,4BAA4B;AAC5B,UAAU,wBAAwB;IAChC,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,sDAAsD;AACtD,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC;CAChC;AAED;;GAEG;AACH,UAAU,0BAA0B;IAClC,aAAa;IACb,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,0BAA0B,YAgB1F,wBAAwB,KAAG,IAAI,CAQhD"}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getMigrationRuleRunner = void 0;
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
5
|
+
const semver_1 = require("semver");
|
6
|
+
/**
|
7
|
+
* Generate the Migration Rule Schematic runner to execute rules according to the range
|
8
|
+
* @param rulesMapping Mapping of rules to execute based on its semver range
|
9
|
+
* @param options Additional options
|
10
|
+
*/
|
11
|
+
function getMigrationRuleRunner(rulesMapping, options) {
|
12
|
+
const rangeMapping = Object.entries(rulesMapping)
|
13
|
+
.reduce((acc, [range, rule]) => {
|
14
|
+
const checkedRange = (0, semver_1.validRange)(range);
|
15
|
+
if (!checkedRange) {
|
16
|
+
options?.logger?.warn(`The range "${range}" is invalid and will be ignored in the Migration rule`);
|
17
|
+
}
|
18
|
+
else {
|
19
|
+
acc.push([checkedRange, Array.isArray(rule) ? rule : [rule]]);
|
20
|
+
}
|
21
|
+
return acc;
|
22
|
+
}, []);
|
23
|
+
/**
|
24
|
+
* Migration rule runner
|
25
|
+
* @param config Provide information regarding the range to match
|
26
|
+
*/
|
27
|
+
return (config) => {
|
28
|
+
const fromToRange = new semver_1.Range(config.to ? `>${config.from} <=${config.to}` : `>${config.from}`);
|
29
|
+
return (0, schematics_1.chain)(rangeMapping
|
30
|
+
.filter(([range]) => (0, semver_1.intersects)(range, fromToRange))
|
31
|
+
.map(([_, rules]) => (0, schematics_1.chain)(rules)));
|
32
|
+
};
|
33
|
+
}
|
34
|
+
exports.getMigrationRuleRunner = getMigrationRuleRunner;
|
35
|
+
//# sourceMappingURL=migration.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migration.js","sourceRoot":"","sources":["../../../../src/utility/migration/migration.ts"],"names":[],"mappings":";;;AACA,2DAA8D;AAC9D,mCAAuD;AA4BvD;;;;GAIG;AACH,SAAgB,sBAAsB,CAAC,YAA+B,EAAE,OAAoC;IAC1G,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC;SAC9C,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE;QAC7B,MAAM,YAAY,GAAG,IAAA,mBAAU,EAAC,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,cAAc,KAAK,wDAAwD,CAAC,CAAC;QACrG,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAwB,CAAC,CAAC;IAE/B;;;OAGG;IACH,OAAO,CAAC,MAAgC,EAAQ,EAAE;QAChD,MAAM,WAAW,GAAG,IAAI,cAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,MAAM,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAChG,OAAO,IAAA,kBAAK,EACV,YAAY;aACT,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAA,mBAAU,EAAC,KAAK,EAAE,WAAW,CAAC,CAAC;aACnD,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,IAAA,kBAAK,EAAC,KAAK,CAAC,CAAC,CACrC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAxBD,wDAwBC"}
|
package/src/utility/monorepo.js
CHANGED
@@ -42,7 +42,7 @@ exports.isStandaloneRepository = isStandaloneRepository;
|
|
42
42
|
* @param tree
|
43
43
|
*/
|
44
44
|
function isMultipackagesContext(tree) {
|
45
|
-
return !!tree.readJson('/package.json').
|
45
|
+
return !!tree.readJson('/package.json').workspaces;
|
46
46
|
}
|
47
47
|
exports.isMultipackagesContext = isMultipackagesContext;
|
48
48
|
/** Default name of the folder where libraries will be generated inside monorepo */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"monorepo.js","sourceRoot":"","sources":["../../../src/utility/monorepo.ts"],"names":[],"mappings":";;;AACA,kCAAkC;AAElC,6CAAmD;AAEnD,uCAA+C;AAE/C;;;;;;GAMG;AACH,SAAgB,0BAA0B,CAAC,IAAU,EAAE,KAAe,EAAE,UAAkB;IACxF,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IAChE,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,SAAS,EAAE,CAAC,CAAC;AAC1D,CAAC;AAPD,gEAOC;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