@o3r/create 9.6.0-rc.5 → 9.6.0-rc.7

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 +2 -0
  2. package/index.js +15 -1
  3. package/package.json +5 -5
package/README.md CHANGED
@@ -17,6 +17,8 @@ npm create @o3r <project-name> -- [...options]
17
17
 
18
18
  ### Yarn
19
19
 
20
+ This feature is experimental for yarn package manager
21
+
20
22
  ```shell
21
23
  yarn create @o3r <project-name> [...options]
22
24
  ```
package/index.js CHANGED
@@ -67,6 +67,7 @@ const logo = `
67
67
  '|. || || || || ||
68
68
  ''|...|' '|.' '|.' '|...' .||.
69
69
  `;
70
+ const packageManager = process.env.npm_config_user_agent?.split('/')[0];
70
71
  const binPath = (0, node_path_1.join)(require.resolve('@angular/cli/package.json'), '../bin/ng.js');
71
72
  const args = process.argv.slice(2).filter((a) => a !== '--create-application');
72
73
  if (!args.some((a) => a.startsWith('--style'))) {
@@ -74,7 +75,6 @@ if (!args.some((a) => a.startsWith('--style'))) {
74
75
  }
75
76
  const hasPackageManagerArg = args.some((a) => a.startsWith('--package-manager'));
76
77
  if (!hasPackageManagerArg) {
77
- const packageManager = process.env.npm_config_user_agent?.split('/')[0];
78
78
  if (packageManager && ['npm', 'pnpm', 'yarn', 'cnpm'].includes(packageManager)) {
79
79
  args.push('--package-manager', packageManager);
80
80
  }
@@ -100,6 +100,18 @@ const isNgNewOptions = (arg) => {
100
100
  }
101
101
  return true;
102
102
  };
103
+ const checkIfSupportedPackageManager = () => {
104
+ if (packageManager !== 'npm') {
105
+ // eslint-disable-next-line no-console
106
+ console.error(`Other package managers than 'npm' are experimental for @o3r create for the time being.
107
+ Please use the following command:
108
+ 'npm create @o3r <project-name> -- [...options]'
109
+
110
+ https://github.com/AmadeusITGroup/otter/tree/main/packages/%40o3r/create#usage
111
+
112
+ `);
113
+ }
114
+ };
103
115
  const createNgProject = () => {
104
116
  const { error } = (0, node_child_process_1.spawnSync)(process.execPath, [binPath, 'new', ...args.filter(isNgNewOptions), '--skip-install'], {
105
117
  stdio: 'inherit'
@@ -107,6 +119,7 @@ const createNgProject = () => {
107
119
  if (error) {
108
120
  // eslint-disable-next-line no-console
109
121
  console.error(error);
122
+ checkIfSupportedPackageManager();
110
123
  process.exit(1);
111
124
  }
112
125
  };
@@ -119,6 +132,7 @@ const addOtterFramework = (relativeDirectory = '.') => {
119
132
  if (error) {
120
133
  // eslint-disable-next-line no-console
121
134
  console.error(error);
135
+ checkIfSupportedPackageManager();
122
136
  process.exit(2);
123
137
  }
124
138
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/create",
3
- "version": "9.6.0-rc.5",
3
+ "version": "9.6.0-rc.7",
4
4
  "description": "Create a new Otter based application",
5
5
  "keywords": [
6
6
  "create",
@@ -26,10 +26,10 @@
26
26
  "@nx/jest": "~16.10.0",
27
27
  "@nx/js": "~16.10.0",
28
28
  "@nx/linter": "~16.10.0",
29
- "@o3r/build-helpers": "^9.6.0-rc.5",
30
- "@o3r/dev-tools": "^9.6.0-rc.5",
31
- "@o3r/eslint-config-otter": "^9.6.0-rc.5",
32
- "@o3r/eslint-plugin": "^9.6.0-rc.5",
29
+ "@o3r/build-helpers": "^9.6.0-rc.7",
30
+ "@o3r/dev-tools": "^9.6.0-rc.7",
31
+ "@o3r/eslint-config-otter": "^9.6.0-rc.7",
32
+ "@o3r/eslint-plugin": "^9.6.0-rc.7",
33
33
  "@types/jest": "~29.5.2",
34
34
  "@types/minimist": "^1.2.2",
35
35
  "@types/node": "^18.0.0",