@workday/canvas-kit-codemod 6.0.0-alpha.0-next.34 → 6.0.0-alpha.0-next.36
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/dist/es6/v7/index.d.ts +3 -0
- package/dist/es6/v7/index.d.ts.map +1 -0
- package/dist/es6/v7/index.js +5 -0
- package/index.js +21 -13
- package/package.json +4 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/v7/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAC,MAAM,aAAa,CAAC;AAEnD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,QAI7E"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export default function transformer(file, api, options) {
|
|
2
|
+
// These will run in order. If your transform depends on others, place yours after dependent transforms
|
|
3
|
+
// const fixes = [];
|
|
4
|
+
// return fixes.reduce((source, fix) => fix({...file, source}, api, options), file.source);
|
|
5
|
+
}
|
package/index.js
CHANGED
|
@@ -21,6 +21,13 @@ const {_: commands, path} = require('yargs')
|
|
|
21
21
|
describe: 'The path to execute the transform in (recursively).'.gray,
|
|
22
22
|
});
|
|
23
23
|
})
|
|
24
|
+
.command('v7 [path]', 'Canvas Kit v6 > v7 migration transform'.gray, yargs => {
|
|
25
|
+
yargs.positional('path', {
|
|
26
|
+
type: 'string',
|
|
27
|
+
default: '.',
|
|
28
|
+
describe: 'The path to execute the transform in (recursively).'.gray,
|
|
29
|
+
});
|
|
30
|
+
})
|
|
24
31
|
.demandCommand(1, 'You must provide a transform to apply.'.red.bold)
|
|
25
32
|
.strictCommands()
|
|
26
33
|
.fail((msg, err, yargs) => {
|
|
@@ -42,18 +49,19 @@ const transform = commands[0];
|
|
|
42
49
|
console.log(transform, path);
|
|
43
50
|
|
|
44
51
|
console.log(`\nApplying ${transform} transform to '${path}'\n`.brightBlue);
|
|
52
|
+
const args = `-t ${__dirname}/dist/es6/${transform} ${path} --parser tsx --extensions js,jsx,ts,tsx`.split(
|
|
53
|
+
' '
|
|
54
|
+
);
|
|
45
55
|
|
|
46
|
-
spawn(
|
|
47
|
-
`jscodeshift -t ${__dirname}/dist/es6/${transform} ${path} --parser=tsx --extensions=js,jsx,ts,tsx`,
|
|
48
|
-
(error, stdout, stderr) => {
|
|
49
|
-
if (error) {
|
|
50
|
-
console.error(`${error}\n`);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
console.log(`${stdout}\n`);
|
|
56
|
+
const proc = spawn(`jscodeshift`, args);
|
|
54
57
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
);
|
|
58
|
+
let errCode = 0;
|
|
59
|
+
proc.stdout.on('data', data => console.log(data.toString()));
|
|
60
|
+
proc.stderr.on('data', data => {
|
|
61
|
+
errCode = 1;
|
|
62
|
+
console.error(data.toString());
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
proc.on('close', code => {
|
|
66
|
+
process.exit(code || errCode);
|
|
67
|
+
});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@workday/canvas-kit-codemod",
|
|
3
3
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"version": "6.0.0-alpha.0-next.
|
|
5
|
+
"version": "6.0.0-alpha.0-next.36+5890bf68",
|
|
6
6
|
"description": "A collection of codemods for use on Workday Canvas Kit packages.",
|
|
7
7
|
"main": "dist/es6/index.js",
|
|
8
8
|
"sideEffects": false,
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"scripts": {
|
|
37
37
|
"clean": "rimraf dist && rimraf .build-info && mkdirp dist",
|
|
38
38
|
"build": "tsc -p tsconfig.es6.json",
|
|
39
|
-
"test": "TZ=UTC jest -c ../../jest.config.js"
|
|
39
|
+
"test": "TZ=UTC jest -c ../../jest.config.js",
|
|
40
|
+
"typecheck:src": "tsc -p . --noEmit --incremental false"
|
|
40
41
|
},
|
|
41
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "5890bf680def9c37d6e386472634cc3e1b6d81e9"
|
|
42
43
|
}
|