skeleton 4.0.0-next.31 → 4.0.0-next.33
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/index.js +5 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1136,21 +1136,18 @@ function transformModule(code) {
|
|
|
1136
1136
|
file.forEachDescendant((node) => {
|
|
1137
1137
|
if (Node.isImportSpecifier(node) && ["@skeletonlabs/skeleton-svelte", "@skeletonlabs/skeleton-react"].includes(node.getImportDeclaration().getModuleSpecifier().getLiteralText())) {
|
|
1138
1138
|
const name = node.getName();
|
|
1139
|
-
|
|
1140
|
-
if (newName) {
|
|
1139
|
+
if (Object.hasOwn(IMPORT_MAPPINGS, name)) {
|
|
1141
1140
|
skeletonImports.push(name);
|
|
1142
|
-
node.setName(
|
|
1141
|
+
node.setName(IMPORT_MAPPINGS[name]);
|
|
1143
1142
|
}
|
|
1144
1143
|
}
|
|
1145
1144
|
});
|
|
1146
1145
|
file.forEachDescendant((node) => {
|
|
1147
1146
|
if (Node.isPropertyAccessExpression(node)) {
|
|
1148
1147
|
const fullName = `${node.getExpression().getText()}.${node.getName()}`;
|
|
1149
|
-
|
|
1150
|
-
if (newName) node.replaceWithText(newName);
|
|
1148
|
+
if (Object.hasOwn(IDENTIFIER_MAPPINGS, fullName)) node.replaceWithText(IDENTIFIER_MAPPINGS[fullName]);
|
|
1151
1149
|
} else if (Node.isIdentifier(node) && !Node.isImportSpecifier(node.getParent())) {
|
|
1152
|
-
|
|
1153
|
-
if (newName) node.replaceWithText(newName);
|
|
1150
|
+
if (Object.hasOwn(IDENTIFIER_MAPPINGS, node.getText())) node.replaceWithText(IDENTIFIER_MAPPINGS[node.getText()]);
|
|
1154
1151
|
}
|
|
1155
1152
|
});
|
|
1156
1153
|
return {
|
|
@@ -1218,8 +1215,7 @@ function transformCss(s, css) {
|
|
|
1218
1215
|
}
|
|
1219
1216
|
function transformFragment(s, fragment, skeletonImports) {
|
|
1220
1217
|
walk(fragment, {}, { Component(node, ctx) {
|
|
1221
|
-
|
|
1222
|
-
if (newName && hasRange(node) && skeletonImports.includes(node.name.split(".").at(0) || "")) renameComponent(s, node, newName);
|
|
1218
|
+
if (Object.hasOwn(IDENTIFIER_MAPPINGS, node.name) && hasRange(node) && skeletonImports.includes(node.name.split(".").at(0) || "")) renameComponent(s, node, IDENTIFIER_MAPPINGS[node.name]);
|
|
1223
1219
|
ctx.next();
|
|
1224
1220
|
} });
|
|
1225
1221
|
}
|
package/package.json
CHANGED