@tamagui/metro-plugin 1.88.22 → 1.88.23
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/esm/index.native.js
CHANGED
|
@@ -1,35 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
10
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
|
-
mod
|
|
23
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
|
-
var src_exports = {};
|
|
25
|
-
__export(src_exports, {
|
|
26
|
-
withTamagui: () => withTamagui
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(src_exports);
|
|
29
|
-
var import_static = require("@tamagui/static"), import_metro = require("react-native-css-interop/metro");
|
|
1
|
+
import { createExtractor } from "@tamagui/static";
|
|
2
|
+
import {
|
|
3
|
+
withCssInterop
|
|
4
|
+
} from "react-native-css-interop/metro";
|
|
30
5
|
function withTamagui(metroConfig, options) {
|
|
31
|
-
const extractor =
|
|
32
|
-
return options.disable || extractor.loadTamagui(options), options.disableCSSInterop || (metroConfig =
|
|
6
|
+
const extractor = createExtractor();
|
|
7
|
+
return options.disable || extractor.loadTamagui(options), options.disableCSSInterop || (metroConfig = withCssInterop(metroConfig, {
|
|
33
8
|
ignorePropertyWarningRegex: ["^--"]
|
|
34
9
|
// grouping: ['^group(/.*)?'],
|
|
35
10
|
})), metroConfig.transformerPath = require.resolve("./transformer"), metroConfig.transformer = {
|
|
@@ -40,8 +15,7 @@ function withTamagui(metroConfig, options) {
|
|
|
40
15
|
}
|
|
41
16
|
}, metroConfig;
|
|
42
17
|
}
|
|
43
|
-
|
|
44
|
-
0 && (module.exports = {
|
|
18
|
+
export {
|
|
45
19
|
withTamagui
|
|
46
|
-
}
|
|
20
|
+
};
|
|
47
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,uBAA4C;AACrD;AAAA,EACE;AAAA,OAEK;AAEA,SAAS,YACd,aACA,SAGA;AAEA,QAAM,YAAY,gBAAgB;AAGlC,SAAK,QAAQ,WACN,UAAU,YAAY,OAAO,GAG/B,QAAQ,sBACX,cAAc,eAAe,aAAa;AAAA,IACxC,4BAA4B,CAAC,KAAK;AAAA;AAAA,EAEpC,CAAC,IASH,YAAY,kBAAkB,gBAAgB,eAAe,GAC7D,YAAY,cAAc;AAAA,IACxB,GAAG,YAAY;AAAA,IACf,SAAS;AAAA,MACP,GAAG;AAAA,MACH,qBAAqB;AAAA,IACvB;AAAA,EACF,GAEO;AACT;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,46 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
10
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
|
-
mod
|
|
23
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
|
-
var transformer_exports = {};
|
|
25
|
-
__export(transformer_exports, {
|
|
26
|
-
transform: () => transform
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(transformer_exports);
|
|
29
|
-
var import_metro_transform_worker = __toESM(require("metro-transform-worker")), import_path = require("path"), import_promises = require("fs/promises"), import_static = require("@tamagui/static");
|
|
30
|
-
const extractor = (0, import_static.createExtractor)();
|
|
1
|
+
import worker from "metro-transform-worker";
|
|
2
|
+
import { join } from "path";
|
|
3
|
+
import { writeFile, mkdir } from "fs/promises";
|
|
4
|
+
import { createExtractor, extractToClassNames } from "@tamagui/static";
|
|
5
|
+
const extractor = createExtractor();
|
|
31
6
|
async function transform(config, projectRoot, filename, data, options) {
|
|
32
|
-
const transformer = config.transformerPath ? require(config.transformerPath).transform :
|
|
7
|
+
const transformer = config.transformerPath ? require(config.transformerPath).transform : worker.transform;
|
|
33
8
|
if (config.tamagui.disable || options.platform !== "web" || filename.includes("node_modules"))
|
|
34
9
|
return transformer(config, projectRoot, filename, data, options);
|
|
35
10
|
if (filename.endsWith(".tsx") || filename.endsWith(".jsx")) {
|
|
36
|
-
const tmpDir =
|
|
11
|
+
const tmpDir = join(projectRoot, ".tamagui", "css");
|
|
37
12
|
try {
|
|
38
|
-
await
|
|
13
|
+
await mkdir(tmpDir, {
|
|
39
14
|
recursive: !0
|
|
40
15
|
});
|
|
41
16
|
} catch {
|
|
42
17
|
}
|
|
43
|
-
const sourcePath =
|
|
18
|
+
const sourcePath = join(projectRoot, filename), source = `${data}`, out = await extractToClassNames({
|
|
44
19
|
extractor,
|
|
45
20
|
options: {
|
|
46
21
|
// @ts-ignore
|
|
@@ -52,11 +27,11 @@ async function transform(config, projectRoot, filename, data, options) {
|
|
|
52
27
|
sourcePath
|
|
53
28
|
});
|
|
54
29
|
if (out != null && out.styles) {
|
|
55
|
-
const outStylePath =
|
|
30
|
+
const outStylePath = join(
|
|
56
31
|
tmpDir,
|
|
57
32
|
`${filename}`.replace(/[^a-zA-Z0-9]/gi, "") + ".css"
|
|
58
33
|
);
|
|
59
|
-
return console.info(" \u{1F95A}", outStylePath), await
|
|
34
|
+
return console.info(" \u{1F95A}", outStylePath), await writeFile(outStylePath, out.styles, "utf-8"), transformer(
|
|
60
35
|
config,
|
|
61
36
|
projectRoot,
|
|
62
37
|
filename,
|
|
@@ -68,8 +43,7 @@ require("${outStylePath}")`),
|
|
|
68
43
|
}
|
|
69
44
|
return transformer(config, projectRoot, filename, data, options);
|
|
70
45
|
}
|
|
71
|
-
|
|
72
|
-
0 && (module.exports = {
|
|
46
|
+
export {
|
|
73
47
|
transform
|
|
74
|
-
}
|
|
48
|
+
};
|
|
75
49
|
//# sourceMappingURL=transformer.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/transformer.ts"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": [
|
|
4
|
+
"mappings": "AAKA,OAAO,YAAY;AACnB,SAAS,YAAY;AACrB,SAAS,WAAW,aAAa;AAGjC,SAAS,iBAAiB,2BAA2B;AAOrD,MAAM,YAAY,gBAAgB;AAElC,eAAsB,UACpB,QACA,aACA,UACA,MACA,SAC4B;AAC5B,QAAM,cAAc,OAAO,kBACvB,QAAQ,OAAO,eAAe,EAAE,YAChC,OAAO;AAEX,MACE,OAAO,QAAQ,WACf,QAAQ,aAAa,SACrB,SAAS,SAAS,cAAc;AAEhC,WAAO,YAAY,QAAQ,aAAa,UAAU,MAAM,OAAO;AAGjE,MAAI,SAAS,SAAS,MAAM,KAAK,SAAS,SAAS,MAAM,GAAG;AAC1D,UAAM,SAAS,KAAK,aAAa,YAAY,KAAK;AAClD,QAAI;AACF,YAAM,MAAM,QAAQ;AAAA,QAClB,WAAW;AAAA,MACb,CAAC;AAAA,IACH,QAAQ;AAAA,IAAC;AAET,UAAM,aAAa,KAAK,aAAa,QAAQ,GAGvC,SAAS,GAAG,IAAI,IAChB,MAAM,MAAM,oBAAoB;AAAA,MACpC;AAAA,MACA,SAAS;AAAA;AAAA,QAEP,UAAU;AAAA,QACV,GAAG,OAAO;AAAA,MACZ;AAAA,MACA,kBAAkB,OAAO,WAAW,kBAAkB,IAClD,YACA,OAAO,WAAW,UAAU;AAAA,MAChC;AAAA,MACA;AAAA,IACF,CAAC;AAGD,QAAI,mBAAK,QAAQ;AACf,YAAM,eAAe;AAAA,QACnB;AAAA,QACA,GAAG,QAAQ,GAAG,QAAQ,kBAAkB,EAAE,IAAI;AAAA,MAChD;AACA,qBAAQ,KAAK,cAAO,YAAY,GAChC,MAAM,UAAU,cAAc,IAAI,QAAQ,OAAO,GAC1C;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA,OAAO,KAAK,GAAG,IAAI,EAAE;AAAA,WAAc,YAAY,IAAI;AAAA,QACnD;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO,YAAY,QAAQ,aAAa,UAAU,MAAM,OAAO;AACjE;",
|
|
5
|
+
"names": []
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/metro-plugin",
|
|
3
|
-
"version": "1.88.
|
|
3
|
+
"version": "1.88.23",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"clean:build": "tamagui-build clean:build"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@tamagui/static": "1.88.
|
|
26
|
+
"@tamagui/static": "1.88.23",
|
|
27
27
|
"metro-config": "^0.80.4",
|
|
28
28
|
"metro-transform-worker": "^0.80.4",
|
|
29
29
|
"react-native-css-interop": "~0.0.21"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@tamagui/build": "1.88.
|
|
32
|
+
"@tamagui/build": "1.88.23"
|
|
33
33
|
}
|
|
34
34
|
}
|