@tamagui/static 1.92.1 → 1.93.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/extractor/bundle.js +4 -4
- package/dist/cjs/extractor/bundle.js.map +1 -1
- package/dist/cjs/extractor/bundle.native.js +4 -4
- package/dist/cjs/extractor/bundle.native.js.map +2 -2
- package/dist/cjs/extractor/bundleConfig.js +10 -10
- package/dist/cjs/extractor/bundleConfig.js.map +1 -1
- package/dist/cjs/extractor/bundleConfig.native.js +10 -10
- package/dist/cjs/extractor/bundleConfig.native.js.map +2 -2
- package/dist/cjs/extractor/createExtractor.js +10 -4
- package/dist/cjs/extractor/createExtractor.js.map +1 -1
- package/dist/cjs/extractor/createExtractor.native.js +3 -3
- package/dist/cjs/extractor/createExtractor.native.js.map +2 -2
- package/dist/cjs/extractor/extractHelpers.js +1 -1
- package/dist/cjs/extractor/extractHelpers.js.map +1 -1
- package/dist/cjs/extractor/extractHelpers.native.js +1 -1
- package/dist/cjs/extractor/extractHelpers.native.js.map +1 -1
- package/dist/cjs/extractor/extractMediaStyle.js +8 -2
- package/dist/cjs/extractor/extractMediaStyle.js.map +1 -1
- package/dist/cjs/extractor/extractMediaStyle.native.js +2 -2
- package/dist/cjs/extractor/extractMediaStyle.native.js.map +2 -2
- package/dist/cjs/extractor/extractToClassNames.js +3 -2
- package/dist/cjs/extractor/extractToClassNames.js.map +1 -1
- package/dist/cjs/extractor/extractToClassNames.native.js +3 -2
- package/dist/cjs/extractor/extractToClassNames.native.js.map +2 -2
- package/dist/cjs/extractor/generateTamaguiStudioConfig.js +12 -8
- package/dist/cjs/extractor/generateTamaguiStudioConfig.js.map +2 -2
- package/dist/cjs/extractor/generateTamaguiStudioConfig.native.js +7 -7
- package/dist/cjs/extractor/generateTamaguiStudioConfig.native.js.map +2 -2
- package/dist/cjs/extractor/generatedUid.js.map +1 -1
- package/dist/cjs/extractor/generatedUid.native.js.map +1 -1
- package/dist/cjs/extractor/getStaticBindingsForScope.js +1 -1
- package/dist/cjs/extractor/getStaticBindingsForScope.js.map +1 -1
- package/dist/cjs/extractor/getStaticBindingsForScope.native.js +1 -1
- package/dist/cjs/extractor/getStaticBindingsForScope.native.js.map +1 -1
- package/dist/cjs/extractor/loadTamagui.js +13 -45
- package/dist/cjs/extractor/loadTamagui.js.map +1 -1
- package/dist/cjs/extractor/loadTamagui.native.js +16 -78
- package/dist/cjs/extractor/loadTamagui.native.js.map +2 -2
- package/dist/cjs/extractor/watchTamaguiConfig.js +53 -0
- package/dist/cjs/extractor/watchTamaguiConfig.js.map +6 -0
- package/dist/cjs/extractor/watchTamaguiConfig.native.js +203 -0
- package/dist/cjs/extractor/watchTamaguiConfig.native.js.map +6 -0
- package/dist/cjs/index.js +18 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +30 -4
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/registerRequire.js +2 -2
- package/dist/cjs/registerRequire.js.map +1 -1
- package/dist/cjs/registerRequire.native.js +3 -3
- package/dist/cjs/registerRequire.native.js.map +2 -2
- package/dist/esm/extractor/bundle.js +4 -4
- package/dist/esm/extractor/bundle.js.map +1 -1
- package/dist/esm/extractor/bundle.mjs +4 -4
- package/dist/esm/extractor/bundle.native.js +4 -4
- package/dist/esm/extractor/bundle.native.js.map +2 -2
- package/dist/esm/extractor/bundleConfig.js +10 -10
- package/dist/esm/extractor/bundleConfig.js.map +1 -1
- package/dist/esm/extractor/bundleConfig.mjs +10 -10
- package/dist/esm/extractor/bundleConfig.native.js +10 -10
- package/dist/esm/extractor/bundleConfig.native.js.map +2 -2
- package/dist/esm/extractor/createExtractor.js +10 -4
- package/dist/esm/extractor/createExtractor.js.map +1 -1
- package/dist/esm/extractor/createExtractor.mjs +4 -4
- package/dist/esm/extractor/createExtractor.native.js +3 -3
- package/dist/esm/extractor/createExtractor.native.js.map +2 -2
- package/dist/esm/extractor/extractHelpers.js +1 -1
- package/dist/esm/extractor/extractHelpers.js.map +1 -1
- package/dist/esm/extractor/extractHelpers.mjs +1 -1
- package/dist/esm/extractor/extractHelpers.native.js +1 -1
- package/dist/esm/extractor/extractHelpers.native.js.map +1 -1
- package/dist/esm/extractor/extractMediaStyle.js +8 -2
- package/dist/esm/extractor/extractMediaStyle.js.map +1 -1
- package/dist/esm/extractor/extractMediaStyle.mjs +2 -2
- package/dist/esm/extractor/extractMediaStyle.native.js +2 -2
- package/dist/esm/extractor/extractMediaStyle.native.js.map +2 -2
- package/dist/esm/extractor/extractToClassNames.js +3 -2
- package/dist/esm/extractor/extractToClassNames.js.map +1 -1
- package/dist/esm/extractor/extractToClassNames.mjs +3 -2
- package/dist/esm/extractor/extractToClassNames.native.js +3 -2
- package/dist/esm/extractor/extractToClassNames.native.js.map +2 -2
- package/dist/esm/extractor/generateTamaguiStudioConfig.js +12 -8
- package/dist/esm/extractor/generateTamaguiStudioConfig.js.map +1 -1
- package/dist/esm/extractor/generateTamaguiStudioConfig.mjs +6 -6
- package/dist/esm/extractor/generateTamaguiStudioConfig.native.js +7 -7
- package/dist/esm/extractor/generateTamaguiStudioConfig.native.js.map +2 -2
- package/dist/esm/extractor/generatedUid.js.map +1 -1
- package/dist/esm/extractor/generatedUid.native.js.map +1 -1
- package/dist/esm/extractor/getStaticBindingsForScope.js +1 -1
- package/dist/esm/extractor/getStaticBindingsForScope.js.map +1 -1
- package/dist/esm/extractor/getStaticBindingsForScope.mjs +1 -1
- package/dist/esm/extractor/getStaticBindingsForScope.native.js +1 -1
- package/dist/esm/extractor/getStaticBindingsForScope.native.js.map +1 -1
- package/dist/esm/extractor/loadTamagui.js +14 -47
- package/dist/esm/extractor/loadTamagui.js.map +1 -1
- package/dist/esm/extractor/loadTamagui.mjs +13 -41
- package/dist/esm/extractor/loadTamagui.native.js +15 -77
- package/dist/esm/extractor/loadTamagui.native.js.map +2 -2
- package/dist/esm/extractor/watchTamaguiConfig.js +38 -0
- package/dist/esm/extractor/watchTamaguiConfig.js.map +6 -0
- package/dist/esm/extractor/watchTamaguiConfig.mjs +31 -0
- package/dist/esm/extractor/watchTamaguiConfig.native.js +183 -0
- package/dist/esm/extractor/watchTamaguiConfig.native.js.map +6 -0
- package/dist/esm/index.js +15 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +13 -2
- package/dist/esm/index.native.js +15 -1
- package/dist/esm/index.native.js.map +2 -2
- package/dist/esm/registerRequire.js +2 -2
- package/dist/esm/registerRequire.js.map +1 -1
- package/dist/esm/registerRequire.mjs +3 -3
- package/dist/esm/registerRequire.native.js +3 -3
- package/dist/esm/registerRequire.native.js.map +2 -2
- package/package.json +25 -19
- package/src/extractor/bundle.ts +4 -4
- package/src/extractor/bundleConfig.ts +10 -10
- package/src/extractor/createExtractor.ts +10 -4
- package/src/extractor/extractHelpers.ts +1 -1
- package/src/extractor/extractMediaStyle.ts +8 -2
- package/src/extractor/extractToClassNames.ts +3 -2
- package/src/extractor/generateTamaguiStudioConfig.ts +14 -10
- package/src/extractor/generatedUid.ts +0 -1
- package/src/extractor/getStaticBindingsForScope.ts +5 -1
- package/src/extractor/loadTamagui.ts +14 -57
- package/src/extractor/watchTamaguiConfig.ts +46 -0
- package/src/index.ts +11 -1
- package/src/registerRequire.ts +2 -3
- package/types/extractor/createExtractor.d.ts.map +1 -1
- package/types/extractor/extractMediaStyle.d.ts +3 -2
- package/types/extractor/extractMediaStyle.d.ts.map +1 -1
- package/types/extractor/extractToClassNames.d.ts.map +1 -1
- package/types/extractor/generateTamaguiStudioConfig.d.ts.map +1 -1
- package/types/extractor/generatedUid.d.ts.map +1 -1
- package/types/extractor/getStaticBindingsForScope.d.ts.map +1 -1
- package/types/extractor/loadTamagui.d.ts +3 -4
- package/types/extractor/loadTamagui.d.ts.map +1 -1
- package/types/extractor/watchTamaguiConfig.d.ts +5 -0
- package/types/extractor/watchTamaguiConfig.d.ts.map +1 -0
- package/types/index.d.ts +11 -1
- package/types/index.d.ts.map +1 -1
- package/types/registerRequire.d.ts.map +1 -1
- package/src/static.ts +0 -10
package/dist/esm/index.js
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
import "./setup";
|
2
|
-
export * from "./static";
|
3
2
|
export * from "./minifyCSS";
|
4
3
|
export * from "./checkDeps";
|
4
|
+
export * from "./types";
|
5
|
+
import { createExtractor } from "./extractor/createExtractor";
|
6
|
+
import { literalToAst } from "./extractor/literalToAst";
|
7
|
+
export * from "./constants";
|
8
|
+
export * from "./extractor/extractToClassNames";
|
9
|
+
export * from "./extractor/extractHelpers";
|
10
|
+
export * from "./extractor/loadTamagui";
|
11
|
+
export * from "./extractor/watchTamaguiConfig";
|
12
|
+
export * from "./extractor/createLogger";
|
13
|
+
export * from "./registerRequire";
|
14
|
+
export * from "./getPragmaOptions";
|
15
|
+
export {
|
16
|
+
createExtractor,
|
17
|
+
literalToAst
|
18
|
+
};
|
5
19
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../src/index.ts"],
|
4
|
-
"mappings": "AAAA,OAAO;AACP,cAAc;AACd,cAAc;AACd,cAAc;",
|
4
|
+
"mappings": "AAAA,OAAO;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAC7B,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
5
5
|
"names": []
|
6
6
|
}
|
package/dist/esm/index.mjs
CHANGED
@@ -1,4 +1,15 @@
|
|
1
1
|
import "./setup.mjs";
|
2
|
-
export * from "./static.mjs";
|
3
2
|
export * from "./minifyCSS.mjs";
|
4
|
-
export * from "./checkDeps.mjs";
|
3
|
+
export * from "./checkDeps.mjs";
|
4
|
+
export * from "./types.mjs";
|
5
|
+
import { createExtractor } from "./extractor/createExtractor.mjs";
|
6
|
+
import { literalToAst } from "./extractor/literalToAst.mjs";
|
7
|
+
export * from "./constants.mjs";
|
8
|
+
export * from "./extractor/extractToClassNames.mjs";
|
9
|
+
export * from "./extractor/extractHelpers.mjs";
|
10
|
+
export * from "./extractor/loadTamagui.mjs";
|
11
|
+
export * from "./extractor/watchTamaguiConfig.mjs";
|
12
|
+
export * from "./extractor/createLogger.mjs";
|
13
|
+
export * from "./registerRequire.mjs";
|
14
|
+
export * from "./getPragmaOptions.mjs";
|
15
|
+
export { createExtractor, literalToAst };
|
package/dist/esm/index.native.js
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
import "./setup";
|
2
|
-
export * from "./static";
|
3
2
|
export * from "./minifyCSS";
|
4
3
|
export * from "./checkDeps";
|
4
|
+
export * from "./types";
|
5
|
+
import { createExtractor } from "./extractor/createExtractor";
|
6
|
+
import { literalToAst } from "./extractor/literalToAst";
|
7
|
+
export * from "./constants";
|
8
|
+
export * from "./extractor/extractToClassNames";
|
9
|
+
export * from "./extractor/extractHelpers";
|
10
|
+
export * from "./extractor/loadTamagui";
|
11
|
+
export * from "./extractor/watchTamaguiConfig";
|
12
|
+
export * from "./extractor/createLogger";
|
13
|
+
export * from "./registerRequire";
|
14
|
+
export * from "./getPragmaOptions";
|
15
|
+
export {
|
16
|
+
createExtractor,
|
17
|
+
literalToAst
|
18
|
+
};
|
5
19
|
//# sourceMappingURL=index.js.map
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/packages/static/src/index.ts"],
|
4
|
-
"mappings": "AAAA,OAAO;AACP,cAAc;AACd,cAAc;AACd,cAAc;",
|
5
|
-
"names": []
|
4
|
+
"mappings": "AAAA,OAAO;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAASA,uBAAuB;AAChC,SAASC,oBAAoB;AAC7B,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
5
|
+
"names": ["createExtractor", "literalToAst"]
|
6
6
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { register } from "esbuild-register/dist/node";
|
2
2
|
import { requireTamaguiCore } from "./helpers/requireTamaguiCore";
|
3
3
|
import { esbuildIgnoreFilesRegex } from "./extractor/bundle";
|
4
|
-
const nameToPaths = {}, Module = require("module"),
|
4
|
+
const nameToPaths = {}, getNameToPaths = () => nameToPaths, Module = require("module"), packageJson = require("react-native-web/package.json"), proxyWorm = require("@tamagui/proxy-worm"), rnw = require("react-native-web");
|
5
5
|
let isRegistered = !1, og;
|
6
6
|
const whitelisted = {
|
7
7
|
react: !0
|
@@ -63,7 +63,7 @@ function registerRequire(platform, { proxyWormImports } = {
|
|
63
63
|
}
|
64
64
|
};
|
65
65
|
}
|
66
|
-
const
|
66
|
+
const IGNORES = process.env.TAMAGUI_IGNORE_BUNDLE_ERRORS, extraIgnores = IGNORES === "true" ? [] : process.env.TAMAGUI_IGNORE_BUNDLE_ERRORS?.split(","), knownIgnorableModules = {
|
67
67
|
"expo-modules": !0,
|
68
68
|
solito: !0,
|
69
69
|
...Object.fromEntries(extraIgnores?.map((k) => [k, !0]) || [])
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../src/registerRequire.ts"],
|
4
|
-
"mappings": "AAAA,SAAS,gBAAgB;AAEzB,SAAS,0BAA0B;AAEnC,SAAS,+BAA+B;AAExC,MAAM,cAAc,CAAC,
|
4
|
+
"mappings": "AAAA,SAAS,gBAAgB;AAEzB,SAAS,0BAA0B;AAEnC,SAAS,+BAA+B;AAExC,MAAM,cAAc,CAAC,GAER,iBAAiB,MAAM,aAE9B,SAAS,QAAQ,QAAQ,GACzB,cAAc,QAAQ,+BAA+B,GACrD,YAAY,QAAQ,qBAAqB,GACzC,MAAM,QAAQ,kBAAkB;AAEtC,IAAI,eAAe,IACf;AAEJ,MAAM,cAAc;AAAA,EAClB,OAAO;AACT,GAEM,WAAW,CAAC;AACX,SAAS,iBAAiB,MAAc,QAAa;AAC1D,WAAS,IAAI,IAAI;AACnB;AAEO,SAAS,gBACd,UACA,EAAE,iBAAiB,IAAI;AAAA,EACrB,kBAAkB;AACpB,GACA;AAEA,MAAI;AACF,WAAO;AAAA,MACL,gBAAgB;AAAA,MAChB,YAAY,MAAM;AAAA,MAAC;AAAA,IACrB;AAGF,QAAM,EAAE,WAAW,IAAI,SAAS;AAAA,IAC9B,uBAAuB;AAAA,EACzB,CAAC;AAED,EAAK,OACH,KAAK,OAAO,UAAU,UAGxB,eAAe,IAEf,OAAO,UAAU,UAAU;AAE3B,WAAS,eAA0B,MAAc;AAC/C,QAAI,SAAS,aAAa,aAAa;AACrC,aAAO,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC;AAG1C,QAAI,SAAS,mBAAmB,SAAS;AACvC,aAAO,mBAAmB,UAAU,CAACA,UAC5B,GAAG,MAAM,MAAM,CAACA,KAAI,CAAC,CAC7B;AAGH,QAAI,QAAQ;AACV,aAAO,SAAS,IAAI;AAGtB,QAAI,wBAAwB,KAAK,IAAI;AACnC,aAAO,CAAC;AAGV,QACE,SAAS,0BACT,KAAK,WAAW,yBAAyB,KACzC,SAAS,0BACT,SAAS,wBACT,SAAS,6BACT,SAAS;AAET,aAAO;AAET,QAAI,SAAS;AACX,aAAO;AAGT,QAAI,SAAS,2BAA2B,KAAK,WAAW,cAAc;AACpE,aAAO;AAGT,QAAI,QAAQ;AACV,aAAO;AAGT,QAAI,CAAC,YAAY,IAAI,KACf,oBAAoB,CAAC,KAAK,SAAS,uBAAuB;AAC5D,aAAI,SAAS,YACJ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,IAEvB;AAIX,QAAI;AAyBF,aAxBY,GAAG,MAAM,MAAM,SAAS;AAAA,IAyBtC,SAAS,KAAU;AACjB,aACE,CAAC,QAAQ,IAAI,oCACb,KAAK,SAAS,sBAAsB,IAGpC,UAEE,eAAe,IAAI,KAAK,YAAY,WAE7B,CAAC,QAAQ,IAAI,mCAAmC,CAAC,QAAQ,IAAI,QAClE,oBAAoB,IAAI,IAAI,MAG9B,oBAAoB,IAAI,IAAI,GAC5B,QAAQ;AAAA,QACN,uBAAuB,IAAI;AAAA,MAC7B,KAQF,QAAQ;AAAA,QACN,2BAA2B,IAAI;AAAA;AAAA,IAErC,IAAI,OAAO;AAAA,IACX,IAAI,KAAK;AAAA;AAAA;AAAA,MAGL,IAGK;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY,MAAM;AAChB,iBAAW,GACX,eAAe,IACf,OAAO,UAAU,UAAU;AAAA,IAC7B;AAAA,EACF;AACF;AAEA,MAAM,UAAU,QAAQ,IAAI,8BACtB,eACJ,YAAY,SAAS,CAAC,IAAI,QAAQ,IAAI,8BAA8B,MAAM,GAAG,GACzE,wBAAwB;AAAA,EAC5B,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,GAAG,OAAO,YAAY,cAAc,IAAI,CAAC,MAAM,CAAC,GAAG,EAAI,CAAC,KAAK,CAAC,CAAC;AACjE,GAEM,sBAAsB,oBAAI,IAAY,GAEtC,iBAAiB;AAAA,EACrB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,mBAAmB;AACrB;",
|
5
5
|
"names": ["path"]
|
6
6
|
}
|
@@ -2,8 +2,9 @@ import { register } from "esbuild-register/dist/node";
|
|
2
2
|
import { requireTamaguiCore } from "./helpers/requireTamaguiCore.mjs";
|
3
3
|
import { esbuildIgnoreFilesRegex } from "./extractor/bundle.mjs";
|
4
4
|
const nameToPaths = {},
|
5
|
-
Module = require("module"),
|
6
5
|
getNameToPaths = () => nameToPaths,
|
6
|
+
Module = require("module"),
|
7
|
+
packageJson = require("react-native-web/package.json"),
|
7
8
|
proxyWorm = require("@tamagui/proxy-worm"),
|
8
9
|
rnw = require("react-native-web");
|
9
10
|
let isRegistered = !1,
|
@@ -58,8 +59,7 @@ function registerRequire(platform, {
|
|
58
59
|
}
|
59
60
|
};
|
60
61
|
}
|
61
|
-
const
|
62
|
-
IGNORES = process.env.TAMAGUI_IGNORE_BUNDLE_ERRORS,
|
62
|
+
const IGNORES = process.env.TAMAGUI_IGNORE_BUNDLE_ERRORS,
|
63
63
|
extraIgnores = IGNORES === "true" ? [] : process.env.TAMAGUI_IGNORE_BUNDLE_ERRORS?.split(","),
|
64
64
|
knownIgnorableModules = {
|
65
65
|
"expo-modules": !0,
|
@@ -20,9 +20,9 @@ function _object_spread(target) {
|
|
20
20
|
}
|
21
21
|
return target;
|
22
22
|
}
|
23
|
-
var _process_env_TAMAGUI_IGNORE_BUNDLE_ERRORS, nameToPaths = {},
|
23
|
+
var _process_env_TAMAGUI_IGNORE_BUNDLE_ERRORS, nameToPaths = {}, getNameToPaths = function() {
|
24
24
|
return nameToPaths;
|
25
|
-
}, proxyWorm = require("@tamagui/proxy-worm"), rnw = require("react-native-web"), isRegistered = !1, og, whitelisted = {
|
25
|
+
}, Module = require("module"), packageJson = require("react-native-web/package.json"), proxyWorm = require("@tamagui/proxy-worm"), rnw = require("react-native-web"), isRegistered = !1, og, whitelisted = {
|
26
26
|
react: !0
|
27
27
|
}, compiled = {};
|
28
28
|
function setRequireResult(name, result) {
|
@@ -89,7 +89,7 @@ function registerRequire(platform) {
|
|
89
89
|
}
|
90
90
|
};
|
91
91
|
}
|
92
|
-
var
|
92
|
+
var IGNORES = process.env.TAMAGUI_IGNORE_BUNDLE_ERRORS, extraIgnores = IGNORES === "true" ? [] : (_process_env_TAMAGUI_IGNORE_BUNDLE_ERRORS = process.env.TAMAGUI_IGNORE_BUNDLE_ERRORS) === null || _process_env_TAMAGUI_IGNORE_BUNDLE_ERRORS === void 0 ? void 0 : _process_env_TAMAGUI_IGNORE_BUNDLE_ERRORS.split(","), knownIgnorableModules = _object_spread({
|
93
93
|
"expo-modules": !0,
|
94
94
|
solito: !0
|
95
95
|
}, Object.fromEntries((extraIgnores == null ? void 0 : extraIgnores.map(function(k) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/packages/static/src/registerRequire.ts"],
|
4
|
-
"mappings": "AAAA,SAASA,gBAAgB;AAEzB,SAASC,0BAA0B;AAEnC,SAASC,+BAA+B;;;;;;;;;;;;;;;;;;;;
|
5
|
-
"names": ["register", "requireTamaguiCore", "esbuildIgnoreFilesRegex", "process", "nameToPaths", "Module", "require", "
|
4
|
+
"mappings": "AAAA,SAASA,gBAAgB;AAEzB,SAASC,0BAA0B;AAEnC,SAASC,+BAA+B;;;;;;;;;;;;;;;;;;;;IAgLZC,2CA9KtBC,cAAc,CAAC,GAERC,iBAAiB,WAAA;SAAMD;GAE9BE,SAASC,QAAQ,QAAA,GACjBC,cAAcD,QAAQ,+BAAA,GACtBE,YAAYF,QAAQ,qBAAA,GACpBG,MAAMH,QAAQ,kBAAA,GAEhBI,eAAe,IACfC,IAEEC,cAAc;EAClBC,OAAO;AACT,GAEMC,WAAW,CAAC;AACX,SAASC,iBAAiBC,MAAcC,QAAW;AACxDH,WAASE,IAAAA,IAAQC;AACnB;AAEO,SAASC,gBACdC,UAAyB;MACvBC,oBAAF,UAAA,SAAA,KAAA,UAAA,CAAA,MAAA,SAAA,UAAA,CAAA,IAAuB;IACrBA,kBAAkB;EACpB,GAFEA;AAKF,MAAIV;AACF,WAAO;MACLW,gBAAgBf;MAChBgB,YAAY,WAAA;MAAO;IACrB;AAGF,MAAQA,aAAevB,SAAS;IAC9BwB,uBAAuB;EACzB,CAAA,EAFQD;AAIR,EAAKX,OACHA,KAAKN,OAAOmB,UAAUlB,UAGxBI,eAAe,IAEfL,OAAOmB,UAAUlB,UAAUe;AAE3B,WAASA,eAA0BI,MAAY;;AAC7C,QAAIA,SAAS,aAAaN,aAAa;AACrC,aAAOR,GAAGe,MAAM,MAAM;QAAC;OAAiB;AAG1C,QAAID,SAAS,mBAAmBA,SAAS;AACvC,aAAOzB,mBAAmBmB,UAAU,SAACM,OAAAA;AACnC,eAAOd,GAAGe,MAAK,OAAO;UAACD;SAAK;MAC9B,CAAA;AAGF,QAAIA,QAAQX;AACV,aAAOA,SAASW,IAAAA;AAGlB,QAAIxB,wBAAwB0B,KAAKF,IAAAA;AAC/B,aAAO,CAAC;AAGV,QACEA,SAAS,0BACTA,KAAKG,WAAW,yBAAA,KAChBH,SAAS,0BACTA,SAAS,wBACTA,SAAS,6BACTA,SAAS;AAET,aAAOjB;AAET,QAAIiB,SAAS;AACX,aAAOlB;AAGT,QAAIkB,SAAS,2BAA2BA,KAAKG,WAAW,cAAA;AACtD,aAAOnB;AAGT,QAAIgB,QAAQI;AACV,aAAOrB;AAGT,QAAI,CAACI,YAAYa,IAAAA,KACXL,oBAAoB,CAACK,KAAKK,SAAS,uBAAA;AACrC,aAAIL,SAAS,YACJd,GAAGe,MAAM,MAAM;QAACD;OAAK,IAEvBjB;AAIX,QAAI;AACF,UAAMuB,MAAMpB,GAAGe,MAAM,MAAMM,SAAAA;AAwB3B,aAAOD;IACT,SAASE,KAAU;AACjB,aACE,CAAC/B,QAAQgC,IAAIC,oCACbV,KAAKK,SAAS,sBAAA,IAGd,UAEEM,eAAeX,IAAAA,KAASY,YAAY,WAE7B,CAACnC,QAAQgC,IAAII,mCAAmC,CAACpC,QAAQgC,IAAIK,QAClEC,oBAAoBC,IAAIhB,IAAAA,MAG1Be,oBAAoBE,IAAIjB,IAAAA,GACxBkB,QAAQC,KACL,uBAA2B,OAALnB,MAAK,4CAAA,CAAA,KAShCkB,QAAQE,MACL,2BAEPZ,OAFiCR,MAAK;;GAAA,EAGtCQ,OADAA,IAAIa,SAAQ;GAAA,EACF,OAAVb,IAAIc,OAAM;;GAAA,CAAA,IAMDvC;IACT;EACF;AAEA,SAAO;IACLa;IACAC,YAAY,WAAA;AACVA,iBAAAA,GACAZ,eAAe,IACfL,OAAOmB,UAAUlB,UAAUK;IAC7B;EACF;AACF;AAEA,IAAM0B,UAAUnC,QAAQgC,IAAIc,8BACtBC,eACJZ,YAAY,SAAS,CAAA,KAAKnC,4CAAAA,QAAQgC,IAAIc,kCAA4B,QAAxC9C,8CAAAA,SAAAA,SAAAA,0CAA0CgD,MAAM,GAAA,GACtErB,wBAAwB,eAAA;EAC5B,gBAAgB;EAChBsB,QAAQ;GACLC,OAAOC,aAAYJ,gBAAAA,OAAAA,SAAAA,aAAcK,IAAI,SAACC,GAAAA;SAAM;IAACA;IAAG;;OAAU,CAAA,CAAE,CAAA,GAG3Df,sBAAsB,oBAAIgB,IAAAA,GAE1BpB,iBAAiB;EACrB,kBAAkB;EAClB,iBAAiB;EACjB,mBAAmB;AACrB;",
|
5
|
+
"names": ["register", "requireTamaguiCore", "esbuildIgnoreFilesRegex", "process", "nameToPaths", "getNameToPaths", "Module", "require", "packageJson", "proxyWorm", "rnw", "isRegistered", "og", "whitelisted", "react", "compiled", "setRequireResult", "name", "result", "registerRequire", "platform", "proxyWormImports", "tamaguiRequire", "unregister", "hookIgnoreNodeModules", "prototype", "path", "apply", "test", "startsWith", "knownIgnorableModules", "includes", "out", "arguments", "err", "env", "TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD", "allowedIgnores", "IGNORES", "TAMAGUI_SHOW_FULL_BUNDLE_ERRORS", "DEBUG", "hasWarnedForModules", "has", "add", "console", "info", "error", "message", "stack", "TAMAGUI_IGNORE_BUNDLE_ERRORS", "extraIgnores", "split", "solito", "Object", "fromEntries", "map", "k", "Set"]
|
6
6
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tamagui/static",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.93.0",
|
4
4
|
"source": "src/index.ts",
|
5
5
|
"types": "./types/index.d.ts",
|
6
6
|
"main": "dist/cjs/index.js",
|
@@ -18,6 +18,15 @@
|
|
18
18
|
"lint": "../../node_modules/.bin/biome check src",
|
19
19
|
"lint:fix": "../../node_modules/.bin/biome check --apply-unsafe src"
|
20
20
|
},
|
21
|
+
"exports": {
|
22
|
+
"./package.json": "./package.json",
|
23
|
+
".": {
|
24
|
+
"types": "./types/index.d.ts",
|
25
|
+
"require": "./dist/cjs/index.js",
|
26
|
+
"import": "./dist/cjs/index.js",
|
27
|
+
"react-native": "./dist/cjs/index.native.js"
|
28
|
+
}
|
29
|
+
},
|
21
30
|
"tests": {
|
22
31
|
"parallel": true
|
23
32
|
},
|
@@ -34,33 +43,30 @@
|
|
34
43
|
"@babel/runtime": "^7.23.2",
|
35
44
|
"@babel/traverse": "^7.23.3",
|
36
45
|
"@babel/types": "^7.23.3",
|
37
|
-
"@tamagui/build": "1.
|
38
|
-
"@tamagui/cli-color": "1.
|
39
|
-
"@tamagui/config-default": "1.
|
40
|
-
"@tamagui/core": "1.
|
41
|
-
"@tamagui/fake-react-native": "1.
|
42
|
-
"@tamagui/generate-themes": "1.
|
43
|
-
"@tamagui/helpers": "1.
|
44
|
-
"@tamagui/helpers-node": "1.
|
45
|
-
"@tamagui/proxy-worm": "1.
|
46
|
-
"@tamagui/shorthands": "1.
|
47
|
-
"@tamagui/types": "1.
|
46
|
+
"@tamagui/build": "1.93.0",
|
47
|
+
"@tamagui/cli-color": "1.93.0",
|
48
|
+
"@tamagui/config-default": "1.93.0",
|
49
|
+
"@tamagui/core": "1.93.0",
|
50
|
+
"@tamagui/fake-react-native": "1.93.0",
|
51
|
+
"@tamagui/generate-themes": "1.93.0",
|
52
|
+
"@tamagui/helpers": "1.93.0",
|
53
|
+
"@tamagui/helpers-node": "1.93.0",
|
54
|
+
"@tamagui/proxy-worm": "1.93.0",
|
55
|
+
"@tamagui/shorthands": "1.93.0",
|
56
|
+
"@tamagui/types": "1.93.0",
|
48
57
|
"babel-literal-to-ast": "^2.1.0",
|
49
58
|
"browserslist": "^4.22.2",
|
50
59
|
"check-dependency-version-consistency": "^4.1.0",
|
51
|
-
"esbuild": "^0.
|
52
|
-
"esbuild-register": "^3.
|
60
|
+
"esbuild": "^0.20.2",
|
61
|
+
"esbuild-register": "^3.5.0",
|
53
62
|
"find-cache-dir": "^3.3.2",
|
54
63
|
"find-root": "^1.1.0",
|
55
64
|
"fs-extra": "^11.2.0",
|
56
65
|
"invariant": "^2.2.4",
|
57
66
|
"lodash": "^4.17.21",
|
58
67
|
"react-native-web": "^0.19.10",
|
59
|
-
"react-native-web-internals": "1.
|
60
|
-
"react-native-web-lite": "1.
|
61
|
-
},
|
62
|
-
"optionalDependencies": {
|
63
|
-
"lightningcss": "*"
|
68
|
+
"react-native-web-internals": "1.93.0",
|
69
|
+
"react-native-web-lite": "1.93.0"
|
64
70
|
},
|
65
71
|
"devDependencies": {
|
66
72
|
"@babel/plugin-syntax-typescript": "^7.23.3",
|
package/src/extractor/bundle.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { basename, dirname, join } from 'path'
|
2
2
|
|
3
3
|
import esbuild from 'esbuild'
|
4
|
-
import
|
4
|
+
import * as FS from 'fs-extra'
|
5
5
|
|
6
6
|
import type { TamaguiPlatform } from '../types'
|
7
7
|
import { esbuildAliasPlugin } from './esbuildAliasPlugin'
|
@@ -150,7 +150,7 @@ export async function bundle(
|
|
150
150
|
// until i do fancier things w plugins:
|
151
151
|
async function asyncLock(props: Props) {
|
152
152
|
const lockFile = join(dirname(props.outfile), basename(props.outfile, '.lock'))
|
153
|
-
const lockStat = await stat(lockFile).catch(() => {
|
153
|
+
const lockStat = await FS.stat(lockFile).catch(() => {
|
154
154
|
/* ok */
|
155
155
|
})
|
156
156
|
const lockedMsAgo = !lockStat
|
@@ -162,11 +162,11 @@ async function asyncLock(props: Props) {
|
|
162
162
|
}
|
163
163
|
let tries = 5
|
164
164
|
while (tries--) {
|
165
|
-
if (await pathExists(props.outfile)) {
|
165
|
+
if (await FS.pathExists(props.outfile)) {
|
166
166
|
return
|
167
167
|
}
|
168
168
|
await new Promise((res) => setTimeout(res, 50))
|
169
169
|
}
|
170
170
|
}
|
171
|
-
void writeFile(lockFile, '')
|
171
|
+
void FS.writeFile(lockFile, '')
|
172
172
|
}
|
@@ -7,7 +7,7 @@ import * as t from '@babel/types'
|
|
7
7
|
import { Color, colorLog } from '@tamagui/cli-color'
|
8
8
|
import type { StaticConfig, TamaguiInternalConfig } from '@tamagui/web'
|
9
9
|
import esbuild from 'esbuild'
|
10
|
-
import
|
10
|
+
import * as FS from 'fs-extra'
|
11
11
|
|
12
12
|
import { registerRequire, setRequireResult } from '../registerRequire'
|
13
13
|
import type { TamaguiOptions } from '../types'
|
@@ -94,7 +94,7 @@ export async function bundleConfig(props: TamaguiOptions) {
|
|
94
94
|
: ''
|
95
95
|
const tmpDir = join(process.cwd(), '.tamagui')
|
96
96
|
const configOutPath = join(tmpDir, `tamagui.config.cjs`)
|
97
|
-
const baseComponents = props.components.filter((x) => x !== '@tamagui/core')
|
97
|
+
const baseComponents = (props.components || []).filter((x) => x !== '@tamagui/core')
|
98
98
|
const componentOutPaths = baseComponents.map((componentModule) =>
|
99
99
|
join(
|
100
100
|
tmpDir,
|
@@ -115,7 +115,7 @@ export async function bundleConfig(props: TamaguiOptions) {
|
|
115
115
|
if (!props.disableInitialBuild) {
|
116
116
|
// build them to node-compat versions
|
117
117
|
try {
|
118
|
-
await ensureDir(tmpDir)
|
118
|
+
await FS.ensureDir(tmpDir)
|
119
119
|
} catch {
|
120
120
|
//
|
121
121
|
}
|
@@ -132,7 +132,7 @@ export async function bundleConfig(props: TamaguiOptions) {
|
|
132
132
|
target: 'node16',
|
133
133
|
...esbuildExtraOptions,
|
134
134
|
},
|
135
|
-
props.platform
|
135
|
+
props.platform || 'web'
|
136
136
|
)
|
137
137
|
: null,
|
138
138
|
...baseComponents.map((componentModule, i) => {
|
@@ -145,7 +145,7 @@ export async function bundleConfig(props: TamaguiOptions) {
|
|
145
145
|
target: 'node16',
|
146
146
|
...esbuildExtraOptions,
|
147
147
|
},
|
148
|
-
props.platform
|
148
|
+
props.platform || 'web'
|
149
149
|
)
|
150
150
|
}),
|
151
151
|
])
|
@@ -167,7 +167,7 @@ export async function bundleConfig(props: TamaguiOptions) {
|
|
167
167
|
}
|
168
168
|
|
169
169
|
let out
|
170
|
-
const { unregister } = registerRequire(props.platform)
|
170
|
+
const { unregister } = registerRequire(props.platform || 'web')
|
171
171
|
try {
|
172
172
|
out = require(configOutPath)
|
173
173
|
} catch (err) {
|
@@ -272,7 +272,7 @@ export function loadComponentsInner(
|
|
272
272
|
props: TamaguiOptions,
|
273
273
|
forceExports = false
|
274
274
|
): null | LoadedComponents[] {
|
275
|
-
const componentsModules = props.components
|
275
|
+
const componentsModules = props.components || []
|
276
276
|
|
277
277
|
const key = componentsModules.join('')
|
278
278
|
|
@@ -280,7 +280,7 @@ export function loadComponentsInner(
|
|
280
280
|
return cacheComponents[key]
|
281
281
|
}
|
282
282
|
|
283
|
-
const { unregister } = registerRequire(props.platform, {
|
283
|
+
const { unregister } = registerRequire(props.platform || 'web', {
|
284
284
|
proxyWormImports: forceExports,
|
285
285
|
})
|
286
286
|
|
@@ -304,7 +304,7 @@ export function loadComponentsInner(
|
|
304
304
|
? transformAddExports(babelParse(esbuildit(fileContents, 'modern'), name))
|
305
305
|
: fileContents
|
306
306
|
|
307
|
-
writeFileSync(loadModule, writtenContents)
|
307
|
+
FS.writeFileSync(loadModule, writtenContents)
|
308
308
|
|
309
309
|
esbuild.buildSync({
|
310
310
|
...esbuildOptions,
|
@@ -344,7 +344,7 @@ export function loadComponentsInner(
|
|
344
344
|
}
|
345
345
|
|
346
346
|
const dispose = () => {
|
347
|
-
isDynamic && removeSync(loadModule)
|
347
|
+
isDynamic && FS.removeSync(loadModule)
|
348
348
|
}
|
349
349
|
|
350
350
|
try {
|
@@ -13,7 +13,7 @@ import type {
|
|
13
13
|
TamaguiComponentState,
|
14
14
|
} from '@tamagui/web'
|
15
15
|
import type { ViewStyle } from 'react-native'
|
16
|
-
import
|
16
|
+
import * as reactNativeWebInternals from 'react-native-web-internals'
|
17
17
|
|
18
18
|
import { FAILED_EVAL } from '../constants'
|
19
19
|
import { requireTamaguiCore } from '../helpers/requireTamaguiCore'
|
@@ -232,7 +232,7 @@ export function createExtractor(
|
|
232
232
|
return !!(
|
233
233
|
staticConfig.validStyles?.[name] ||
|
234
234
|
pseudoDescriptors[name] ||
|
235
|
-
//
|
235
|
+
// don't disable variants or else you lose many things flattening
|
236
236
|
staticConfig.variants?.[name] ||
|
237
237
|
projectInfo?.tamaguiConfig?.shorthands[name] ||
|
238
238
|
(name[0] === '$' ? !!mediaQueryConfig[name.slice(1)] : false)
|
@@ -1169,7 +1169,10 @@ export function createExtractor(
|
|
1169
1169
|
if (out) {
|
1170
1170
|
if (isTargetingHTML) {
|
1171
1171
|
// translate to DOM-compat
|
1172
|
-
out = createDOMProps(
|
1172
|
+
out = reactNativeWebInternals.createDOMProps(
|
1173
|
+
isTextView ? 'span' : 'div',
|
1174
|
+
out
|
1175
|
+
)
|
1173
1176
|
// remove className - we dont use rnw styling
|
1174
1177
|
delete out.className
|
1175
1178
|
}
|
@@ -1876,7 +1879,10 @@ export function createExtractor(
|
|
1876
1879
|
if (out && isTargetingHTML) {
|
1877
1880
|
const cn = out.className
|
1878
1881
|
// translate to DOM-compat
|
1879
|
-
out = createDOMProps(
|
1882
|
+
out = reactNativeWebInternals.createDOMProps(
|
1883
|
+
isTextView ? 'span' : 'div',
|
1884
|
+
out
|
1885
|
+
)
|
1880
1886
|
// remove rnw className use ours
|
1881
1887
|
out.className = cn
|
1882
1888
|
}
|
@@ -199,7 +199,7 @@ export const isValidImport = (
|
|
199
199
|
|
200
200
|
const getValidComponentPackages = memoize((props: TamaguiOptionsWithFileInfo) => {
|
201
201
|
// just always look for `tamagui` and `@tamagui/core`
|
202
|
-
return [...new Set(['@tamagui/core', 'tamagui', ...props.components])]
|
202
|
+
return [...new Set(['@tamagui/core', 'tamagui', ...(props.components || [])])]
|
203
203
|
})
|
204
204
|
|
205
205
|
export const getValidComponentsPaths = memoize((props: TamaguiOptionsWithFileInfo) => {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { NodePath } from '@babel/traverse'
|
2
2
|
import * as t from '@babel/types'
|
3
3
|
import type { TamaguiInternalConfig } from '@tamagui/core'
|
4
|
-
import
|
4
|
+
import * as core from '@tamagui/core'
|
5
5
|
import type { ViewStyle } from 'react-native'
|
6
6
|
|
7
7
|
import { requireTamaguiCore } from '../helpers/requireTamaguiCore'
|
@@ -54,7 +54,13 @@ export function extractMediaStyle(
|
|
54
54
|
const styles = getStylesAtomic(styleObj as any)
|
55
55
|
|
56
56
|
const singleMediaStyles = styles.map((style) => {
|
57
|
-
const mediaStyle = createMediaStyle(
|
57
|
+
const mediaStyle = core.createMediaStyle(
|
58
|
+
style,
|
59
|
+
key,
|
60
|
+
tamaguiConfig.media,
|
61
|
+
true,
|
62
|
+
negate
|
63
|
+
)
|
58
64
|
const className = `.${mediaStyle.identifier}`
|
59
65
|
return {
|
60
66
|
...mediaStyle,
|
@@ -3,7 +3,7 @@ import * as util from 'util'
|
|
3
3
|
|
4
4
|
import generate from '@babel/generator'
|
5
5
|
import * as t from '@babel/types'
|
6
|
-
import
|
6
|
+
import * as helpers from '@tamagui/helpers'
|
7
7
|
import type { ViewStyle } from 'react-native'
|
8
8
|
|
9
9
|
import { requireTamaguiCore } from '../helpers/requireTamaguiCore'
|
@@ -101,6 +101,7 @@ export async function extractToClassNames({
|
|
101
101
|
const res = await extractor.parse(ast, {
|
102
102
|
shouldPrintDebug,
|
103
103
|
...options,
|
104
|
+
platform: 'web',
|
104
105
|
sourcePath,
|
105
106
|
extractStyledDefinitions: true,
|
106
107
|
onStyleRule(identifier, rules) {
|
@@ -199,7 +200,7 @@ export async function extractToClassNames({
|
|
199
200
|
} else {
|
200
201
|
const styles = addStyles(attr.value)
|
201
202
|
const newFontFamily = getFontFamilyClassNameFromProps(attr.value) || ''
|
202
|
-
const newClassNames = concatClassName(
|
203
|
+
const newClassNames = helpers.concatClassName(
|
203
204
|
styles.map((x) => x.identifier).join(' ') + newFontFamily
|
204
205
|
)
|
205
206
|
const existing = finalClassNames.find(
|
@@ -2,7 +2,7 @@ import { dirname, join } from 'path'
|
|
2
2
|
|
3
3
|
import { generateThemes, writeGeneratedThemes } from '@tamagui/generate-themes'
|
4
4
|
import type { TamaguiOptions } from '@tamagui/types'
|
5
|
-
import
|
5
|
+
import * as FS from 'fs-extra'
|
6
6
|
|
7
7
|
import { requireTamaguiCore } from '../helpers/requireTamaguiCore'
|
8
8
|
import type { TamaguiPlatform } from '../types'
|
@@ -24,10 +24,10 @@ export async function generateTamaguiStudioConfig(
|
|
24
24
|
try {
|
25
25
|
const config = configIn ?? (await getBundledConfig(tamaguiOptions, rebuild))
|
26
26
|
if (!config) return
|
27
|
-
const out = transformConfig(config, tamaguiOptions.platform)
|
27
|
+
const out = transformConfig(config, tamaguiOptions.platform || 'web')
|
28
28
|
|
29
|
-
await
|
30
|
-
await
|
29
|
+
await FS.ensureDir(dirname(confFile))
|
30
|
+
await FS.writeJSON(confFile, out, {
|
31
31
|
spaces: 2,
|
32
32
|
})
|
33
33
|
} catch (err) {
|
@@ -43,10 +43,14 @@ export function generateTamaguiStudioConfigSync(
|
|
43
43
|
config: BundledConfig
|
44
44
|
) {
|
45
45
|
try {
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
46
|
+
FS.ensureDirSync(dirname(confFile))
|
47
|
+
FS.writeJSONSync(
|
48
|
+
confFile,
|
49
|
+
transformConfig(config, _tamaguiOptions.platform || 'web'),
|
50
|
+
{
|
51
|
+
spaces: 2,
|
52
|
+
}
|
53
|
+
)
|
50
54
|
} catch (err) {
|
51
55
|
if (process.env.DEBUG?.includes('tamagui') || process.env.IS_TAMAGUI_DEV) {
|
52
56
|
console.warn('generateTamaguiStudioConfig error', err)
|
@@ -73,13 +77,13 @@ export async function generateTamaguiThemes(
|
|
73
77
|
force ||
|
74
78
|
(await (async () => {
|
75
79
|
try {
|
76
|
-
const themeBuilderJsonExists = await
|
80
|
+
const themeBuilderJsonExists = await FS.pathExists(
|
77
81
|
join(tamaguiDir, 'theme-builder.json')
|
78
82
|
)
|
79
83
|
if (!themeBuilderJsonExists) return true
|
80
84
|
if (!generatedOutput) return false
|
81
85
|
const next = generatedOutput.generated
|
82
|
-
const current = await readFile(outPath, 'utf-8')
|
86
|
+
const current = await FS.readFile(outPath, 'utf-8')
|
83
87
|
return next !== current
|
84
88
|
} catch (err) {
|
85
89
|
// ok
|
@@ -8,13 +8,17 @@ import * as t from '@babel/types'
|
|
8
8
|
import { evaluateAstNode } from './evaluateAstNode'
|
9
9
|
import { getSourceModule } from './getSourceModule'
|
10
10
|
|
11
|
+
// import { fileURLToPath } from 'node:url'
|
12
|
+
// // @ts-ignore
|
13
|
+
// const __dirname = dirname(fileURLToPath(import.meta.url))
|
14
|
+
|
11
15
|
const isLocalImport = (path: string) => path.startsWith('.') || path.startsWith('/')
|
12
16
|
|
13
17
|
function resolveImportPath(sourcePath: string, path: string) {
|
14
18
|
const sourceDir = dirname(sourcePath)
|
15
19
|
if (isLocalImport(path)) {
|
16
20
|
if (extname(path) === '') {
|
17
|
-
path += '
|
21
|
+
path += ''
|
18
22
|
}
|
19
23
|
return resolve(sourceDir, path)
|
20
24
|
}
|