@ama-sdk/schematics 11.6.0-prerelease.7 → 11.6.0-prerelease.8
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/cli/clear-index.cjs +10 -6
- package/cli/files-pack.cjs +25 -24
- package/cli/update-spec-from-npm.cjs +8 -8
- package/package.json +23 -18
- package/schematics/api-extension/index.d.ts.map +1 -1
- package/schematics/api-extension/schema.d.ts.map +1 -1
- package/schematics/code-generator/code-generator.d.ts.map +1 -1
- package/schematics/code-generator/code-generator.js +2 -2
- package/schematics/code-generator/open-api-cli-generator/open-api-cli.generator.d.ts.map +1 -1
- package/schematics/code-generator/open-api-cli-generator/open-api-cli.generator.js +9 -8
- package/schematics/code-generator/open-api-cli-generator/open-api-cli.options.d.ts.map +1 -1
- package/schematics/code-generator/swagger-java-generator/swagger-java.generator.d.ts.map +1 -1
- package/schematics/code-generator/swagger-java-generator/swagger-java.generator.js +2 -2
- package/schematics/code-generator/swagger-java-generator/swagger-java.options.d.ts.map +1 -1
- package/schematics/helpers/is-typescript-project.d.ts.map +1 -1
- package/schematics/helpers/node-install.d.ts +1 -1
- package/schematics/helpers/node-install.d.ts.map +1 -1
- package/schematics/helpers/node-install.js +1 -1
- package/schematics/helpers/read-package.d.ts.map +1 -1
- package/schematics/helpers/tree-glob.d.ts.map +1 -1
- package/schematics/helpers/tree-glob.js +3 -3
- package/schematics/java/client-core/index.d.ts.map +1 -1
- package/schematics/java/client-core/index.js +2 -3
- package/schematics/java/client-core/schema.d.ts.map +1 -1
- 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.map +1 -1
- package/schematics/migrate/index.js +7 -9
- package/schematics/ng-add/index.d.ts +3 -1
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +7 -9
- package/schematics/ng-add/schema.d.ts.map +1 -1
- package/schematics/ng-update/index.d.ts.map +1 -1
- package/schematics/ng-update/index.js +6 -3
- package/schematics/ng-update/typescript/index.d.ts.map +1 -1
- package/schematics/ng-update/typescript/index.js +6 -3
- package/schematics/ng-update/typescript/v10.0/script-removal.d.ts.map +1 -1
- package/schematics/ng-update/typescript/v10.0/script-removal.js +1 -1
- package/schematics/ng-update/typescript/v10.1/add-presets-renovate.d.ts.map +1 -1
- package/schematics/ng-update/typescript/v10.1/add-presets-renovate.js +0 -1
- package/schematics/ng-update/typescript/v10.3/update-openapiversion.d.ts.map +1 -1
- package/schematics/ng-update/typescript/v10.3/update-openapiversion.js +7 -7
- package/schematics/ng-update/typescript/v11.0/update-openapitools.d.ts.map +1 -1
- package/schematics/ng-update/typescript/v11.0/update-regen-script.d.ts.map +1 -1
- package/schematics/ng-update/typescript/v11.4/create-gitattributes.d.ts.map +1 -1
- package/schematics/typescript/core/helpers/copy-referenced-files.d.ts.map +1 -1
- package/schematics/typescript/core/helpers/copy-referenced-files.js +9 -9
- package/schematics/typescript/core/helpers/path-extractor.d.ts.map +1 -1
- package/schematics/typescript/core/helpers/path-extractor.js +1 -3
- package/schematics/typescript/core/index.d.ts.map +1 -1
- package/schematics/typescript/core/index.js +24 -14
- 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/core/schema.d.ts.map +1 -1
- package/schematics/typescript/mock/index.d.ts.map +1 -1
- package/schematics/typescript/mock/index.js +1 -9
- package/schematics/typescript/mock/schema.d.ts.map +1 -1
- package/schematics/typescript/shell/index.d.ts.map +1 -1
- package/schematics/typescript/shell/index.js +37 -43
- package/schematics/typescript/shell/schema.d.ts.map +1 -1
- package/schematics/typescript/shell/templates/base/eslint.config.mjs.template +96 -0
- package/schematics/typescript/shell/templates/base/package.json.template +3 -2
- package/schematics/typescript/shell/templates/base/.eslintignore.template +0 -9
- package/schematics/typescript/shell/templates/base/.eslintrc.js.template +0 -50
package/cli/clear-index.cjs
CHANGED
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
* Remove deleted models' exports
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const minimist = require("minimist");
|
|
8
7
|
const node_fs_1 = require("node:fs");
|
|
9
8
|
const node_path_1 = require("node:path");
|
|
9
|
+
const minimist = require("minimist");
|
|
10
10
|
const argv = minimist(process.argv.slice(2));
|
|
11
|
-
const { help } = argv;
|
|
11
|
+
const { help, quiet } = argv;
|
|
12
12
|
const baseDir = (0, node_path_1.resolve)(process.cwd(), 'src', 'models', 'base');
|
|
13
|
+
const noop = () => { };
|
|
14
|
+
const logger = quiet ? { error: noop, warn: noop, log: noop, info: noop, debug: noop } : console;
|
|
13
15
|
if (help) {
|
|
14
|
-
// eslint-disable-next-line no-console
|
|
16
|
+
// eslint-disable-next-line no-console -- even if we call the CLI with `--quiet` we want to log the help information
|
|
15
17
|
console.log(`Remove the index files that are no longer necessary after the deletion of the associated model.
|
|
16
18
|
Usage: amasdk-clear-index
|
|
17
19
|
`);
|
|
@@ -19,16 +21,18 @@ if (help) {
|
|
|
19
21
|
}
|
|
20
22
|
const run = async () => {
|
|
21
23
|
const models = await node_fs_1.promises.readdir(baseDir);
|
|
22
|
-
const
|
|
24
|
+
const modelsWithRemoveIndex = await Promise.all(models
|
|
23
25
|
.filter((file) => (0, node_fs_1.statSync)((0, node_path_1.resolve)(baseDir, file)).isDirectory())
|
|
24
26
|
.map(async (model) => {
|
|
25
27
|
const files = await node_fs_1.promises.readdir((0, node_path_1.resolve)(baseDir, model));
|
|
26
28
|
return { model, removeIndex: files.length === 1 };
|
|
27
|
-
}))
|
|
29
|
+
}));
|
|
30
|
+
const shouldRemoveModels = modelsWithRemoveIndex
|
|
31
|
+
.filter(({ removeIndex }) => removeIndex)
|
|
28
32
|
.map(({ model }) => model);
|
|
29
33
|
await Promise.all(shouldRemoveModels
|
|
30
34
|
.map((model) => {
|
|
31
|
-
|
|
35
|
+
logger.warn(`Removing ${model} model`);
|
|
32
36
|
return node_fs_1.promises.unlink((0, node_path_1.resolve)(baseDir, model, 'index.ts'));
|
|
33
37
|
}));
|
|
34
38
|
};
|
package/cli/files-pack.cjs
CHANGED
|
@@ -5,21 +5,23 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const node_fs_1 = require("node:fs");
|
|
8
|
-
const minimist = require("minimist");
|
|
9
8
|
const path = require("node:path");
|
|
10
|
-
const node_fs_2 = require("node:fs");
|
|
11
9
|
const globby = require("globby");
|
|
10
|
+
const minimist = require("minimist");
|
|
12
11
|
const argv = minimist(process.argv.slice(2));
|
|
13
12
|
const distFolder = argv.dist || 'dist';
|
|
14
|
-
const baseDir = argv.cwd && path.resolve(process.cwd(), argv.cwd) || process.cwd();
|
|
15
|
-
const { help, watch, noExports } = argv;
|
|
13
|
+
const baseDir = (argv.cwd && path.resolve(process.cwd(), argv.cwd)) || process.cwd();
|
|
14
|
+
const { help, watch, noExports, quiet } = argv;
|
|
15
|
+
const noop = () => { };
|
|
16
|
+
const logger = quiet ? { error: noop, warn: noop, log: noop, info: noop, debug: noop } : console;
|
|
16
17
|
if (help) {
|
|
17
|
-
// eslint-disable-next-line no-console
|
|
18
|
+
// eslint-disable-next-line no-console -- even if we call the CLI with `--quiet` we want to log the help information
|
|
18
19
|
console.log(`Prepare the dist folder for publication. This will copy necessary files from src and update the exports in package.json.
|
|
19
|
-
Usage: amasdk-files-pack [--exports] [--watch]
|
|
20
|
+
Usage: amasdk-files-pack [--exports] [--watch] [--quiet]
|
|
20
21
|
|
|
21
22
|
--exports Update the exports in package.json. (Default: true)
|
|
22
23
|
--watch Watch for files changes and run the updates
|
|
24
|
+
--quiet Don't log anything
|
|
23
25
|
`);
|
|
24
26
|
process.exit(0);
|
|
25
27
|
}
|
|
@@ -31,12 +33,12 @@ const files = [
|
|
|
31
33
|
];
|
|
32
34
|
/** Update package.json exports */
|
|
33
35
|
const updateExports = async () => {
|
|
34
|
-
const packageJson = JSON.parse(await
|
|
36
|
+
const packageJson = JSON.parse(await node_fs_1.promises.readFile(path.join(baseDir, 'package.json'), { encoding: 'utf8' }));
|
|
35
37
|
const packageJsonFiles = globby.sync(path.posix.join(distFolder, '*', '**', 'package.json'), { absolute: true });
|
|
36
38
|
packageJson.exports = packageJson.exports || {};
|
|
37
39
|
for (const packageJsonFile of packageJsonFiles) {
|
|
38
40
|
try {
|
|
39
|
-
const subPackageJson = JSON.parse(await
|
|
41
|
+
const subPackageJson = JSON.parse(await node_fs_1.promises.readFile(packageJsonFile, { encoding: 'utf8' }));
|
|
40
42
|
const folder = './' + path.relative(path.join(baseDir, distFolder), path.dirname(packageJsonFile)).replace(/[/\\]+/g, '/');
|
|
41
43
|
packageJson.exports[folder] = packageJson.exports[folder] || {};
|
|
42
44
|
Object.entries(subPackageJson).forEach(([key, value]) => {
|
|
@@ -51,7 +53,7 @@ const updateExports = async () => {
|
|
|
51
53
|
}
|
|
52
54
|
catch (e) {
|
|
53
55
|
if (watch) {
|
|
54
|
-
|
|
56
|
+
logger.warn(`Exception in ${packageJsonFile}`, e);
|
|
55
57
|
}
|
|
56
58
|
else {
|
|
57
59
|
throw e;
|
|
@@ -59,23 +61,22 @@ const updateExports = async () => {
|
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
63
|
delete packageJson.scripts;
|
|
62
|
-
await
|
|
64
|
+
await node_fs_1.promises.writeFile(path.join(baseDir, distFolder, 'package.json'), JSON.stringify(packageJson, null, 2));
|
|
65
|
+
};
|
|
66
|
+
const copyToDist = (file, cwdForCopy) => {
|
|
67
|
+
const distFile = path.resolve(baseDir, distFolder, path.relative(cwdForCopy, file));
|
|
68
|
+
logger.log(`${file} copied to ${distFile}`);
|
|
69
|
+
try {
|
|
70
|
+
(0, node_fs_1.mkdirSync)(path.dirname(distFile), { recursive: true });
|
|
71
|
+
}
|
|
72
|
+
catch { /* ignore error */ }
|
|
73
|
+
return (0, node_fs_1.copyFileSync)(file, distFile);
|
|
63
74
|
};
|
|
64
75
|
const run = async () => {
|
|
65
|
-
const copyToDist = (file, cwdForCopy) => {
|
|
66
|
-
const distFile = path.resolve(baseDir, distFolder, path.relative(cwdForCopy, file));
|
|
67
|
-
// eslint-disable-next-line no-console
|
|
68
|
-
console.log(`${file} copied to ${distFile}`);
|
|
69
|
-
try {
|
|
70
|
-
(0, node_fs_1.mkdirSync)(path.dirname(distFile), { recursive: true });
|
|
71
|
-
}
|
|
72
|
-
catch { /* ignore error */ }
|
|
73
|
-
return (0, node_fs_1.copyFileSync)(file, distFile);
|
|
74
|
-
};
|
|
75
76
|
// Move files into the dist folder
|
|
76
77
|
const copies = files.map(async ({ glob, cwdForCopy }) => {
|
|
77
|
-
return watch
|
|
78
|
-
Promise.resolve().then(() => require('chokidar')).then((chokidar) => chokidar.watch(glob, { cwd: baseDir }))
|
|
78
|
+
return watch
|
|
79
|
+
? Promise.resolve().then(() => require('chokidar')).then((chokidar) => chokidar.watch(glob, { cwd: baseDir }))
|
|
79
80
|
.then((watcher) => watcher.on('all', async (event, file) => {
|
|
80
81
|
if (event !== 'unlink' && event !== 'unlinkDir') {
|
|
81
82
|
copyToDist(file, cwdForCopy);
|
|
@@ -83,8 +84,8 @@ const run = async () => {
|
|
|
83
84
|
await updateExports();
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
|
-
}))
|
|
87
|
-
globby.sync(glob)
|
|
87
|
+
}))
|
|
88
|
+
: globby.sync(glob)
|
|
88
89
|
.forEach((file) => copyToDist(file, cwdForCopy));
|
|
89
90
|
});
|
|
90
91
|
await Promise.all(copies);
|
|
@@ -4,23 +4,23 @@
|
|
|
4
4
|
* Update the OpenAPI spec from an NPM package
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const minimist = require("minimist");
|
|
8
7
|
const node_fs_1 = require("node:fs");
|
|
8
|
+
const promises_1 = require("node:fs/promises");
|
|
9
9
|
const node_module_1 = require("node:module");
|
|
10
10
|
const node_path_1 = require("node:path");
|
|
11
|
-
const
|
|
11
|
+
const minimist = require("minimist");
|
|
12
12
|
const schematics_1 = require("@ama-sdk/schematics");
|
|
13
13
|
const argv = minimist(process.argv.slice(2));
|
|
14
14
|
const packageName = argv._[0];
|
|
15
15
|
const { help, output, 'package-path': packagePath, quiet } = argv;
|
|
16
16
|
const openApiConfigDefaultPath = './openapitools.json';
|
|
17
|
-
const noop = () =>
|
|
17
|
+
const noop = () => { };
|
|
18
18
|
const logger = quiet ? { error: noop, warn: noop, log: noop, info: noop, debug: noop } : console;
|
|
19
19
|
const SPEC_YML_EXTENSION = 'yml';
|
|
20
20
|
const DEFAULT_SPEC_EXPORT_PATH_IN_NPM_MODULE = 'openapi';
|
|
21
21
|
const supportedExtensions = [schematics_1.SPEC_JSON_EXTENSION, schematics_1.SPEC_YAML_EXTENSION, SPEC_YML_EXTENSION];
|
|
22
22
|
if (help) {
|
|
23
|
-
// eslint-disable-next-line no-console
|
|
23
|
+
// eslint-disable-next-line no-console -- even if we call the CLI with `--quiet` we want to log the help information
|
|
24
24
|
console.log(`This script can be used to update your local spec file from a given locally installed npm package.
|
|
25
25
|
Usage: amasdk-update-spec-from-npm <package-name> [--package-path] [--output] [--quiet]
|
|
26
26
|
|
|
@@ -39,7 +39,10 @@ const run = async () => {
|
|
|
39
39
|
let specSourcePath;
|
|
40
40
|
const appRequire = (0, node_module_1.createRequire)(node_path_1.posix.join(process.cwd(), 'package.json'));
|
|
41
41
|
const packageJsonPath = appRequire.resolve(`${packageName}/package.json`);
|
|
42
|
-
if (
|
|
42
|
+
if (packagePath) {
|
|
43
|
+
specSourcePath = packageJsonPath.replace(/package.json$/, packagePath);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
43
46
|
const packageJson = JSON.parse(await (0, promises_1.readFile)(packageJsonPath, { encoding: 'utf8' }));
|
|
44
47
|
const exportMatcher = new RegExp(`^\\./${DEFAULT_SPEC_EXPORT_PATH_IN_NPM_MODULE}\\.(?:${supportedExtensions.join('|')})$`);
|
|
45
48
|
const matchingExport = packageJson.exports && Object.keys(packageJson.exports).find((exportPath) => exportMatcher.test(exportPath));
|
|
@@ -47,9 +50,6 @@ const run = async () => {
|
|
|
47
50
|
specSourcePath = appRequire.resolve(node_path_1.posix.join(packageName, matchingExport));
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
|
-
else {
|
|
51
|
-
specSourcePath = packageJsonPath.replace(/package.json$/, packagePath);
|
|
52
|
-
}
|
|
53
53
|
if (!specSourcePath || !(0, node_fs_1.existsSync)(specSourcePath)) {
|
|
54
54
|
logger.error(`Unable to find source spec from ${packageName}, please make sure it is correctly exported in package.json`);
|
|
55
55
|
process.exit(-2);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ama-sdk/schematics",
|
|
3
|
-
"version": "11.6.0-prerelease.
|
|
3
|
+
"version": "11.6.0-prerelease.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -63,11 +63,11 @@
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@ama-sdk/core": "^11.6.0-prerelease.
|
|
66
|
+
"@ama-sdk/core": "^11.6.0-prerelease.8",
|
|
67
67
|
"@angular-devkit/core": "~18.2.0",
|
|
68
68
|
"@angular-devkit/schematics-cli": "^18.0.5",
|
|
69
69
|
"@angular/cli": "~18.2.0",
|
|
70
|
-
"@o3r/schematics": "^11.6.0-prerelease.
|
|
70
|
+
"@o3r/schematics": "^11.6.0-prerelease.8",
|
|
71
71
|
"@openapitools/openapi-generator-cli": "~2.15.0",
|
|
72
72
|
"openapi-types": "^12.0.0",
|
|
73
73
|
"type-fest": "^4.10.2"
|
|
@@ -85,20 +85,20 @@
|
|
|
85
85
|
"tslib": "^2.6.2"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@ama-sdk/core": "^11.6.0-prerelease.
|
|
88
|
+
"@ama-sdk/core": "^11.6.0-prerelease.8",
|
|
89
89
|
"@angular-devkit/schematics-cli": "^18.0.5",
|
|
90
|
-
"@angular-eslint/eslint-plugin": "~18.3.0",
|
|
91
90
|
"@angular/cli": "~18.2.0",
|
|
91
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
92
92
|
"@nx/eslint-plugin": "~19.5.0",
|
|
93
93
|
"@nx/jest": "~19.5.0",
|
|
94
|
-
"@o3r/build-helpers": "^11.6.0-prerelease.
|
|
95
|
-
"@o3r/eslint-plugin": "^11.6.0-prerelease.
|
|
96
|
-
"@o3r/schematics": "^11.6.0-prerelease.
|
|
97
|
-
"@o3r/telemetry": "^11.6.0-prerelease.
|
|
98
|
-
"@o3r/test-helpers": "^11.6.0-prerelease.
|
|
94
|
+
"@o3r/build-helpers": "^11.6.0-prerelease.8",
|
|
95
|
+
"@o3r/eslint-plugin": "^11.6.0-prerelease.8",
|
|
96
|
+
"@o3r/schematics": "^11.6.0-prerelease.8",
|
|
97
|
+
"@o3r/telemetry": "^11.6.0-prerelease.8",
|
|
98
|
+
"@o3r/test-helpers": "^11.6.0-prerelease.8",
|
|
99
99
|
"@openapitools/openapi-generator-cli": "~2.15.0",
|
|
100
100
|
"@schematics/angular": "~18.2.0",
|
|
101
|
-
"@stylistic/eslint-plugin
|
|
101
|
+
"@stylistic/eslint-plugin": "~2.7.0",
|
|
102
102
|
"@types/jest": "~29.5.2",
|
|
103
103
|
"@types/js-yaml": "^4.0.5",
|
|
104
104
|
"@types/minimatch": "^5.1.2",
|
|
@@ -106,18 +106,22 @@
|
|
|
106
106
|
"@types/node": "^20.0.0",
|
|
107
107
|
"@types/pid-from-port": "^1.1.0",
|
|
108
108
|
"@types/semver": "^7.3.13",
|
|
109
|
-
"@typescript-eslint/
|
|
110
|
-
"
|
|
111
|
-
"@typescript-eslint/utils": "^7.14.1",
|
|
109
|
+
"@typescript-eslint/parser": "~8.12.2",
|
|
110
|
+
"angular-eslint": "~18.4.0",
|
|
112
111
|
"commit-and-tag-version": "^12.0.0",
|
|
113
112
|
"copyfiles": "^2.4.1",
|
|
114
113
|
"cpy-cli": "^5.0.0",
|
|
115
|
-
"eslint": "
|
|
114
|
+
"eslint": "~9.14.0",
|
|
116
115
|
"eslint-import-resolver-node": "^0.3.9",
|
|
116
|
+
"eslint-import-resolver-typescript": "^3.6.3",
|
|
117
|
+
"eslint-plugin-import": "^2.31.0",
|
|
118
|
+
"eslint-plugin-import-newlines": "^1.4.0",
|
|
117
119
|
"eslint-plugin-jest": "~28.8.0",
|
|
118
|
-
"eslint-plugin-jsdoc": "~
|
|
120
|
+
"eslint-plugin-jsdoc": "~50.2.0",
|
|
119
121
|
"eslint-plugin-prefer-arrow": "~1.2.3",
|
|
120
|
-
"eslint-plugin-unicorn": "^
|
|
122
|
+
"eslint-plugin-unicorn": "^56.0.0",
|
|
123
|
+
"eslint-plugin-unused-imports": "^4.1.4",
|
|
124
|
+
"globals": "^15.9.0",
|
|
121
125
|
"isomorphic-fetch": "~3.0.0",
|
|
122
126
|
"jest": "~29.7.0",
|
|
123
127
|
"jest-junit": "~16.0.0",
|
|
@@ -131,7 +135,8 @@
|
|
|
131
135
|
"ts-jest": "~29.2.0",
|
|
132
136
|
"ts-node": "~10.9.2",
|
|
133
137
|
"type-fest": "^4.10.2",
|
|
134
|
-
"typescript": "~5.5.4"
|
|
138
|
+
"typescript": "~5.5.4",
|
|
139
|
+
"typescript-eslint": "~8.12.2"
|
|
135
140
|
},
|
|
136
141
|
"generatorDependencies": {
|
|
137
142
|
"@swc/cli": "~0.5.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/api-extension/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/api-extension/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,IAAI,EAIL,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,sCAAsC,EACvC,MAAM,UAAU,CAAC;AAiBlB;;;GAGG;AACH,eAAO,MAAM,sBAAsB,YAAa,sCAAsC,wBAGrF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/api-extension/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/api-extension/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,sCAAuC,SAAQ,qBAAqB;IACnF,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,QAAQ,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC/B,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-generator.d.ts","sourceRoot":"","sources":["../../../schematics/code-generator/code-generator.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"code-generator.d.ts","sourceRoot":"","sources":["../../../schematics/code-generator/code-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,YAAY,EAEb,MAAM,4BAA4B,CAAC;AAKpC;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;GAMG;AACH,8BAAsB,aAAa,CAAC,CAAC,SAAS,kBAAkB;IAC9D;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAEzC;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAa5B;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;IAcjC;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,iBAAiB,IAAI,CAAC;IAEzC;;;;OAIG;IACH,SAAS,CAAC,uBAAuB,CAAC,eAAe,GAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,YAAY,CAAC,CAAC,CAAC;IAMpG;;;;;OAKG;IACI,wBAAwB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,cAAc,GAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAO;CAU9G"}
|
|
@@ -35,7 +35,7 @@ class CodeGenerator {
|
|
|
35
35
|
registerGeneratorExecutor(factoryOptions) {
|
|
36
36
|
return (tree, context) => {
|
|
37
37
|
// workaround for issue https://github.com/angular/angular-cli/issues/12678
|
|
38
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
38
|
+
// eslint-disable-next-line no-underscore-dangle -- accessing to a private field for the workaround
|
|
39
39
|
const host = context.engine._host;
|
|
40
40
|
host.registerTaskExecutor({
|
|
41
41
|
name: this.generatorName,
|
|
@@ -51,7 +51,7 @@ class CodeGenerator {
|
|
|
51
51
|
*/
|
|
52
52
|
runCodeGeneratorFactory(_factoryOptions = {}) {
|
|
53
53
|
return (_options) => {
|
|
54
|
-
return Promise.reject('No implementation, please target an implementation');
|
|
54
|
+
return Promise.reject(new Error('No implementation, please target an implementation'));
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-api-cli.generator.d.ts","sourceRoot":"","sources":["../../../../schematics/code-generator/open-api-cli-generator/open-api-cli.generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"open-api-cli.generator.d.ts","sourceRoot":"","sources":["../../../../schematics/code-generator/open-api-cli-generator/open-api-cli.generator.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,aAAa,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,aAAa,CAAC,iBAAiB,CAAC;IACvE,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,KAAK,GAAG,MAAM,CAAC;IAClD,SAAS,KAAK,oBAAoB,IAAI,KAAK,GAAG,MAAM,CAEnD;IAED,kBAAkB;IAClB,SAAS,CAAC,QAAQ,CAAC,aAAa,6BAA6B;gBAEjD,OAAO,CAAC,EAAE;QAAE,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,EAAE,CAAA;KAAE;IAK9D;;;;OAIG;IACH,OAAO,CAAC,0BAA0B;IAelC;;;;OAIG;IACH,OAAO,CAAC,YAAY;IA4BpB,kBAAkB;IAClB,SAAS,CAAC,iBAAiB,0BAA2C;IAEtE,kBAAkB;IAClB,SAAS,CAAC,uBAAuB,oBAAoB;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,yBAI5C,iBAAiB,wBAclD;CACH"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OpenApiCliGenerator = void 0;
|
|
4
|
-
const code_generator_1 = require("../code-generator");
|
|
5
4
|
const node_child_process_1 = require("node:child_process");
|
|
6
|
-
const open_api_cli_options_1 = require("./open-api-cli.options");
|
|
7
5
|
const path = require("node:path");
|
|
8
6
|
const node_install_1 = require("../../helpers/node-install");
|
|
7
|
+
const code_generator_1 = require("../code-generator");
|
|
8
|
+
const open_api_cli_options_1 = require("./open-api-cli.options");
|
|
9
9
|
/**
|
|
10
10
|
* Manage the schematic to generate a sdk using the @openapitools/openapi-generator-cli
|
|
11
11
|
*/
|
|
@@ -21,12 +21,12 @@ class OpenApiCliGenerator extends code_generator_1.CodeGenerator {
|
|
|
21
21
|
this.getDefaultOptions = () => open_api_cli_options_1.defaultTypescriptGeneratorOptions;
|
|
22
22
|
/** @inheritDoc */
|
|
23
23
|
this.runCodeGeneratorFactory = (factoryOptions = {}) => {
|
|
24
|
-
const rootDirectory = factoryOptions.rootDirectory
|
|
25
|
-
(path.isAbsolute(factoryOptions.rootDirectory) ? factoryOptions.rootDirectory : path.resolve(process.cwd(), factoryOptions.rootDirectory))
|
|
26
|
-
process.cwd();
|
|
24
|
+
const rootDirectory = factoryOptions.rootDirectory
|
|
25
|
+
? (path.isAbsolute(factoryOptions.rootDirectory) ? factoryOptions.rootDirectory : path.resolve(process.cwd(), factoryOptions.rootDirectory))
|
|
26
|
+
: process.cwd();
|
|
27
27
|
return async (generatorOptions) => {
|
|
28
28
|
if (!generatorOptions) {
|
|
29
|
-
return Promise.reject('Missing options to run open api generator');
|
|
29
|
+
return Promise.reject(new Error('Missing options to run open api generator'));
|
|
30
30
|
}
|
|
31
31
|
const spawnOptions = {
|
|
32
32
|
stdio: 'inherit',
|
|
@@ -69,8 +69,9 @@ class OpenApiCliGenerator extends code_generator_1.CodeGenerator {
|
|
|
69
69
|
'generate',
|
|
70
70
|
generatorOptions.generatorCustomPath ? `--custom-generator=${generatorOptions.generatorCustomPath}` : '',
|
|
71
71
|
...generatorOptions.openapiNormalizer ? ['--openapi-normalizer', generatorOptions.openapiNormalizer] : [],
|
|
72
|
-
...generatorOptions.generatorKey
|
|
73
|
-
[
|
|
72
|
+
...generatorOptions.generatorKey
|
|
73
|
+
? ['--generator-key', generatorOptions.generatorKey]
|
|
74
|
+
: [
|
|
74
75
|
'-g', generatorOptions.generatorName,
|
|
75
76
|
'-i', generatorOptions.specPath,
|
|
76
77
|
...generatorOptions.specConfigPath ? ['-c', generatorOptions.specConfigPath] : [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-api-cli.options.d.ts","sourceRoot":"","sources":["../../../../schematics/code-generator/open-api-cli-generator/open-api-cli.options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"open-api-cli.options.d.ts","sourceRoot":"","sources":["../../../../schematics/code-generator/open-api-cli-generator/open-api-cli.options.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,GAAG;IACnD;;;;;;OAMG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iCAAiC,EAAE,iBAU/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swagger-java.generator.d.ts","sourceRoot":"","sources":["../../../../schematics/code-generator/swagger-java-generator/swagger-java.generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"swagger-java.generator.d.ts","sourceRoot":"","sources":["../../../../schematics/code-generator/swagger-java-generator/swagger-java.generator.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,aAAa,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAEhC;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,aAAa,CAAC,wBAAwB,CAAC;IAC/E,kBAAkB;IAClB,SAAS,CAAC,aAAa,SAAoB;IAE3C,kBAAkB;IAClB,SAAS,CAAC,iBAAiB,iCAAwB;IACnD,kBAAkB;IAClB,SAAS,CAAC,uBAAuB,CAAC,cAAc,GAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAO,uBAE9C,wBAAwB;CA6C5D"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SwaggerJavaGenerator = void 0;
|
|
4
|
-
const path = require("node:path");
|
|
5
4
|
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const path = require("node:path");
|
|
6
6
|
const code_generator_1 = require("../code-generator");
|
|
7
7
|
const swagger_java_options_1 = require("./swagger-java.options");
|
|
8
8
|
/**
|
|
@@ -22,7 +22,7 @@ class SwaggerJavaGenerator extends code_generator_1.CodeGenerator {
|
|
|
22
22
|
const rootDirectory = factoryOptions.rootDirectory || process.cwd();
|
|
23
23
|
return async (generatorOptions) => {
|
|
24
24
|
if (!generatorOptions) {
|
|
25
|
-
return Promise.reject('Missing options');
|
|
25
|
+
return Promise.reject(new Error('Missing options'));
|
|
26
26
|
}
|
|
27
27
|
const spawnOptions = {
|
|
28
28
|
stdio: 'inherit',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swagger-java.options.d.ts","sourceRoot":"","sources":["../../../../schematics/code-generator/swagger-java-generator/swagger-java.options.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"swagger-java.options.d.ts","sourceRoot":"","sources":["../../../../schematics/code-generator/swagger-java-generator/swagger-java.options.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAE3B;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,kBAAkB,GAAG;IAC1D,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,wBAS5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-typescript-project.d.ts","sourceRoot":"","sources":["../../../schematics/helpers/is-typescript-project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"is-typescript-project.d.ts","sourceRoot":"","sources":["../../../schematics/helpers/is-typescript-project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,eAAe,SAAU,IAAI,iCAIzC,CAAC"}
|
|
@@ -4,7 +4,7 @@ import type { SupportedPackageManagers } from '@o3r/schematics';
|
|
|
4
4
|
* Get the Package Manager
|
|
5
5
|
* @param enforcedNpmManager package manager to enforce
|
|
6
6
|
*/
|
|
7
|
-
export declare function getPackageManagerName(enforcedNpmManager?: SupportedPackageManagers | '' |
|
|
7
|
+
export declare function getPackageManagerName(enforcedNpmManager?: SupportedPackageManagers | '' | null): SupportedPackageManagers;
|
|
8
8
|
/**
|
|
9
9
|
* Duplication of the interface not exposed by the @angular-devkit/schematics
|
|
10
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-install.d.ts","sourceRoot":"","sources":["../../../schematics/helpers/node-install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"node-install.d.ts","sourceRoot":"","sources":["../../../schematics/helpers/node-install.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACvB,MAAM,kCAAkC,CAAC;AAI1C,OAAO,KAAK,EACV,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AAEzB;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,kBAAkB,CAAC,EAAE,wBAAwB,GAAG,EAAE,GAAG,IAAI,GAAG,wBAAwB,CAEzH;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,cAAc,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,EAAE,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,sBAAsB;IAC7C,KAAK,UAAS;gBAET,OAAO,CAAC,EAAE,6BAA6B;IAKnD,kBAAkB;IACX,eAAe;;;;;;;;;;CAYvB;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,sBAAsB;IAC7C,KAAK,UAAS;gBAET,OAAO,CAAC,EAAE,6BAA6B;IAKnD,kBAAkB;IACX,eAAe;;;;;;;;;;;;;CAavB"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NpmInstall = exports.DevInstall = void 0;
|
|
4
4
|
exports.getPackageManagerName = getPackageManagerName;
|
|
5
|
-
const options_1 = require("@angular-devkit/schematics/tasks/package-manager/options");
|
|
6
5
|
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
6
|
+
const options_1 = require("@angular-devkit/schematics/tasks/package-manager/options");
|
|
7
7
|
/**
|
|
8
8
|
* Get the Package Manager
|
|
9
9
|
* @param enforcedNpmManager package manager to enforce
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-package.d.ts","sourceRoot":"","sources":["../../../schematics/helpers/read-package.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"read-package.d.ts","sourceRoot":"","sources":["../../../schematics/helpers/read-package.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,WAAW,CAAC;AAEnB,iCAAiC;AACjC,eAAO,MAAM,eAAe,GAAU,CAAC,SAAS,WAAW,GAAG;IAAE,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,OAAK,OAAO,CAAC,CAAC,CAI5H,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-glob.d.ts","sourceRoot":"","sources":["../../../schematics/helpers/tree-glob.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"tree-glob.d.ts","sourceRoot":"","sources":["../../../schematics/helpers/tree-glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EACL,MAAM,4BAA4B,CAAC;AA4BpC;;;;GAIG;AACH,eAAO,MAAM,QAAQ,SAAU,IAAI,WAAW,MAAM,aAOnD,CAAC"}
|
|
@@ -4,9 +4,9 @@ exports.treeGlob = void 0;
|
|
|
4
4
|
const minimatch = require("minimatch");
|
|
5
5
|
const walkThroughDir = (tree, dir, filterFunction, parents = '') => {
|
|
6
6
|
const folders = dir.subdirs.map((d) => `${parents}/${d}`);
|
|
7
|
-
const matchingFolders = folders.filter(filterFunction);
|
|
7
|
+
const matchingFolders = folders.filter((value, index, array) => filterFunction(value, index, array));
|
|
8
8
|
return [
|
|
9
|
-
...dir.subfiles.map((f) => `${parents}/${f}`).filter(filterFunction),
|
|
9
|
+
...dir.subfiles.map((f) => `${parents}/${f}`).filter((value, index, array) => filterFunction(value, index, array)),
|
|
10
10
|
...matchingFolders,
|
|
11
11
|
...folders
|
|
12
12
|
.filter((item) => !(item in matchingFolders))
|
|
@@ -19,7 +19,7 @@ const walkThroughDir = (tree, dir, filterFunction, parents = '') => {
|
|
|
19
19
|
* @param pattern Pattern to match files or folders
|
|
20
20
|
*/
|
|
21
21
|
const treeGlob = (tree, pattern) => {
|
|
22
|
-
const filterFunction = minimatch.filter('/' + pattern.replace(/[
|
|
22
|
+
const filterFunction = minimatch.filter('/' + pattern.replace(/[/\\]+/g, '/'), { dot: true });
|
|
23
23
|
return walkThroughDir(tree, tree.root, filterFunction);
|
|
24
24
|
};
|
|
25
25
|
exports.treeGlob = treeGlob;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/java/client-core/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/java/client-core/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AAOpC,OAAO,EACL,wCAAwC,EACzC,MAAM,UAAU,CAAC;AA2ElB;;;GAGG;AACH,eAAO,MAAM,wBAAwB,YAAa,wCAAwC,wBAGzF,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ngGenerateJavaClientCore = void 0;
|
|
4
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
4
|
const node_fs_1 = require("node:fs");
|
|
6
5
|
const path = require("node:path");
|
|
7
|
-
const
|
|
6
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
8
7
|
const swagger_java_generator_1 = require("../../code-generator/swagger-java-generator/swagger-java.generator");
|
|
8
|
+
const tree_glob_1 = require("../../helpers/tree-glob");
|
|
9
9
|
/** Base path where to find codegen jars */
|
|
10
10
|
const jarBasePath = path.resolve(__dirname, 'swagger-codegen-java-client', 'target');
|
|
11
11
|
/**
|
|
@@ -49,7 +49,6 @@ function ngGenerateJavaClientCoreFn(options) {
|
|
|
49
49
|
/**
|
|
50
50
|
* rule to update readme and generate mandatory code source
|
|
51
51
|
* @param tree
|
|
52
|
-
* @param _context
|
|
53
52
|
*/
|
|
54
53
|
const generateSource = async (tree) => {
|
|
55
54
|
const specContent = await node_fs_1.promises.readFile(path.resolve(process.cwd(), options.specPath), { encoding: 'utf8' });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../schematics/java/client-core/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../schematics/java/client-core/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,wCAAyC,SAAQ,qBAAqB;IACrF,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IAEjB,0BAA0B;IAC1B,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC"}
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/migrate/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/migrate/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AAsBpC,OAAO,EACL,8BAA8B,EAC/B,MAAM,UAAU,CAAC;AAgClB;;;GAGG;AACH,eAAO,MAAM,OAAO,YAAa,8BAA8B,wBAG9D,CAAC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.migrate = void 0;
|
|
4
|
-
const schematics_1 = require("@o3r/schematics");
|
|
5
|
-
const node_path_1 = require("node:path");
|
|
6
4
|
const node_fs_1 = require("node:fs");
|
|
7
|
-
const
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const schematics_1 = require("@o3r/schematics");
|
|
8
7
|
const semver_1 = require("semver");
|
|
9
8
|
const is_typescript_project_1 = require("../helpers/is-typescript-project");
|
|
10
|
-
const update_openapiversion_1 = require("../ng-update/typescript/v10.3/update-openapiversion");
|
|
11
9
|
const typescript_1 = require("../ng-update/typescript");
|
|
12
|
-
|
|
10
|
+
const update_openapiversion_1 = require("../ng-update/typescript/v10.3/update-openapiversion");
|
|
11
|
+
const update_regen_script_1 = require("../ng-update/typescript/v11.0/update-regen-script");
|
|
13
12
|
const tsMigrationMap = {
|
|
14
13
|
'~10.3.2': (0, update_openapiversion_1.updateOpenApiVersionInProject)(),
|
|
15
14
|
'11.0.*': [
|
|
@@ -19,7 +18,6 @@ const tsMigrationMap = {
|
|
|
19
18
|
typescript_1.updateV11_4
|
|
20
19
|
]
|
|
21
20
|
};
|
|
22
|
-
/* eslint-enable @typescript-eslint/naming-convention */
|
|
23
21
|
/**
|
|
24
22
|
* Facilitate the migration of a version to another by the run of migration rules
|
|
25
23
|
* @param options
|
|
@@ -30,10 +28,10 @@ function migrateFn(options) {
|
|
|
30
28
|
const minimumVersion = (0, semver_1.minVersion)(to);
|
|
31
29
|
return (tree, context) => {
|
|
32
30
|
if (minimumVersion && (0, semver_1.gt)(minimumVersion, currentVersion)) {
|
|
33
|
-
context.logger.warn(`The specified range "${to}" has a minimum supported version higher than the current version of @ama-sdk/schematics (${currentVersion}).`
|
|
34
|
-
' The migration may not have any effect.');
|
|
31
|
+
context.logger.warn(`The specified range "${to}" has a minimum supported version higher than the current version of @ama-sdk/schematics (${currentVersion}).`
|
|
32
|
+
+ ' The migration may not have any effect.');
|
|
35
33
|
}
|
|
36
|
-
const workingDirectory = options?.projectName && (0, schematics_1.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root || '/';
|
|
34
|
+
const workingDirectory = (options?.projectName && (0, schematics_1.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root) || '/';
|
|
37
35
|
const runMigrateSchematic = (0, is_typescript_project_1.isTypescriptSdk)(tree, workingDirectory) ? (0, schematics_1.getMigrationRuleRunner)(tsMigrationMap, { logger: context.logger }) : undefined;
|
|
38
36
|
return runMigrateSchematic?.({ from: options.from, to });
|
|
39
37
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
import type { NgAddSchematicsSchema } from './schema';
|
|
2
3
|
/**
|
|
3
4
|
* Rule to update package.json scripts using yeoman generator from `@ama-sdk/generator-sdk`
|
|
4
5
|
* @param tree Tree
|
|
@@ -7,6 +8,7 @@ import { Rule } from '@angular-devkit/schematics';
|
|
|
7
8
|
export declare const updatePackageJsonScripts: Rule;
|
|
8
9
|
/**
|
|
9
10
|
* Add Otter ama-sdk-schematics to a Project
|
|
11
|
+
* @param opts
|
|
10
12
|
*/
|
|
11
|
-
export declare const ngAdd: () => Rule;
|
|
13
|
+
export declare const ngAdd: (opts: NgAddSchematicsSchema) => Rule;
|
|
12
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AAcpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAOlB;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,IAkDtC,CAAC;AAuGF;;;GAGG;AACH,eAAO,MAAM,KAAK,SAAU,qBAAqB,KAAG,IAGnD,CAAC"}
|