@ama-sdk/create 11.0.0-prerelease.2 → 11.0.0-prerelease.21

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +9 -1
  3. package/package.json +10 -10
package/README.md CHANGED
@@ -44,7 +44,7 @@ npm create @ama-sdk typescript <project-name> -- --package-manager=yarn [...opti
44
44
 
45
45
  - `--spec-path`: Path to the swagger/open-api specification used to generate the SDK
46
46
  - `--spec-package-name`: The npm package name where the spec file can be fetched
47
- - `--spec-package-path`: The path inside the package where to find the spec file
47
+ - `--spec-package-path`: The export path inside the package.json where to find the spec file. Defaults to _./openapi.[yml|yaml|json]_
48
48
  - `--spec-package-version`: The version to target for the npm package where the spec file can be fetched
49
49
  - `--spec-package-registry`: The npm registry where the spec file can be fetched
50
50
 
package/index.js CHANGED
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  const node_child_process_1 = require("node:child_process");
6
6
  const node_path_1 = require("node:path");
7
7
  const minimist = require("minimist");
8
+ const core_1 = require("@ama-sdk/core");
8
9
  const packageManagerEnv = process.env.npm_config_user_agent?.split('/')[0];
9
10
  const binPath = (0, node_path_1.resolve)(require.resolve('@angular-devkit/schematics-cli/package.json'), '../bin/schematics.js');
10
11
  const args = process.argv.slice(2);
@@ -56,6 +57,12 @@ if (argv['spec-path'] && argv['spec-package-name']) {
56
57
  console.error('--spec-path cannot be set with --spec-package-name');
57
58
  process.exit(-4);
58
59
  }
60
+ /* The local file (path) which will be created in case of generation using specs from an npm module */
61
+ let localFilePathToBeCreated;
62
+ if (argv['spec-package-name']) {
63
+ const localSpecFileComputedExtension = argv['spec-package-path'] && (0, node_path_1.extname)(argv['spec-package-path']) === '.json' ? `.${core_1.SPEC_JSON_EXTENSION}` : `.${core_1.SPEC_YAML_EXTENSION}`;
64
+ localFilePathToBeCreated = `./${core_1.LOCAL_SPEC_FILENAME}${localSpecFileComputedExtension}`;
65
+ }
59
66
  const commonSchematicArgs = [
60
67
  argv.debug !== undefined ? `--debug=${argv.debug}` : '--debug=false', // schematics enable debug mode per default when using schematics with relative path
61
68
  ...(name ? ['--name', name] : []),
@@ -77,7 +84,8 @@ const run = () => {
77
84
  ];
78
85
  const coreSchematicArgs = [
79
86
  ...commonSchematicArgs,
80
- '--spec-path', argv['spec-package-name'] ? './openapi.yml' : isSpecRelativePath ? (0, node_path_1.relative)(resolveTargetDirectory, (0, node_path_1.resolve)(process.cwd(), argv['spec-path'])) : argv['spec-path']
87
+ '--spec-path',
88
+ localFilePathToBeCreated || (isSpecRelativePath ? (0, node_path_1.relative)(resolveTargetDirectory, (0, node_path_1.resolve)(process.cwd(), argv['spec-path'])) : argv['spec-path'])
81
89
  ];
82
90
  const runner = process.platform === 'win32' ? `${packageManager}.cmd` : packageManager;
83
91
  const steps = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ama-sdk/create",
3
- "version": "11.0.0-prerelease.2",
3
+ "version": "11.0.0-prerelease.21",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -17,13 +17,13 @@
17
17
  "prepare:publish": "prepare-publish ./dist"
18
18
  },
19
19
  "dependencies": {
20
- "@ama-sdk/core": "11.0.0-prerelease.2",
21
- "@ama-sdk/schematics": "11.0.0-prerelease.2",
20
+ "@ama-sdk/core": "11.0.0-prerelease.21",
21
+ "@ama-sdk/schematics": "11.0.0-prerelease.21",
22
22
  "@angular-devkit/core": "~17.3.0",
23
23
  "@angular-devkit/schematics": "~17.3.0",
24
24
  "@angular-devkit/schematics-cli": "~17.3.0",
25
25
  "@angular/cli": "~17.3.0",
26
- "@o3r/schematics": "11.0.0-prerelease.2",
26
+ "@o3r/schematics": "11.0.0-prerelease.21",
27
27
  "@openapitools/openapi-generator-cli": "~2.13.0",
28
28
  "@schematics/angular": "~17.3.0",
29
29
  "minimist": "^1.2.6",
@@ -31,16 +31,16 @@
31
31
  "typescript": "~5.4.2"
32
32
  },
33
33
  "devDependencies": {
34
- "@angular-eslint/eslint-plugin": "~17.3.0",
35
- "@angular-eslint/eslint-plugin-template": "~17.3.0",
34
+ "@angular-eslint/eslint-plugin": "~17.5.0",
35
+ "@angular-eslint/eslint-plugin-template": "~17.5.0",
36
36
  "@nx/eslint": "~18.3.0",
37
37
  "@nx/eslint-plugin": "~18.3.0",
38
38
  "@nx/jest": "~18.3.0",
39
39
  "@nx/js": "~18.3.0",
40
- "@o3r/build-helpers": "^11.0.0-prerelease.2",
41
- "@o3r/eslint-config-otter": "^11.0.0-prerelease.2",
42
- "@o3r/eslint-plugin": "^11.0.0-prerelease.2",
43
- "@o3r/test-helpers": "^11.0.0-prerelease.2",
40
+ "@o3r/build-helpers": "^11.0.0-prerelease.21",
41
+ "@o3r/eslint-config-otter": "^11.0.0-prerelease.21",
42
+ "@o3r/eslint-plugin": "^11.0.0-prerelease.21",
43
+ "@o3r/test-helpers": "^11.0.0-prerelease.21",
44
44
  "@stylistic/eslint-plugin-ts": "^1.5.4",
45
45
  "@types/jest": "~29.5.2",
46
46
  "@types/minimist": "^1.2.2",