@ama-sdk/schematics 10.3.0 → 10.3.6
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/README.md +12 -0
- package/collection.json +5 -0
- package/migration.json +5 -0
- package/package.json +8 -8
- package/schematics/helpers/is-typescript-project.d.ts +8 -0
- package/schematics/helpers/is-typescript-project.d.ts.map +1 -0
- package/schematics/helpers/is-typescript-project.js +15 -0
- package/schematics/helpers/is-typescript-project.js.map +1 -0
- package/schematics/java/client-core/swagger-codegen-java-client/target/javaClient-swagger-codegen-tests.jar +0 -0
- package/schematics/java/client-core/swagger-codegen-java-client/target/javaClient-swagger-codegen.jar +0 -0
- package/schematics/migrate/index.d.ts +8 -0
- package/schematics/migrate/index.d.ts.map +1 -0
- package/schematics/migrate/index.js +41 -0
- package/schematics/migrate/index.js.map +1 -0
- package/schematics/migrate/schema.d.ts +10 -0
- package/schematics/migrate/schema.d.ts.map +1 -0
- package/schematics/migrate/schema.js +3 -0
- package/schematics/migrate/schema.js.map +1 -0
- package/schematics/migrate/schema.json +28 -0
- package/schematics/ng-update/index.d.ts +1 -1
- package/schematics/ng-update/index.d.ts.map +1 -1
- package/schematics/ng-update/index.js +2 -8
- package/schematics/ng-update/index.js.map +1 -1
- package/schematics/ng-update/typescript/index.d.ts +4 -0
- package/schematics/ng-update/typescript/index.d.ts.map +1 -1
- package/schematics/ng-update/typescript/index.js +12 -1
- package/schematics/ng-update/typescript/index.js.map +1 -1
- package/schematics/ng-update/typescript/v10.3/update-openapiversion.d.ts +6 -0
- package/schematics/ng-update/typescript/v10.3/update-openapiversion.d.ts.map +1 -0
- package/schematics/ng-update/typescript/v10.3/update-openapiversion.js +71 -0
- package/schematics/ng-update/typescript/v10.3/update-openapiversion.js.map +1 -0
- package/schematics/typescript/core/openapi-codegen-typescript/target/typescriptFetch-openapi-generator-tests.jar +0 -0
- package/schematics/typescript/core/openapi-codegen-typescript/target/typescriptFetch-openapi-generator.jar +0 -0
- package/schematics/typescript/shell/templates/base/package.json.template +2 -1
package/README.md
CHANGED
|
@@ -242,6 +242,18 @@ yarn schematics @ama-sdk/schematics:typescript-core --generator-key example-sdk
|
|
|
242
242
|
> The values provided by the parameter `--global-property` will actually be merged with the values of `globalProperty` from
|
|
243
243
|
> `openapitools.json` (rather than override them like the other properties).
|
|
244
244
|
|
|
245
|
+
### Migration
|
|
246
|
+
|
|
247
|
+
To help to apply changes on the Shell part of the SDK repository, a `migrate` schematic is exposed:
|
|
248
|
+
|
|
249
|
+
```shell
|
|
250
|
+
yarn schematics @ama-sdk/schematics:migrate --from 10.0.0 [--to 11.0.0]
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
> [!NOTE]
|
|
254
|
+
> - The `--from` parameter is mandatory to provide the version of the original `@ama-sdk/schematics` package from which the rules should be run.
|
|
255
|
+
> - The *optional* `--to` parameter allows to indicate a version until which the rules should be run. The current installed version will be used if not provided.
|
|
256
|
+
|
|
245
257
|
### Debug
|
|
246
258
|
|
|
247
259
|
The OpenApi generator extracts an enhanced JSON data model from the specification YAML and uses this data model to feed the templates to generate the code.
|
package/collection.json
CHANGED
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
"schema": "./schematics/ng-add/schema.json",
|
|
8
8
|
"aliases": ["install", "i"]
|
|
9
9
|
},
|
|
10
|
+
"migrate": {
|
|
11
|
+
"description": "Execute migration scripts between 2 versions.",
|
|
12
|
+
"factory": "./schematics/migrate/index#migrate",
|
|
13
|
+
"schema": "./schematics/migrate/schema.json"
|
|
14
|
+
},
|
|
10
15
|
"typescript-mock": {
|
|
11
16
|
"description": "Generate an api mock into the project.",
|
|
12
17
|
"factory": "./schematics/typescript/mock/index#ngGenerateMock",
|
package/migration.json
CHANGED
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
"version": "10.0.0-alpha.0",
|
|
6
6
|
"description": "Updates of @ama-sdk/schematics to v10.0.*",
|
|
7
7
|
"factory": "./schematics/ng-update/index#updateV10_0"
|
|
8
|
+
},
|
|
9
|
+
"migration-v10_3": {
|
|
10
|
+
"version": "10.3.0-alpha.0",
|
|
11
|
+
"description": "Updates of @ama-sdk/schematics to v10.3.*",
|
|
12
|
+
"factory": "./schematics/ng-update/index#updateV10_3"
|
|
8
13
|
}
|
|
9
14
|
}
|
|
10
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ama-sdk/schematics",
|
|
3
|
-
"version": "10.3.
|
|
3
|
+
"version": "10.3.6",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@ama-sdk/core": "^10.3.
|
|
51
|
+
"@ama-sdk/core": "^10.3.6",
|
|
52
52
|
"@angular-devkit/core": "~17.3.0",
|
|
53
53
|
"@angular-devkit/schematics": "~17.3.0",
|
|
54
54
|
"@angular-devkit/schematics-cli": "^17.0.1",
|
|
55
55
|
"@angular/cli": "^17.0.1",
|
|
56
|
-
"@o3r/schematics": "^10.3.
|
|
56
|
+
"@o3r/schematics": "^10.3.6",
|
|
57
57
|
"@openapitools/openapi-generator-cli": "~2.13.0",
|
|
58
58
|
"@schematics/angular": "~17.3.0"
|
|
59
59
|
},
|
|
@@ -67,16 +67,16 @@
|
|
|
67
67
|
"tslib": "^2.6.2"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@ama-sdk/core": "^10.3.
|
|
70
|
+
"@ama-sdk/core": "^10.3.6",
|
|
71
71
|
"@angular-devkit/schematics-cli": "~17.3.0",
|
|
72
72
|
"@angular-eslint/eslint-plugin": "~17.3.0",
|
|
73
73
|
"@angular/cli": "~17.3.0",
|
|
74
74
|
"@nx/eslint-plugin": "~18.3.0",
|
|
75
75
|
"@nx/jest": "~18.3.0",
|
|
76
|
-
"@o3r/build-helpers": "^10.3.
|
|
77
|
-
"@o3r/eslint-plugin": "^10.3.
|
|
78
|
-
"@o3r/schematics": "^10.3.
|
|
79
|
-
"@o3r/test-helpers": "^10.3.
|
|
76
|
+
"@o3r/build-helpers": "^10.3.6",
|
|
77
|
+
"@o3r/eslint-plugin": "^10.3.6",
|
|
78
|
+
"@o3r/schematics": "^10.3.6",
|
|
79
|
+
"@o3r/test-helpers": "^10.3.6",
|
|
80
80
|
"@openapitools/openapi-generator-cli": "~2.13.0",
|
|
81
81
|
"@schematics/angular": "~17.3.0",
|
|
82
82
|
"@stylistic/eslint-plugin-ts": "^1.5.4",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Tree } from '@angular-devkit/schematics';
|
|
2
|
+
/**
|
|
3
|
+
* Determine if the targeted SDK is typescript based
|
|
4
|
+
* @param tree Schematic Tree
|
|
5
|
+
* @param pathInTree Path to the SDK in the tree
|
|
6
|
+
*/
|
|
7
|
+
export declare const isTypescriptSdk: (tree: Tree, pathInTree?: string) => boolean;
|
|
8
|
+
//# sourceMappingURL=is-typescript-project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-typescript-project.d.ts","sourceRoot":"","sources":["../../../schematics/helpers/is-typescript-project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,eAAe,SAAU,IAAI,iCAIzC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTypescriptSdk = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Determine if the targeted SDK is typescript based
|
|
6
|
+
* @param tree Schematic Tree
|
|
7
|
+
* @param pathInTree Path to the SDK in the tree
|
|
8
|
+
*/
|
|
9
|
+
const isTypescriptSdk = (tree, pathInTree = '/') => {
|
|
10
|
+
return tree.getDir(pathInTree)
|
|
11
|
+
.subfiles
|
|
12
|
+
.some((filePath) => /tsconfig[^/\\]*\.json$/.test(filePath));
|
|
13
|
+
};
|
|
14
|
+
exports.isTypescriptSdk = isTypescriptSdk;
|
|
15
|
+
//# sourceMappingURL=is-typescript-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-typescript-project.js","sourceRoot":"","sources":["../../../schematics/helpers/is-typescript-project.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACI,MAAM,eAAe,GAAG,CAAC,IAAU,EAAE,UAAU,GAAG,GAAG,EAAE,EAAE;IAC9D,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;SAC3B,QAAQ;SACR,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,wBAAwB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;AACjE,CAAC,CAAC;AAJW,QAAA,eAAe,mBAI1B"}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
import { MigrateSchematicsSchemaOptions } from './schema';
|
|
3
|
+
/**
|
|
4
|
+
* Facilitate the migration of a version to another by the run of migration rules
|
|
5
|
+
* @param options
|
|
6
|
+
*/
|
|
7
|
+
export declare const migrate: (options: MigrateSchematicsSchemaOptions) => () => Promise<Rule>;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/migrate/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAkC1D;;;GAGG;AACH,eAAO,MAAM,OAAO,YAAa,8BAA8B,wBAG9D,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.migrate = void 0;
|
|
4
|
+
const schematics_1 = require("@o3r/schematics");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const semver_1 = require("semver");
|
|
7
|
+
const is_typescript_project_1 = require("../helpers/is-typescript-project");
|
|
8
|
+
const update_openapiversion_1 = require("../ng-update/typescript/v10.3/update-openapiversion");
|
|
9
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
10
|
+
const tsMigrationMap = {
|
|
11
|
+
'~10.3.2': (0, update_openapiversion_1.updateOpenApiVersionInProject)()
|
|
12
|
+
};
|
|
13
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
14
|
+
/**
|
|
15
|
+
* Facilitate the migration of a version to another by the run of migration rules
|
|
16
|
+
* @param options
|
|
17
|
+
*/
|
|
18
|
+
function migrateFn(options) {
|
|
19
|
+
const currentVersion = require((0, node_path_1.resolve)(__dirname, '..', '..', 'package.json')).version;
|
|
20
|
+
const to = options.to || currentVersion;
|
|
21
|
+
const minimumVersion = (0, semver_1.minVersion)(to);
|
|
22
|
+
return (tree, context) => {
|
|
23
|
+
if (minimumVersion && (0, semver_1.gt)(minimumVersion, currentVersion)) {
|
|
24
|
+
context.logger.warn(`The specified range "${to}" has a minimum supported version higher than the current version of @ama-sdk/schematics (${currentVersion}).` +
|
|
25
|
+
' The migration may not have any effect.');
|
|
26
|
+
}
|
|
27
|
+
const workingDirectory = options?.projectName && (0, schematics_1.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root || '/';
|
|
28
|
+
const runMigrateSchematic = (0, is_typescript_project_1.isTypescriptSdk)(tree, workingDirectory) ? (0, schematics_1.getMigrationRuleRunner)(tsMigrationMap, { logger: context.logger }) : undefined;
|
|
29
|
+
return runMigrateSchematic?.({ from: options.from, to });
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Facilitate the migration of a version to another by the run of migration rules
|
|
34
|
+
* @param options
|
|
35
|
+
*/
|
|
36
|
+
const migrate = (options) => async () => {
|
|
37
|
+
const { createSchematicWithMetricsIfInstalled } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
38
|
+
return createSchematicWithMetricsIfInstalled(migrateFn)(options);
|
|
39
|
+
};
|
|
40
|
+
exports.migrate = migrate;
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/migrate/index.ts"],"names":[],"mappings":";;;AAEA,gDAAqG;AACrG,yCAAoC;AACpC,mCAAwC;AACxC,4EAAmE;AACnE,+FAAkG;AAElG,yDAAyD;AACzD,MAAM,cAAc,GAAsB;IACxC,SAAS,EAAE,IAAA,qDAA6B,GAAE;CAC3C,CAAC;AACF,wDAAwD;AAExD;;;GAGG;AACH,SAAS,SAAS,CAAC,OAAuC;IAExD,MAAM,cAAc,GAAG,OAAO,CAAC,IAAA,mBAAO,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC;IACvF,MAAM,EAAE,GAAW,OAAO,CAAC,EAAE,IAAI,cAAc,CAAC;IAChD,MAAM,cAAc,GAAG,IAAA,mBAAU,EAAC,EAAE,CAAC,CAAC;IAEtC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;QACvB,IAAI,cAAc,IAAI,IAAA,WAAE,EAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC;YACzD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE,6FAA6F,cAAc,IAAI;gBAC7J,yCAAyC,CAAC,CAAC;QAC7C,CAAC;QACD,MAAM,gBAAgB,GAAG,OAAO,EAAE,WAAW,IAAI,IAAA,+BAAkB,EAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,IAAI,GAAG,CAAC;QACtH,MAAM,mBAAmB,GAAG,IAAA,uCAAe,EAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAA,mCAAsB,EAAC,cAAc,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACrJ,OAAO,mBAAmB,EAAE,CAAC,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,EAAC,CAAC,CAAC;IACzD,CAAC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACI,MAAM,OAAO,GAAG,CAAC,OAAuC,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE;IAC7E,MAAM,EAAE,qCAAqC,EAAE,GAAG,2CAAa,iBAAiB,EAAC,CAAC;IAClF,OAAO,qCAAqC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC;AACnE,CAAC,CAAC;AAHW,QAAA,OAAO,WAGlB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Schematic Option */
|
|
2
|
+
export interface MigrateSchematicsSchemaOptions {
|
|
3
|
+
/** Starting version from which the migration scripts are executed */
|
|
4
|
+
from: string;
|
|
5
|
+
/** Version of the package to migrate to (will use the current version if not specified) */
|
|
6
|
+
to?: string;
|
|
7
|
+
/** Project name */
|
|
8
|
+
projectName?: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/migrate/schema.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,MAAM,WAAW,8BAA8B;IAC7C,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,2FAA2F;IAC3F,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../schematics/migrate/schema.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "MigrateSchematicsSchema",
|
|
4
|
+
"title": "Execute migration scripts between 2 versions",
|
|
5
|
+
"description": "Schematics to migrate from a specific version to another one",
|
|
6
|
+
"properties": {
|
|
7
|
+
"from": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Starting version from which the migration scripts are executed",
|
|
10
|
+
"x-prompt": "What was the original version before migration?"
|
|
11
|
+
},
|
|
12
|
+
"to": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Version of the package to migrate to (will use the current version if not specified)"
|
|
15
|
+
},
|
|
16
|
+
"projectName": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "Project name (in case it is applied to a module from an Angular Project)",
|
|
19
|
+
"$default": {
|
|
20
|
+
"$source": "projectName"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"additionalProperties": true,
|
|
25
|
+
"required": [
|
|
26
|
+
"from"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-update/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-update/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAIvD;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAQlC"}
|
|
@@ -4,19 +4,13 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.updateV10_0 = void 0;
|
|
6
6
|
const typescript_1 = require("./typescript");
|
|
7
|
-
|
|
8
|
-
* Determine if the script is run in a Typescript SDK
|
|
9
|
-
* @param tree
|
|
10
|
-
*/
|
|
11
|
-
const isTypescriptSdk = (tree) => {
|
|
12
|
-
return tree.exists('/tsconfig.json');
|
|
13
|
-
};
|
|
7
|
+
const is_typescript_project_1 = require("../helpers/is-typescript-project");
|
|
14
8
|
/**
|
|
15
9
|
* update of Otter library V10.0
|
|
16
10
|
*/
|
|
17
11
|
function updateV10_0() {
|
|
18
12
|
return (tree, context) => {
|
|
19
|
-
if (isTypescriptSdk(tree)) {
|
|
13
|
+
if ((0, is_typescript_project_1.isTypescriptSdk)(tree)) {
|
|
20
14
|
return (0, typescript_1.updateV10_0)()(tree, context);
|
|
21
15
|
}
|
|
22
16
|
return tree;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-update/index.ts"],"names":[],"mappings":";AAAA,yDAAyD;AACzD,8BAA8B;;;AAG9B,6CAA4D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-update/index.ts"],"names":[],"mappings":";AAAA,yDAAyD;AACzD,8BAA8B;;;AAG9B,6CAA4D;AAC5D,4EAAmE;AAEnE;;GAEG;AACH,SAAgB,WAAW;IACzB,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;QACvB,IAAI,IAAA,uCAAe,EAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,OAAO,IAAA,wBAAa,GAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACxC,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AARD,kCAQC"}
|
|
@@ -7,4 +7,8 @@ export declare function updateV10_0(): Rule;
|
|
|
7
7
|
* Update of Ama-sdk library V10.1
|
|
8
8
|
*/
|
|
9
9
|
export declare function updateV10_1(): Rule;
|
|
10
|
+
/**
|
|
11
|
+
* Update of Ama-sdk library V10.3
|
|
12
|
+
*/
|
|
13
|
+
export declare function updateV10_3(): Rule;
|
|
10
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-update/typescript/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAS,IAAI,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-update/typescript/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAS,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAKzD;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAQlC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAMlC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAMlC"}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
3
3
|
/* eslint-disable camelcase */
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.updateV10_1 = exports.updateV10_0 = void 0;
|
|
5
|
+
exports.updateV10_3 = exports.updateV10_1 = exports.updateV10_0 = void 0;
|
|
6
6
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
7
7
|
const script_removal_1 = require("./v10.0/script-removal");
|
|
8
8
|
const add_presets_renovate_1 = require("./v10.1/add-presets-renovate");
|
|
9
|
+
const update_openapiversion_1 = require("./v10.3/update-openapiversion");
|
|
9
10
|
/**
|
|
10
11
|
* update of Otter library V10.0
|
|
11
12
|
*/
|
|
@@ -28,4 +29,14 @@ function updateV10_1() {
|
|
|
28
29
|
return (0, schematics_1.chain)(updateRules);
|
|
29
30
|
}
|
|
30
31
|
exports.updateV10_1 = updateV10_1;
|
|
32
|
+
/**
|
|
33
|
+
* Update of Ama-sdk library V10.3
|
|
34
|
+
*/
|
|
35
|
+
function updateV10_3() {
|
|
36
|
+
const updateRules = [
|
|
37
|
+
(0, update_openapiversion_1.updateOpenApiVersionInProject)()
|
|
38
|
+
];
|
|
39
|
+
return (0, schematics_1.chain)(updateRules);
|
|
40
|
+
}
|
|
41
|
+
exports.updateV10_3 = updateV10_3;
|
|
31
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/ng-update/typescript/index.ts"],"names":[],"mappings":";AAAA,yDAAyD;AACzD,8BAA8B;;;AAE9B,2DAAyD;AACzD,2DAA6G;AAC7G,uEAAkE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/ng-update/typescript/index.ts"],"names":[],"mappings":";AAAA,yDAAyD;AACzD,8BAA8B;;;AAE9B,2DAAyD;AACzD,2DAA6G;AAC7G,uEAAkE;AAClE,yEAA4E;AAE5E;;GAEG;AACH,SAAgB,WAAW;IACzB,MAAM,WAAW,GAAW;QAC1B,IAAA,wCAAuB,GAAE;QACzB,IAAA,uCAAsB,GAAE;QACxB,IAAA,mCAAkB,GAAE;KACrB,CAAC;IAEF,OAAO,IAAA,kBAAK,EAAC,WAAW,CAAC,CAAC;AAC5B,CAAC;AARD,kCAQC;AAED;;GAEG;AACH,SAAgB,WAAW;IACzB,MAAM,WAAW,GAAW;QAC1B,IAAA,yCAAkB,GAAE;KACrB,CAAC;IAEF,OAAO,IAAA,kBAAK,EAAC,WAAW,CAAC,CAAC;AAC5B,CAAC;AAND,kCAMC;AAED;;GAEG;AACH,SAAgB,WAAW;IACzB,MAAM,WAAW,GAAW;QAC1B,IAAA,qDAA6B,GAAE;KAChC,CAAC;IAEF,OAAO,IAAA,kBAAK,EAAC,WAAW,CAAC,CAAC;AAC5B,CAAC;AAND,kCAMC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
/**
|
|
3
|
+
* Update open api version used in the project to match with the one used in @ama-sdk/schematics:typescript-core
|
|
4
|
+
*/
|
|
5
|
+
export declare const updateOpenApiVersionInProject: () => Rule;
|
|
6
|
+
//# sourceMappingURL=update-openapiversion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-openapiversion.d.ts","sourceRoot":"","sources":["../../../../../schematics/ng-update/typescript/v10.3/update-openapiversion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAKrD;;GAEG;AACH,eAAO,MAAM,6BAA6B,QAAO,IAiEhD,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateOpenApiVersionInProject = void 0;
|
|
4
|
+
const semver = require("semver");
|
|
5
|
+
const schematics_1 = require("@o3r/schematics");
|
|
6
|
+
const schematics_2 = require("@angular-devkit/schematics");
|
|
7
|
+
/**
|
|
8
|
+
* Update open api version used in the project to match with the one used in @ama-sdk/schematics:typescript-core
|
|
9
|
+
*/
|
|
10
|
+
const updateOpenApiVersionInProject = () => {
|
|
11
|
+
const overwriteOpenApiVersion = (pathOfWorkspace) => {
|
|
12
|
+
return (tree, context) => {
|
|
13
|
+
const packageJson = tree.readText(`${pathOfWorkspace}/package.json`);
|
|
14
|
+
const amaSdkTypescriptUsage = packageJson.match(/@ama-sdk\/schematics:typescript-core.*",?$/mg);
|
|
15
|
+
if (!amaSdkTypescriptUsage) {
|
|
16
|
+
context.logger.info(`Skipping ng-update for ${pathOfWorkspace} as it does not use @ama-sdk/schematics:typescript-core`);
|
|
17
|
+
return tree;
|
|
18
|
+
}
|
|
19
|
+
const openapitoolsPaths = [];
|
|
20
|
+
amaSdkTypescriptUsage.forEach((script) => {
|
|
21
|
+
const openapiToolsPath = new RegExp(/@ama-sdk\/schematics:typescript-core.* --spec-config-path(?:=|\s+)["']?(?:\.\/)?([a-zA-Z-/.0-9_]*\.json)/).exec(script);
|
|
22
|
+
if (openapiToolsPath?.length === 2) {
|
|
23
|
+
openapitoolsPaths.push(`${pathOfWorkspace}/${openapiToolsPath[1]}`);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
if (amaSdkTypescriptUsage.length > openapitoolsPaths.length) {
|
|
27
|
+
openapitoolsPaths.push(`${pathOfWorkspace}/openapitools.json`);
|
|
28
|
+
}
|
|
29
|
+
(openapitoolsPaths || []).forEach((path) => {
|
|
30
|
+
if (!tree.exists(path)) {
|
|
31
|
+
context.logger.warn(`Missing ${path} file described in the package json.`);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const openApiToolsConfig = tree.readJson(path);
|
|
35
|
+
openApiToolsConfig['generator-cli'] ||= {};
|
|
36
|
+
if (!openApiToolsConfig['generator-cli'].version || !semver.satisfies(openApiToolsConfig['generator-cli'].version, '~7.4.0')) {
|
|
37
|
+
context.logger.info(`The following file will be updated to target open api tools version 7.4: ${path}`);
|
|
38
|
+
openApiToolsConfig['generator-cli'].version = '7.4.0';
|
|
39
|
+
tree.overwrite(path, JSON.stringify(openApiToolsConfig, null, 2));
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return tree;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
return (tree, context) => {
|
|
46
|
+
const pathsPackageJson = ['.'];
|
|
47
|
+
if (!tree.exists('package.json')) {
|
|
48
|
+
context.logger.error('Could not find a package.json file, make sure to run the ng-update at the root of typescript project');
|
|
49
|
+
}
|
|
50
|
+
const cwdPackageJson = tree.readJson('package.json');
|
|
51
|
+
if (tree.exists('angular.json')) {
|
|
52
|
+
const workspaceConfig = (0, schematics_1.getWorkspaceConfig)(tree);
|
|
53
|
+
pathsPackageJson.push(...Object.values(workspaceConfig?.projects || {}).map((project) => project.root));
|
|
54
|
+
}
|
|
55
|
+
else if (cwdPackageJson.workspaces) {
|
|
56
|
+
context.logger.info('Workspaces detected outside an angular project, running the update on the workspaces');
|
|
57
|
+
pathsPackageJson.push(...cwdPackageJson.workspaces.reduce((paths, workspace) => {
|
|
58
|
+
if (workspace.includes('*')) {
|
|
59
|
+
paths.push(...(0, schematics_1.globInTree)(tree, [`**/${workspace}/package.json`]).map((path) => path.replace('/package.json', '')));
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
paths.push(workspace);
|
|
63
|
+
}
|
|
64
|
+
return paths;
|
|
65
|
+
}, []));
|
|
66
|
+
}
|
|
67
|
+
return (0, schematics_2.chain)(pathsPackageJson.map((pathPackageJson) => overwriteOpenApiVersion(pathPackageJson.at(pathPackageJson.length - 1) === '/' ? pathPackageJson.trim() : pathPackageJson)));
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
exports.updateOpenApiVersionInProject = updateOpenApiVersionInProject;
|
|
71
|
+
//# sourceMappingURL=update-openapiversion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-openapiversion.js","sourceRoot":"","sources":["../../../../../schematics/ng-update/typescript/v10.3/update-openapiversion.ts"],"names":[],"mappings":";;;AACA,iCAAiC;AACjC,gDAA+D;AAC/D,2DAAiD;AAEjD;;GAEG;AACI,MAAM,6BAA6B,GAAG,GAAS,EAAE;IACtD,MAAM,uBAAuB,GAAG,CAAC,eAAuB,EAAQ,EAAE;QAChE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;YACvB,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,eAAe,eAAe,CAAC,CAAC;YACrE,MAAM,qBAAqB,GAAG,WAAW,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;YAChG,IAAI,CAAC,qBAAqB,EAAE,CAAC;gBAC3B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,eAAe,yDAAyD,CAAC,CAAC;gBACxH,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,iBAAiB,GAAa,EAAE,CAAC;YACvC,qBAAqB,CAAC,OAAO,CA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,CAAC,CACvG,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACN,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBACxB,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACV,CAAC;QACD,OAAO,IAAA,kBAAK,EACV,gBAAgB,CAAC,GAAG,CAAC,CAAC,eAAe,EAAE,EAAE,CACvC,uBAAuB,CAAC,eAAe,CAAC,EAAE,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAC3H,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AAjEW,QAAA,6BAA6B,iCAiExC"}
|
|
Binary file
|
|
Binary file
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
|
+
"schematics": "schematics",
|
|
32
33
|
"clean": "rimraf test/ test-dev/ dist/ dist-dev/ dist-test/ build/",
|
|
33
34
|
"lint:ci": "eslint \"**/*[jt]s\" --quiet --format junit --output-file ./dist-lint/result.xml",
|
|
34
35
|
"lint": "eslint \"**/*[jt]s\" --cache",
|
|
@@ -82,7 +83,7 @@
|
|
|
82
83
|
"@openapitools/openapi-generator-cli": "<%= versions['@openapitools/openapi-generator-cli'] %>",
|
|
83
84
|
"@stylistic/eslint-plugin-ts": "<%= versions['@stylistic/eslint-plugin-ts'] %>",
|
|
84
85
|
"@swc/cli": "^0.1.57",
|
|
85
|
-
"@swc/core": "
|
|
86
|
+
"@swc/core": "1.5.7",
|
|
86
87
|
"@types/jest": "<%= versions['@types/jest'] %>",
|
|
87
88
|
"@types/node": "<%= versions['@types/node'] %>",
|
|
88
89
|
"@typescript-eslint/eslint-plugin": "<%= versions['@typescript-eslint/eslint-plugin'] %>",
|