devextreme-cli 1.12.0 → 1.12.2

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  # DevExtreme CLI
2
2
 
3
- DevExtreme CLI is a set of command-line tools to be used with the DevExtreme controls library.
3
+ DevExtreme CLI implements command-line tools that help you integrate DevExpress DevExtreme components into your web applications.
4
4
 
5
5
  * [Documentation](https://js.devexpress.com/Documentation/Guide/Getting_Started/DevExtreme_CLI/)
6
6
 
7
7
  ## License ##
8
8
 
9
- **DevExtreme CLI is released as a MIT-licensed (free and open-source) add-on to DevExtreme.**
9
+ **DevExtreme CLI is a free and open-source add-on to DevExtreme, available under the [MIT license](LICENSE).**
10
10
 
11
- Familiarize yourself with the [DevExtreme License](https://js.devexpress.com/Licensing/). [Free trial is available!](http://js.devexpress.com/Buy/)
11
+ License terms for DevExpress DevExtreme are avialable on the [DevExtreme Licensing page](https://js.devexpress.com/Licensing/). To download a free evaluation version, visit the [DevExtreme website](http://js.devexpress.com/Buy/).
12
12
 
13
13
  ## Support & Feedback ##
14
14
 
15
- If you want to report a bug, request a feature, or ask a question, submit an [issue](https://github.com/DevExpress/devextreme-angular/issues) to this repo. Alternatively, you can contact us at the [DevExpress Support Center](https://www.devexpress.com/Support/Center) if you own an active DevExtreme license.
15
+ If you want to report a bug, request a feature, or ask a question, submit an [issue](https://github.com/DevExpress/devextreme-angular/issues) to this repo. You can also submit a ticket to the [DevExpress Support Center](https://www.devexpress.com/Support/Center) if you own an active DevExtreme license.
package/index.js CHANGED
@@ -41,7 +41,7 @@ const run = async(commands, options) => {
41
41
  await application.run(commands, options, devextremeConfig.read());
42
42
  } else if(application.isMigrationCommand(commands[0])) {
43
43
  if(!commands[1]) {
44
- console.error('Please specify a change name for migration.');
44
+ console.error('Please specify a migration command.');
45
45
  printHelp('migrate');
46
46
  return;
47
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devextreme-cli",
3
- "version": "1.12.0",
3
+ "version": "1.12.2",
4
4
  "description": "DevExtreme CLI",
5
5
  "keywords": [
6
6
  "devexpress",
@@ -43,14 +43,13 @@
43
43
  "minimist": "^1.2.8",
44
44
  "mustache": "^3.2.1",
45
45
  "prompts": "^2.4.2",
46
- "sass": "^1.93.2",
46
+ "sass": "^1.94.2",
47
47
  "semver": "^5.7.2",
48
48
  "strip-bom": "^4.0.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@typescript-eslint/eslint-plugin": "^4.33.0",
52
52
  "@typescript-eslint/parser": "^4.33.0",
53
- "babel-eslint": "^10.1.0",
54
53
  "create-vite": "7.1.3",
55
54
  "cross-env": "^5.2.1",
56
55
  "eslint": "^7.32.0",
@@ -74,5 +73,9 @@
74
73
  "typescript-eslint-parser": "^22.0.0",
75
74
  "wait-on": "8.0.5"
76
75
  },
77
- "gitHead": "0a56ed4e9c13e1deb23007f0d23f974806878a7f"
76
+ "overrides": {
77
+ "@babel/traverse@<7.23.2": ">=7.23.2",
78
+ "braces@<3.0.3": ">=3.0.3"
79
+ },
80
+ "gitHead": "d8919cf6f14386254ace295b651ce3f532833ba8"
78
81
  }
@@ -19,7 +19,7 @@ const handleWrongAppType = (appType, command) => {
19
19
  };
20
20
 
21
21
  const handleWrongChangeName = (changeName, command) => {
22
- console.error(`The '${changeName}' change name is not valid`);
22
+ console.error(`Invalid migration command: ${changeName}`);
23
23
  printHelp(command);
24
24
  };
25
25
 
@@ -53,7 +53,6 @@ async function runNgCommand(commandArguments, commandOptions, commandConfig) {
53
53
  }
54
54
 
55
55
  function localPackageExists(packageName) {
56
- // Check local node_modules first
57
56
  const nodeModulesPath = path.join(process.cwd(), 'node_modules');
58
57
  if(fs.existsSync(nodeModulesPath)) {
59
58
  const packageJsonPath = path.join(nodeModulesPath, packageName, 'package.json');
@@ -61,16 +60,41 @@ function localPackageExists(packageName) {
61
60
  return true;
62
61
  }
63
62
  }
63
+ return false;
64
+ }
65
+
66
+ function getLocalCollectionPath(packageName) {
67
+ const nodeModulesPath = path.join(process.cwd(), 'node_modules', packageName, 'src', 'collection.json');
68
+ if(fs.existsSync(nodeModulesPath)) {
69
+ return nodeModulesPath;
70
+ }
71
+ return null;
72
+ }
73
+
74
+ function getCollectionPath(packageName) {
75
+ const localPath = getLocalCollectionPath(packageName);
76
+ if(localPath) {
77
+ return localPath;
78
+ }
64
79
 
65
- // Check if globally installed by trying to resolve the package
66
80
  try {
67
- require.resolve(`${packageName}/package.json`);
81
+ const packageJsonPath = require.resolve(`${packageName}/package.json`);
82
+ const collectionPath = path.join(path.dirname(packageJsonPath), 'src', 'collection.json');
83
+ if(fs.existsSync(collectionPath)) {
84
+ return collectionPath;
85
+ }
86
+ } catch(e) {}
87
+
88
+ return null;
89
+ }
90
+
91
+ function schematicsCliExists() {
92
+ try {
93
+ require.resolve('@angular-devkit/schematics-cli/package.json');
68
94
  return true;
69
95
  } catch(e) {
70
- // Package not found globally
96
+ return false;
71
97
  }
72
-
73
- return false;
74
98
  }
75
99
 
76
100
  const hasSutableNgCli = async() => {
@@ -165,33 +189,22 @@ const addView = (viewName, options) => {
165
189
 
166
190
  const migrateConfigComponents = async(options = {}) => {
167
191
  const collectionName = 'devextreme-schematics';
192
+ const collectionPath = getCollectionPath(collectionName);
168
193
 
169
- // Check if devextreme-schematics is installed
170
- if(!localPackageExists(collectionName)) {
194
+ if(!collectionPath) {
171
195
  const prompts = require('prompts');
172
196
 
173
- console.log(`\nThe '${collectionName}' package is required to run this command.`);
197
+ console.log(`\nRequired package is missing: '${collectionName}'`);
174
198
 
175
199
  const response = await prompts({
176
200
  type: 'confirm',
177
201
  name: 'install',
178
- message: `Would you like to install '${collectionName}' now?`,
202
+ message: `Would you like to install '${collectionName}@${schematicsVersion}' in the npm cache?`,
179
203
  initial: true
180
204
  });
181
205
 
182
206
  if(!response.install) {
183
- console.log('Migration cancelled. Please install devextreme-schematics manually:');
184
- console.log(`npm install -g ${collectionName}@${schematicsVersion}`);
185
- process.exit(1);
186
- }
187
-
188
- console.log(`Installing ${collectionName}@${schematicsVersion}...`);
189
- try {
190
- await runCommand('npm', ['install', '-g', `${collectionName}@${schematicsVersion}`], { stdio: 'inherit' });
191
- console.log('Installation completed successfully.');
192
- } catch(error) {
193
- console.error('Failed to install devextreme-schematics. Please install manually:');
194
- console.error(`npm install -g ${collectionName}@${schematicsVersion}`);
207
+ console.log('Migration was canceled.');
195
208
  process.exit(1);
196
209
  }
197
210
  }
@@ -200,14 +213,22 @@ const migrateConfigComponents = async(options = {}) => {
200
213
  ...options
201
214
  };
202
215
 
203
- if(schematicOptions.include && typeof schematicOptions.include === 'string') {
204
- schematicOptions.include = schematicOptions.include.split(',').map(s => s.trim());
216
+ const hasSchematicsCli = schematicsCliExists();
217
+ const commandArguments = ['--yes'];
218
+
219
+ if(!hasSchematicsCli) {
220
+ commandArguments.push('-p', '@angular-devkit/schematics-cli');
205
221
  }
206
- if(schematicOptions.scriptInclude && typeof schematicOptions.scriptInclude === 'string') {
207
- schematicOptions.scriptInclude = schematicOptions.scriptInclude.split(',').map(s => s.trim());
222
+
223
+ if(!collectionPath) {
224
+ commandArguments.push('-p', `${collectionName}@${schematicsVersion}`);
208
225
  }
209
226
 
210
- const commandArguments = ['schematics', `${collectionName}:migrate-config-components`];
227
+ const collectionSpecifier = collectionPath
228
+ ? `${collectionPath.replace(/\\/g, '/')}:migrate-config-components`
229
+ : `${collectionName}:migrate-config-components`;
230
+
231
+ commandArguments.push('schematics', collectionSpecifier);
211
232
 
212
233
  const { [depsVersionTagOptionName]: _, ...optionsToArguments } = schematicOptions; // eslint-disable-line no-unused-vars
213
234
  for(let option in optionsToArguments) {
package/src/commands.json CHANGED
@@ -51,19 +51,19 @@
51
51
  }, {
52
52
  "name": "migrate",
53
53
  "description": "Migration commands for DevExtreme applications",
54
- "usage": "devextreme migrate <change name> [options]",
54
+ "usage": "devextreme migrate <migration command> [options]",
55
55
  "arguments": [{
56
56
  "name": "angular-config-components",
57
- "description": "Migrate to the latest DevExtreme configuration components.",
57
+ "description": "Migrates DevExtreme Angular applications to named configuration components.",
58
58
  "options": [{
59
59
  "name": "--include",
60
- "description": "Template file glob patterns to include (default: **/*.html). You can pass multiple patterns as a comma-separated string (e.g. \"**/a.html,**/b.html\") or as an array (e.g. [\"**/a.html\",\"**/b.html\"])."
60
+ "description": "Template file glob patterns to include (default: **/*.html). You can pass multiple patterns as a comma-separated string (\"**/a.html,**/b.html\") or as an array ([\"**/a.html\",\"**/b.html\"])."
61
61
  }, {
62
62
  "name": "--script-include",
63
- "description": "TypeScript/JavaScript file glob patterns to scan for inline templates (default: **/*.ts,**/*.js). You can pass multiple patterns as a comma-separated string or as an array. Pass an empty value ('' or []) to disable."
63
+ "description": "TypeScript/JavaScript file glob patterns to scan for inline templates (default: **/*.ts,**/*.js). You can pass multiple patterns as a comma-separated string or as an array. Pass an empty value to disable ('' or [])."
64
64
  }, {
65
65
  "name": "--dry",
66
- "description": "Run in dry mode to preview changes without applying them (default: false)."
66
+ "description": "Run in dry mode to preview changes."
67
67
  }]
68
68
  }]
69
69
  }, {
@@ -1,8 +1,8 @@
1
1
  const packageJson = require('../../package.json');
2
2
  module.exports = {
3
- 'devextreme': '25.1.6',
4
- 'devextreme-react': '25.1.6',
5
- 'devextreme-vue': '25.1.6',
3
+ 'devextreme': '25.1.7',
4
+ 'devextreme-react': '25.1.7',
5
+ 'devextreme-vue': '25.1.7',
6
6
  'create-vite': '7.0.0',
7
7
  'create-vue': '3.17.0',
8
8
  'create-next-app': '15.3.4',
@@ -2,12 +2,12 @@ const semver = require('semver').SemVer;
2
2
  const execSync = require('child_process').execSync;
3
3
 
4
4
  function parseNgCliVersion(stdout) {
5
- return /angular.cli:\s*(\S+)/ig.exec(stdout)[1];
5
+ return stdout.trim();
6
6
  }
7
7
 
8
8
  const getLocalNgVersion = () => {
9
9
  try {
10
- const version = parseNgCliVersion(execSync('ng v').toString());
10
+ const version = parseNgCliVersion(execSync('ng --version').toString());
11
11
  return new semver(version);
12
12
  } catch(e) {
13
13
  return '';