@ama-sdk/schematics 11.6.0-prerelease.4 → 11.6.0-prerelease.40
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/collection.json +1 -1
- package/package.json +28 -22
- 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 +1 -1
- 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 +1 -1
- 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 +2 -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 +3 -2
- package/schematics/code-generator/swagger-java-generator/swagger-java.options.d.ts +1 -1
- 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 +1 -0
- package/schematics/java/client-core/index.d.ts.map +1 -1
- package/schematics/java/client-core/index.js +3 -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 +41 -46
- 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/collection.json
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"schema": "./schematics/typescript/shell/schema.json"
|
|
34
34
|
},
|
|
35
35
|
"java-client-core": {
|
|
36
|
-
"description": "Generate a Java SDK source code based on swagger specification",
|
|
36
|
+
"description": "[Deprecated - Removed in v12] Generate a Java SDK source code based on swagger specification",
|
|
37
37
|
"factory": "./schematics/java/client-core/index#ngGenerateJavaClientCore",
|
|
38
38
|
"schema": "./schematics/java/client-core/schema.json"
|
|
39
39
|
}
|
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.40",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -63,12 +63,12 @@
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@ama-sdk/core": "^11.6.0-prerelease.
|
|
67
|
-
"@angular-devkit/core": "
|
|
66
|
+
"@ama-sdk/core": "^11.6.0-prerelease.40",
|
|
67
|
+
"@angular-devkit/core": "^18.2.0",
|
|
68
68
|
"@angular-devkit/schematics-cli": "^18.0.5",
|
|
69
|
-
"@angular/cli": "
|
|
70
|
-
"@o3r/schematics": "^11.6.0-prerelease.
|
|
71
|
-
"@openapitools/openapi-generator-cli": "
|
|
69
|
+
"@angular/cli": "^18.2.0",
|
|
70
|
+
"@o3r/schematics": "^11.6.0-prerelease.40",
|
|
71
|
+
"@openapitools/openapi-generator-cli": "^2.15.0",
|
|
72
72
|
"openapi-types": "^12.0.0",
|
|
73
73
|
"type-fest": "^4.10.2"
|
|
74
74
|
},
|
|
@@ -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.40",
|
|
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.40",
|
|
95
|
+
"@o3r/eslint-plugin": "^11.6.0-prerelease.40",
|
|
96
|
+
"@o3r/schematics": "^11.6.0-prerelease.40",
|
|
97
|
+
"@o3r/telemetry": "^11.6.0-prerelease.40",
|
|
98
|
+
"@o3r/test-helpers": "^11.6.0-prerelease.40",
|
|
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.17.0",
|
|
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,14 +135,16 @@
|
|
|
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.17.0"
|
|
135
140
|
},
|
|
136
141
|
"generatorDependencies": {
|
|
137
142
|
"@swc/cli": "~0.5.0",
|
|
138
|
-
"@swc/core": "~1.
|
|
143
|
+
"@swc/core": "~1.10.0",
|
|
139
144
|
"@swc/helpers": "~0.5.0",
|
|
140
145
|
"@commitlint/cli": "^19.0.0",
|
|
141
146
|
"@commitlint/config-conventional": "^19.0.0",
|
|
147
|
+
"@typescript-eslint/eslint-plugin": "~8.17.0",
|
|
142
148
|
"jest-junit": "~16.0.0",
|
|
143
149
|
"lint-staged": "^15.0.0",
|
|
144
150
|
"minimist": "^1.2.6",
|
|
@@ -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
|
/**
|
|
@@ -24,7 +24,7 @@ export declare class OpenApiCliGenerator extends CodeGenerator<OpenApiCliOptions
|
|
|
24
24
|
*/
|
|
25
25
|
private runGenerator;
|
|
26
26
|
/** @inheritDoc */
|
|
27
|
-
protected getDefaultOptions: () => OpenApiCliOptions
|
|
27
|
+
protected getDefaultOptions: () => Readonly<OpenApiCliOptions>;
|
|
28
28
|
/** @inheritDoc */
|
|
29
29
|
protected runCodeGeneratorFactory: (factoryOptions?: {
|
|
30
30
|
rootDirectory?: string;
|
|
@@ -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,oCAA2C;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] : [],
|
|
@@ -57,5 +57,5 @@ export type OpenApiCliOptions = CodegenTaskOptions & {
|
|
|
57
57
|
/**
|
|
58
58
|
* Default options to run our custom typescript generator
|
|
59
59
|
*/
|
|
60
|
-
export declare const defaultTypescriptGeneratorOptions: OpenApiCliOptions
|
|
60
|
+
export declare const defaultTypescriptGeneratorOptions: Readonly<OpenApiCliOptions>;
|
|
61
61
|
//# sourceMappingURL=open-api-cli.options.d.ts.map
|
|
@@ -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,QAAQ,CAAC,iBAAiB,CAUhE,CAAC"}
|
|
@@ -3,12 +3,13 @@ import { JavaGeneratorTaskOptions } from './swagger-java.options';
|
|
|
3
3
|
/**
|
|
4
4
|
* Manage the schematic to generate a sdk using the Swagger 2 Generator
|
|
5
5
|
* Note: a working java setup compatible with Swagger 2 Generator is required to use this class
|
|
6
|
+
* @deprecated to be removed in v12
|
|
6
7
|
*/
|
|
7
8
|
export declare class SwaggerJavaGenerator extends CodeGenerator<JavaGeneratorTaskOptions> {
|
|
8
9
|
/** @inheritDoc */
|
|
9
10
|
protected generatorName: string;
|
|
10
11
|
/** @inheritDoc */
|
|
11
|
-
protected getDefaultOptions: () => JavaGeneratorTaskOptions
|
|
12
|
+
protected getDefaultOptions: () => Readonly<JavaGeneratorTaskOptions>;
|
|
12
13
|
/** @inheritDoc */
|
|
13
14
|
protected runCodeGeneratorFactory(factoryOptions?: {
|
|
14
15
|
rootDirectory?: string;
|
|
@@ -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;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,aAAa,CAAC,wBAAwB,CAAC;IAC/E,kBAAkB;IAClB,SAAS,CAAC,aAAa,SAAoB;IAE3C,kBAAkB;IAClB,SAAS,CAAC,iBAAiB,2CAAwB;IACnD,kBAAkB;IAClB,SAAS,CAAC,uBAAuB,CAAC,cAAc,GAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAO,uBAE9C,wBAAwB;CA6C5D"}
|
|
@@ -1,13 +1,14 @@
|
|
|
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
|
/**
|
|
9
9
|
* Manage the schematic to generate a sdk using the Swagger 2 Generator
|
|
10
10
|
* Note: a working java setup compatible with Swagger 2 Generator is required to use this class
|
|
11
|
+
* @deprecated to be removed in v12
|
|
11
12
|
*/
|
|
12
13
|
class SwaggerJavaGenerator extends code_generator_1.CodeGenerator {
|
|
13
14
|
constructor() {
|
|
@@ -22,7 +23,7 @@ class SwaggerJavaGenerator extends code_generator_1.CodeGenerator {
|
|
|
22
23
|
const rootDirectory = factoryOptions.rootDirectory || process.cwd();
|
|
23
24
|
return async (generatorOptions) => {
|
|
24
25
|
if (!generatorOptions) {
|
|
25
|
-
return Promise.reject('Missing options');
|
|
26
|
+
return Promise.reject(new Error('Missing options'));
|
|
26
27
|
}
|
|
27
28
|
const spawnOptions = {
|
|
28
29
|
stdio: 'inherit',
|
|
@@ -28,5 +28,5 @@ export type JavaGeneratorTaskOptions = CodegenTaskOptions & {
|
|
|
28
28
|
/**
|
|
29
29
|
* Default options to generate a JAVA sdk using the Swagger 2 Generator
|
|
30
30
|
*/
|
|
31
|
-
export declare const defaultOptions: JavaGeneratorTaskOptions
|
|
31
|
+
export declare const defaultOptions: Readonly<JavaGeneratorTaskOptions>;
|
|
32
32
|
//# sourceMappingURL=swagger-java.options.d.ts.map
|
|
@@ -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,QAAQ,CAAC,wBAAwB,CASpD,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;
|
|
@@ -2,6 +2,7 @@ import { Rule } from '@angular-devkit/schematics';
|
|
|
2
2
|
import { NgGenerateJavaClientCoreSchematicsSchema } from './schema';
|
|
3
3
|
/**
|
|
4
4
|
* Generate a Java client SDK source code base on swagger specification
|
|
5
|
+
* @deprecated Remove in otter v12
|
|
5
6
|
* @param options
|
|
6
7
|
*/
|
|
7
8
|
export declare const ngGenerateJavaClientCore: (options: NgGenerateJavaClientCoreSchematicsSchema) => () => Promise<Rule>;
|
|
@@ -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;;;;GAIG;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' });
|
|
@@ -75,6 +74,7 @@ function ngGenerateJavaClientCoreFn(options) {
|
|
|
75
74
|
}
|
|
76
75
|
/**
|
|
77
76
|
* Generate a Java client SDK source code base on swagger specification
|
|
77
|
+
* @deprecated Remove in otter v12
|
|
78
78
|
* @param options
|
|
79
79
|
*/
|
|
80
80
|
const ngGenerateJavaClientCore = (options) => async () => {
|
|
@@ -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"}
|