@sanity/ui-codemod 1.0.0-alpha.1
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/bin/run.js +5 -0
- package/dist/_chunks-es/addAttribute.js +11 -0
- package/dist/_chunks-es/addAttribute.js.map +1 -0
- package/dist/_chunks-es/box.mods.js +186 -0
- package/dist/_chunks-es/box.mods.js.map +1 -0
- package/dist/_chunks-es/flex.mods.js +74 -0
- package/dist/_chunks-es/flex.mods.js.map +1 -0
- package/dist/_chunks-es/getTransformPath.js +75 -0
- package/dist/_chunks-es/getTransformPath.js.map +1 -0
- package/dist/_chunks-es/grid.mods.js +110 -0
- package/dist/_chunks-es/grid.mods.js.map +1 -0
- package/dist/_chunks-es/layout-mods.js +424 -0
- package/dist/_chunks-es/layout-mods.js.map +1 -0
- package/dist/_chunks-es/transformComponent.js +359 -0
- package/dist/_chunks-es/transformComponent.js.map +1 -0
- package/dist/commands/latest/box.d.ts +47 -0
- package/dist/commands/latest/box.js +17 -0
- package/dist/commands/latest/box.js.map +1 -0
- package/dist/commands/latest/card.d.ts +47 -0
- package/dist/commands/latest/card.js +17 -0
- package/dist/commands/latest/card.js.map +1 -0
- package/dist/commands/latest/code.d.ts +47 -0
- package/dist/commands/latest/code.js +17 -0
- package/dist/commands/latest/code.js.map +1 -0
- package/dist/commands/latest/container.d.ts +47 -0
- package/dist/commands/latest/container.js +17 -0
- package/dist/commands/latest/container.js.map +1 -0
- package/dist/commands/latest/flex.d.ts +47 -0
- package/dist/commands/latest/flex.js +17 -0
- package/dist/commands/latest/flex.js.map +1 -0
- package/dist/commands/latest/grid.d.ts +47 -0
- package/dist/commands/latest/grid.js +17 -0
- package/dist/commands/latest/grid.js.map +1 -0
- package/dist/commands/latest/heading.d.ts +47 -0
- package/dist/commands/latest/heading.js +17 -0
- package/dist/commands/latest/heading.js.map +1 -0
- package/dist/commands/latest/text.d.ts +47 -0
- package/dist/commands/latest/text.js +17 -0
- package/dist/commands/latest/text.js.map +1 -0
- package/dist/transforms/latest/box/box.d.ts +18 -0
- package/dist/transforms/latest/box/box.js +101 -0
- package/dist/transforms/latest/box/box.js.map +1 -0
- package/dist/transforms/latest/card/card.d.ts +18 -0
- package/dist/transforms/latest/card/card.js +618 -0
- package/dist/transforms/latest/card/card.js.map +1 -0
- package/dist/transforms/latest/code/code.d.ts +18 -0
- package/dist/transforms/latest/code/code.js +73 -0
- package/dist/transforms/latest/code/code.js.map +1 -0
- package/dist/transforms/latest/container/container.d.ts +18 -0
- package/dist/transforms/latest/container/container.js +91 -0
- package/dist/transforms/latest/container/container.js.map +1 -0
- package/dist/transforms/latest/flex/flex.d.ts +18 -0
- package/dist/transforms/latest/flex/flex.js +19 -0
- package/dist/transforms/latest/flex/flex.js.map +1 -0
- package/dist/transforms/latest/grid/grid.d.ts +18 -0
- package/dist/transforms/latest/grid/grid.js +19 -0
- package/dist/transforms/latest/grid/grid.js.map +1 -0
- package/dist/transforms/latest/heading/heading.d.ts +18 -0
- package/dist/transforms/latest/heading/heading.js +85 -0
- package/dist/transforms/latest/heading/heading.js.map +1 -0
- package/dist/transforms/latest/text/text.d.ts +18 -0
- package/dist/transforms/latest/text/text.js +88 -0
- package/dist/transforms/latest/text/text.js.map +1 -0
- package/package.json +68 -0
- package/src/baseCommand.ts +74 -0
- package/src/commands/latest/box.ts +21 -0
- package/src/commands/latest/card.ts +21 -0
- package/src/commands/latest/code.ts +21 -0
- package/src/commands/latest/container.ts +21 -0
- package/src/commands/latest/flex.ts +21 -0
- package/src/commands/latest/grid.ts +21 -0
- package/src/commands/latest/heading.ts +21 -0
- package/src/commands/latest/inline.ts +21 -0
- package/src/commands/latest/label.ts +21 -0
- package/src/commands/latest/stack.ts +21 -0
- package/src/commands/latest/text.ts +21 -0
- package/src/constants/latest/layout-mods.ts +422 -0
- package/src/transforms/latest/box/box.mods.ts +88 -0
- package/src/transforms/latest/box/box.test.ts +204 -0
- package/src/transforms/latest/box/box.ts +104 -0
- package/src/transforms/latest/card/card.mods.ts +592 -0
- package/src/transforms/latest/card/card.test.ts +207 -0
- package/src/transforms/latest/card/card.ts +71 -0
- package/src/transforms/latest/code/code.mods.ts +57 -0
- package/src/transforms/latest/code/code.test.ts +61 -0
- package/src/transforms/latest/code/code.ts +53 -0
- package/src/transforms/latest/container/container.mods.ts +77 -0
- package/src/transforms/latest/container/container.test.ts +105 -0
- package/src/transforms/latest/container/container.ts +42 -0
- package/src/transforms/latest/flex/flex.mods.ts +73 -0
- package/src/transforms/latest/flex/flex.test.ts +80 -0
- package/src/transforms/latest/flex/flex.ts +42 -0
- package/src/transforms/latest/grid/grid.mods.ts +109 -0
- package/src/transforms/latest/grid/grid.test.ts +97 -0
- package/src/transforms/latest/grid/grid.ts +42 -0
- package/src/transforms/latest/heading/heading.mods.ts +70 -0
- package/src/transforms/latest/heading/heading.test.ts +87 -0
- package/src/transforms/latest/heading/heading.ts +53 -0
- package/src/transforms/latest/inline/inline.mods.ts +65 -0
- package/src/transforms/latest/inline/inline.test.ts +57 -0
- package/src/transforms/latest/inline/inline.ts +42 -0
- package/src/transforms/latest/label/label.mods.ts +72 -0
- package/src/transforms/latest/label/label.test.ts +113 -0
- package/src/transforms/latest/label/label.ts +67 -0
- package/src/transforms/latest/stack/stack.mods.ts +12 -0
- package/src/transforms/latest/stack/stack.test.ts +160 -0
- package/src/transforms/latest/stack/stack.ts +102 -0
- package/src/transforms/latest/text/text.mods.ts +72 -0
- package/src/transforms/latest/text/text.test.ts +113 -0
- package/src/transforms/latest/text/text.ts +57 -0
- package/src/types/AnyExpression.ts +9 -0
- package/src/types/AttributeMods.ts +16 -0
- package/src/types/BaseOptions.ts +6 -0
- package/src/utils/addAttribute.test.ts +43 -0
- package/src/utils/addAttribute.ts +26 -0
- package/src/utils/addImportSpecifier.test.ts +36 -0
- package/src/utils/addImportSpecifier.ts +42 -0
- package/src/utils/getAttribute.ts +22 -0
- package/src/utils/getAttributeExpression.ts +22 -0
- package/src/utils/getAttributeValue.ts +20 -0
- package/src/utils/getClonedImportSpecifiers.ts +29 -0
- package/src/utils/getComponentJsxNames.ts +17 -0
- package/src/utils/getComponentLocalNames.ts +69 -0
- package/src/utils/getCompositeAttrValue.ts +39 -0
- package/src/utils/getMappingArray.ts +36 -0
- package/src/utils/getMappingExpression.ts +22 -0
- package/src/utils/getMappingValue.ts +52 -0
- package/src/utils/getShorthandAttributes.ts +54 -0
- package/src/utils/getSplitImportSpecifiers.ts +40 -0
- package/src/utils/getStaticAttributeExpression.ts +35 -0
- package/src/utils/getStyleExpression.ts +37 -0
- package/src/utils/getStyledComponentAliases.ts +28 -0
- package/src/utils/getStyledComponentName.ts +52 -0
- package/src/utils/getTransformPath.ts +17 -0
- package/src/utils/insertTodoWarning.ts +48 -0
- package/src/utils/isImportBindingUsed.ts +53 -0
- package/src/utils/isValidStyleType.ts +21 -0
- package/src/utils/mergeStyle.ts +64 -0
- package/src/utils/removeUnusedImport.test.ts +77 -0
- package/src/utils/removeUnusedImport.ts +57 -0
- package/src/utils/replaceElement.test.ts +181 -0
- package/src/utils/replaceElement.ts +106 -0
- package/src/utils/replaceStyledComponent.test.ts +57 -0
- package/src/utils/replaceStyledComponent.ts +60 -0
- package/src/utils/shouldTransformComponent.test.ts +61 -0
- package/src/utils/shouldTransformComponent.ts +40 -0
- package/src/utils/testUtils.ts +54 -0
- package/src/utils/transformAttributes.test.ts +544 -0
- package/src/utils/transformAttributes.ts +248 -0
- package/src/utils/transformComponent.test.ts +45 -0
- package/src/utils/transformComponent.ts +31 -0
- package/src/utils/transformImport.test.ts +175 -0
- package/src/utils/transformImport.ts +55 -0
- package/src/utils/transformImportAlias.test.ts +40 -0
- package/src/utils/transformImportAlias.ts +49 -0
- package/src/utils/transformStyledComponents.test.ts +172 -0
- package/src/utils/transformStyledComponents.ts +58 -0
package/bin/run.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getAttribute } from "./transformComponent.js";
|
|
2
|
+
function getAttributeValue(j, value) {
|
|
3
|
+
return value === !0 || value === !1 ? j.jsxExpressionContainer(j.booleanLiteral(value)) : typeof value == "string" ? j.stringLiteral(value) : typeof value == "number" ? j.jsxExpressionContainer(j.numericLiteral(value)) : j.jsxExpressionContainer(j.nullLiteral());
|
|
4
|
+
}
|
|
5
|
+
function addAttribute(j, node, name, value) {
|
|
6
|
+
return getAttribute(node.attributes, name) ? !1 : (node.attributes || (node.attributes = []), node.attributes.push(j.jsxAttribute(j.jsxIdentifier(name), getAttributeValue(j, value))), !0);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
addAttribute
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=addAttribute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addAttribute.js","sources":["../../src/utils/getAttributeValue.ts","../../src/utils/addAttribute.ts"],"sourcesContent":["import type {API, JSXAttribute} from 'jscodeshift'\n\nexport function getAttributeValue(\n j: API['jscodeshift'],\n value: unknown,\n): NonNullable<JSXAttribute['value']> {\n if (value === true || value === false) {\n return j.jsxExpressionContainer(j.booleanLiteral(value))\n }\n\n if (typeof value === 'string') {\n return j.stringLiteral(value)\n }\n\n if (typeof value === 'number') {\n return j.jsxExpressionContainer(j.numericLiteral(value))\n }\n\n return j.jsxExpressionContainer(j.nullLiteral())\n}\n","import type {API, JSXOpeningElement} from 'jscodeshift'\n\nimport {getAttribute} from './getAttribute'\nimport {getAttributeValue} from './getAttributeValue'\n\n/**\n * Adds a JSX attribute to the opening element if it doesn't already exist.\n * Returns whether the AST was updated.\n */\nexport function addAttribute(\n j: API['jscodeshift'],\n node: JSXOpeningElement,\n name: string,\n value: unknown,\n): boolean {\n if (getAttribute(node.attributes, name)) {\n return false\n }\n\n if (!node.attributes) {\n node.attributes = []\n }\n\n node.attributes.push(j.jsxAttribute(j.jsxIdentifier(name), getAttributeValue(j, value)))\n return true\n}\n"],"names":[],"mappings":";AAEO,SAAS,kBACd,GACA,OACoC;AACpC,SAAI,UAAU,MAAQ,UAAU,KACvB,EAAE,uBAAuB,EAAE,eAAe,KAAK,CAAC,IAGrD,OAAO,SAAU,WACZ,EAAE,cAAc,KAAK,IAG1B,OAAO,SAAU,WACZ,EAAE,uBAAuB,EAAE,eAAe,KAAK,CAAC,IAGlD,EAAE,uBAAuB,EAAE,aAAa;AACjD;ACVO,SAAS,aACd,GACA,MACA,MACA,OACS;AACT,SAAI,aAAa,KAAK,YAAY,IAAI,IAC7B,MAGJ,KAAK,eACR,KAAK,aAAa,CAAA,IAGpB,KAAK,WAAW,KAAK,EAAE,aAAa,EAAE,cAAc,IAAI,GAAG,kBAAkB,GAAG,KAAK,CAAC,CAAC,GAChF;AACT;"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { insertTodoWarning } from "./transformComponent.js";
|
|
2
|
+
import { LAYOUT_MODS } from "./layout-mods.js";
|
|
3
|
+
function addImportSpecifier(j, root, addTo, name) {
|
|
4
|
+
let hasChanges = !1;
|
|
5
|
+
return root.find(j.ImportDeclaration).forEach((path) => {
|
|
6
|
+
const specs = path.node.specifiers;
|
|
7
|
+
if (!specs?.length)
|
|
8
|
+
return;
|
|
9
|
+
const hasFromSpecifier = specs.some(
|
|
10
|
+
(s) => s.type === "ImportSpecifier" && s.imported.type === "Identifier" && s.imported.name === addTo
|
|
11
|
+
), hasToSpecifier = specs.some(
|
|
12
|
+
(s) => s.type === "ImportSpecifier" && s.imported.type === "Identifier" && s.imported.name === name
|
|
13
|
+
);
|
|
14
|
+
hasFromSpecifier && !hasToSpecifier && (specs.push(j.importSpecifier(j.identifier(name), j.identifier(name))), hasChanges = !0);
|
|
15
|
+
}), hasChanges;
|
|
16
|
+
}
|
|
17
|
+
function isImportBindingUsed(j, root, name, specifierPath) {
|
|
18
|
+
if (root.find(j.JSXOpeningElement).some(({ node }) => node.name.type === "JSXIdentifier" && node.name.name === name) || root.find(j.JSXClosingElement).some(({ node }) => node.name.type === "JSXIdentifier" && node.name.name === name))
|
|
19
|
+
return !0;
|
|
20
|
+
const importedPath = specifierPath.get("imported"), localPath = specifierPath.get("local");
|
|
21
|
+
return root.find(j.Identifier).some((idPath) => {
|
|
22
|
+
if (idPath.node.name !== name || idPath === importedPath || idPath === localPath)
|
|
23
|
+
return !1;
|
|
24
|
+
const parent = idPath.parent?.node;
|
|
25
|
+
return parent ? !(parent.type === "MemberExpression" && !parent.computed && parent.property === idPath.node || parent.type === "TSQualifiedName" && parent.right === idPath.node) : !0;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function removeUnusedImport(j, root, name) {
|
|
29
|
+
let hasChanges = !1;
|
|
30
|
+
return root.find(j.ImportDeclaration).forEach((path) => {
|
|
31
|
+
const specs = path.node.specifiers;
|
|
32
|
+
if (!specs?.length)
|
|
33
|
+
return;
|
|
34
|
+
const next = specs.filter((spec, i) => {
|
|
35
|
+
if (spec.type !== "ImportSpecifier" || spec.imported.type !== "Identifier" || spec.imported.name !== name || "importKind" in spec && spec.importKind === "type")
|
|
36
|
+
return !0;
|
|
37
|
+
const localName = spec.local?.type === "Identifier" ? spec.local.name : spec.imported.name, specifierPath = path.get("specifiers", i);
|
|
38
|
+
return isImportBindingUsed(j, root, localName, specifierPath);
|
|
39
|
+
});
|
|
40
|
+
if (next.length !== specs.length) {
|
|
41
|
+
if (next.length === 0) {
|
|
42
|
+
j(path).remove(), hasChanges = !0;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
path.node.specifiers = next, hasChanges = !0;
|
|
46
|
+
}
|
|
47
|
+
}), hasChanges;
|
|
48
|
+
}
|
|
49
|
+
function transformImportAlias(j, root, fromExport, toExport, localName, warning) {
|
|
50
|
+
let updated = !1;
|
|
51
|
+
return root.find(j.ImportDeclaration).forEach((path) => {
|
|
52
|
+
const specs = path.node.specifiers;
|
|
53
|
+
if (specs?.length) {
|
|
54
|
+
for (const spec of specs)
|
|
55
|
+
if (!(spec.type !== "ImportSpecifier" || spec.imported.type !== "Identifier" || spec.imported.name !== fromExport || (spec.local?.type === "Identifier" ? spec.local.name : spec.imported.name) !== localName)) {
|
|
56
|
+
spec.imported.name = toExport, updated = !0, warning && insertTodoWarning(j, path, warning);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}), updated;
|
|
61
|
+
}
|
|
62
|
+
function replaceElement(j, root, filter, from, to) {
|
|
63
|
+
const names = new Set(from.localNames);
|
|
64
|
+
names.size === 0 && names.add(from.element);
|
|
65
|
+
let hasChanges = !1, needsDefaultImportUpdate = !1;
|
|
66
|
+
const aliases = /* @__PURE__ */ new Set();
|
|
67
|
+
return root.find(j.JSXOpeningElement).forEach((path) => {
|
|
68
|
+
const openingEl = path.node, openingName = openingEl.name;
|
|
69
|
+
if (openingName.type !== "JSXIdentifier" || !names.has(openingName.name))
|
|
70
|
+
return;
|
|
71
|
+
const attrs = openingEl.attributes;
|
|
72
|
+
if (!attrs || !filter(attrs)) {
|
|
73
|
+
from.callback?.(path) && (hasChanges = !0);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const localTag = openingName.name;
|
|
77
|
+
if (localTag !== from.element && localTag !== to.element)
|
|
78
|
+
aliases.has(localTag) || (transformImportAlias(
|
|
79
|
+
j,
|
|
80
|
+
root,
|
|
81
|
+
from.element,
|
|
82
|
+
to.element,
|
|
83
|
+
localTag,
|
|
84
|
+
`Consider renaming ${localTag} to ${to.element}`
|
|
85
|
+
) && (hasChanges = !0), aliases.add(localTag));
|
|
86
|
+
else {
|
|
87
|
+
openingName.name = to.element;
|
|
88
|
+
const parentNode = path.parent?.node;
|
|
89
|
+
if (parentNode?.type === "JSXElement") {
|
|
90
|
+
const closing = parentNode.closingElement;
|
|
91
|
+
closing?.name.type === "JSXIdentifier" && (closing.name.name = to.element);
|
|
92
|
+
}
|
|
93
|
+
needsDefaultImportUpdate = !0, hasChanges = !0;
|
|
94
|
+
}
|
|
95
|
+
to.callback?.(path) && (hasChanges = !0);
|
|
96
|
+
}), needsDefaultImportUpdate && (addImportSpecifier(j, root, from.element, to.element) && (hasChanges = !0), removeUnusedImport(j, root, from.element) && (hasChanges = !0)), hasChanges;
|
|
97
|
+
}
|
|
98
|
+
const BOX_MODS = {
|
|
99
|
+
...LAYOUT_MODS,
|
|
100
|
+
alignItems: {
|
|
101
|
+
type: "style-only",
|
|
102
|
+
style: "alignItems"
|
|
103
|
+
},
|
|
104
|
+
flexDirection: {
|
|
105
|
+
type: "style-only",
|
|
106
|
+
style: "flexDirection"
|
|
107
|
+
},
|
|
108
|
+
flexWrap: {
|
|
109
|
+
type: "style-only",
|
|
110
|
+
style: "flexWrap"
|
|
111
|
+
},
|
|
112
|
+
gridAutoColumns: {
|
|
113
|
+
type: "style-only",
|
|
114
|
+
style: "gridAutoColumns"
|
|
115
|
+
},
|
|
116
|
+
gridAutoFlow: {
|
|
117
|
+
type: "style-only",
|
|
118
|
+
style: "gridAutoFlow"
|
|
119
|
+
},
|
|
120
|
+
gridAutoRows: {
|
|
121
|
+
type: "style-only",
|
|
122
|
+
style: "gridAutoRows"
|
|
123
|
+
},
|
|
124
|
+
gridTemplateColumns: {
|
|
125
|
+
type: "style-mapped",
|
|
126
|
+
style: "gridTemplateColumns",
|
|
127
|
+
mapping: {
|
|
128
|
+
0: "0px",
|
|
129
|
+
1: "repeat(1, 1fr)",
|
|
130
|
+
2: "repeat(2, 1fr)",
|
|
131
|
+
3: "repeat(3, 1fr)",
|
|
132
|
+
4: "repeat(4, 1fr)",
|
|
133
|
+
5: "repeat(5, 1fr)",
|
|
134
|
+
6: "repeat(6, 1fr)",
|
|
135
|
+
7: "repeat(7, 1fr)",
|
|
136
|
+
8: "repeat(8, 1fr)",
|
|
137
|
+
9: "repeat(9, 1fr)",
|
|
138
|
+
10: "repeat(10, 1fr)",
|
|
139
|
+
11: "repeat(11, 1fr)",
|
|
140
|
+
12: "repeat(12, 1fr)"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
gridTemplateRows: {
|
|
144
|
+
type: "style-mapped",
|
|
145
|
+
style: "gridTemplateRows",
|
|
146
|
+
mapping: {
|
|
147
|
+
0: "0px",
|
|
148
|
+
1: "repeat(1, 1fr)",
|
|
149
|
+
2: "repeat(2, 1fr)",
|
|
150
|
+
3: "repeat(3, 1fr)",
|
|
151
|
+
4: "repeat(4, 1fr)",
|
|
152
|
+
5: "repeat(5, 1fr)",
|
|
153
|
+
6: "repeat(6, 1fr)",
|
|
154
|
+
7: "repeat(7, 1fr)",
|
|
155
|
+
8: "repeat(8, 1fr)",
|
|
156
|
+
9: "repeat(9, 1fr)",
|
|
157
|
+
10: "repeat(10, 1fr)",
|
|
158
|
+
11: "repeat(11, 1fr)",
|
|
159
|
+
12: "repeat(12, 1fr)"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
justifyContent: {
|
|
163
|
+
type: "style-only",
|
|
164
|
+
style: "justifyContent"
|
|
165
|
+
},
|
|
166
|
+
tone: {
|
|
167
|
+
type: "mapped-only",
|
|
168
|
+
mapping: {
|
|
169
|
+
default: "none",
|
|
170
|
+
none: "none",
|
|
171
|
+
transparent: "neutral",
|
|
172
|
+
neutral: "neutral",
|
|
173
|
+
brand: "primary",
|
|
174
|
+
primary: "primary",
|
|
175
|
+
positive: "positive",
|
|
176
|
+
caution: "caution",
|
|
177
|
+
critical: "critical",
|
|
178
|
+
suggest: "suggest"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
export {
|
|
183
|
+
BOX_MODS,
|
|
184
|
+
replaceElement
|
|
185
|
+
};
|
|
186
|
+
//# sourceMappingURL=box.mods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"box.mods.js","sources":["../../src/utils/addImportSpecifier.ts","../../src/utils/isImportBindingUsed.ts","../../src/utils/removeUnusedImport.ts","../../src/utils/transformImportAlias.ts","../../src/utils/replaceElement.ts","../../src/transforms/latest/box/box.mods.ts"],"sourcesContent":["import type {API} from 'jscodeshift'\n\n/**\n * Adds an import specifier to an existing import declaration.\n * Returns whether the AST was updated.\n */\nexport function addImportSpecifier(\n j: API['jscodeshift'],\n root: ReturnType<API['jscodeshift']>,\n addTo: string,\n name: string,\n): boolean {\n let hasChanges = false\n\n root.find(j.ImportDeclaration).forEach((path) => {\n const specs = path.node.specifiers\n\n if (!specs?.length) {\n return\n }\n\n const hasFromSpecifier = specs.some(\n (s) =>\n s.type === 'ImportSpecifier' &&\n s.imported.type === 'Identifier' &&\n s.imported.name === addTo,\n )\n const hasToSpecifier = specs.some(\n (s) =>\n s.type === 'ImportSpecifier' &&\n s.imported.type === 'Identifier' &&\n s.imported.name === name,\n )\n\n if (hasFromSpecifier && !hasToSpecifier) {\n specs.push(j.importSpecifier(j.identifier(name), j.identifier(name)))\n hasChanges = true\n }\n })\n\n return hasChanges\n}\n","import type {API, ASTPath, ImportSpecifier} from 'jscodeshift'\n\nexport function isImportBindingUsed(\n j: API['jscodeshift'],\n root: ReturnType<API['jscodeshift']>,\n name: string,\n specifierPath: ASTPath<ImportSpecifier>,\n): boolean {\n const jsxOpening = root.find(j.JSXOpeningElement).some(({node}) => {\n return node.name.type === 'JSXIdentifier' && node.name.name === name\n })\n\n if (jsxOpening) {\n return true\n }\n\n const jsxClosing = root.find(j.JSXClosingElement).some(({node}) => {\n return node.name.type === 'JSXIdentifier' && node.name.name === name\n })\n\n if (jsxClosing) {\n return true\n }\n\n const importedPath = specifierPath.get('imported')\n const localPath = specifierPath.get('local')\n\n return root.find(j.Identifier).some((idPath) => {\n if (idPath.node.name !== name) {\n return false\n }\n\n if (idPath === importedPath || idPath === localPath) {\n return false\n }\n\n const parent = idPath.parent?.node\n\n if (!parent) {\n return true\n }\n\n if (parent.type === 'MemberExpression' && !parent.computed && parent.property === idPath.node) {\n return false\n }\n\n if (parent.type === 'TSQualifiedName' && parent.right === idPath.node) {\n return false\n }\n\n return true\n })\n}\n","import type {API, ASTPath, ImportSpecifier} from 'jscodeshift'\n\nimport {isImportBindingUsed} from './isImportBindingUsed'\n\n/**\n * Removes unused import specifier or the whole import if no specifiers remain.\n * Returns whether the AST was updated.\n */\nexport function removeUnusedImport(\n j: API['jscodeshift'],\n root: ReturnType<API['jscodeshift']>,\n name: string,\n): boolean {\n let hasChanges = false\n\n root.find(j.ImportDeclaration).forEach((path) => {\n const specs = path.node.specifiers\n\n if (!specs?.length) {\n return\n }\n\n const next = specs.filter((spec, i) => {\n if (spec.type !== 'ImportSpecifier' || spec.imported.type !== 'Identifier') {\n return true\n }\n\n if (spec.imported.name !== name) {\n return true\n }\n\n if ('importKind' in spec && spec.importKind === 'type') {\n return true\n }\n\n const localName = spec.local?.type === 'Identifier' ? spec.local.name : spec.imported.name\n const specifierPath = path.get('specifiers', i) as ASTPath<ImportSpecifier>\n\n return isImportBindingUsed(j, root, localName, specifierPath)\n })\n\n if (next.length === specs.length) {\n return\n }\n\n if (next.length === 0) {\n j(path).remove()\n hasChanges = true\n return\n }\n\n path.node.specifiers = next\n hasChanges = true\n })\n\n return hasChanges\n}\n","import type {API} from 'jscodeshift'\n\nimport {insertTodoWarning} from './insertTodoWarning'\n\nexport function transformImportAlias(\n j: API['jscodeshift'],\n root: ReturnType<API['jscodeshift']>,\n fromExport: string,\n toExport: string,\n localName: string,\n warning?: string,\n): boolean {\n let updated = false\n\n root.find(j.ImportDeclaration).forEach((path) => {\n const specs = path.node.specifiers\n\n if (!specs?.length) {\n return\n }\n\n for (const spec of specs) {\n if (spec.type !== 'ImportSpecifier' || spec.imported.type !== 'Identifier') {\n continue\n }\n\n if (spec.imported.name !== fromExport) {\n continue\n }\n\n const local = spec.local?.type === 'Identifier' ? spec.local.name : spec.imported.name\n\n if (local !== localName) {\n continue\n }\n\n spec.imported.name = toExport\n updated = true\n\n if (warning) {\n insertTodoWarning(j, path, warning)\n }\n\n return\n }\n })\n\n return updated\n}\n","import type {API, ASTPath, JSXAttribute, JSXOpeningElement, JSXSpreadAttribute} from 'jscodeshift'\n\nimport {addImportSpecifier} from './addImportSpecifier'\nimport {removeUnusedImport} from './removeUnusedImport'\nimport {transformImportAlias} from './transformImportAlias'\n\n/**\n * Replaces JSX component if `filter` passes. Runs callbacks and updates imports.\n * Returns whether the AST was updated.\n */\nexport function replaceElement(\n j: API['jscodeshift'],\n root: ReturnType<API['jscodeshift']>,\n filter: (attrs: (JSXAttribute | JSXSpreadAttribute)[]) => boolean,\n from: {\n element: string\n localNames?: Iterable<string>\n callback?: (path: ASTPath<JSXOpeningElement>) => boolean | void\n },\n to: {\n element: string\n callback?: (path: ASTPath<JSXOpeningElement>) => boolean | void\n },\n): boolean {\n const names = new Set(from.localNames)\n\n if (names.size === 0) {\n names.add(from.element)\n }\n\n let hasChanges = false\n let needsDefaultImportUpdate = false\n const aliases = new Set<string>()\n\n root.find(j.JSXOpeningElement).forEach((path) => {\n const openingEl = path.node\n const openingName = openingEl.name\n\n if (openingName.type !== 'JSXIdentifier' || !names.has(openingName.name)) {\n return\n }\n\n const attrs = openingEl.attributes\n\n if (!attrs || !filter(attrs)) {\n if (from.callback?.(path)) {\n hasChanges = true\n }\n\n return\n }\n\n const localTag = openingName.name\n const preserveAlias = localTag !== from.element && localTag !== to.element\n\n if (preserveAlias) {\n if (!aliases.has(localTag)) {\n if (\n transformImportAlias(\n j,\n root,\n from.element,\n to.element,\n localTag,\n `Consider renaming ${localTag} to ${to.element}`,\n )\n ) {\n hasChanges = true\n }\n\n aliases.add(localTag)\n }\n } else {\n openingName.name = to.element\n\n const parentNode = path.parent?.node\n\n if (parentNode?.type === 'JSXElement') {\n const closing = parentNode.closingElement\n\n if (closing?.name.type === 'JSXIdentifier') {\n closing.name.name = to.element\n }\n }\n\n needsDefaultImportUpdate = true\n hasChanges = true\n }\n\n if (to.callback?.(path)) {\n hasChanges = true\n }\n })\n\n if (needsDefaultImportUpdate) {\n if (addImportSpecifier(j, root, from.element, to.element)) {\n hasChanges = true\n }\n\n if (removeUnusedImport(j, root, from.element)) {\n hasChanges = true\n }\n }\n\n return hasChanges\n}\n","import {LAYOUT_MODS} from '../../../constants/latest/layout-mods'\nimport type {AttributeMods} from '../../../types/AttributeMods'\n\n/** @internal */\nexport const BOX_MODS: AttributeMods = {\n ...LAYOUT_MODS,\n alignItems: {\n type: 'style-only',\n style: 'alignItems',\n },\n flexDirection: {\n type: 'style-only',\n style: 'flexDirection',\n },\n flexWrap: {\n type: 'style-only',\n style: 'flexWrap',\n },\n gridAutoColumns: {\n type: 'style-only',\n style: 'gridAutoColumns',\n },\n gridAutoFlow: {\n type: 'style-only',\n style: 'gridAutoFlow',\n },\n gridAutoRows: {\n type: 'style-only',\n style: 'gridAutoRows',\n },\n gridTemplateColumns: {\n type: 'style-mapped',\n style: 'gridTemplateColumns',\n mapping: {\n 0: '0px',\n 1: 'repeat(1, 1fr)',\n 2: 'repeat(2, 1fr)',\n 3: 'repeat(3, 1fr)',\n 4: 'repeat(4, 1fr)',\n 5: 'repeat(5, 1fr)',\n 6: 'repeat(6, 1fr)',\n 7: 'repeat(7, 1fr)',\n 8: 'repeat(8, 1fr)',\n 9: 'repeat(9, 1fr)',\n 10: 'repeat(10, 1fr)',\n 11: 'repeat(11, 1fr)',\n 12: 'repeat(12, 1fr)',\n },\n },\n gridTemplateRows: {\n type: 'style-mapped',\n style: 'gridTemplateRows',\n mapping: {\n 0: '0px',\n 1: 'repeat(1, 1fr)',\n 2: 'repeat(2, 1fr)',\n 3: 'repeat(3, 1fr)',\n 4: 'repeat(4, 1fr)',\n 5: 'repeat(5, 1fr)',\n 6: 'repeat(6, 1fr)',\n 7: 'repeat(7, 1fr)',\n 8: 'repeat(8, 1fr)',\n 9: 'repeat(9, 1fr)',\n 10: 'repeat(10, 1fr)',\n 11: 'repeat(11, 1fr)',\n 12: 'repeat(12, 1fr)',\n },\n },\n justifyContent: {\n type: 'style-only',\n style: 'justifyContent',\n },\n tone: {\n type: 'mapped-only',\n mapping: {\n default: 'none',\n none: 'none',\n transparent: 'neutral',\n neutral: 'neutral',\n brand: 'primary',\n primary: 'primary',\n positive: 'positive',\n caution: 'caution',\n critical: 'crit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b,SAAS;AAAA,MACT,OAAO;AAAA,MACP,SAAS;AAAA,MACT,UAAU;AAAA,MACV,SAAS;AAAA,MACT,UAAU;AAAA,MACV,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { LAYOUT_MODS } from "./layout-mods.js";
|
|
2
|
+
const FLEX_MODS = {
|
|
3
|
+
...LAYOUT_MODS,
|
|
4
|
+
align: {
|
|
5
|
+
type: "rename-only",
|
|
6
|
+
name: "alignItems"
|
|
7
|
+
},
|
|
8
|
+
direction: {
|
|
9
|
+
type: "rename-only",
|
|
10
|
+
name: "flexDirection"
|
|
11
|
+
},
|
|
12
|
+
gridAutoColumns: {
|
|
13
|
+
type: "style-only",
|
|
14
|
+
style: "gridAutoColumns"
|
|
15
|
+
},
|
|
16
|
+
gridAutoFlow: {
|
|
17
|
+
type: "style-only",
|
|
18
|
+
style: "gridAutoFlow"
|
|
19
|
+
},
|
|
20
|
+
gridAutoRows: {
|
|
21
|
+
type: "style-only",
|
|
22
|
+
style: "gridAutoRows"
|
|
23
|
+
},
|
|
24
|
+
gridTemplateColumns: {
|
|
25
|
+
type: "style-mapped",
|
|
26
|
+
style: "gridTemplateColumns",
|
|
27
|
+
mapping: {
|
|
28
|
+
0: "0px",
|
|
29
|
+
1: "repeat(1, 1fr)",
|
|
30
|
+
2: "repeat(2, 1fr)",
|
|
31
|
+
3: "repeat(3, 1fr)",
|
|
32
|
+
4: "repeat(4, 1fr)",
|
|
33
|
+
5: "repeat(5, 1fr)",
|
|
34
|
+
6: "repeat(6, 1fr)",
|
|
35
|
+
7: "repeat(7, 1fr)",
|
|
36
|
+
8: "repeat(8, 1fr)",
|
|
37
|
+
9: "repeat(9, 1fr)",
|
|
38
|
+
10: "repeat(10, 1fr)",
|
|
39
|
+
11: "repeat(11, 1fr)",
|
|
40
|
+
12: "repeat(12, 1fr)"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
gridTemplateRows: {
|
|
44
|
+
type: "style-mapped",
|
|
45
|
+
style: "gridTemplateRows",
|
|
46
|
+
mapping: {
|
|
47
|
+
0: "0px",
|
|
48
|
+
1: "repeat(1, 1fr)",
|
|
49
|
+
2: "repeat(2, 1fr)",
|
|
50
|
+
3: "repeat(3, 1fr)",
|
|
51
|
+
4: "repeat(4, 1fr)",
|
|
52
|
+
5: "repeat(5, 1fr)",
|
|
53
|
+
6: "repeat(6, 1fr)",
|
|
54
|
+
7: "repeat(7, 1fr)",
|
|
55
|
+
8: "repeat(8, 1fr)",
|
|
56
|
+
9: "repeat(9, 1fr)",
|
|
57
|
+
10: "repeat(10, 1fr)",
|
|
58
|
+
11: "repeat(11, 1fr)",
|
|
59
|
+
12: "repeat(12, 1fr)"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
wrap: {
|
|
63
|
+
type: "rename-only",
|
|
64
|
+
name: "flexWrap"
|
|
65
|
+
},
|
|
66
|
+
justify: {
|
|
67
|
+
type: "rename-only",
|
|
68
|
+
name: "justifyContent"
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
FLEX_MODS
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=flex.mods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flex.mods.js","sources":["../../src/transforms/latest/flex/flex.mods.ts"],"sourcesContent":["import {LAYOUT_MODS} from '../../../constants/latest/layout-mods'\nimport type {AttributeMods} from '../../../types/AttributeMods'\n\n/** @internal */\nexport const FLEX_MODS: AttributeMods = {\n ...LAYOUT_MODS,\n align: {\n type: 'rename-only',\n name: 'alignItems',\n },\n direction: {\n type: 'rename-only',\n name: 'flexDirection',\n },\n gridAutoColumns: {\n type: 'style-only',\n style: 'gridAutoColumns',\n },\n gridAutoFlow: {\n type: 'style-only',\n style: 'gridAutoFlow',\n },\n gridAutoRows: {\n type: 'style-only',\n style: 'gridAutoRows',\n },\n gridTemplateColumns: {\n type: 'style-mapped',\n style: 'gridTemplateColumns',\n mapping: {\n 0: '0px',\n 1: 'repeat(1, 1fr)',\n 2: 'repeat(2, 1fr)',\n 3: 'repeat(3, 1fr)',\n 4: 'repeat(4, 1fr)',\n 5: 'repeat(5, 1fr)',\n 6: 'repeat(6, 1fr)',\n 7: 'repeat(7, 1fr)',\n 8: 'repeat(8, 1fr)',\n 9: 'repeat(9, 1fr)',\n 10: 'repeat(10, 1fr)',\n 11: 'repeat(11, 1fr)',\n 12: 'repeat(12, 1fr)',\n },\n },\n gridTemplateRows: {\n type: 'style-mapped',\n style: 'gridTemplateRows',\n mapping: {\n 0: '0px',\n 1: 'repeat(1, 1fr)',\n 2: 'repeat(2, 1fr)',\n 3: 'repeat(3, 1fr)',\n 4: 'repeat(4, 1fr)',\n 5: 'repeat(5, 1fr)',\n 6: 'repeat(6, 1fr)',\n 7: 'repeat(7, 1fr)',\n 8: 'repeat(8, 1fr)',\n 9: 'repeat(9, 1fr)',\n 10: 'repeat(10, 1fr)',\n 11: 'repeat(11, 1fr)',\n 12: 'repeat(12, 1fr)',\n },\n },\n wrap: {\n type: 'rename-only',\n name: 'flexWrap',\n },\n justify: {\n type: 'rename-only',\n name: 'justifyContent',\n },\n}\n"],"names":[],"mappings":";AAIO,MAAM,YAA2B;AAAA,EACtC,GAAG;AAAA,EACH,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,EAAA;AAAA,EAER,WAAW;AAAA,IACT,MAAM;AAAA,IACN,MAAM;AAAA,EAAA;AAAA,EAER,iBAAiB;AAAA,IACf,MAAM;AAAA,IACN,OAAO;AAAA,EAAA;AAAA,EAET,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,OAAO;AAAA,EAAA;AAAA,EAET,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,OAAO;AAAA,EAAA;AAAA,EAET,qBAAqB;AAAA,IACnB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,MACP,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,kBAAkB;AAAA,IAChB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,MACP,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,MAAM;AAAA,EAAA;AAAA,EAER,SAAS;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,EAAA;AAEV;"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Command, Flags } from "@oclif/core";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
class BaseCommand extends Command {
|
|
5
|
+
static baseFlags = {
|
|
6
|
+
paths: Flags.string({
|
|
7
|
+
description: "Paths for jscodeshift",
|
|
8
|
+
multiple: !0,
|
|
9
|
+
required: !0,
|
|
10
|
+
helpValue: "<paths>"
|
|
11
|
+
}),
|
|
12
|
+
fromPackage: Flags.string({
|
|
13
|
+
description: "Original package name to transform"
|
|
14
|
+
}),
|
|
15
|
+
toPackage: Flags.string({
|
|
16
|
+
description: "New package name"
|
|
17
|
+
}),
|
|
18
|
+
extensions: Flags.string({
|
|
19
|
+
description: "File extensions to transform (comma-separated, without dots)",
|
|
20
|
+
default: "ts,tsx,js,jsx"
|
|
21
|
+
}),
|
|
22
|
+
dry: Flags.boolean({
|
|
23
|
+
description: "Dry run without changing files",
|
|
24
|
+
default: !1,
|
|
25
|
+
allowNo: !0
|
|
26
|
+
}),
|
|
27
|
+
print: Flags.boolean({
|
|
28
|
+
description: "Print transformed files",
|
|
29
|
+
default: !1,
|
|
30
|
+
allowNo: !0
|
|
31
|
+
}),
|
|
32
|
+
verbose: Flags.integer({
|
|
33
|
+
description: "Log level for jscodeshift errors",
|
|
34
|
+
min: 0,
|
|
35
|
+
max: 2,
|
|
36
|
+
default: 0
|
|
37
|
+
})
|
|
38
|
+
};
|
|
39
|
+
flags;
|
|
40
|
+
args;
|
|
41
|
+
static examples = [
|
|
42
|
+
"<%= config.bin %> <%= command.id %> --paths <paths>",
|
|
43
|
+
"<%= config.bin %> <%= command.id %> --paths <paths> --dry",
|
|
44
|
+
"<%= config.bin %> <%= command.id %> --paths <paths> --print"
|
|
45
|
+
];
|
|
46
|
+
async init() {
|
|
47
|
+
await super.init();
|
|
48
|
+
const { args, flags } = await this.parse({
|
|
49
|
+
flags: this.ctor.flags,
|
|
50
|
+
baseFlags: super.ctor.baseFlags,
|
|
51
|
+
args: this.ctor.args,
|
|
52
|
+
strict: this.ctor.strict
|
|
53
|
+
});
|
|
54
|
+
this.flags = flags, this.args = args;
|
|
55
|
+
}
|
|
56
|
+
async catch(err) {
|
|
57
|
+
return super.catch(err);
|
|
58
|
+
}
|
|
59
|
+
async finally(_) {
|
|
60
|
+
return super.finally(_);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function getTransformPath(root, version, name) {
|
|
64
|
+
const jsPath = path.join(root, `dist/transforms/${version}/${name}/${name}.js`), tsPath = path.join(root, `src/transforms/${version}/${name}/${name}.ts`);
|
|
65
|
+
if (existsSync(jsPath))
|
|
66
|
+
return jsPath;
|
|
67
|
+
if (existsSync(tsPath))
|
|
68
|
+
return tsPath;
|
|
69
|
+
throw new Error(`Could not find ${name} codemod`);
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
BaseCommand,
|
|
73
|
+
getTransformPath
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=getTransformPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTransformPath.js","sources":["../../src/baseCommand.ts","../../src/utils/getTransformPath.ts"],"sourcesContent":["import {Command, Flags, type Interfaces} from '@oclif/core'\n\nexport type Flags<T extends typeof Command> = Interfaces.InferredFlags<\n (typeof BaseCommand)['baseFlags'] & T['flags']\n>\nexport type Args<T extends typeof Command> = Interfaces.InferredArgs<T['args']>\n\nexport abstract class BaseCommand<T extends typeof Command> extends Command {\n static override baseFlags = {\n paths: Flags.string({\n description: 'Paths for jscodeshift',\n multiple: true,\n required: true,\n helpValue: '<paths>',\n }),\n fromPackage: Flags.string({\n description: 'Original package name to transform',\n }),\n toPackage: Flags.string({\n description: 'New package name',\n }),\n extensions: Flags.string({\n description: 'File extensions to transform (comma-separated, without dots)',\n default: 'ts,tsx,js,jsx',\n }),\n dry: Flags.boolean({\n description: 'Dry run without changing files',\n default: false,\n allowNo: true,\n }),\n print: Flags.boolean({\n description: 'Print transformed files',\n default: false,\n allowNo: true,\n }),\n verbose: Flags.integer({\n description: 'Log level for jscodeshift errors',\n min: 0,\n max: 2,\n default: 0,\n }),\n }\n\n protected flags!: Flags<T>\n protected args!: Args<T>\n\n static override examples = [\n '<%= config.bin %> <%= command.id %> --paths <paths>',\n '<%= config.bin %> <%= command.id %> --paths <paths> --dry',\n '<%= config.bin %> <%= command.id %> --paths <paths> --print',\n ]\n\n public override async init(): Promise<void> {\n await super.init()\n\n const {args, flags} = await this.parse({\n flags: this.ctor.flags,\n baseFlags: (super.ctor as typeof BaseCommand).baseFlags,\n args: this.ctor.args,\n strict: this.ctor.strict,\n })\n\n this.flags = flags as Flags<T>\n this.args = args as Args<T>\n }\n\n protected override async catch(err: Error & {exitCode?: number}): Promise<unknown> {\n return super.catch(err)\n }\n\n protected override async finally(_: Error | undefined): Promise<unknown> {\n return super.finally(_)\n }\n}\n","import {existsSync} from 'node:fs'\nimport path from 'node:path'\n\nexport function getTransformPath(root: string, version: string, name: string) {\n const jsPath = path.join(root, `dist/transforms/${version}/${name}/${name}.js`)\n const tsPath = path.join(root, `src/transforms/${version}/${name}/${name}.ts`)\n\n if (existsSync(jsPath)) {\n return jsPath\n }\n\n if (existsSync(tsPath)) {\n return tsPath\n }\n\n throw new Error(`Could not find ${name} codemod`)\n}\n"],"names":[],"mappings":";;;AAOO,MAAe,oBAA8C,QAAQ;AAAA,EAC1E,OAAgB,YAAY;AAAA,IAC1B,OAAO,MAAM,OAAO;AAAA,MAClB,aAAa;AAAA,MACb,UAAU;AAAA,MACV,UAAU;AAAA,MACV,WAAW;AAAA,IAAA,CACZ;AAAA,IACD,aAAa,MAAM,OAAO;AAAA,MACxB,aAAa;AAAA,IAAA,CACd;AAAA,IACD,WAAW,MAAM,OAAO;AAAA,MACtB,aAAa;AAAA,IAAA,CACd;AAAA,IACD,YAAY,MAAM,OAAO;AAAA,MACvB,aAAa;AAAA,MACb,SAAS;AAAA,IAAA,CACV;AAAA,IACD,KAAK,MAAM,QAAQ;AAAA,MACjB,aAAa;AAAA,MACb,SAAS;AAAA,MACT,SAAS;AAAA,IAAA,CACV;AAAA,IACD,OAAO,MAAM,QAAQ;AAAA,MACnB,aAAa;AAAA,MACb,SAAS;AAAA,MACT,SAAS;AAAA,IAAA,CACV;AAAA,IACD,SAAS,MAAM,QAAQ;AAAA,MACrB,aAAa;AAAA,MACb,KAAK;AAAA,MACL,KAAK;AAAA,MACL,SAAS;AAAA,IAAA,CACV;AAAA,EAAA;AAAA,EAGO;AAAA,EACA;AAAA,EAEV,OAAgB,WAAW;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAGF,MAAsB,OAAsB;AAC1C,UAAM,MAAM,KAAA;AAEZ,UAAM,EAAC,MAAM,MAAA,IAAS,MAAM,KAAK,MAAM;AAAA,MACrC,OAAO,KAAK,KAAK;AAAA,MACjB,WAAY,MAAM,KAA4B;AAAA,MAC9C,MAAM,KAAK,KAAK;AAAA,MAChB,QAAQ,KAAK,KAAK;AAAA,IAAA,CACnB;AAED,SAAK,QAAQ,OACb,KAAK,OAAO;AAAA,EACd;AAAA,EAEA,MAAyB,MAAM,KAAoD;AACjF,WAAO,MAAM,MAAM,GAAG;AAAA,EACxB;AAAA,EAEA,MAAyB,QAAQ,GAAwC;AACvE,WAAO,MAAM,QAAQ,CAAC;AAAA,EACxB;AACF;ACtEO,SAAS,iBAAiB,MAAc,SAAiB,MAAc;AAC5E,QAAM,SAAS,KAAK,KAAK,MAAM,mBAAmB,OAAO,IAAI,IAAI,IAAI,IAAI,KAAK,GACxE,SAAS,KAAK,KAAK,MAAM,kBAAkB,OAAO,IAAI,IAAI,IAAI,IAAI,KAAK;AAE7E,MAAI,WAAW,MAAM;AACnB,WAAO;AAGT,MAAI,WAAW,MAAM;AACnB,WAAO;AAGT,QAAM,IAAI,MAAM,kBAAkB,IAAI,UAAU;AAClD;"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { LAYOUT_MODS } from "./layout-mods.js";
|
|
2
|
+
const GRID_MODS = {
|
|
3
|
+
...LAYOUT_MODS,
|
|
4
|
+
alignItems: {
|
|
5
|
+
type: "style-only",
|
|
6
|
+
style: "alignItems"
|
|
7
|
+
},
|
|
8
|
+
autoCols: {
|
|
9
|
+
type: "rename-only",
|
|
10
|
+
name: "gridAutoColumns"
|
|
11
|
+
},
|
|
12
|
+
autoFlow: {
|
|
13
|
+
type: "rename-only",
|
|
14
|
+
name: "gridAutoFlow"
|
|
15
|
+
},
|
|
16
|
+
autoRows: {
|
|
17
|
+
type: "rename-only",
|
|
18
|
+
name: "gridAutoRows"
|
|
19
|
+
},
|
|
20
|
+
flexDirection: {
|
|
21
|
+
type: "style-only",
|
|
22
|
+
style: "flexDirection"
|
|
23
|
+
},
|
|
24
|
+
flexWrap: {
|
|
25
|
+
type: "style-only",
|
|
26
|
+
style: "flexWrap"
|
|
27
|
+
},
|
|
28
|
+
columns: {
|
|
29
|
+
type: "rename-mapped",
|
|
30
|
+
name: "gridTemplateColumns",
|
|
31
|
+
mapping: {
|
|
32
|
+
0: "0px",
|
|
33
|
+
1: "repeat(1, 1fr)",
|
|
34
|
+
2: "repeat(2, 1fr)",
|
|
35
|
+
3: "repeat(3, 1fr)",
|
|
36
|
+
4: "repeat(4, 1fr)",
|
|
37
|
+
5: "repeat(5, 1fr)",
|
|
38
|
+
6: "repeat(6, 1fr)",
|
|
39
|
+
7: "repeat(7, 1fr)",
|
|
40
|
+
8: "repeat(8, 1fr)",
|
|
41
|
+
9: "repeat(9, 1fr)",
|
|
42
|
+
10: "repeat(10, 1fr)",
|
|
43
|
+
11: "repeat(11, 1fr)",
|
|
44
|
+
12: "repeat(12, 1fr)"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
gridTemplateColumns: {
|
|
48
|
+
type: "mapped-only",
|
|
49
|
+
mapping: {
|
|
50
|
+
0: "0px",
|
|
51
|
+
1: "repeat(1, 1fr)",
|
|
52
|
+
2: "repeat(2, 1fr)",
|
|
53
|
+
3: "repeat(3, 1fr)",
|
|
54
|
+
4: "repeat(4, 1fr)",
|
|
55
|
+
5: "repeat(5, 1fr)",
|
|
56
|
+
6: "repeat(6, 1fr)",
|
|
57
|
+
7: "repeat(7, 1fr)",
|
|
58
|
+
8: "repeat(8, 1fr)",
|
|
59
|
+
9: "repeat(9, 1fr)",
|
|
60
|
+
10: "repeat(10, 1fr)",
|
|
61
|
+
11: "repeat(11, 1fr)",
|
|
62
|
+
12: "repeat(12, 1fr)"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
gridTemplateRows: {
|
|
66
|
+
type: "mapped-only",
|
|
67
|
+
mapping: {
|
|
68
|
+
0: "0px",
|
|
69
|
+
1: "repeat(1, 1fr)",
|
|
70
|
+
2: "repeat(2, 1fr)",
|
|
71
|
+
3: "repeat(3, 1fr)",
|
|
72
|
+
4: "repeat(4, 1fr)",
|
|
73
|
+
5: "repeat(5, 1fr)",
|
|
74
|
+
6: "repeat(6, 1fr)",
|
|
75
|
+
7: "repeat(7, 1fr)",
|
|
76
|
+
8: "repeat(8, 1fr)",
|
|
77
|
+
9: "repeat(9, 1fr)",
|
|
78
|
+
10: "repeat(10, 1fr)",
|
|
79
|
+
11: "repeat(11, 1fr)",
|
|
80
|
+
12: "repeat(12, 1fr)"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
justifyContent: {
|
|
84
|
+
type: "style-only",
|
|
85
|
+
style: "justifyContent"
|
|
86
|
+
},
|
|
87
|
+
rows: {
|
|
88
|
+
type: "rename-mapped",
|
|
89
|
+
name: "gridTemplateRows",
|
|
90
|
+
mapping: {
|
|
91
|
+
0: "0px",
|
|
92
|
+
1: "repeat(1, 1fr)",
|
|
93
|
+
2: "repeat(2, 1fr)",
|
|
94
|
+
3: "repeat(3, 1fr)",
|
|
95
|
+
4: "repeat(4, 1fr)",
|
|
96
|
+
5: "repeat(5, 1fr)",
|
|
97
|
+
6: "repeat(6, 1fr)",
|
|
98
|
+
7: "repeat(7, 1fr)",
|
|
99
|
+
8: "repeat(8, 1fr)",
|
|
100
|
+
9: "repeat(9, 1fr)",
|
|
101
|
+
10: "repeat(10, 1fr)",
|
|
102
|
+
11: "repeat(11, 1fr)",
|
|
103
|
+
12: "repeat(12, 1fr)"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
export {
|
|
108
|
+
GRID_MODS
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=grid.mods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid.mods.js","sources":["../../src/transforms/latest/grid/grid.mods.ts"],"sourcesContent":["import {LAYOUT_MODS} from '../../../constants/latest/layout-mods'\nimport type {AttributeMods} from '../../../types/AttributeMods'\n\n/** @internal */\nexport const GRID_MODS: AttributeMods = {\n ...LAYOUT_MODS,\n alignItems: {\n type: 'style-only',\n style: 'alignItems',\n },\n autoCols: {\n type: 'rename-only',\n name: 'gridAutoColumns',\n },\n autoFlow: {\n type: 'rename-only',\n name: 'gridAutoFlow',\n },\n autoRows: {\n type: 'rename-only',\n name: 'gridAutoRows',\n },\n flexDirection: {\n type: 'style-only',\n style: 'flexDirection',\n },\n flexWrap: {\n type: 'style-only',\n style: 'flexWrap',\n },\n columns: {\n type: 'rename-mapped',\n name: 'gridTemplateColumns',\n mapping: {\n 0: '0px',\n 1: 'repeat(1, 1fr)',\n 2: 'repeat(2, 1fr)',\n 3: 'repeat(3, 1fr)',\n 4: 'repeat(4, 1fr)',\n 5: 'repeat(5, 1fr)',\n 6: 'repeat(6, 1fr)',\n 7: 'repeat(7, 1fr)',\n 8: 'repeat(8, 1fr)',\n 9: 'repeat(9, 1fr)',\n 10: 'repeat(10, 1fr)',\n 11: 'repeat(11, 1fr)',\n 12: 'repeat(12, 1fr)',\n },\n },\n gridTemplateColumns: {\n type: 'mapped-only',\n mapping: {\n 0: '0px',\n 1: 'repeat(1, 1fr)',\n 2: 'repeat(2, 1fr)',\n 3: 'repeat(3, 1fr)',\n 4: 'repeat(4, 1fr)',\n 5: 'repeat(5, 1fr)',\n 6: 'repeat(6, 1fr)',\n 7: 'repeat(7, 1fr)',\n 8: 'repeat(8, 1fr)',\n 9: 'repeat(9, 1fr)',\n 10: 'repeat(10, 1fr)',\n 11: 'repeat(11, 1fr)',\n 12: 'repeat(12, 1fr)',\n },\n },\n gridTemplateRows: {\n type: 'mapped-only',\n mapping: {\n 0: '0px',\n 1: 'repeat(1, 1fr)',\n 2: 'repeat(2, 1fr)',\n 3: 'repeat(3, 1fr)',\n 4: 'repeat(4, 1fr)',\n 5: 'repeat(5, 1fr)',\n 6: 'repeat(6, 1fr)',\n 7: 'repeat(7, 1fr)',\n 8: 'repeat(8, 1fr)',\n 9: 'repeat(9, 1fr)',\n 10: 'repeat(10, 1fr)',\n 11: 'repeat(11, 1fr)',\n 12: 'repeat(12, 1fr)',\n },\n },\n justifyContent: {\n type: 'style-only',\n style: 'justifyContent',\n },\n rows: {\n type: 'rename-mapped',\n name: 'gridTemplateRows',\n mapping: {\n 0: '0px',\n 1: 'repeat(1, 1fr)',\n 2: 'repeat(2, 1fr)',\n 3: 'repeat(3, 1fr)',\n 4: 'repeat(4, 1fr)',\n 5: 'repeat(5, 1fr)',\n 6: 'repeat(6, 1fr)',\n 7: 'repeat(7, 1fr)',\n 8: 'repeat(8, 1fr)',\n 9: 'repeat(9, 1fr)',\n 10: 'repeat(10, 1fr)',\n 11: 'repeat(11, 1fr)',\n 12: 'repeat(12, 1fr)',\n },\n },\n}\n"],"names":[],"mappings":";AAIO,MAAM,YAA2B;AAAA,EACtC,GAAG;AAAA,EACH,YAAY;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,EAAA;AAAA,EAET,UAAU;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,EAAA;AAAA,EAER,UAAU;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,EAAA;AAAA,EAER,UAAU;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,EAAA;AAAA,EAER,eAAe;AAAA,IACb,MAAM;AAAA,IACN,OAAO;AAAA,EAAA;AAAA,EAET,UAAU;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,EAAA;AAAA,EAET,SAAS;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,MACP,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,qBAAqB;AAAA,IACnB,MAAM;AAAA,IACN,SAAS;AAAA,MACP,GAAG;AAAA,MACH,GAAG;AAAA,MACH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