@workday/canvas-kit-codemod 9.0.0-alpha.338-next.5 → 9.0.0-alpha.348-next.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.
@@ -34,7 +34,7 @@ export default function transformer(file, api, options) {
34
34
  var runningSource = file.source;
35
35
  var _loop_1 = function (inputPackageName) {
36
36
  var currentRoot = j(runningSource);
37
- var _a = getImportRenameMap(j, currentRoot, inputPackageName), containsCanvasImports = _a.containsCanvasImports, importMap = _a.importMap, styledMap = _a.styledMap;
37
+ var _b = getImportRenameMap(j, currentRoot, inputPackageName), containsCanvasImports = _b.containsCanvasImports, importMap = _b.importMap, styledMap = _b.styledMap;
38
38
  if (containsCanvasImports) {
39
39
  var inputNames_1 = inputsMap[inputPackageName];
40
40
  currentRoot
@@ -1,15 +1,13 @@
1
- var __spreadArrays = (this && this.__spreadArrays) || function () {
2
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
3
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
4
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
5
- r[k] = a[j];
6
- return r;
1
+ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
2
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
3
+ to[j] = from[i];
4
+ return to;
7
5
  };
8
6
  import { filterImportSpecifiers, renameImports, hasImportSpecifiers, } from './utils';
9
7
  var mainPackage = '@workday/canvas-kit-labs-react';
10
8
  var headerPackage = '@workday/canvas-kit-labs-react/header';
11
9
  var searchBarRenameImports = ['SearchBar', 'SearchBarProps', 'SearchBarState'];
12
- var searchBarImportSpecifiers = __spreadArrays(searchBarRenameImports, [
10
+ var searchBarImportSpecifiers = __spreadArray(__spreadArray([], searchBarRenameImports), [
13
11
  'SearchThemeAttributes',
14
12
  'SearchThemes',
15
13
  ]);
@@ -1,9 +1,7 @@
1
- var __spreadArrays = (this && this.__spreadArrays) || function () {
2
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
3
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
4
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
5
- r[k] = a[j];
6
- return r;
1
+ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
2
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
3
+ to[j] = from[i];
4
+ return to;
7
5
  };
8
6
  import { getImportRenameMap } from './utils/getImportRenameMap';
9
7
  import { hasImportSpecifiers } from '../v6/utils';
@@ -50,7 +48,7 @@ export default function transformer(file, api, options) {
50
48
  ['PrimaryButton', 'SecondaryButton'].includes(child.openingElement.name.name)) {
51
49
  // Add isPrimary attribute to primary Action Item
52
50
  var elementAttrs = child.openingElement.name.name === 'PrimaryButton'
53
- ? __spreadArrays(buttonAttrs, [j.jsxAttribute(j.jsxIdentifier('isPrimary'))]) : buttonAttrs;
51
+ ? __spreadArray(__spreadArray([], buttonAttrs), [j.jsxAttribute(j.jsxIdentifier('isPrimary'))]) : buttonAttrs;
54
52
  nodePath.value.children[index] = j.jsxElement(j.jsxOpeningElement(ActionItemJSX, elementAttrs), j.jsxClosingElement(ActionItemJSX), child.children);
55
53
  }
56
54
  }
@@ -71,11 +69,7 @@ export default function transformer(file, api, options) {
71
69
  var ActionBarListJSX = j.jsxMemberExpression(j.jsxIdentifier(importMap.ActionBar), j.jsxIdentifier('List'));
72
70
  var subComponentJSX = j.jsxElement(j.jsxOpeningElement(ActionBarListJSX,
73
71
  // All attributes except fixed should be passed
74
- attributes === null ||
75
- // All attributes except fixed should be passed
76
- attributes === void 0 ? void 0 :
77
- // All attributes except fixed should be passed
78
- attributes.filter(function (attr) { return !(attr.type === 'JSXAttribute' && attr.name.name === 'fixed'); })), j.jsxClosingElement(ActionBarListJSX), children);
72
+ attributes === null || attributes === void 0 ? void 0 : attributes.filter(function (attr) { return !(attr.type === 'JSXAttribute' && attr.name.name === 'fixed'); })), j.jsxClosingElement(ActionBarListJSX), children);
79
73
  // Keep space for code structure
80
74
  var textLiteralStart = children.find(function (child) { return child.type === 'JSXText'; });
81
75
  var textLiteralEnd = children
@@ -36,7 +36,7 @@ export default function transformer(file, api, options) {
36
36
  var runningSource = file.source;
37
37
  var _loop_1 = function (inputPackageName) {
38
38
  var currentRoot = j(runningSource);
39
- var _a = getImportRenameMap(j, currentRoot, inputPackageName), containsCanvasImports = _a.containsCanvasImports, importMap = _a.importMap, styledMap = _a.styledMap;
39
+ var _b = getImportRenameMap(j, currentRoot, inputPackageName), containsCanvasImports = _b.containsCanvasImports, importMap = _b.importMap, styledMap = _b.styledMap;
40
40
  if (containsCanvasImports) {
41
41
  var inputNames_1 = inputsMap[inputPackageName];
42
42
  currentRoot
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": "9.0.0-alpha.338-next.5+fb2aa9bc",
5
+ "version": "9.0.0-alpha.348-next.3+62cb7fef",
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,
@@ -43,5 +43,5 @@
43
43
  "test": "TZ=UTC jest -c ../../jest.config.js",
44
44
  "typecheck:src": "tsc -p . --noEmit --incremental false"
45
45
  },
46
- "gitHead": "fb2aa9bcbecaf55a5a8b6b01964b54f8c7519dd7"
46
+ "gitHead": "62cb7fefb41fcc2ba937163d06d22deb7bf77203"
47
47
  }