@tamagui/vite-plugin 1.101.3 → 1.101.5
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/cjs/extensions.native.js.map +1 -1
- package/dist/cjs/extract.js +36 -49
- package/dist/cjs/extract.js.map +2 -2
- package/dist/cjs/extract.native.js +61 -91
- package/dist/cjs/extract.native.js.map +3 -3
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +1 -3
- package/dist/cjs/index.native.js.map +2 -2
- package/dist/cjs/plugin.js +1 -1
- package/dist/cjs/plugin.js.map +1 -1
- package/dist/cjs/plugin.native.js +57 -48
- package/dist/cjs/plugin.native.js.map +2 -2
- package/dist/esm/extensions.native.js.map +1 -1
- package/dist/esm/extract.js +35 -49
- package/dist/esm/extract.js.map +2 -2
- package/dist/esm/extract.mjs +34 -49
- package/dist/esm/extract.native.js +60 -91
- package/dist/esm/extract.native.js.map +3 -3
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -2
- package/dist/esm/index.native.js +0 -1
- package/dist/esm/index.native.js.map +2 -2
- package/dist/esm/plugin.js +1 -1
- package/dist/esm/plugin.js.map +1 -1
- package/dist/esm/plugin.mjs +1 -1
- package/dist/esm/plugin.native.js +57 -48
- package/dist/esm/plugin.native.js.map +2 -2
- package/package.json +8 -7
- package/src/extract.ts +53 -100
- package/src/index.ts +0 -1
- package/src/plugin.ts +1 -1
- package/types/extract.d.ts.map +1 -1
- package/types/index.d.ts +0 -1
- package/types/index.d.ts.map +1 -1
- package/dist/cjs/getVitePath.js +0 -47
- package/dist/cjs/getVitePath.js.map +0 -6
- package/dist/cjs/getVitePath.native.js +0 -193
- package/dist/cjs/getVitePath.native.js.map +0 -6
- package/dist/esm/getVitePath.js +0 -25
- package/dist/esm/getVitePath.js.map +0 -6
- package/dist/esm/getVitePath.mjs +0 -17
- package/dist/esm/getVitePath.native.js +0 -166
- package/dist/esm/getVitePath.native.js.map +0 -6
- package/src/getVitePath.ts +0 -46
- package/types/getVitePath.d.ts +0 -2
- package/types/getVitePath.d.ts.map +0 -1
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
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 getVitePath_exports = {};
|
|
25
|
-
__export(getVitePath_exports, {
|
|
26
|
-
getVitePath: () => getVitePath
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(getVitePath_exports);
|
|
29
|
-
var import_path = require("path"), import_esm_resolve = __toESM(require("esm-resolve"), 1), fsExtra = __toESM(require("fs-extra"), 1);
|
|
30
|
-
function asyncGeneratorStep(gen, resolve2, reject, _next, _throw, key, arg) {
|
|
31
|
-
try {
|
|
32
|
-
var info = gen[key](arg), value = info.value;
|
|
33
|
-
} catch (error) {
|
|
34
|
-
reject(error);
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
info.done ? resolve2(value) : Promise.resolve(value).then(_next, _throw);
|
|
38
|
-
}
|
|
39
|
-
function _async_to_generator(fn) {
|
|
40
|
-
return function() {
|
|
41
|
-
var self = this, args = arguments;
|
|
42
|
-
return new Promise(function(resolve2, reject) {
|
|
43
|
-
var gen = fn.apply(self, args);
|
|
44
|
-
function _next(value) {
|
|
45
|
-
asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "next", value);
|
|
46
|
-
}
|
|
47
|
-
function _throw(err) {
|
|
48
|
-
asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "throw", err);
|
|
49
|
-
}
|
|
50
|
-
_next(void 0);
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function _ts_generator(thisArg, body) {
|
|
55
|
-
var f, y, t, g, _ = {
|
|
56
|
-
label: 0,
|
|
57
|
-
sent: function() {
|
|
58
|
-
if (t[0] & 1) throw t[1];
|
|
59
|
-
return t[1];
|
|
60
|
-
},
|
|
61
|
-
trys: [],
|
|
62
|
-
ops: []
|
|
63
|
-
};
|
|
64
|
-
return g = {
|
|
65
|
-
next: verb(0),
|
|
66
|
-
throw: verb(1),
|
|
67
|
-
return: verb(2)
|
|
68
|
-
}, typeof Symbol == "function" && (g[Symbol.iterator] = function() {
|
|
69
|
-
return this;
|
|
70
|
-
}), g;
|
|
71
|
-
function verb(n) {
|
|
72
|
-
return function(v) {
|
|
73
|
-
return step([
|
|
74
|
-
n,
|
|
75
|
-
v
|
|
76
|
-
]);
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
function step(op) {
|
|
80
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
81
|
-
for (; _; ) try {
|
|
82
|
-
if (f = 1, y && (t = op[0] & 2 ? y.return : op[0] ? y.throw || ((t = y.return) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
83
|
-
switch (y = 0, t && (op = [
|
|
84
|
-
op[0] & 2,
|
|
85
|
-
t.value
|
|
86
|
-
]), op[0]) {
|
|
87
|
-
case 0:
|
|
88
|
-
case 1:
|
|
89
|
-
t = op;
|
|
90
|
-
break;
|
|
91
|
-
case 4:
|
|
92
|
-
return _.label++, {
|
|
93
|
-
value: op[1],
|
|
94
|
-
done: !1
|
|
95
|
-
};
|
|
96
|
-
case 5:
|
|
97
|
-
_.label++, y = op[1], op = [
|
|
98
|
-
0
|
|
99
|
-
];
|
|
100
|
-
continue;
|
|
101
|
-
case 7:
|
|
102
|
-
op = _.ops.pop(), _.trys.pop();
|
|
103
|
-
continue;
|
|
104
|
-
default:
|
|
105
|
-
if (t = _.trys, !(t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
106
|
-
_ = 0;
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
110
|
-
_.label = op[1];
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
114
|
-
_.label = t[1], t = op;
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
if (t && _.label < t[2]) {
|
|
118
|
-
_.label = t[2], _.ops.push(op);
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
t[2] && _.ops.pop(), _.trys.pop();
|
|
122
|
-
continue;
|
|
123
|
-
}
|
|
124
|
-
op = body.call(thisArg, _);
|
|
125
|
-
} catch (e) {
|
|
126
|
-
op = [
|
|
127
|
-
6,
|
|
128
|
-
e
|
|
129
|
-
], y = 0;
|
|
130
|
-
} finally {
|
|
131
|
-
f = t = 0;
|
|
132
|
-
}
|
|
133
|
-
if (op[0] & 5) throw op[1];
|
|
134
|
-
return {
|
|
135
|
-
value: op[0] ? op[1] : void 0,
|
|
136
|
-
done: !0
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
function getVitePath(importer, moduleName) {
|
|
141
|
-
return _getVitePath.apply(this, arguments);
|
|
142
|
-
}
|
|
143
|
-
function _getVitePath() {
|
|
144
|
-
return _getVitePath = _async_to_generator(function(importer, moduleName) {
|
|
145
|
-
var absolute, sourceFile, resolved, real, id, _arguments = arguments;
|
|
146
|
-
return _ts_generator(this, function(_state) {
|
|
147
|
-
switch (_state.label) {
|
|
148
|
-
case 0:
|
|
149
|
-
if (absolute = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : !1, moduleName === "react-native")
|
|
150
|
-
return [
|
|
151
|
-
2,
|
|
152
|
-
"react-native"
|
|
153
|
-
];
|
|
154
|
-
if (moduleName === "react")
|
|
155
|
-
return [
|
|
156
|
-
2,
|
|
157
|
-
"react"
|
|
158
|
-
];
|
|
159
|
-
if (moduleName === "react/jsx-runtime")
|
|
160
|
-
return [
|
|
161
|
-
2,
|
|
162
|
-
"react/jsx-runtime"
|
|
163
|
-
];
|
|
164
|
-
if (moduleName === "react/jsx-dev-runtime")
|
|
165
|
-
return [
|
|
166
|
-
2,
|
|
167
|
-
"react/jsx-dev-runtime"
|
|
168
|
-
];
|
|
169
|
-
if (moduleName[0] === ".")
|
|
170
|
-
return [
|
|
171
|
-
2,
|
|
172
|
-
(0, import_path.join)("apps/tamastack/src", moduleName) + ".js"
|
|
173
|
-
];
|
|
174
|
-
if (sourceFile = (0, import_path.join)(process.cwd(), "index.js"), resolved = (0, import_esm_resolve.default)(sourceFile)(moduleName), !resolved)
|
|
175
|
-
throw new Error("\u274C cant find ".concat(moduleName, " via ").concat(importer, " ").concat(absolute));
|
|
176
|
-
return [
|
|
177
|
-
4,
|
|
178
|
-
fsExtra.realpath(resolved)
|
|
179
|
-
];
|
|
180
|
-
case 1:
|
|
181
|
-
return real = _state.sent(), id = real, absolute || (id = (0, import_path.relative)(importer, real)), id.endsWith("/react/jsx-dev-runtime.js") && (id = "react/jsx-runtime"), [
|
|
182
|
-
2,
|
|
183
|
-
id
|
|
184
|
-
];
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
}), _getVitePath.apply(this, arguments);
|
|
188
|
-
}
|
|
189
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
190
|
-
0 && (module.exports = {
|
|
191
|
-
getVitePath
|
|
192
|
-
});
|
|
193
|
-
//# sourceMappingURL=getVitePath.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/Users/n8/tamagui/packages/vite-plugin/src/getVitePath.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAA+B,iBAE/B,qBAAoB,oCACpB,UAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzB,SAAsBA,YACpBC,UACAC,YAAkB;SAFEF,aAAAA,MAAAA,MAAAA,SAAAA;;SAAAA,eAAAA;AAAAA,wBAAf,oBAAA,SACLC,UACAC,YAAkB;QAClBC,UAqBMC,YACAC,UAMAC,MACFC;;;;AA1BJ,cAHAJ,WAAAA,WAAAA,SAAAA,KAAAA,WAAAA,CAAAA,MAAAA,SAAAA,WAAAA,CAAAA,IAAW,IAGPD,eAAe;AACjB,mBAAA;;cAAO;;AAET,cAAIA,eAAe;AACjB,mBAAA;;cAAO;;AAET,cAAIA,eAAe;AACjB,mBAAA;;cAAO;;AAET,cAAIA,eAAe;AACjB,mBAAA;;cAAO;;AAGT,cAAIA,WAAW,CAAA,MAAO;AAEpB,mBAAA;;kBAAOM,kBAAM,sBAAqBN,UAAAA,IAAc;;AAMlD,cAHME,iBAAaI,kBAAKC,QAAQC,IAAG,GAAI,UAAA,GACjCL,eAAWM,mBAAAA,SAAQP,UAAAA,EAAYF,UAAAA,GAEjC,CAACG;AACH,kBAAM,IAAIO,MAAO,oBAAgCX,OAAlBC,YAAW,OAAA,EAAmBC,OAAZF,UAAS,GAAA,EAAY,OAATE,QAAAA,CAAAA;AAGlD,iBAAA;;YAAMU,QAAQC,SAAST,QAAAA;;;AAA9BC,wBAAO,OAAA,KAAA,GACTC,KAAKD,MACJH,aACHI,SAAKQ,sBAASd,UAAUK,IAAAA,IAEtBC,GAAGS,SAAU,2BAAA,MACfT,KAAK,sBAEP;;YAAOA;;;;EACT,CAAA,GAxCsBP,aAAAA,MAAAA,MAAAA,SAAAA;;",
|
|
5
|
-
"names": ["getVitePath", "importer", "moduleName", "absolute", "sourceFile", "resolved", "real", "id", "join", "process", "cwd", "resolve", "Error", "fsExtra", "realpath", "relative", "endsWith"]
|
|
6
|
-
}
|
package/dist/esm/getVitePath.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { join, relative } from "path";
|
|
2
|
-
import resolve from "esm-resolve";
|
|
3
|
-
import * as fsExtra from "fs-extra";
|
|
4
|
-
async function getVitePath(importer, moduleName, absolute = !1) {
|
|
5
|
-
if (moduleName === "react-native")
|
|
6
|
-
return "react-native";
|
|
7
|
-
if (moduleName === "react")
|
|
8
|
-
return "react";
|
|
9
|
-
if (moduleName === "react/jsx-runtime")
|
|
10
|
-
return "react/jsx-runtime";
|
|
11
|
-
if (moduleName === "react/jsx-dev-runtime")
|
|
12
|
-
return "react/jsx-dev-runtime";
|
|
13
|
-
if (moduleName[0] === ".")
|
|
14
|
-
return join("apps/tamastack/src", moduleName) + ".js";
|
|
15
|
-
const sourceFile = join(process.cwd(), "index.js"), resolved = resolve(sourceFile)(moduleName);
|
|
16
|
-
if (!resolved)
|
|
17
|
-
throw new Error(`\u274C cant find ${moduleName} via ${importer} ${absolute}`);
|
|
18
|
-
const real = await fsExtra.realpath(resolved);
|
|
19
|
-
let id = real;
|
|
20
|
-
return absolute || (id = relative(importer, real)), id.endsWith("/react/jsx-dev-runtime.js") && (id = "react/jsx-runtime"), id;
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
getVitePath
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=getVitePath.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/getVitePath.ts"],
|
|
4
|
-
"mappings": "AAAA,SAAS,MAAM,gBAAgB;AAE/B,OAAO,aAAa;AACpB,YAAY,aAAa;AAEzB,eAAsB,YACpB,UACA,YACA,WAAW,IACX;AAEA,MAAI,eAAe;AACjB,WAAO;AAET,MAAI,eAAe;AACjB,WAAO;AAET,MAAI,eAAe;AACjB,WAAO;AAET,MAAI,eAAe;AACjB,WAAO;AAGT,MAAI,WAAW,CAAC,MAAM;AAEpB,WAAO,KAAK,sBAAsB,UAAU,IAAI;AAGlD,QAAM,aAAa,KAAK,QAAQ,IAAI,GAAG,UAAU,GAC3C,WAAW,QAAQ,UAAU,EAAE,UAAU;AAE/C,MAAI,CAAC;AACH,UAAM,IAAI,MAAM,oBAAe,UAAU,QAAQ,QAAQ,IAAI,QAAQ,EAAE;AAGzE,QAAM,OAAO,MAAM,QAAQ,SAAS,QAAQ;AAC5C,MAAI,KAAK;AACT,SAAK,aACH,KAAK,SAAS,UAAU,IAAI,IAE1B,GAAG,SAAS,2BAA2B,MACzC,KAAK,sBAEA;AACT;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/esm/getVitePath.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { join, relative } from "path";
|
|
2
|
-
import resolve from "esm-resolve";
|
|
3
|
-
import * as fsExtra from "fs-extra";
|
|
4
|
-
async function getVitePath(importer, moduleName, absolute = !1) {
|
|
5
|
-
if (moduleName === "react-native") return "react-native";
|
|
6
|
-
if (moduleName === "react") return "react";
|
|
7
|
-
if (moduleName === "react/jsx-runtime") return "react/jsx-runtime";
|
|
8
|
-
if (moduleName === "react/jsx-dev-runtime") return "react/jsx-dev-runtime";
|
|
9
|
-
if (moduleName[0] === ".") return join("apps/tamastack/src", moduleName) + ".js";
|
|
10
|
-
const sourceFile = join(process.cwd(), "index.js"),
|
|
11
|
-
resolved = resolve(sourceFile)(moduleName);
|
|
12
|
-
if (!resolved) throw new Error(`\u274C cant find ${moduleName} via ${importer} ${absolute}`);
|
|
13
|
-
const real = await fsExtra.realpath(resolved);
|
|
14
|
-
let id = real;
|
|
15
|
-
return absolute || (id = relative(importer, real)), id.endsWith("/react/jsx-dev-runtime.js") && (id = "react/jsx-runtime"), id;
|
|
16
|
-
}
|
|
17
|
-
export { getVitePath };
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { join, relative } from "path";
|
|
2
|
-
import resolve from "esm-resolve";
|
|
3
|
-
import * as fsExtra from "fs-extra";
|
|
4
|
-
function asyncGeneratorStep(gen, resolve2, reject, _next, _throw, key, arg) {
|
|
5
|
-
try {
|
|
6
|
-
var info = gen[key](arg), value = info.value;
|
|
7
|
-
} catch (error) {
|
|
8
|
-
reject(error);
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
info.done ? resolve2(value) : Promise.resolve(value).then(_next, _throw);
|
|
12
|
-
}
|
|
13
|
-
function _async_to_generator(fn) {
|
|
14
|
-
return function() {
|
|
15
|
-
var self = this, args = arguments;
|
|
16
|
-
return new Promise(function(resolve2, reject) {
|
|
17
|
-
var gen = fn.apply(self, args);
|
|
18
|
-
function _next(value) {
|
|
19
|
-
asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "next", value);
|
|
20
|
-
}
|
|
21
|
-
function _throw(err) {
|
|
22
|
-
asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "throw", err);
|
|
23
|
-
}
|
|
24
|
-
_next(void 0);
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function _ts_generator(thisArg, body) {
|
|
29
|
-
var f, y, t, g, _ = {
|
|
30
|
-
label: 0,
|
|
31
|
-
sent: function() {
|
|
32
|
-
if (t[0] & 1) throw t[1];
|
|
33
|
-
return t[1];
|
|
34
|
-
},
|
|
35
|
-
trys: [],
|
|
36
|
-
ops: []
|
|
37
|
-
};
|
|
38
|
-
return g = {
|
|
39
|
-
next: verb(0),
|
|
40
|
-
throw: verb(1),
|
|
41
|
-
return: verb(2)
|
|
42
|
-
}, typeof Symbol == "function" && (g[Symbol.iterator] = function() {
|
|
43
|
-
return this;
|
|
44
|
-
}), g;
|
|
45
|
-
function verb(n) {
|
|
46
|
-
return function(v) {
|
|
47
|
-
return step([
|
|
48
|
-
n,
|
|
49
|
-
v
|
|
50
|
-
]);
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function step(op) {
|
|
54
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
55
|
-
for (; _; ) try {
|
|
56
|
-
if (f = 1, y && (t = op[0] & 2 ? y.return : op[0] ? y.throw || ((t = y.return) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
57
|
-
switch (y = 0, t && (op = [
|
|
58
|
-
op[0] & 2,
|
|
59
|
-
t.value
|
|
60
|
-
]), op[0]) {
|
|
61
|
-
case 0:
|
|
62
|
-
case 1:
|
|
63
|
-
t = op;
|
|
64
|
-
break;
|
|
65
|
-
case 4:
|
|
66
|
-
return _.label++, {
|
|
67
|
-
value: op[1],
|
|
68
|
-
done: !1
|
|
69
|
-
};
|
|
70
|
-
case 5:
|
|
71
|
-
_.label++, y = op[1], op = [
|
|
72
|
-
0
|
|
73
|
-
];
|
|
74
|
-
continue;
|
|
75
|
-
case 7:
|
|
76
|
-
op = _.ops.pop(), _.trys.pop();
|
|
77
|
-
continue;
|
|
78
|
-
default:
|
|
79
|
-
if (t = _.trys, !(t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
80
|
-
_ = 0;
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
84
|
-
_.label = op[1];
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
88
|
-
_.label = t[1], t = op;
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
if (t && _.label < t[2]) {
|
|
92
|
-
_.label = t[2], _.ops.push(op);
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
t[2] && _.ops.pop(), _.trys.pop();
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
op = body.call(thisArg, _);
|
|
99
|
-
} catch (e) {
|
|
100
|
-
op = [
|
|
101
|
-
6,
|
|
102
|
-
e
|
|
103
|
-
], y = 0;
|
|
104
|
-
} finally {
|
|
105
|
-
f = t = 0;
|
|
106
|
-
}
|
|
107
|
-
if (op[0] & 5) throw op[1];
|
|
108
|
-
return {
|
|
109
|
-
value: op[0] ? op[1] : void 0,
|
|
110
|
-
done: !0
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
function getVitePath(importer, moduleName) {
|
|
115
|
-
return _getVitePath.apply(this, arguments);
|
|
116
|
-
}
|
|
117
|
-
function _getVitePath() {
|
|
118
|
-
return _getVitePath = _async_to_generator(function(importer, moduleName) {
|
|
119
|
-
var absolute, sourceFile, resolved, real, id, _arguments = arguments;
|
|
120
|
-
return _ts_generator(this, function(_state) {
|
|
121
|
-
switch (_state.label) {
|
|
122
|
-
case 0:
|
|
123
|
-
if (absolute = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : !1, moduleName === "react-native")
|
|
124
|
-
return [
|
|
125
|
-
2,
|
|
126
|
-
"react-native"
|
|
127
|
-
];
|
|
128
|
-
if (moduleName === "react")
|
|
129
|
-
return [
|
|
130
|
-
2,
|
|
131
|
-
"react"
|
|
132
|
-
];
|
|
133
|
-
if (moduleName === "react/jsx-runtime")
|
|
134
|
-
return [
|
|
135
|
-
2,
|
|
136
|
-
"react/jsx-runtime"
|
|
137
|
-
];
|
|
138
|
-
if (moduleName === "react/jsx-dev-runtime")
|
|
139
|
-
return [
|
|
140
|
-
2,
|
|
141
|
-
"react/jsx-dev-runtime"
|
|
142
|
-
];
|
|
143
|
-
if (moduleName[0] === ".")
|
|
144
|
-
return [
|
|
145
|
-
2,
|
|
146
|
-
join("apps/tamastack/src", moduleName) + ".js"
|
|
147
|
-
];
|
|
148
|
-
if (sourceFile = join(process.cwd(), "index.js"), resolved = resolve(sourceFile)(moduleName), !resolved)
|
|
149
|
-
throw new Error("\u274C cant find ".concat(moduleName, " via ").concat(importer, " ").concat(absolute));
|
|
150
|
-
return [
|
|
151
|
-
4,
|
|
152
|
-
fsExtra.realpath(resolved)
|
|
153
|
-
];
|
|
154
|
-
case 1:
|
|
155
|
-
return real = _state.sent(), id = real, absolute || (id = relative(importer, real)), id.endsWith("/react/jsx-dev-runtime.js") && (id = "react/jsx-runtime"), [
|
|
156
|
-
2,
|
|
157
|
-
id
|
|
158
|
-
];
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
}), _getVitePath.apply(this, arguments);
|
|
162
|
-
}
|
|
163
|
-
export {
|
|
164
|
-
getVitePath
|
|
165
|
-
};
|
|
166
|
-
//# sourceMappingURL=getVitePath.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/Users/n8/tamagui/packages/vite-plugin/src/getVitePath.ts"],
|
|
4
|
-
"mappings": "AAAA,SAASA,MAAMC,gBAAgB;AAE/B,OAAOC,aAAa;AACpB,YAAYC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzB,SAAsBC,YACpBC,UACAC,YAAkB;SAFEF,aAAAA,MAAAA,MAAAA,SAAAA;;SAAAA,eAAAA;AAAAA,wBAAf,oBAAA,SACLC,UACAC,YAAkB;QAClBC,UAqBMC,YACAC,UAMAC,MACFC;;;;AA1BJ,cAHAJ,WAAAA,WAAAA,SAAAA,KAAAA,WAAAA,CAAAA,MAAAA,SAAAA,WAAAA,CAAAA,IAAW,IAGPD,eAAe;AACjB,mBAAA;;cAAO;;AAET,cAAIA,eAAe;AACjB,mBAAA;;cAAO;;AAET,cAAIA,eAAe;AACjB,mBAAA;;cAAO;;AAET,cAAIA,eAAe;AACjB,mBAAA;;cAAO;;AAGT,cAAIA,WAAW,CAAA,MAAO;AAEpB,mBAAA;;cAAON,KAAM,sBAAqBM,UAAAA,IAAc;;AAMlD,cAHME,aAAaR,KAAKY,QAAQC,IAAG,GAAI,UAAA,GACjCJ,WAAWP,QAAQM,UAAAA,EAAYF,UAAAA,GAEjC,CAACG;AACH,kBAAM,IAAIK,MAAO,oBAAgCT,OAAlBC,YAAW,OAAA,EAAmBC,OAAZF,UAAS,GAAA,EAAY,OAATE,QAAAA,CAAAA;AAGlD,iBAAA;;YAAMJ,QAAQY,SAASN,QAAAA;;;AAA9BC,wBAAO,OAAA,KAAA,GACTC,KAAKD,MACJH,aACHI,KAAKV,SAASI,UAAUK,IAAAA,IAEtBC,GAAGK,SAAU,2BAAA,MACfL,KAAK,sBAEP;;YAAOA;;;;EACT,CAAA,GAxCsBP,aAAAA,MAAAA,MAAAA,SAAAA;;",
|
|
5
|
-
"names": ["join", "relative", "resolve", "fsExtra", "getVitePath", "importer", "moduleName", "absolute", "sourceFile", "resolved", "real", "id", "process", "cwd", "Error", "realpath", "endsWith"]
|
|
6
|
-
}
|
package/src/getVitePath.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { join, relative } from 'path'
|
|
2
|
-
|
|
3
|
-
import resolve from 'esm-resolve'
|
|
4
|
-
import * as fsExtra from 'fs-extra'
|
|
5
|
-
|
|
6
|
-
export async function getVitePath(
|
|
7
|
-
importer: string,
|
|
8
|
-
moduleName: string,
|
|
9
|
-
absolute = false
|
|
10
|
-
) {
|
|
11
|
-
// our virtual modules
|
|
12
|
-
if (moduleName === 'react-native') {
|
|
13
|
-
return 'react-native'
|
|
14
|
-
}
|
|
15
|
-
if (moduleName === 'react') {
|
|
16
|
-
return 'react'
|
|
17
|
-
}
|
|
18
|
-
if (moduleName === 'react/jsx-runtime') {
|
|
19
|
-
return 'react/jsx-runtime'
|
|
20
|
-
}
|
|
21
|
-
if (moduleName === 'react/jsx-dev-runtime') {
|
|
22
|
-
return 'react/jsx-dev-runtime'
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (moduleName[0] === '.') {
|
|
26
|
-
// hardcode for now. :/
|
|
27
|
-
return join(`apps/tamastack/src`, moduleName) + '.js'
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const sourceFile = join(process.cwd(), 'index.js')
|
|
31
|
-
const resolved = resolve(sourceFile)(moduleName)
|
|
32
|
-
// figure out symlinks
|
|
33
|
-
if (!resolved) {
|
|
34
|
-
throw new Error(`❌ cant find ${moduleName} via ${importer} ${absolute}`)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const real = await fsExtra.realpath(resolved)
|
|
38
|
-
let id = real
|
|
39
|
-
if (!absolute) {
|
|
40
|
-
id = relative(importer, real)
|
|
41
|
-
}
|
|
42
|
-
if (id.endsWith(`/react/jsx-dev-runtime.js`)) {
|
|
43
|
-
id = 'react/jsx-runtime'
|
|
44
|
-
}
|
|
45
|
-
return id
|
|
46
|
-
}
|
package/types/getVitePath.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getVitePath.d.ts","sourceRoot":"","sources":["../src/getVitePath.ts"],"names":[],"mappings":"AAKA,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,QAAQ,UAAQ,mBAqCjB"}
|