@ama-sdk/create 10.1.0-prerelease.8 → 10.1.0-rc.0
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 +1 -0
- package/index.js +15 -12
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -33,6 +33,7 @@ npm create @ama-sdk typescript <project-name> -- --package-manager=yarn [...opti
|
|
|
33
33
|
- `--spec-path`: Path to the swagger/open-api specification used to generate the SDK
|
|
34
34
|
- `--package-manager`: Node package manager to be used (`npm` and `yarn` are available).
|
|
35
35
|
- `--debug`: Enable schematics debug mode (including dry run).
|
|
36
|
+
- `--exact-o3r-version` : use a pinned version for [otter packages](https://github.com/AmadeusITGroup/otter/blob/main/docs/README.md).
|
|
36
37
|
|
|
37
38
|
> [!NOTE]
|
|
38
39
|
> If the `--spec-path` is specified, the SDK will be generated based on this specification at the creation time.
|
package/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/* eslint-disable no-console */
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
const node_child_process_1 = require("node:child_process");
|
|
6
|
+
const url = require("node:url");
|
|
6
7
|
const node_path_1 = require("node:path");
|
|
7
8
|
const minimist = require("minimist");
|
|
8
9
|
const packageManagerEnv = process.env.npm_config_user_agent?.split('/')[0];
|
|
@@ -33,10 +34,6 @@ if (!pck) {
|
|
|
33
34
|
}
|
|
34
35
|
const targetDirectory = (0, node_path_1.join)('.', name, pck);
|
|
35
36
|
const schematicsPackage = (0, node_path_1.dirname)(require.resolve('@ama-sdk/schematics/package.json'));
|
|
36
|
-
const schematicsToRun = [
|
|
37
|
-
`${schematicsPackage}:typescript-shell`,
|
|
38
|
-
...(argv['spec-path'] ? [`${schematicsPackage}:typescript-core`] : [])
|
|
39
|
-
];
|
|
40
37
|
const getYarnVersion = () => {
|
|
41
38
|
try {
|
|
42
39
|
return (0, node_child_process_1.execSync)('yarn --version', {
|
|
@@ -61,21 +58,27 @@ const schematicArgs = [
|
|
|
61
58
|
'--name', name,
|
|
62
59
|
'--package', pck,
|
|
63
60
|
'--package-manager', packageManager,
|
|
64
|
-
'--
|
|
65
|
-
...(argv['spec-path'] ? ['--spec-path', argv['spec-path']] : []),
|
|
61
|
+
...(argv['exact-o3r-version'] ? ['--exact-o3r-version'] : []),
|
|
66
62
|
...(typeof argv['o3r-metrics'] !== 'undefined' ? [`--${!argv['o3r-metrics'] ? 'no-' : ''}o3r-metrics`] : [])
|
|
67
63
|
];
|
|
68
|
-
const
|
|
69
|
-
args: [binPath, schematic, ...schematicArgs]
|
|
70
|
-
});
|
|
64
|
+
const resolveTargetDirectory = (0, node_path_1.resolve)(process.cwd(), targetDirectory);
|
|
71
65
|
const run = () => {
|
|
66
|
+
const isSpecPathUrl = url.URL.canParse(argv['spec-path']);
|
|
72
67
|
const runner = process.platform === 'win32' ? `${packageManager}.cmd` : packageManager;
|
|
73
68
|
const steps = [
|
|
74
|
-
|
|
69
|
+
{ args: [binPath, `${schematicsPackage}:typescript-shell`, ...schematicArgs, '--directory', targetDirectory] },
|
|
75
70
|
...(packageManager === 'yarn'
|
|
76
|
-
? [{ runner, args: ['set', 'version', getYarnVersion()], cwd:
|
|
71
|
+
? [{ runner, args: ['set', 'version', getYarnVersion()], cwd: resolveTargetDirectory }]
|
|
77
72
|
: []),
|
|
78
|
-
...
|
|
73
|
+
...(argv['spec-path'] ? [{
|
|
74
|
+
args: [
|
|
75
|
+
binPath,
|
|
76
|
+
`${schematicsPackage}:typescript-core`,
|
|
77
|
+
...schematicArgs,
|
|
78
|
+
'--spec-path', isSpecPathUrl ? argv['spec-path'] : (0, node_path_1.relative)(resolveTargetDirectory, (0, node_path_1.resolve)(process.cwd(), argv['spec-path']))
|
|
79
|
+
],
|
|
80
|
+
cwd: resolveTargetDirectory
|
|
81
|
+
}] : [])
|
|
79
82
|
];
|
|
80
83
|
const errors = steps
|
|
81
84
|
.map((step) => (0, node_child_process_1.spawnSync)(step.runner || process.execPath, step.args, { stdio: 'inherit', cwd: step.cwd || process.cwd() }))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ama-sdk/create",
|
|
3
|
-
"version": "10.1.0-
|
|
3
|
+
"version": "10.1.0-rc.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
"prepare:publish": "prepare-publish ./dist"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ama-sdk/core": "
|
|
21
|
-
"@ama-sdk/schematics": "
|
|
20
|
+
"@ama-sdk/core": "10.1.0-rc.0",
|
|
21
|
+
"@ama-sdk/schematics": "10.1.0-rc.0",
|
|
22
22
|
"@angular-devkit/core": "~17.2.0",
|
|
23
23
|
"@angular-devkit/schematics": "~17.2.0",
|
|
24
24
|
"@angular-devkit/schematics-cli": "~17.2.0",
|
|
25
25
|
"@angular/cli": "~17.2.0",
|
|
26
|
-
"@o3r/schematics": "
|
|
27
|
-
"@openapitools/openapi-generator-cli": "~2.
|
|
26
|
+
"@o3r/schematics": "10.1.0-rc.0",
|
|
27
|
+
"@openapitools/openapi-generator-cli": "~2.10.0",
|
|
28
28
|
"@schematics/angular": "~17.2.0",
|
|
29
29
|
"minimist": "^1.2.6",
|
|
30
30
|
"rxjs": "^7.8.1",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"@nx/eslint-plugin": "~18.0.2",
|
|
38
38
|
"@nx/jest": "~18.0.2",
|
|
39
39
|
"@nx/js": "~18.0.2",
|
|
40
|
-
"@o3r/build-helpers": "^10.1.0-
|
|
41
|
-
"@o3r/eslint-config-otter": "^10.1.0-
|
|
42
|
-
"@o3r/eslint-plugin": "^10.1.0-
|
|
43
|
-
"@o3r/test-helpers": "^10.1.0-
|
|
40
|
+
"@o3r/build-helpers": "^10.1.0-rc.0",
|
|
41
|
+
"@o3r/eslint-config-otter": "^10.1.0-rc.0",
|
|
42
|
+
"@o3r/eslint-plugin": "^10.1.0-rc.0",
|
|
43
|
+
"@o3r/test-helpers": "^10.1.0-rc.0",
|
|
44
44
|
"@stylistic/eslint-plugin-ts": "^1.5.4",
|
|
45
45
|
"@types/jest": "~29.5.2",
|
|
46
46
|
"@types/minimist": "^1.2.2",
|