@atlaskit/codemod-cli 0.8.2 → 0.8.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/codemod-cli
2
2
 
3
+ ## 0.8.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f4d22b1c8af`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f4d22b1c8af) - Ignore directory filtering logic if filtering returns no paths
8
+
3
9
  ## 0.8.2
4
10
 
5
11
  ### Patch Changes
package/dist/cjs/cli.js CHANGED
@@ -30,7 +30,7 @@ function _run() {
30
30
  while (1) {
31
31
  switch (_context.prev = _context.next) {
32
32
  case 0:
33
- cli = (0, _meow.default)("\nUsage\n $ npx @atlaskit/codemod-cli [options] <file-paths>...\n\nOptions\n --transform, -t the transform to run, will prompt for a transform if not provided and no module is passed\n --since-ref, runs transforms for all packages that have been upgraded since the specified git ref\n --packages, runs transforms for the specified comma separated list of packages, optionally include a version for each package to run all transforms since that version\n --parser, -p babel|babylon|flow|ts|tsx parser to use for parsing the source files (default: babel)\n --extensions, -e transform files with these file extensions (comma separated list) (default: js)\n --ignore-pattern, ignore files that match a provided glob expression\n --fail-on-error, return a 1 exit code when errors were found during execution of codemods\n --version, -v version number\n --filterPaths filters source paths to package directories that declare a dependency on the package being upgraded (default: true)\n --help Help me \uD83D\uDE31\n\nExamples\n # Run a codemod over the /project/src directory, will be prompted for which codemod to run\n $ npx @atlaskit/codemod-cli /project/src\n\n # Run the \"4.0.0-remove-appearance-prop\" transform of the \"button\" package\n $ npx @atlaskit/codemod-cli -t button@4.0.0-remove-appearance-prop /project/src\n\n # Run all transforms for \"@atlaskit/button\" greater than version 3.0.0 and @atlaskit/range greater than 4.0.0\n $ npx @atlaskit/codemod-cli --packages @atlaskit/button@3.0.0,@atlaskit/range@4.0.0 /project/src\n", {
33
+ cli = (0, _meow.default)("\nUsage\n $ npx @atlaskit/codemod-cli [options] <file-paths>...\n\nOptions\n --transform, -t the transform to run, will prompt for a transform if not provided and no module is passed\n --since-ref, runs transforms for all packages that have been upgraded since the specified git ref\n --packages, runs transforms for the specified comma separated list of packages, optionally include a version for each package to run all transforms since that version\n --parser, -p babel|babylon|flow|ts|tsx parser to use for parsing the source files (default: babel)\n --extensions, -e transform files with these file extensions (comma separated list) (default: js)\n --ignore-pattern, ignore files that match a provided glob expression\n --fail-on-error, return a 1 exit code when errors were found during execution of codemods\n --version, -v version number\n --no-filter-paths disables dependant package file path filtering logic \n --help Help me \uD83D\uDE31\n\nExamples\n # Run a codemod over the /project/src directory, will be prompted for which codemod to run\n $ npx @atlaskit/codemod-cli /project/src\n\n # Run the \"4.0.0-remove-appearance-prop\" transform of the \"button\" package\n $ npx @atlaskit/codemod-cli -t button@4.0.0-remove-appearance-prop /project/src\n\n # Run all transforms for \"@atlaskit/button\" greater than version 3.0.0 and @atlaskit/range greater than 4.0.0\n $ npx @atlaskit/codemod-cli --packages @atlaskit/button@3.0.0,@atlaskit/range@4.0.0 /project/src\n", {
34
34
  flags: {
35
35
  transform: {
36
36
  type: 'string',
package/dist/cjs/main.js CHANGED
@@ -179,7 +179,9 @@ var runTransform = /*#__PURE__*/function () {
179
179
  codemodDirs = _context3.sent;
180
180
 
181
181
  if (codemodDirs.length === 0) {
182
- logger.log(_chalk.default.yellow("Filtering for module ".concat(transform.module, " returned no directories, please validate specified paths.")));
182
+ // Fallback to non-filter logic if filtering returns no directories
183
+ logger.log(_chalk.default.yellow("Could not filter source paths for ".concat(transform.module, ", falling back to running over all specified paths. (See --no-filter-paths flag)")));
184
+ codemodDirs = filePaths;
183
185
  } else {
184
186
  logger.log(_chalk.default.green("Running transform '".concat(_chalk.default.bold(transform.name), "' over filtered dirs ").concat(_chalk.default.bold(codemodDirs.join(', ')), "...")));
185
187
  }
@@ -361,7 +363,7 @@ function _main() {
361
363
  case 4:
362
364
  _yield$parseArgs = _context5.sent;
363
365
  packages = _yield$parseArgs.packages;
364
- _process$env$_PACKAGE = "0.8.2", _PACKAGE_VERSION_ = _process$env$_PACKAGE === void 0 ? '0.0.0-dev' : _process$env$_PACKAGE;
366
+ _process$env$_PACKAGE = "0.8.3", _PACKAGE_VERSION_ = _process$env$_PACKAGE === void 0 ? '0.0.0-dev' : _process$env$_PACKAGE;
365
367
  logger.log(_chalk.default.bgBlue(_chalk.default.black("\uD83D\uDCDA Atlassian-Frontend codemod library @ ".concat(_PACKAGE_VERSION_, " \uD83D\uDCDA"))));
366
368
 
367
369
  if (packages && packages.length > 0) {
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/codemod-cli",
3
- "version": "0.8.2"
3
+ "version": "0.8.3"
4
4
  }
@@ -16,7 +16,7 @@ Options
16
16
  --ignore-pattern, ignore files that match a provided glob expression
17
17
  --fail-on-error, return a 1 exit code when errors were found during execution of codemods
18
18
  --version, -v version number
19
- --filterPaths filters source paths to package directories that declare a dependency on the package being upgraded (default: true)
19
+ --no-filter-paths disables dependant package file path filtering logic
20
20
  --help Help me 😱
21
21
 
22
22
  Examples
@@ -78,7 +78,9 @@ const runTransform = async (filePaths, transform, flags) => {
78
78
  codemodDirs = await findDependentPackagePaths(filePaths, transform.module);
79
79
 
80
80
  if (codemodDirs.length === 0) {
81
- logger.log(chalk.yellow(`Filtering for module ${transform.module} returned no directories, please validate specified paths.`));
81
+ // Fallback to non-filter logic if filtering returns no directories
82
+ logger.log(chalk.yellow(`Could not filter source paths for ${transform.module}, falling back to running over all specified paths. (See --no-filter-paths flag)`));
83
+ codemodDirs = filePaths;
82
84
  } else {
83
85
  logger.log(chalk.green(`Running transform '${chalk.bold(transform.name)}' over filtered dirs ${chalk.bold(codemodDirs.join(', '))}...`));
84
86
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/codemod-cli",
3
- "version": "0.8.2"
3
+ "version": "0.8.3"
4
4
  }
package/dist/esm/cli.js CHANGED
@@ -15,7 +15,7 @@ function _run() {
15
15
  while (1) {
16
16
  switch (_context.prev = _context.next) {
17
17
  case 0:
18
- cli = meow("\nUsage\n $ npx @atlaskit/codemod-cli [options] <file-paths>...\n\nOptions\n --transform, -t the transform to run, will prompt for a transform if not provided and no module is passed\n --since-ref, runs transforms for all packages that have been upgraded since the specified git ref\n --packages, runs transforms for the specified comma separated list of packages, optionally include a version for each package to run all transforms since that version\n --parser, -p babel|babylon|flow|ts|tsx parser to use for parsing the source files (default: babel)\n --extensions, -e transform files with these file extensions (comma separated list) (default: js)\n --ignore-pattern, ignore files that match a provided glob expression\n --fail-on-error, return a 1 exit code when errors were found during execution of codemods\n --version, -v version number\n --filterPaths filters source paths to package directories that declare a dependency on the package being upgraded (default: true)\n --help Help me \uD83D\uDE31\n\nExamples\n # Run a codemod over the /project/src directory, will be prompted for which codemod to run\n $ npx @atlaskit/codemod-cli /project/src\n\n # Run the \"4.0.0-remove-appearance-prop\" transform of the \"button\" package\n $ npx @atlaskit/codemod-cli -t button@4.0.0-remove-appearance-prop /project/src\n\n # Run all transforms for \"@atlaskit/button\" greater than version 3.0.0 and @atlaskit/range greater than 4.0.0\n $ npx @atlaskit/codemod-cli --packages @atlaskit/button@3.0.0,@atlaskit/range@4.0.0 /project/src\n", {
18
+ cli = meow("\nUsage\n $ npx @atlaskit/codemod-cli [options] <file-paths>...\n\nOptions\n --transform, -t the transform to run, will prompt for a transform if not provided and no module is passed\n --since-ref, runs transforms for all packages that have been upgraded since the specified git ref\n --packages, runs transforms for the specified comma separated list of packages, optionally include a version for each package to run all transforms since that version\n --parser, -p babel|babylon|flow|ts|tsx parser to use for parsing the source files (default: babel)\n --extensions, -e transform files with these file extensions (comma separated list) (default: js)\n --ignore-pattern, ignore files that match a provided glob expression\n --fail-on-error, return a 1 exit code when errors were found during execution of codemods\n --version, -v version number\n --no-filter-paths disables dependant package file path filtering logic \n --help Help me \uD83D\uDE31\n\nExamples\n # Run a codemod over the /project/src directory, will be prompted for which codemod to run\n $ npx @atlaskit/codemod-cli /project/src\n\n # Run the \"4.0.0-remove-appearance-prop\" transform of the \"button\" package\n $ npx @atlaskit/codemod-cli -t button@4.0.0-remove-appearance-prop /project/src\n\n # Run all transforms for \"@atlaskit/button\" greater than version 3.0.0 and @atlaskit/range greater than 4.0.0\n $ npx @atlaskit/codemod-cli --packages @atlaskit/button@3.0.0,@atlaskit/range@4.0.0 /project/src\n", {
19
19
  flags: {
20
20
  transform: {
21
21
  type: 'string',
package/dist/esm/main.js CHANGED
@@ -159,7 +159,9 @@ var runTransform = /*#__PURE__*/function () {
159
159
  codemodDirs = _context3.sent;
160
160
 
161
161
  if (codemodDirs.length === 0) {
162
- logger.log(chalk.yellow("Filtering for module ".concat(transform.module, " returned no directories, please validate specified paths.")));
162
+ // Fallback to non-filter logic if filtering returns no directories
163
+ logger.log(chalk.yellow("Could not filter source paths for ".concat(transform.module, ", falling back to running over all specified paths. (See --no-filter-paths flag)")));
164
+ codemodDirs = filePaths;
163
165
  } else {
164
166
  logger.log(chalk.green("Running transform '".concat(chalk.bold(transform.name), "' over filtered dirs ").concat(chalk.bold(codemodDirs.join(', ')), "...")));
165
167
  }
@@ -338,7 +340,7 @@ function _main() {
338
340
  case 4:
339
341
  _yield$parseArgs = _context5.sent;
340
342
  packages = _yield$parseArgs.packages;
341
- _process$env$_PACKAGE = "0.8.2", _PACKAGE_VERSION_ = _process$env$_PACKAGE === void 0 ? '0.0.0-dev' : _process$env$_PACKAGE;
343
+ _process$env$_PACKAGE = "0.8.3", _PACKAGE_VERSION_ = _process$env$_PACKAGE === void 0 ? '0.0.0-dev' : _process$env$_PACKAGE;
342
344
  logger.log(chalk.bgBlue(chalk.black("\uD83D\uDCDA Atlassian-Frontend codemod library @ ".concat(_PACKAGE_VERSION_, " \uD83D\uDCDA"))));
343
345
 
344
346
  if (packages && packages.length > 0) {
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/codemod-cli",
3
- "version": "0.8.2"
3
+ "version": "0.8.3"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/codemod-cli",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "A cli for distributing codemods for atlassian-frontend components and services",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"