@sps-woodland/codemods 0.0.3 → 0.0.4

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 (2) hide show
  1. package/main.js +9 -1
  2. package/package.json +2 -1
package/main.js CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env node
2
+ const glob = require("glob");
3
+ const path = require("path");
2
4
  const yargs = require("yargs");
3
5
  const { run } = require("jscodeshift/src/Runner")
4
6
 
@@ -14,10 +16,16 @@ const yargv = yargs
14
16
 
15
17
  console.log(yargv);
16
18
 
17
- run("node_modules/@sps-woodland/codemods/dist/transform.js", ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"], {
19
+ const transformFile = path.resolve(__dirname, "./dist/transform.js")
20
+
21
+ const targets = glob.sync("**/*.tsx");
22
+
23
+ run(transformFile, targets, {
18
24
  dry: true,
19
25
  print: true,
20
26
  verbose: 1,
27
+ extensions: "tsx",
28
+ parser: "tsx"
21
29
  }).then((result) => {
22
30
  console.log(result);
23
31
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sps-woodland/codemods",
3
3
  "description": "SPS Woodland Design System codemods",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "author": "SPS Commerce",
6
6
  "license": "UNLICENSED",
7
7
  "repository": "https://github.com/spscommerce/woodland/tree/master/packages/@sps-woodland/codemods",
@@ -16,6 +16,7 @@
16
16
  "@babel/preset-env": "^7.1.6",
17
17
  "chalk": "^2.4.1",
18
18
  "concat-stream": "^1.6.2",
19
+ "glob": "^8.0.3",
19
20
  "jscodeshift": "^0.13.1",
20
21
  "yargs": "^12.0.2"
21
22
  },