@tamagui/static 1.141.5 → 1.143.0
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/checkDeps.cjs +38 -3
- package/dist/checkDeps.js +37 -3
- package/dist/checkDeps.js.map +1 -1
- package/dist/extractor/buildClassName.cjs +62 -0
- package/dist/extractor/buildClassName.js +72 -0
- package/dist/extractor/buildClassName.js.map +6 -0
- package/dist/extractor/ensureImportingConcat.cjs +48 -0
- package/dist/extractor/ensureImportingConcat.js +50 -0
- package/dist/extractor/ensureImportingConcat.js.map +6 -0
- package/dist/extractor/extractToNative.cjs +5 -1
- package/dist/extractor/extractToNative.js +14 -4
- package/dist/extractor/extractToNative.js.map +1 -1
- package/dist/extractor/hoistClassNames.cjs +62 -0
- package/dist/extractor/hoistClassNames.js +63 -0
- package/dist/extractor/hoistClassNames.js.map +6 -0
- package/package.json +15 -15
- package/src/checkDeps.ts +105 -3
- package/src/extractor/extractToNative.ts +12 -3
- package/types/checkDeps.d.ts.map +1 -1
- package/types/extractor/buildClassName.d.ts.map +1 -0
- package/types/extractor/ensureImportingConcat.d.ts.map +1 -0
- package/types/extractor/extractToNative.d.ts.map +1 -1
- package/types/extractor/hoistClassNames.d.ts.map +1 -0
package/dist/checkDeps.cjs
CHANGED
|
@@ -24,9 +24,44 @@ __export(checkDeps_exports, {
|
|
|
24
24
|
checkDeps: () => checkDeps
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(checkDeps_exports);
|
|
27
|
-
var
|
|
27
|
+
var import_node_fs = require("node:fs"),
|
|
28
|
+
import_node_path = require("node:path"),
|
|
29
|
+
import_check_dep_versions = require("./check-dep-versions.cjs"),
|
|
28
30
|
DEPENDENCY_TYPE = /* @__PURE__ */(DEPENDENCY_TYPE2 => (DEPENDENCY_TYPE2.dependencies = "dependencies", DEPENDENCY_TYPE2.devDependencies = "devDependencies", DEPENDENCY_TYPE2.optionalDependencies = "optionalDependencies", DEPENDENCY_TYPE2.peerDependencies = "peerDependencies", DEPENDENCY_TYPE2.resolutions = "resolutions", DEPENDENCY_TYPE2))(DEPENDENCY_TYPE || {});
|
|
31
|
+
function checkTamaguiPackageVersions(root) {
|
|
32
|
+
const packageJsonPath = (0, import_node_path.join)(root, "package.json");
|
|
33
|
+
if (!(0, import_node_fs.existsSync)(packageJsonPath)) return "";
|
|
34
|
+
const packageJson = JSON.parse((0, import_node_fs.readFileSync)(packageJsonPath, "utf8")),
|
|
35
|
+
tamaguiDeps = [],
|
|
36
|
+
allDeps = {
|
|
37
|
+
...packageJson.dependencies,
|
|
38
|
+
...packageJson.devDependencies,
|
|
39
|
+
...packageJson.optionalDependencies
|
|
40
|
+
};
|
|
41
|
+
for (const [name, version] of Object.entries(allDeps)) (name === "tamagui" || name.startsWith("@tamagui/")) && tamaguiDeps.push({
|
|
42
|
+
name,
|
|
43
|
+
version
|
|
44
|
+
});
|
|
45
|
+
if (tamaguiDeps.length <= 1) return "";
|
|
46
|
+
const normalizeVersion = v => v.startsWith("workspace:") ? v : v.replace(/^[\^~>=<]+/, ""),
|
|
47
|
+
versionGroups = /* @__PURE__ */new Map();
|
|
48
|
+
for (const dep of tamaguiDeps) {
|
|
49
|
+
const normalized = normalizeVersion(dep.version);
|
|
50
|
+
versionGroups.has(normalized) || versionGroups.set(normalized, []), versionGroups.get(normalized).push(`${dep.name}@${dep.version}`);
|
|
51
|
+
}
|
|
52
|
+
if (versionGroups.size <= 1) return "";
|
|
53
|
+
const lines = ["Found mismatched @tamagui/* package versions in package.json:", ""];
|
|
54
|
+
for (const [version, packages] of versionGroups) {
|
|
55
|
+
lines.push(` ${version}:`);
|
|
56
|
+
for (const pkg of packages.sort()) lines.push(` - ${pkg}`);
|
|
57
|
+
}
|
|
58
|
+
return lines.push(""), lines.push("All @tamagui/* packages should use the same version to avoid runtime issues."), lines.push("Run `npx tamagui upgrade` to sync all packages to the latest version."), lines.join(`
|
|
59
|
+
`);
|
|
60
|
+
}
|
|
29
61
|
async function checkDeps(root) {
|
|
30
|
-
const
|
|
31
|
-
|
|
62
|
+
const tamaguiMismatchSummary = checkTamaguiPackageVersions(root),
|
|
63
|
+
workspaceMismatchSummary = new import_check_dep_versions.CDVC(root).toMismatchSummary(),
|
|
64
|
+
hasTamaguiMismatch = !!tamaguiMismatchSummary,
|
|
65
|
+
hasWorkspaceMismatch = !!workspaceMismatchSummary;
|
|
66
|
+
!hasTamaguiMismatch && !hasWorkspaceMismatch && (console.info("Tamagui dependencies look good \u2705"), process.exit(0)), hasTamaguiMismatch && console.error(tamaguiMismatchSummary), hasWorkspaceMismatch && (hasTamaguiMismatch && console.error(""), console.error(workspaceMismatchSummary)), process.exit(1);
|
|
32
67
|
}
|
package/dist/checkDeps.js
CHANGED
|
@@ -18,9 +18,43 @@ __export(checkDeps_exports, {
|
|
|
18
18
|
checkDeps: () => checkDeps
|
|
19
19
|
});
|
|
20
20
|
module.exports = __toCommonJS(checkDeps_exports);
|
|
21
|
-
var import_check_dep_versions = require("./check-dep-versions"), DEPENDENCY_TYPE = /* @__PURE__ */ ((DEPENDENCY_TYPE2) => (DEPENDENCY_TYPE2.dependencies = "dependencies", DEPENDENCY_TYPE2.devDependencies = "devDependencies", DEPENDENCY_TYPE2.optionalDependencies = "optionalDependencies", DEPENDENCY_TYPE2.peerDependencies = "peerDependencies", DEPENDENCY_TYPE2.resolutions = "resolutions", DEPENDENCY_TYPE2))(DEPENDENCY_TYPE || {});
|
|
21
|
+
var import_node_fs = require("node:fs"), import_node_path = require("node:path"), import_check_dep_versions = require("./check-dep-versions"), DEPENDENCY_TYPE = /* @__PURE__ */ ((DEPENDENCY_TYPE2) => (DEPENDENCY_TYPE2.dependencies = "dependencies", DEPENDENCY_TYPE2.devDependencies = "devDependencies", DEPENDENCY_TYPE2.optionalDependencies = "optionalDependencies", DEPENDENCY_TYPE2.peerDependencies = "peerDependencies", DEPENDENCY_TYPE2.resolutions = "resolutions", DEPENDENCY_TYPE2))(DEPENDENCY_TYPE || {});
|
|
22
|
+
function checkTamaguiPackageVersions(root) {
|
|
23
|
+
const packageJsonPath = (0, import_node_path.join)(root, "package.json");
|
|
24
|
+
if (!(0, import_node_fs.existsSync)(packageJsonPath))
|
|
25
|
+
return "";
|
|
26
|
+
const packageJson = JSON.parse((0, import_node_fs.readFileSync)(packageJsonPath, "utf8")), tamaguiDeps = [], allDeps = {
|
|
27
|
+
...packageJson.dependencies,
|
|
28
|
+
...packageJson.devDependencies,
|
|
29
|
+
...packageJson.optionalDependencies
|
|
30
|
+
};
|
|
31
|
+
for (const [name, version] of Object.entries(allDeps))
|
|
32
|
+
(name === "tamagui" || name.startsWith("@tamagui/")) && tamaguiDeps.push({ name, version });
|
|
33
|
+
if (tamaguiDeps.length <= 1)
|
|
34
|
+
return "";
|
|
35
|
+
const normalizeVersion = (v) => v.startsWith("workspace:") ? v : v.replace(/^[\^~>=<]+/, ""), versionGroups = /* @__PURE__ */ new Map();
|
|
36
|
+
for (const dep of tamaguiDeps) {
|
|
37
|
+
const normalized = normalizeVersion(dep.version);
|
|
38
|
+
versionGroups.has(normalized) || versionGroups.set(normalized, []), versionGroups.get(normalized).push(`${dep.name}@${dep.version}`);
|
|
39
|
+
}
|
|
40
|
+
if (versionGroups.size <= 1)
|
|
41
|
+
return "";
|
|
42
|
+
const lines = [
|
|
43
|
+
"Found mismatched @tamagui/* package versions in package.json:",
|
|
44
|
+
""
|
|
45
|
+
];
|
|
46
|
+
for (const [version, packages] of versionGroups) {
|
|
47
|
+
lines.push(` ${version}:`);
|
|
48
|
+
for (const pkg of packages.sort())
|
|
49
|
+
lines.push(` - ${pkg}`);
|
|
50
|
+
}
|
|
51
|
+
return lines.push(""), lines.push(
|
|
52
|
+
"All @tamagui/* packages should use the same version to avoid runtime issues."
|
|
53
|
+
), lines.push("Run `npx tamagui upgrade` to sync all packages to the latest version."), lines.join(`
|
|
54
|
+
`);
|
|
55
|
+
}
|
|
22
56
|
async function checkDeps(root) {
|
|
23
|
-
const
|
|
24
|
-
|
|
57
|
+
const tamaguiMismatchSummary = checkTamaguiPackageVersions(root), workspaceMismatchSummary = new import_check_dep_versions.CDVC(root).toMismatchSummary(), hasTamaguiMismatch = !!tamaguiMismatchSummary, hasWorkspaceMismatch = !!workspaceMismatchSummary;
|
|
58
|
+
!hasTamaguiMismatch && !hasWorkspaceMismatch && (console.info("Tamagui dependencies look good \u2705"), process.exit(0)), hasTamaguiMismatch && console.error(tamaguiMismatchSummary), hasWorkspaceMismatch && (hasTamaguiMismatch && console.error(""), console.error(workspaceMismatchSummary)), process.exit(1);
|
|
25
59
|
}
|
|
26
60
|
//# sourceMappingURL=checkDeps.js.map
|
package/dist/checkDeps.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/checkDeps.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAyC,oBACzC,mBAAqB,sBACrB,4BAAqB,iCAET,kBAAL,kBAAKA,sBACVA,iBAAA,eAAe,gBACfA,iBAAA,kBAAkB,mBAClBA,iBAAA,uBAAuB,wBACvBA,iBAAA,mBAAmB,oBACnBA,iBAAA,cAAc,eALJA,mBAAA;AA6BZ,SAAS,4BAA4B,MAAsB;AACzD,QAAM,sBAAkB,uBAAK,MAAM,cAAc;AACjD,MAAI,KAAC,2BAAW,eAAe;AAC7B,WAAO;AAGT,QAAM,cAA2B,KAAK,UAAM,6BAAa,iBAAiB,MAAM,CAAC,GAG3E,cAAmD,CAAC,GAEpD,UAAU;AAAA,IACd,GAAG,YAAY;AAAA,IACf,GAAG,YAAY;AAAA,IACf,GAAG,YAAY;AAAA,EACjB;AAEA,aAAW,CAAC,MAAM,OAAO,KAAK,OAAO,QAAQ,OAAO;AAClD,KAAI,SAAS,aAAa,K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
|
6
6
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
32
|
+
var buildClassName_exports = {};
|
|
33
|
+
__export(buildClassName_exports, {
|
|
34
|
+
buildClassName: () => buildClassName,
|
|
35
|
+
buildClassNameLogic: () => buildClassNameLogic
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(buildClassName_exports);
|
|
38
|
+
var t = __toESM(require("@babel/types"));
|
|
39
|
+
const buildClassName = (objectsIn, extras = "") => {
|
|
40
|
+
let objects = buildClassNameLogic(objectsIn);
|
|
41
|
+
return objects ? (t.isStringLiteral(objects) ? objects.value = `${extras} ${objects.value}` : objects = t.binaryExpression("+", t.stringLiteral(extras), objects), objects) : null;
|
|
42
|
+
},
|
|
43
|
+
buildClassNameLogic = objects => objects.reduce((acc, val) => {
|
|
44
|
+
if (acc == null) return (
|
|
45
|
+
// pass conditional expressions through
|
|
46
|
+
t.isConditionalExpression(val) ||
|
|
47
|
+
// pass non-null literals through
|
|
48
|
+
t.isStringLiteral(val) || t.isNumericLiteral(val) ? val : t.logicalExpression("||", val, t.stringLiteral(""))
|
|
49
|
+
);
|
|
50
|
+
let inner;
|
|
51
|
+
if (t.isStringLiteral(val)) {
|
|
52
|
+
if (t.isStringLiteral(acc)) return t.stringLiteral(`${acc.value} ${val.value}`);
|
|
53
|
+
inner = t.stringLiteral(` ${val.value}`);
|
|
54
|
+
} else if (t.isLiteral(val)) inner = t.binaryExpression("+", t.stringLiteral(" "), val);else if (t.isConditionalExpression(val) || t.isBinaryExpression(val)) {
|
|
55
|
+
if (t.isStringLiteral(acc)) return t.binaryExpression("+", t.stringLiteral(`${acc.value} `), val);
|
|
56
|
+
inner = t.binaryExpression("+", t.stringLiteral(" "), val);
|
|
57
|
+
} else if (t.isIdentifier(val) || t.isMemberExpression(val)) inner = t.conditionalExpression(val, t.binaryExpression("+", t.stringLiteral(" "), val), t.stringLiteral(""));else {
|
|
58
|
+
if (t.isStringLiteral(acc)) return t.binaryExpression("+", t.stringLiteral(`${acc.value} `), t.logicalExpression("||", val, t.stringLiteral("")));
|
|
59
|
+
inner = t.binaryExpression("+", t.stringLiteral(" "), t.logicalExpression("||", val, t.stringLiteral("")));
|
|
60
|
+
}
|
|
61
|
+
return t.binaryExpression("+", acc, inner);
|
|
62
|
+
}, null);
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
+
mod
|
|
22
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
+
var buildClassName_exports = {};
|
|
24
|
+
__export(buildClassName_exports, {
|
|
25
|
+
buildClassName: () => buildClassName,
|
|
26
|
+
buildClassNameLogic: () => buildClassNameLogic
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(buildClassName_exports);
|
|
29
|
+
var t = __toESM(require("@babel/types"));
|
|
30
|
+
const buildClassName = (objectsIn, extras = "") => {
|
|
31
|
+
let objects = buildClassNameLogic(objectsIn);
|
|
32
|
+
return objects ? (t.isStringLiteral(objects) ? objects.value = `${extras} ${objects.value}` : objects = t.binaryExpression("+", t.stringLiteral(extras), objects), objects) : null;
|
|
33
|
+
}, buildClassNameLogic = (objects) => objects.reduce((acc, val) => {
|
|
34
|
+
if (acc == null)
|
|
35
|
+
return (
|
|
36
|
+
// pass conditional expressions through
|
|
37
|
+
t.isConditionalExpression(val) || // pass non-null literals through
|
|
38
|
+
t.isStringLiteral(val) || t.isNumericLiteral(val) ? val : t.logicalExpression("||", val, t.stringLiteral(""))
|
|
39
|
+
);
|
|
40
|
+
let inner;
|
|
41
|
+
if (t.isStringLiteral(val)) {
|
|
42
|
+
if (t.isStringLiteral(acc))
|
|
43
|
+
return t.stringLiteral(`${acc.value} ${val.value}`);
|
|
44
|
+
inner = t.stringLiteral(` ${val.value}`);
|
|
45
|
+
} else if (t.isLiteral(val))
|
|
46
|
+
inner = t.binaryExpression("+", t.stringLiteral(" "), val);
|
|
47
|
+
else if (t.isConditionalExpression(val) || t.isBinaryExpression(val)) {
|
|
48
|
+
if (t.isStringLiteral(acc))
|
|
49
|
+
return t.binaryExpression("+", t.stringLiteral(`${acc.value} `), val);
|
|
50
|
+
inner = t.binaryExpression("+", t.stringLiteral(" "), val);
|
|
51
|
+
} else if (t.isIdentifier(val) || t.isMemberExpression(val))
|
|
52
|
+
inner = t.conditionalExpression(
|
|
53
|
+
val,
|
|
54
|
+
t.binaryExpression("+", t.stringLiteral(" "), val),
|
|
55
|
+
t.stringLiteral("")
|
|
56
|
+
);
|
|
57
|
+
else {
|
|
58
|
+
if (t.isStringLiteral(acc))
|
|
59
|
+
return t.binaryExpression(
|
|
60
|
+
"+",
|
|
61
|
+
t.stringLiteral(`${acc.value} `),
|
|
62
|
+
t.logicalExpression("||", val, t.stringLiteral(""))
|
|
63
|
+
);
|
|
64
|
+
inner = t.binaryExpression(
|
|
65
|
+
"+",
|
|
66
|
+
t.stringLiteral(" "),
|
|
67
|
+
t.logicalExpression("||", val, t.stringLiteral(""))
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
return t.binaryExpression("+", acc, inner);
|
|
71
|
+
}, null);
|
|
72
|
+
//# sourceMappingURL=buildClassName.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/extractor/buildClassName.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAAmB;AASZ,MAAM,iBAA0B,CAAC,WAAW,SAAS,OAAO;AACjE,MAAI,UAAU,oBAAoB,SAAS;AAC3C,SAAK,WACD,EAAE,gBAAgB,OAAO,IAE3B,QAAQ,QAAQ,GAAG,MAAM,IAAI,QAAQ,KAAK,KAE1C,UAAU,EAAE,iBAAiB,KAAK,EAAE,cAAc,MAAM,GAAG,OAAO,GAE7D,WAPc;AAQvB,GAEa,sBAA+B,CAAC,YACpC,QAAQ,OAA4B,CAAC,KAAK,QAAQ;AACvD,MAAI,OAAO;AACT;AAAA;AAAA,MAEE,EAAE,wBAAwB,GAAG;AAAA,MAE7B,EAAE,gBAAgB,GAAG,KACrB,EAAE,iBAAiB,GAAG,IAEf,MAEF,EAAE,kBAAkB,MAAM,KAAK,EAAE,cAAc,EAAE,CAAC;AAAA;AAG3D,MAAI;AACJ,MAAI,EAAE,gBAAgB,GAAG,GAAG;AAC1B,QAAI,EAAE,gBAAgB,GAAG;AAEvB,aAAO,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,IAAI,KAAK,EAAE;AAEpD,YAAQ,EAAE,cAAc,IAAI,IAAI,KAAK,EAAE;AAAA,EACzC,WAAW,EAAE,UAAU,GAAG;AACxB,YAAQ,EAAE,iBAAiB,KAAK,EAAE,cAAc,GAAG,GAAG,GAAG;AAAA,WAChD,EAAE,wBAAwB,GAAG,KAAK,EAAE,mBAAmB,GAAG,GAAG;AACtE,QAAI,EAAE,gBAAgB,GAAG;AACvB,aAAO,EAAE,iBAAiB,KAAK,EAAE,cAAc,GAAG,IAAI,KAAK,GAAG,GAAG,GAAG;AAEtE,YAAQ,EAAE,iBAAiB,KAAK,EAAE,cAAc,GAAG,GAAG,GAAG;AAAA,EAC3D,WAAW,EAAE,aAAa,GAAG,KAAK,EAAE,mBAAmB,GAAG;AAExD,YAAQ,EAAE;AAAA,MACR;AAAA,MACA,EAAE,iBAAiB,KAAK,EAAE,cAAc,GAAG,GAAG,GAAG;AAAA,MACjD,EAAE,cAAc,EAAE;AAAA,IACpB;AAAA,OACK;AACL,QAAI,EAAE,gBAAgB,GAAG;AACvB,aAAO,EAAE;AAAA,QACP;AAAA,QACA,EAAE,cAAc,GAAG,IAAI,KAAK,GAAG;AAAA,QAC/B,EAAE,kBAAkB,MAAM,KAAK,EAAE,cAAc,EAAE,CAAC;AAAA,MACpD;AAGF,YAAQ,EAAE;AAAA,MACR;AAAA,MACA,EAAE,cAAc,GAAG;AAAA,MACnB,EAAE,kBAAkB,MAAM,KAAK,EAAE,cAAc,EAAE,CAAC;AAAA,IACpD;AAAA,EACF;AAEA,SAAO,EAAE,iBAAiB,KAAK,KAAK,KAAK;AAC3C,GAAG,IAAI;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
32
|
+
var ensureImportingConcat_exports = {};
|
|
33
|
+
__export(ensureImportingConcat_exports, {
|
|
34
|
+
ensureImportingConcat: () => ensureImportingConcat
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(ensureImportingConcat_exports);
|
|
37
|
+
var t = __toESM(require("@babel/types"));
|
|
38
|
+
const importConcatPkg = "@tamagui/helpers";
|
|
39
|
+
function ensureImportingConcat(path) {
|
|
40
|
+
const imported = path.get("body").find(x => x.isImportDeclaration() && x.node.source.value === importConcatPkg),
|
|
41
|
+
importSpecifier = t.importSpecifier(t.identifier("concatClassName"), t.identifier("concatClassName"));
|
|
42
|
+
if (!imported) {
|
|
43
|
+
path.node.body.push(t.importDeclaration([importSpecifier], t.stringLiteral(importConcatPkg)));
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const specifiers = imported.node.specifiers;
|
|
47
|
+
specifiers.some(x => t.isImportSpecifier(x) && t.isIdentifier(x.imported) && x.imported.name === "concatClassName") || specifiers.push(t.importSpecifier(t.identifier("concatClassName"), t.identifier("concatClassName")));
|
|
48
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
+
mod
|
|
22
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
+
var ensureImportingConcat_exports = {};
|
|
24
|
+
__export(ensureImportingConcat_exports, {
|
|
25
|
+
ensureImportingConcat: () => ensureImportingConcat
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(ensureImportingConcat_exports);
|
|
28
|
+
var t = __toESM(require("@babel/types"));
|
|
29
|
+
const importConcatPkg = "@tamagui/helpers";
|
|
30
|
+
function ensureImportingConcat(path) {
|
|
31
|
+
const imported = path.get("body").find(
|
|
32
|
+
(x) => x.isImportDeclaration() && x.node.source.value === importConcatPkg
|
|
33
|
+
), importSpecifier = t.importSpecifier(
|
|
34
|
+
t.identifier("concatClassName"),
|
|
35
|
+
t.identifier("concatClassName")
|
|
36
|
+
);
|
|
37
|
+
if (!imported) {
|
|
38
|
+
path.node.body.push(
|
|
39
|
+
t.importDeclaration([importSpecifier], t.stringLiteral(importConcatPkg))
|
|
40
|
+
);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const specifiers = imported.node.specifiers;
|
|
44
|
+
specifiers.some(
|
|
45
|
+
(x) => t.isImportSpecifier(x) && t.isIdentifier(x.imported) && x.imported.name === "concatClassName"
|
|
46
|
+
) || specifiers.push(
|
|
47
|
+
t.importSpecifier(t.identifier("concatClassName"), t.identifier("concatClassName"))
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=ensureImportingConcat.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/extractor/ensureImportingConcat.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,QAAmB;AAEnB,MAAM,kBAAkB;AAEjB,SAAS,sBAAsB,MAA2B;AAE/D,QAAM,WADW,KAAK,IAAI,MAAM,EACqC;AAAA,IACnE,CAAC,MAAM,EAAE,oBAAoB,KAAK,EAAE,KAAK,OAAO,UAAU;AAAA,EAC5D,GACM,kBAAkB,EAAE;AAAA,IACxB,EAAE,WAAW,iBAAiB;AAAA,IAC9B,EAAE,WAAW,iBAAiB;AAAA,EAChC;AAEA,MAAI,CAAC,UAAU;AACb,SAAK,KAAK,KAAK;AAAA,MACb,EAAE,kBAAkB,CAAC,eAAe,GAAG,EAAE,cAAc,eAAe,CAAC;AAAA,IACzE;AACA;AAAA,EACF;AAEA,QAAM,aAAa,SAAS,KAAK;AAQjC,EAPwB,WAAW;AAAA,IACjC,CAAC,MACC,EAAE,kBAAkB,CAAC,KACrB,EAAE,aAAa,EAAE,QAAQ,KACzB,EAAE,SAAS,SAAS;AAAA,EACxB,KAGE,WAAW;AAAA,IACT,EAAE,gBAAgB,EAAE,WAAW,iBAAiB,GAAG,EAAE,WAAW,iBAAiB,CAAC;AAAA,EACpF;AAEJ;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -180,7 +180,11 @@ function getBabelParseDefinition(options) {
|
|
|
180
180
|
const themedStylesAst = (0, import_literalToAst.literalToAst)(styles);
|
|
181
181
|
return themedStylesAst.properties.forEach(_ => {
|
|
182
182
|
const prop = _;
|
|
183
|
-
prop.value.type === "StringLiteral"
|
|
183
|
+
if (prop.value.type === "StringLiteral") {
|
|
184
|
+
const propVal = prop.value.value.slice(1),
|
|
185
|
+
isComputed = !t.isValidIdentifier(propVal);
|
|
186
|
+
prop.value = t.callExpression(t.memberExpression(t.memberExpression(t.identifier("theme"), isComputed ? t.stringLiteral(propVal) : t.identifier(propVal), isComputed), t.identifier("get")), []);
|
|
187
|
+
}
|
|
184
188
|
}), themedStylesAst;
|
|
185
189
|
}
|
|
186
190
|
let hasDynamicStyle = !1;
|
|
@@ -145,10 +145,20 @@ function getBabelParseDefinition(options) {
|
|
|
145
145
|
const themedStylesAst = (0, import_literalToAst.literalToAst)(styles);
|
|
146
146
|
return themedStylesAst.properties.forEach((_) => {
|
|
147
147
|
const prop = _;
|
|
148
|
-
prop.value.type === "StringLiteral"
|
|
149
|
-
t.
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
if (prop.value.type === "StringLiteral") {
|
|
149
|
+
const propVal = prop.value.value.slice(1), isComputed = !t.isValidIdentifier(propVal);
|
|
150
|
+
prop.value = t.callExpression(
|
|
151
|
+
t.memberExpression(
|
|
152
|
+
t.memberExpression(
|
|
153
|
+
t.identifier("theme"),
|
|
154
|
+
isComputed ? t.stringLiteral(propVal) : t.identifier(propVal),
|
|
155
|
+
isComputed
|
|
156
|
+
),
|
|
157
|
+
t.identifier("get")
|
|
158
|
+
),
|
|
159
|
+
[]
|
|
160
|
+
);
|
|
161
|
+
}
|
|
152
162
|
}), themedStylesAst;
|
|
153
163
|
}
|
|
154
164
|
let hasDynamicStyle = !1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/extractor/extractToNative.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2D,wBAC3D,mBAAsB,sCACtB,6BAAwB,uCACxB,gBAAsB,0BACtB,kBAAqB,qCACrB,IAAmB,kCACnB,mBAAyB,sBACzB,0BAAiC,gCAEjC,yBAAgC,8BAChC,sBAA6B,2BAC7B,wBAA+B,6BAC/B,sBAA6B,2BAC7B,qBAA2C;AAE3C,MAAM,uBAAmB,gBAAAA,SAAS;AAAA;AAAA;AAAA,CAGjC,GAEK,uBAAmB,gBAAAA,SAAS;AAAA;AAAA,CAEjC,GAEK,sBAAkB,gBAAAA,SAAS;AAAA;AAAA,CAEhC,GAEK,yBAAqB,gBAAAA,SAAS;AAAA;AAAA,CAEnC,GAEK,gBAAY,wCAAgB,EAAE,UAAU,SAAS,CAAC;AAExD,IAAI;AAEG,SAAS,gBACd,gBACA,YACA,SACiB;AACjB,QAAM,UAAM,qBAAM,YAAY;AAAA,IAC5B,YAAY;AAAA,IACZ,SAAS,CAAC,OAAO,YAAY;AAAA,EAC/B,CAAC,GAEK,cAAc,eAAe,GAE7B,UAAM,kCAAqB,KAAK,YAAY;AAAA,IAChD,SAAS,CAAC,CAAC,aAAa,OAAO,CAAC;AAAA,I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,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,eAAe,MAA2B;AACjD,EAAI,KAAK,WAAW,KAAK,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,KAAK,SAAS,OAAO,KAG9E,QAAQ,IAAI,OAAO,WAAW,SAAS,KACzC,QAAQ,KAAK,6DAAmD;AAGtE;AAEA,SAAS,iBAAiB,OAAe;AACvC,QAAM,SAAiB,CAAC,GAClB,QAAgB,CAAC;AACvB,MAAI,UAAU;AACd,aAAW,OAAO,OAAO;AACvB,UAAM,MAAM,MAAM,GAAG;AACrB,IAAI,OAAO,IAAI,CAAC,MAAM,OACpB,OAAO,GAAG,IAAI,KACd,UAAU,MAEV,MAAM,GAAG,IAAI;AAAA,EAEjB;AACA,SAAO,EAAE,QAAQ,UAAU,OAAO,QAAQ,MAAM;AAClD;",
|
|
5
5
|
"names": ["template", "generator"]
|
|
6
6
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
32
|
+
var hoistClassNames_exports = {};
|
|
33
|
+
__export(hoistClassNames_exports, {
|
|
34
|
+
hoistClassNames: () => hoistClassNames
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(hoistClassNames_exports);
|
|
37
|
+
var t = __toESM(require("@babel/types"));
|
|
38
|
+
function hoistClassNames(path, existing, expr) {
|
|
39
|
+
const hoist = hoistClassNames.bind(null, path, existing);
|
|
40
|
+
if (t.isStringLiteral(expr)) {
|
|
41
|
+
if (expr.value.trim() === "") return expr;
|
|
42
|
+
if (existing[expr.value]) return existing[expr.value];
|
|
43
|
+
const identifier = replaceStringWithVariable(expr);
|
|
44
|
+
return existing[expr.value] = identifier, identifier;
|
|
45
|
+
}
|
|
46
|
+
if (t.isBinaryExpression(expr)) {
|
|
47
|
+
if (t.isPrivateName(expr.left)) throw new Error("no private name");
|
|
48
|
+
return t.binaryExpression(expr.operator, hoist(expr.left), hoist(expr.right));
|
|
49
|
+
}
|
|
50
|
+
if (t.isLogicalExpression(expr)) return t.logicalExpression(expr.operator, hoist(expr.left), hoist(expr.right));
|
|
51
|
+
if (t.isConditionalExpression(expr)) return t.conditionalExpression(expr.test, hoist(expr.consequent), hoist(expr.alternate));
|
|
52
|
+
return expr;
|
|
53
|
+
function replaceStringWithVariable(str) {
|
|
54
|
+
const uid = path.scope.generateUidIdentifier("cn"),
|
|
55
|
+
parent = path.findParent(path2 => path2.isProgram());
|
|
56
|
+
if (!parent) throw new Error("no program?");
|
|
57
|
+
const variable = t.variableDeclaration("const", [
|
|
58
|
+
// adding a space for extra safety
|
|
59
|
+
t.variableDeclarator(uid, t.stringLiteral(` ${str.value}`))]);
|
|
60
|
+
return parent.unshiftContainer("body", variable), uid;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
+
mod
|
|
22
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
+
var hoistClassNames_exports = {};
|
|
24
|
+
__export(hoistClassNames_exports, {
|
|
25
|
+
hoistClassNames: () => hoistClassNames
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(hoistClassNames_exports);
|
|
28
|
+
var t = __toESM(require("@babel/types"));
|
|
29
|
+
function hoistClassNames(path, existing, expr) {
|
|
30
|
+
const hoist = hoistClassNames.bind(null, path, existing);
|
|
31
|
+
if (t.isStringLiteral(expr)) {
|
|
32
|
+
if (expr.value.trim() === "")
|
|
33
|
+
return expr;
|
|
34
|
+
if (existing[expr.value])
|
|
35
|
+
return existing[expr.value];
|
|
36
|
+
const identifier = replaceStringWithVariable(expr);
|
|
37
|
+
return existing[expr.value] = identifier, identifier;
|
|
38
|
+
}
|
|
39
|
+
if (t.isBinaryExpression(expr)) {
|
|
40
|
+
if (t.isPrivateName(expr.left))
|
|
41
|
+
throw new Error("no private name");
|
|
42
|
+
return t.binaryExpression(expr.operator, hoist(expr.left), hoist(expr.right));
|
|
43
|
+
}
|
|
44
|
+
if (t.isLogicalExpression(expr))
|
|
45
|
+
return t.logicalExpression(expr.operator, hoist(expr.left), hoist(expr.right));
|
|
46
|
+
if (t.isConditionalExpression(expr))
|
|
47
|
+
return t.conditionalExpression(
|
|
48
|
+
expr.test,
|
|
49
|
+
hoist(expr.consequent),
|
|
50
|
+
hoist(expr.alternate)
|
|
51
|
+
);
|
|
52
|
+
return expr;
|
|
53
|
+
function replaceStringWithVariable(str) {
|
|
54
|
+
const uid = path.scope.generateUidIdentifier("cn"), parent = path.findParent((path2) => path2.isProgram());
|
|
55
|
+
if (!parent) throw new Error("no program?");
|
|
56
|
+
const variable = t.variableDeclaration("const", [
|
|
57
|
+
// adding a space for extra safety
|
|
58
|
+
t.variableDeclarator(uid, t.stringLiteral(` ${str.value}`))
|
|
59
|
+
]);
|
|
60
|
+
return parent.unshiftContainer("body", variable), uid;
|
|
61
|
+
}
|
|
62
|
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E,oBAAoB,SAAS;AAAA;AAAA,MAE9C,EAAE,mBAAmB,KAAK,EAAE,cAAc,IAAI,IAAI,KAAK,EAAE,CAAC;AAAA,IAC5D,CAAC;AAED,kBAAO,iBAAiB,QAAQ,QAAQ,GACjC;AAAA,EACT;AACF;",
|
|
5
|
+
"names": ["path"]
|
|
6
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/static",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.143.0",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -50,19 +50,19 @@
|
|
|
50
50
|
"@babel/template": "^7.25.0",
|
|
51
51
|
"@babel/traverse": "^7.25.4",
|
|
52
52
|
"@babel/types": "^7.25.4",
|
|
53
|
-
"@tamagui/cli-color": "1.
|
|
54
|
-
"@tamagui/config-default": "1.
|
|
55
|
-
"@tamagui/core": "1.
|
|
56
|
-
"@tamagui/fake-react-native": "1.
|
|
57
|
-
"@tamagui/generate-themes": "1.
|
|
58
|
-
"@tamagui/helpers": "1.
|
|
59
|
-
"@tamagui/helpers-node": "1.
|
|
60
|
-
"@tamagui/proxy-worm": "1.
|
|
61
|
-
"@tamagui/react-native-web-internals": "1.
|
|
62
|
-
"@tamagui/react-native-web-lite": "1.
|
|
63
|
-
"@tamagui/shorthands": "1.
|
|
64
|
-
"@tamagui/types": "1.
|
|
65
|
-
"@tamagui/web": "1.
|
|
53
|
+
"@tamagui/cli-color": "1.143.0",
|
|
54
|
+
"@tamagui/config-default": "1.143.0",
|
|
55
|
+
"@tamagui/core": "1.143.0",
|
|
56
|
+
"@tamagui/fake-react-native": "1.143.0",
|
|
57
|
+
"@tamagui/generate-themes": "1.143.0",
|
|
58
|
+
"@tamagui/helpers": "1.143.0",
|
|
59
|
+
"@tamagui/helpers-node": "1.143.0",
|
|
60
|
+
"@tamagui/proxy-worm": "1.143.0",
|
|
61
|
+
"@tamagui/react-native-web-internals": "1.143.0",
|
|
62
|
+
"@tamagui/react-native-web-lite": "1.143.0",
|
|
63
|
+
"@tamagui/shorthands": "1.143.0",
|
|
64
|
+
"@tamagui/types": "1.143.0",
|
|
65
|
+
"@tamagui/web": "1.143.0",
|
|
66
66
|
"babel-literal-to-ast": "^2.1.0",
|
|
67
67
|
"browserslist": "^4.22.2",
|
|
68
68
|
"check-dependency-version-consistency": "^4.1.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@babel/plugin-syntax-typescript": "^7.25.4",
|
|
81
81
|
"@expo/match-media": "^0.4.0",
|
|
82
|
-
"@tamagui/build": "1.
|
|
82
|
+
"@tamagui/build": "1.143.0",
|
|
83
83
|
"@types/babel__core": "^7.20.5",
|
|
84
84
|
"@types/find-root": "^1.1.2",
|
|
85
85
|
"@types/node": "^22.1.0",
|
package/src/checkDeps.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs'
|
|
2
|
+
import { join } from 'node:path'
|
|
1
3
|
import { CDVC } from './check-dep-versions'
|
|
2
4
|
|
|
3
5
|
export enum DEPENDENCY_TYPE {
|
|
@@ -19,14 +21,114 @@ export type Options = {
|
|
|
19
21
|
ignorePathPattern?: readonly string[]
|
|
20
22
|
}
|
|
21
23
|
|
|
24
|
+
type PackageJson = {
|
|
25
|
+
dependencies?: Record<string, string>
|
|
26
|
+
devDependencies?: Record<string, string>
|
|
27
|
+
optionalDependencies?: Record<string, string>
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Checks if @tamagui/* packages within a single package.json have mismatched versions.
|
|
32
|
+
* Returns a summary of mismatches or empty string if all versions match.
|
|
33
|
+
*/
|
|
34
|
+
function checkTamaguiPackageVersions(root: string): string {
|
|
35
|
+
const packageJsonPath = join(root, 'package.json')
|
|
36
|
+
if (!existsSync(packageJsonPath)) {
|
|
37
|
+
return ''
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const packageJson: PackageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'))
|
|
41
|
+
|
|
42
|
+
// Collect all @tamagui/* dependencies and their versions
|
|
43
|
+
const tamaguiDeps: { name: string; version: string }[] = []
|
|
44
|
+
|
|
45
|
+
const allDeps = {
|
|
46
|
+
...packageJson.dependencies,
|
|
47
|
+
...packageJson.devDependencies,
|
|
48
|
+
...packageJson.optionalDependencies,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
for (const [name, version] of Object.entries(allDeps)) {
|
|
52
|
+
if (name === 'tamagui' || name.startsWith('@tamagui/')) {
|
|
53
|
+
tamaguiDeps.push({ name, version })
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (tamaguiDeps.length <= 1) {
|
|
58
|
+
return ''
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Normalize versions by removing prefixes like ^, ~, >=, etc.
|
|
62
|
+
const normalizeVersion = (v: string): string => {
|
|
63
|
+
// Handle workspace: protocol
|
|
64
|
+
if (v.startsWith('workspace:')) {
|
|
65
|
+
return v
|
|
66
|
+
}
|
|
67
|
+
return v.replace(/^[\^~>=<]+/, '')
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Group by normalized version
|
|
71
|
+
const versionGroups = new Map<string, string[]>()
|
|
72
|
+
for (const dep of tamaguiDeps) {
|
|
73
|
+
const normalized = normalizeVersion(dep.version)
|
|
74
|
+
if (!versionGroups.has(normalized)) {
|
|
75
|
+
versionGroups.set(normalized, [])
|
|
76
|
+
}
|
|
77
|
+
versionGroups.get(normalized)!.push(`${dep.name}@${dep.version}`)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// If all packages have the same normalized version, no mismatch
|
|
81
|
+
if (versionGroups.size <= 1) {
|
|
82
|
+
return ''
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Build mismatch summary
|
|
86
|
+
const lines: string[] = [
|
|
87
|
+
'Found mismatched @tamagui/* package versions in package.json:',
|
|
88
|
+
'',
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
for (const [version, packages] of versionGroups) {
|
|
92
|
+
lines.push(` ${version}:`)
|
|
93
|
+
for (const pkg of packages.sort()) {
|
|
94
|
+
lines.push(` - ${pkg}`)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
lines.push('')
|
|
99
|
+
lines.push(
|
|
100
|
+
'All @tamagui/* packages should use the same version to avoid runtime issues.'
|
|
101
|
+
)
|
|
102
|
+
lines.push('Run `npx tamagui upgrade` to sync all packages to the latest version.')
|
|
103
|
+
|
|
104
|
+
return lines.join('\n')
|
|
105
|
+
}
|
|
106
|
+
|
|
22
107
|
export async function checkDeps(root: string) {
|
|
23
|
-
|
|
108
|
+
// Check for @tamagui/* version mismatches within the same package.json
|
|
109
|
+
const tamaguiMismatchSummary = checkTamaguiPackageVersions(root)
|
|
110
|
+
|
|
111
|
+
// Check for dependency version mismatches across workspace packages
|
|
112
|
+
const workspaceMismatchSummary = new CDVC(root).toMismatchSummary()
|
|
24
113
|
|
|
25
|
-
|
|
114
|
+
const hasTamaguiMismatch = Boolean(tamaguiMismatchSummary)
|
|
115
|
+
const hasWorkspaceMismatch = Boolean(workspaceMismatchSummary)
|
|
116
|
+
|
|
117
|
+
if (!hasTamaguiMismatch && !hasWorkspaceMismatch) {
|
|
26
118
|
console.info(`Tamagui dependencies look good ✅`)
|
|
27
119
|
process.exit(0)
|
|
28
120
|
}
|
|
29
121
|
|
|
30
|
-
|
|
122
|
+
if (hasTamaguiMismatch) {
|
|
123
|
+
console.error(tamaguiMismatchSummary)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (hasWorkspaceMismatch) {
|
|
127
|
+
if (hasTamaguiMismatch) {
|
|
128
|
+
console.error('') // Add spacing between error sections
|
|
129
|
+
}
|
|
130
|
+
console.error(workspaceMismatchSummary)
|
|
131
|
+
}
|
|
132
|
+
|
|
31
133
|
process.exit(1)
|
|
32
134
|
}
|
|
@@ -230,9 +230,18 @@ export function getBabelParseDefinition(options: TamaguiOptions) {
|
|
|
230
230
|
themedStylesAst.properties.forEach((_) => {
|
|
231
231
|
const prop = _ as t.ObjectProperty
|
|
232
232
|
if (prop.value.type === 'StringLiteral') {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
const propVal = prop.value.value.slice(1)
|
|
234
|
+
const isComputed = !t.isValidIdentifier(propVal)
|
|
235
|
+
prop.value = t.callExpression(
|
|
236
|
+
t.memberExpression(
|
|
237
|
+
t.memberExpression(
|
|
238
|
+
t.identifier('theme'),
|
|
239
|
+
isComputed ? t.stringLiteral(propVal) : t.identifier(propVal),
|
|
240
|
+
isComputed
|
|
241
|
+
),
|
|
242
|
+
t.identifier('get')
|
|
243
|
+
),
|
|
244
|
+
[]
|
|
236
245
|
)
|
|
237
246
|
}
|
|
238
247
|
})
|
package/types/checkDeps.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkDeps.d.ts","sourceRoot":"","sources":["../src/checkDeps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkDeps.d.ts","sourceRoot":"","sources":["../src/checkDeps.ts"],"names":[],"mappings":"AAIA,oBAAY,eAAe;IACzB,YAAY,iBAAiB;IAC7B,eAAe,oBAAoB;IACnC,oBAAoB,yBAAyB;IAC7C,gBAAgB,qBAAqB;IACrC,WAAW,gBAAgB;CAC5B;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,CAAC,EAAE,SAAS,GAAG,eAAe,EAAE,EAAE,CAAA;IACzC,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC7B,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACxC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC9B,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACtC,CAAA;AAqFD,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,iBA2B3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildClassName.d.ts","sourceRoot":"","sources":["../../src/extractor/buildClassName.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAEjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,KAAK,OAAO,GAAG,CACb,OAAO,EAAE,eAAe,EAAE,EAC1B,MAAM,CAAC,EAAE,MAAM,KACZ,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,aAAa,GAAG,IAAI,CAAA;AAE1C,eAAO,MAAM,cAAc,EAAE,OAU5B,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,OAsDjC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensureImportingConcat.d.ts","sourceRoot":"","sources":["../../src/extractor/ensureImportingConcat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAIjC,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QA8B9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractToNative.d.ts","sourceRoot":"","sources":["../../src/extractor/extractToNative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAwB,MAAM,aAAa,CAAA;AAQxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AA4B9C,wBAAgB,eAAe,CAC7B,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,cAAc,GACtB,eAAe,CAoBjB;AAED,wBAAgB,cAAc,QAK7B;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,cAAc;;;;wBAM3C,GAAG;;;
|
|
1
|
+
{"version":3,"file":"extractToNative.d.ts","sourceRoot":"","sources":["../../src/extractor/extractToNative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAwB,MAAM,aAAa,CAAA;AAQxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AA4B9C,wBAAgB,eAAe,CAC7B,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,cAAc,GACtB,eAAe,CAoBjB;AAED,wBAAgB,cAAc,QAK7B;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,cAAc;;;;wBAM3C,GAAG;;;EA4WtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hoistClassNames.d.ts","sourceRoot":"","sources":["../../src/extractor/hoistClassNames.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAEjC,wBAAgB,eAAe,CAC7B,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,EAC5B,QAAQ,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,UAAU,CAAA;CAAE,EACzC,IAAI,EAAE,CAAC,CAAC,UAAU,OA6CnB"}
|