@ama-sdk/create 10.0.0-prerelease.8 → 10.0.0-prerelease.81

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 +9 -3
  2. package/index.js +4 -6
  3. package/package.json +27 -18
package/README.md CHANGED
@@ -9,18 +9,24 @@ This package is simplifying the start of new SDK repository.
9
9
 
10
10
  ## Usage
11
11
 
12
- ### NPM
13
-
14
12
  ```shell
15
13
  npm create @ama-sdk typescript <package-name> -- [...options]
16
14
  ```
17
15
 
18
- ### Yarn
16
+ or
19
17
 
20
18
  ```shell
21
19
  yarn create @ama-sdk typescript <project-name> [...options]
22
20
  ```
23
21
 
22
+ > **Warning** : Please notice that the command `yarn create` is **not** available for versions *>= 2.0.0* (see [Yarn cli commands](https://yarnpkg.com/cli)).
23
+
24
+ You can generate an environment with a specific package manager thanks to the `--package-manager` options:
25
+
26
+ ```shell
27
+ npm create @ama-sdk typescript <project-name> -- --package-manager=yarn [...options]
28
+ ```
29
+
24
30
  ## Options list
25
31
 
26
32
  - `--spec-path`: Path to the swagger/open-api specification used to generate the SDK
package/index.js CHANGED
@@ -1,21 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
+ /* eslint-disable no-console */
3
4
  Object.defineProperty(exports, "__esModule", { value: true });
4
5
  const node_child_process_1 = require("node:child_process");
5
6
  const node_path_1 = require("node:path");
6
7
  const minimist = require("minimist");
8
+ const packageManagerEnv = process.env.npm_config_user_agent?.split('/')[0];
7
9
  const defaultScope = 'sdk';
8
10
  const binPath = (0, node_path_1.resolve)(require.resolve('@angular-devkit/schematics-cli/package.json'), '../bin/schematics.js');
9
11
  const args = process.argv.slice(2);
10
12
  const argv = minimist(args);
11
- const packageManagerEnv = process.env.npm_config_user_agent?.split('/')[0];
12
13
  let defaultPackageManager = 'npm';
13
14
  if (packageManagerEnv && ['npm', 'yarn'].includes(packageManagerEnv)) {
14
15
  defaultPackageManager = packageManagerEnv;
15
16
  }
16
17
  const packageManager = argv['package-manager'] || defaultPackageManager;
17
18
  if (argv._.length < 2) {
18
- // eslint-disable-next-line no-console
19
19
  console.error('The SDK type and project name are mandatory');
20
20
  console.info(`usage: ${packageManager} create @ama-sdk typescript <@scope/package>`);
21
21
  process.exit(-1);
@@ -23,7 +23,6 @@ if (argv._.length < 2) {
23
23
  const sdkType = argv._[0];
24
24
  let [name, pck] = argv._[1].replace(/^@/, '').split('/');
25
25
  if (sdkType !== 'typescript') {
26
- // eslint-disable-next-line no-console
27
26
  console.error('Only the generation of "typescript" SDK is available');
28
27
  process.exit(-2);
29
28
  }
@@ -72,16 +71,15 @@ const run = () => {
72
71
  const steps = [
73
72
  getSchematicStepInfo(schematicsToRun[0]),
74
73
  ...(packageManager === 'yarn'
75
- ? [{ args: ['yarn', 'set', 'version', getYarnVersion()], cwd: (0, node_path_1.resolve)(process.cwd(), targetDirectory) }]
74
+ ? [{ runner: 'yarn', args: ['set', 'version', getYarnVersion()], cwd: (0, node_path_1.resolve)(process.cwd(), targetDirectory) }]
76
75
  : []),
77
76
  ...schematicsToRun.slice(1).map(getSchematicStepInfo)
78
77
  ];
79
78
  const errors = steps
80
- .map((step) => (0, node_child_process_1.spawnSync)(process.execPath, step.args, { stdio: 'inherit', cwd: step.cwd || process.cwd() }))
79
+ .map((step) => (0, node_child_process_1.spawnSync)(step.runner || process.execPath, step.args, { stdio: 'pipe', cwd: step.cwd || process.cwd() }))
81
80
  .map(({ error }) => error)
82
81
  .filter((err) => !!err);
83
82
  if (errors.length > 0) {
84
- // eslint-disable-next-line no-console
85
83
  errors.forEach((err) => console.error(err));
86
84
  process.exit(1);
87
85
  }
package/package.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "name": "@ama-sdk/create",
3
- "version": "10.0.0-prerelease.8",
3
+ "version": "10.0.0-prerelease.81",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
4
7
  "description": "Create a new SDK",
5
8
  "keywords": [
6
9
  "create"
@@ -14,55 +17,61 @@
14
17
  "prepare:publish": "prepare-publish ./dist"
15
18
  },
16
19
  "dependencies": {
17
- "@ama-sdk/core": "^10.0.0-prerelease.8",
18
- "@ama-sdk/schematics": "^10.0.0-prerelease.8",
20
+ "@ama-sdk/core": "^10.0.0-prerelease.81",
21
+ "@ama-sdk/schematics": "^10.0.0-prerelease.81",
19
22
  "@angular-devkit/core": "~17.0.3",
20
23
  "@angular-devkit/schematics": "~17.0.3",
21
24
  "@angular-devkit/schematics-cli": "~17.0.3",
22
- "@openapitools/openapi-generator-cli": "~2.7.0",
25
+ "@angular/cli": "~17.0.3",
26
+ "@o3r/schematics": "^10.0.0-prerelease.81",
27
+ "@openapitools/openapi-generator-cli": "~2.9.0",
23
28
  "@schematics/angular": "~17.0.3",
24
29
  "minimist": "^1.2.6",
30
+ "rxjs": "^7.8.1",
25
31
  "typescript": "~5.2.2"
26
32
  },
27
33
  "devDependencies": {
28
34
  "@angular-eslint/eslint-plugin": "~17.2.0",
29
35
  "@angular-eslint/eslint-plugin-template": "~17.2.0",
30
- "@nx/eslint": "~17.2.0",
31
- "@nx/eslint-plugin": "~17.2.0",
32
- "@nx/jest": "~17.2.0",
33
- "@nx/js": "~17.2.0",
34
- "@o3r/build-helpers": "^10.0.0-prerelease.8",
35
- "@o3r/eslint-config-otter": "^10.0.0-prerelease.8",
36
- "@o3r/eslint-plugin": "^10.0.0-prerelease.8",
37
- "@o3r/test-helpers": "^10.0.0-prerelease.8",
36
+ "@nx/eslint": "~18.0.2",
37
+ "@nx/eslint-plugin": "~18.0.2",
38
+ "@nx/jest": "~18.0.2",
39
+ "@nx/js": "~18.0.2",
40
+ "@o3r/build-helpers": "^10.0.0-prerelease.81",
41
+ "@o3r/eslint-config-otter": "^10.0.0-prerelease.81",
42
+ "@o3r/eslint-plugin": "^10.0.0-prerelease.81",
43
+ "@o3r/test-helpers": "^10.0.0-prerelease.81",
44
+ "@stylistic/eslint-plugin-ts": "^1.5.4",
38
45
  "@types/jest": "~29.5.2",
39
46
  "@types/minimist": "^1.2.2",
40
47
  "@types/node": "^20.0.0",
41
48
  "@types/pid-from-port": "^1.1.0",
42
49
  "@types/semver": "^7.3.13",
43
- "@typescript-eslint/eslint-plugin": "^6.19.0",
44
- "@typescript-eslint/parser": "^6.11.0",
50
+ "@typescript-eslint/eslint-plugin": "^7.0.1",
51
+ "@typescript-eslint/parser": "^7.0.1",
45
52
  "cpy-cli": "^5.0.0",
46
53
  "eslint": "^8.42.0",
47
54
  "eslint-import-resolver-node": "^0.3.4",
48
55
  "eslint-plugin-jest": "~27.6.0",
49
56
  "eslint-plugin-jsdoc": "~48.0.0",
50
57
  "eslint-plugin-prefer-arrow": "~1.2.3",
51
- "eslint-plugin-unicorn": "^50.0.0",
58
+ "eslint-plugin-unicorn": "^51.0.0",
52
59
  "jest": "~29.7.0",
53
60
  "jest-junit": "~16.0.0",
54
61
  "jsonc-eslint-parser": "~2.4.0",
55
- "nx": "~17.2.0",
62
+ "nx": "~18.0.2",
56
63
  "pid-from-port": "^1.1.3",
57
64
  "rimraf": "^5.0.1",
58
65
  "rxjs": "^7.8.1",
59
66
  "semver": "^7.5.2",
60
67
  "ts-jest": "~29.1.1",
61
68
  "tslib": "^2.5.3",
62
- "type-fest": "^4.3.1"
69
+ "type-fest": "^4.10.2"
63
70
  },
64
71
  "engines": {
65
- "node": ">=18.0.0"
72
+ "node": ">=18.0.0",
73
+ "yarn": "<2.0.0",
74
+ "npm": "*"
66
75
  },
67
76
  "contributors": [
68
77
  {