@workday/canvas-kit-codemod 13.2.8 → 13.2.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"migrateColorTokens.d.ts","sourceRoot":"","sources":["../../../lib/v13.2/migrateColorTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAC,MAAM,aAAa,CAAC;AAQlD,QAAA,MAAM,SAAS,EAAE,SAwFhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"migrateColorTokens.d.ts","sourceRoot":"","sources":["../../../lib/v13.2/migrateColorTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAC,MAAM,aAAa,CAAC;AAQlD,QAAA,MAAM,SAAS,EAAE,SAuFhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -13,6 +13,9 @@ const transform = (file, api) => {
13
13
  .forEach(nodePath => {
14
14
  importDeclaration = { ...importDeclaration, ...filterOutImports(nodePath) };
15
15
  });
16
+ if (!Object.values(importDeclaration).includes('colors')) {
17
+ return root.toSource();
18
+ }
16
19
  root
17
20
  .find(j.CallExpression, {
18
21
  callee: {
@@ -20,7 +23,6 @@ const transform = (file, api) => {
20
23
  },
21
24
  })
22
25
  .forEach(nodePath => {
23
- addMissingImports({ j, root }, { importPath: '@workday/canvas-tokens-web', specifiers: ['system'] });
24
26
  const name = nodePath.value.callee.name;
25
27
  const stylesDeclaration = nodePath.value.arguments[0];
26
28
  const isCanvasKitStyling = importDeclaration[name] === 'createStyles' || importDeclaration[name] === 'createStencil';
@@ -1 +1 @@
1
- {"version":3,"file":"migrateDepthTokens.d.ts","sourceRoot":"","sources":["../../../lib/v13.2/migrateDepthTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAOtC,QAAA,MAAM,SAAS,EAAE,SAgKhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"migrateDepthTokens.d.ts","sourceRoot":"","sources":["../../../lib/v13.2/migrateDepthTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAOtC,QAAA,MAAM,SAAS,EAAE,SAoKhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -12,6 +12,9 @@ const transform = (file, api) => {
12
12
  .forEach(nodePath => {
13
13
  importDeclaration = { ...importDeclaration, ...filterOutImports(nodePath) };
14
14
  });
15
+ if (!Object.values(importDeclaration).includes('depth')) {
16
+ return root.toSource();
17
+ }
15
18
  root
16
19
  .find(j.SpreadElement, {
17
20
  argument: {
@@ -1 +1 @@
1
- {"version":3,"file":"migrateOtherTokens.d.ts","sourceRoot":"","sources":["../../../lib/v13.2/migrateOtherTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAC,MAAM,aAAa,CAAC;AAQpE,QAAA,MAAM,SAAS,EAAE,SAsKhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"migrateOtherTokens.d.ts","sourceRoot":"","sources":["../../../lib/v13.2/migrateOtherTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAC,MAAM,aAAa,CAAC;AAQpE,QAAA,MAAM,SAAS,EAAE,SA4KhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -13,6 +13,9 @@ const transform = (file, api) => {
13
13
  .forEach(nodePath => {
14
14
  importDeclaration = { ...importDeclaration, ...filterOutImports(nodePath) };
15
15
  });
16
+ if (!Object.values(importDeclaration).some(value => value === 'space' || value === 'borderRadius')) {
17
+ return root.toSource();
18
+ }
16
19
  root
17
20
  .find(j.CallExpression, {
18
21
  callee: {
@@ -1 +1 @@
1
- {"version":3,"file":"migrateTypeTokens.d.ts","sourceRoot":"","sources":["../../../lib/v13.2/migrateTypeTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAC,MAAM,aAAa,CAAC;AASpE,QAAA,MAAM,SAAS,EAAE,SA6NhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"migrateTypeTokens.d.ts","sourceRoot":"","sources":["../../../lib/v13.2/migrateTypeTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAC,MAAM,aAAa,CAAC;AASpE,QAAA,MAAM,SAAS,EAAE,SAiOhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -14,6 +14,9 @@ const transform = (file, api) => {
14
14
  .forEach(nodePath => {
15
15
  importDeclaration = { ...importDeclaration, ...filterOutImports(nodePath) };
16
16
  });
17
+ if (!Object.values(importDeclaration).includes('type')) {
18
+ return root.toSource();
19
+ }
17
20
  root
18
21
  .find(j.SpreadElement, {
19
22
  argument: {
@@ -1 +1 @@
1
- {"version":3,"file":"transformObjectPropertyRecursively.d.ts","sourceRoot":"","sources":["../../../../lib/v13.2/utils/transformObjectPropertyRecursively.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kCAAkC,gBAClC,GAAG,YACJ,GAAG;;wBAEQ,OAAO,KAC3B,GAsIF,CAAC"}
1
+ {"version":3,"file":"transformObjectPropertyRecursively.d.ts","sourceRoot":"","sources":["../../../../lib/v13.2/utils/transformObjectPropertyRecursively.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kCAAkC,gBAClC,GAAG,YACJ,GAAG;;wBAEQ,OAAO,KAC3B,GAgJF,CAAC"}
@@ -17,6 +17,7 @@ export const transformObjectPropertyRecursively = ({ j, root }, property, import
17
17
  if (!isCanvasKitStyling) {
18
18
  addMissingImports({ j, root }, { importPath: '@workday/canvas-kit-styling', specifiers: ['cssVar'] });
19
19
  }
20
+ addMissingImports({ j, root }, { importPath: '@workday/canvas-tokens-web', specifiers: ['system'] });
20
21
  return j.objectProperty(j.identifier(key), isCanvasKitStyling
21
22
  ? varToMemberExpression(j, colorToken)
22
23
  : j.callExpression(j.identifier('cssVar'), [varToMemberExpression(j, colorToken)]));
@@ -35,6 +36,7 @@ export const transformObjectPropertyRecursively = ({ j, root }, property, import
35
36
  const colorToken = tokens === null || tokens === void 0 ? void 0 : tokens[expr.property.name];
36
37
  if (colorToken) {
37
38
  addMissingImports({ j, root }, { importPath: '@workday/canvas-kit-styling', specifiers: ['cssVar'] });
39
+ addMissingImports({ j, root }, { importPath: '@workday/canvas-tokens-web', specifiers: ['system'] });
38
40
  return j.callExpression(j.identifier('cssVar'), [varToMemberExpression(j, colorToken)]);
39
41
  }
40
42
  }
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": "13.2.8",
5
+ "version": "13.2.9",
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,
@@ -46,5 +46,5 @@
46
46
  "resolutions": {
47
47
  "recast": "0.20.4"
48
48
  },
49
- "gitHead": "27d34446ce96cc5df77cdea5135c9040d2339fa3"
49
+ "gitHead": "aedfa7c1778095d2f955808fba504f7f1356a108"
50
50
  }