@progress/kendo-cli 1.9.2 → 1.9.3-develop.1

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
@@ -274,6 +274,93 @@ Options:
274
274
  [string] [choices: "default", "bootstrap", "material", "fluent"] [default: "default"]
275
275
  ```
276
276
 
277
+ ## Assisted Migration
278
+
279
+ ### Overview
280
+
281
+ 0. Install the Kendo CLI globally.
282
+
283
+ ```bash
284
+ npm i -g @progress/kendo-cli
285
+ ```
286
+
287
+ 1. In the root of your project, run:
288
+
289
+ ```bash
290
+ npx @progress/kendo-cli migrate
291
+ ```
292
+
293
+ If not already installed, you will be prompted to install the Kendo CLI. Next, this command checks for available Kendo UI updates (including any peer dependencies), prompts you to install the updates, and then applies any available codemods on top.
294
+
295
+ 2. Confirm that you want to install the available updates.
296
+ 3. Confirm that you want to apply the available transformations.
297
+ 4. Review and accept the suggested transformations.<br/>The Kendo CLI begins to apply the available codemods version by version, starting with the transformations for the earliest version.
298
+ 5. Look for newly added code comments to your code. These indicate that you need to further adjust any existing custom logic.
299
+ 6. Finally, do a test run of your project to verify that everything works as expected.
300
+
301
+ ### Best Practices
302
+
303
+ For a more manageable migration process, consider the following recommended practices:
304
+
305
+ * Migrate between consecutive major versions. For example, migrate from v10 to v11. This lets you review and adjust your code version by version, avoiding possible conflicts between breaking changes.
306
+ * Migrate one package at a time. This provides finer control over the migration process.
307
+
308
+ ### CLI Quick Guide
309
+
310
+ The following list describes the most common migration scenarios.
311
+
312
+ * You can run any of the listed commands with or without a package specified.
313
+ * If not already installed, you will be prompted to install the Kendo CLI when running `npx @progress/kendo-cli migrate` for the first time.
314
+ * Once installed, you can also run commands with the `kendo` handle instead of `npx @progress/kendo-cli`. For example: `kendo migrate`.
315
+
316
+ ```bash
317
+ # Install the Kendo CLI globally.
318
+ npm i -g @progress/kendo-cli
319
+
320
+ # Run a guided migration. You will be prompted every step of the way.
321
+ npx @progress/kendo-cli migrate
322
+
323
+ # Migrate a specific package.
324
+ npx @progress/kendo-cli migrate @progress/kendo-react-grid
325
+
326
+ # Migrate between specific versions.
327
+ npx @progress/kendo-cli migrate @progress/kendo-react-grid --from 10 --to 11
328
+
329
+ # Run a quick migration without any prompts.
330
+ npx @progress/kendo-cli migrate --force
331
+
332
+ # Only install the available updates. Do not run any codemods.
333
+ # Useful when you want to manually migrate your code.
334
+ npx @progress/kendo-cli migrate --no-codemods
335
+
336
+ # Only run the available codemods. Do not install any packages.
337
+ # Useful when you already have the packages installed.
338
+ npx @progress/kendo-cli migrate @progress/kendo-react-grid --no-install
339
+
340
+ # Ignoring specific files or directories during the migration.
341
+ npx @progress/kendo-cli migrate @progress/kendo-react-grid --no-install --ignore-pattern="dist/**"
342
+ ```
343
+
344
+ ### CLI Arguments
345
+
346
+ If you want more control over the migration, you can use any of the following arguments when running `npx @progress/kendo-cli migrate`.
347
+
348
+ | Argument | Description | Sample Use |
349
+ | -------- | ----------- | ---------- |
350
+ | `<pkg>` | Specifies one or more packages for which to execute the assisted migration (with any additional arguments). If not set, runs for all available Kendo packages. | `npx @progress/kendo-cli migrate @progress/kendo-react-grid` |
351
+ | `--help` | Prints the help for the command. | `npx @progress/kendo-cli migrate --help` |
352
+ | `--version` | Prints the version of the Kendo CLI. | `npx @progress/kendo-cli --version` |
353
+ | `--verbose` | Sets the verbosity level of the command output on a level from 0 (silent) to 5 (most verbose). By default: 1. | `npx @progress/kendo-cli migrate --verbose=3` |
354
+ | `--quiet` | Silences the output as much as possible. Shorthand for `--verbose=0`. | `npx @progress/kendo-cli migrate --quiet` |
355
+ | `--force` | Runs in force mode and does not ask for any confirmations. | `npx @progress/kendo-cli migrate --force` |
356
+ | `--to` | Specifies the package version to migrate to. If not set, migrates to the latest available version of the respective package(s). | `npx @progress/kendo-cli migrate @progress/kendo-react-grid --codemods --to=11` |
357
+ | `--from` | Specifies the package version to migrate from. If not set, uses the current version. | `npx @progress/kendo-cli migrate @progress/kendo-react-grid --codemods --from=10` |
358
+ | `--no-install` | Skips the installation part of the migration. Use this option if you have already updated your packages and want to **only** run the available codemods. | `npx @progress/kendo-cli migrate --no-install` |
359
+ | `--no-codemods` | Skips the codemods step of the migration. Use this option to **only** install the available updates. | `npx @progress/kendo-cli migrate --no-codemods` |
360
+ | `--no-peer-deps` | Skips the installation of any peer dependencies for the updated packages. By default, the `migrate` command always installs the available peer dependencies. | `npx @progress/kendo-cli migrate --no-peer-deps` |
361
+ | `--no-optional` | Skips the optional codemods, if any. Use this option to run **only** the required transformations. | `npx @progress/kendo-cli migrate --no-optional` |
362
+ | `--ignore-pattern` | Specifies a glob pattern to ignore specific files or directories during the migration. Use this option to exclude files that you do not want to be modified. | `npx @progress/kendo-cli migrate --ignore-pattern="dist/**"` |
363
+
277
364
  ---
278
365
 
279
366
  *Copyright © 2023 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.*
package/dist/index.js CHANGED
@@ -50921,9 +50921,12 @@ function getPkgJsonPath(path) {
50921
50921
  currentPath = (0, path_1.dirname)(currentPath);
50922
50922
  }
50923
50923
  }
50924
- const getFiles = (pattern) => glob.sync(`${cwd}/**/${pattern || defaultPattern}`, {
50925
- ignore: ["**/node_modules/**"],
50926
- });
50924
+ const getFiles = (pattern, ignorePattern) => {
50925
+ let ignorePatterns = ignorePattern ? ["**/node_modules/**", (0, path_1.join)(cwd, ignorePattern)] : ["**/node_modules/**"];
50926
+ return glob.sync(`${cwd}/**/${pattern || defaultPattern}`, {
50927
+ ignore: ignorePatterns,
50928
+ });
50929
+ };
50927
50930
  async function shouldRunCodemod(codemod, version, args) {
50928
50931
  const isOptional = codemod.prompt;
50929
50932
  const isForce = args.force;
@@ -50964,7 +50967,7 @@ async function runMigrations({ migrations, pkgPath, pkgJson }, args) {
50964
50967
  let originalRoot;
50965
50968
  let originalFiles;
50966
50969
  let root = (originalRoot = cwd);
50967
- let files = (originalFiles = getFiles(migrations.options?.pattern));
50970
+ let files = (originalFiles = getFiles(migrations.options?.pattern, args.ignorePattern));
50968
50971
  if (!args.force) {
50969
50972
  root = createTempDiffRoot(cwd, originalFiles);
50970
50973
  files = files.map((file) => file.replace(originalRoot, root));
@@ -51290,6 +51293,10 @@ function builder(yargs) {
51290
51293
  describe: "Runs the optional codemods (code transformations) configured by the `@progress` package.",
51291
51294
  type: "boolean",
51292
51295
  default: true,
51296
+ })
51297
+ .option("ignore-pattern", {
51298
+ describe: "Glob patterns to ignore",
51299
+ type: "string"
51293
51300
  });
51294
51301
  }
51295
51302
  exports.builder = builder;
@@ -51305,7 +51312,7 @@ async function handler(args) {
51305
51312
  }
51306
51313
  if (args.codemods) {
51307
51314
  for (const pkg in updatedDeps) {
51308
- (0, codemods_1.runCodemodsFor)(pkg, args);
51315
+ await (0, codemods_1.runCodemodsFor)(pkg, args);
51309
51316
  }
51310
51317
  }
51311
51318
  }