@vxrn/vite-flow 1.12.3 → 1.12.4
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.js +4 -8
- package/dist/esm/index.js.map +1 -6
- package/package.json +3 -3
- package/dist/cjs/index.js +0 -34
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/transformFlowBabel.js +0 -52
- package/dist/cjs/transformFlowBabel.js.map +0 -6
- package/dist/esm/transformFlowBabel.js +0 -30
- package/dist/esm/transformFlowBabel.js.map +0 -6
package/dist/esm/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { createFilter } from "vite";
|
|
2
|
-
import { transformFlowBabel } from "./transformFlowBabel";
|
|
3
|
-
import { transformFlowBabel as transformFlowBabel2 } from "./transformFlowBabel";
|
|
2
|
+
import { transformFlowBabel } from "./transformFlowBabel.mjs";
|
|
3
|
+
import { transformFlowBabel as transformFlowBabel2 } from "./transformFlowBabel.mjs";
|
|
4
4
|
function createFlowPlugin(opts) {
|
|
5
|
-
if (!opts?.include || Array.isArray(opts.include) && opts.include.length === 0)
|
|
6
|
-
return;
|
|
5
|
+
if (!opts?.include || Array.isArray(opts.include) && opts.include.length === 0) return;
|
|
7
6
|
const filter = createFilter(opts?.include, opts?.exclude);
|
|
8
7
|
return {
|
|
9
8
|
name: "@vxrn/vite-flow",
|
|
@@ -13,8 +12,5 @@ function createFlowPlugin(opts) {
|
|
|
13
12
|
}
|
|
14
13
|
};
|
|
15
14
|
}
|
|
16
|
-
export {
|
|
17
|
-
createFlowPlugin as default,
|
|
18
|
-
transformFlowBabel2 as transformFlowBabel
|
|
19
|
-
};
|
|
15
|
+
export { createFlowPlugin as default, transformFlowBabel2 as transformFlowBabel };
|
|
20
16
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "AACA,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AAEnC,SAAS,sBAAAA,2BAA0B;AAOpB,SAAR,iBAAkC,MAA8B;AACrE,MAAI,CAAC,MAAM,WAAY,MAAM,QAAQ,KAAK,OAAO,KAAK,KAAK,QAAQ,WAAW;AAC5E;AAGF,QAAM,SAAS,aAAa,MAAM,SAAS,MAAM,OAAO;AAExD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,UAAU,MAAM,IAAI;AAClB,aAAI,OAAO,EAAE,IACJ,mBAAmB,IAAI,IAEzB;AAAA,IACT;AAAA,EACF;AACF;",
|
|
5
|
-
"names": ["transformFlowBabel"]
|
|
6
|
-
}
|
|
1
|
+
{"version":3,"names":["createFilter","transformFlowBabel","transformFlowBabel2","createFlowPlugin","opts","include","Array","isArray","length","filter","exclude","name","enforce","transform","code","id"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AACA,SAASA,YAAA,QAAoB;AAC7B,SAASC,kBAAA,QAA0B;AAEnC,SAASA,kBAAA,IAAAC,mBAAA,QAA0B;AAOpB,SAARC,iBAAkCC,IAAA,EAA8B;EACrE,IAAI,CAACA,IAAA,EAAMC,OAAA,IAAYC,KAAA,CAAMC,OAAA,CAAQH,IAAA,CAAKC,OAAO,KAAKD,IAAA,CAAKC,OAAA,CAAQG,MAAA,KAAW,GAC5E;EAGF,MAAMC,MAAA,GAAST,YAAA,CAAaI,IAAA,EAAMC,OAAA,EAASD,IAAA,EAAMM,OAAO;EAExD,OAAO;IACLC,IAAA,EAAM;IACNC,OAAA,EAAS;IACTC,UAAUC,IAAA,EAAMC,EAAA,EAAI;MAClB,OAAIN,MAAA,CAAOM,EAAE,IACJd,kBAAA,CAAmBa,IAAI,IAEzB;IACT;EACF;AACF","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vxrn/vite-flow",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./package.json": "./package.json",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"@babel/core": "^7.28.5",
|
|
32
32
|
"@babel/helper-plugin-utils": "^7.27.1",
|
|
33
33
|
"@react-native/babel-preset": "^0.83.0",
|
|
34
|
-
"@vxrn/resolve": "1.12.
|
|
34
|
+
"@vxrn/resolve": "1.12.4",
|
|
35
35
|
"vite": "^8.0.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@biomejs/biome": "2.3.3",
|
|
39
|
-
"@tamagui/build": "2.0.0-rc.
|
|
39
|
+
"@tamagui/build": "2.0.0-rc.28"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
package/dist/cjs/index.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
-
var index_exports = {};
|
|
16
|
-
__export(index_exports, {
|
|
17
|
-
default: () => createFlowPlugin,
|
|
18
|
-
transformFlowBabel: () => import_transformFlowBabel2.transformFlowBabel
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(index_exports);
|
|
21
|
-
var import_vite = require("vite"), import_transformFlowBabel = require("./transformFlowBabel"), import_transformFlowBabel2 = require("./transformFlowBabel");
|
|
22
|
-
function createFlowPlugin(opts) {
|
|
23
|
-
if (!opts?.include || Array.isArray(opts.include) && opts.include.length === 0)
|
|
24
|
-
return;
|
|
25
|
-
const filter = (0, import_vite.createFilter)(opts?.include, opts?.exclude);
|
|
26
|
-
return {
|
|
27
|
-
name: "@vxrn/vite-flow",
|
|
28
|
-
enforce: "pre",
|
|
29
|
-
transform(code, id) {
|
|
30
|
-
return filter(id) ? (0, import_transformFlowBabel.transformFlowBabel)(code) : null;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA6B,iBAC7B,4BAAmC,iCAEnCA,6BAAmC;AAOpB,SAAR,iBAAkC,MAA8B;AACrE,MAAI,CAAC,MAAM,WAAY,MAAM,QAAQ,KAAK,OAAO,KAAK,KAAK,QAAQ,WAAW;AAC5E;AAGF,QAAM,aAAS,0BAAa,MAAM,SAAS,MAAM,OAAO;AAExD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,UAAU,MAAM,IAAI;AAClB,aAAI,OAAO,EAAE,QACJ,8CAAmB,IAAI,IAEzB;AAAA,IACT;AAAA,EACF;AACF;",
|
|
5
|
-
"names": ["import_transformFlowBabel"]
|
|
6
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
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 transformFlowBabel_exports = {};
|
|
24
|
-
__export(transformFlowBabel_exports, {
|
|
25
|
-
transformFlowBabel: () => transformFlowBabel
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(transformFlowBabel_exports);
|
|
28
|
-
var import_promises = require("node:fs/promises"), import_core = __toESM(require("@babel/core"), 1), import_resolve = require("@vxrn/resolve");
|
|
29
|
-
async function transformFlowBabel(input, { development = !1, path } = {}) {
|
|
30
|
-
let babelPreset = "module:@react-native/babel-preset";
|
|
31
|
-
try {
|
|
32
|
-
const attempt = (0, import_resolve.resolvePath)("@react-native/babel-preset");
|
|
33
|
-
(await (0, import_promises.stat)(attempt)).isDirectory() && (babelPreset = attempt);
|
|
34
|
-
} catch {
|
|
35
|
-
}
|
|
36
|
-
return await new Promise((res, rej) => {
|
|
37
|
-
import_core.default.transform(
|
|
38
|
-
input,
|
|
39
|
-
{
|
|
40
|
-
filename: path || "file.js",
|
|
41
|
-
presets: [babelPreset],
|
|
42
|
-
plugins: []
|
|
43
|
-
},
|
|
44
|
-
(err, result) => {
|
|
45
|
-
if (!result || err)
|
|
46
|
-
return rej(err || "no res");
|
|
47
|
-
res(result.code);
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=transformFlowBabel.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/transformFlowBabel.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAqB,6BACrB,cAAkB,oCAClB,iBAA4B;AAE5B,eAAsB,mBACpB,OACA,EAAE,cAAc,IAAO,KAAK,IAA8C,CAAC,GAC3E;AACA,MAAI,cAAc;AAElB,MAAI;AAGF,UAAM,cAAU,4BAAY,4BAA4B;AACxD,KAAK,UAAM,sBAAK,OAAO,GAAG,YAAY,MACpC,cAAc;AAAA,EAElB,QAAc;AAAA,EAEd;AAEA,SAAO,MAAM,IAAI,QAAgB,CAAC,KAAK,QAAQ;AAC7C,gBAAAA,QAAM;AAAA,MACJ;AAAA,MACA;AAAA,QACE,UAAU,QAAQ;AAAA,QAClB,SAAS,CAAC,WAAW;AAAA,QACrB,SAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,KAAU,WAAW;AACpB,YAAI,CAAC,UAAU;AACb,iBAAO,IAAI,OAAO,QAAQ;AAE5B,YAAI,OAAQ,IAAK;AAAA,MACnB;AAAA,IACF;AAAA,EACF,CAAC;AACH;",
|
|
5
|
-
"names": ["babel"]
|
|
6
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { stat } from "node:fs/promises";
|
|
2
|
-
import babel from "@babel/core";
|
|
3
|
-
import { resolvePath } from "@vxrn/resolve";
|
|
4
|
-
async function transformFlowBabel(input, { development = !1, path } = {}) {
|
|
5
|
-
let babelPreset = "module:@react-native/babel-preset";
|
|
6
|
-
try {
|
|
7
|
-
const attempt = resolvePath("@react-native/babel-preset");
|
|
8
|
-
(await stat(attempt)).isDirectory() && (babelPreset = attempt);
|
|
9
|
-
} catch {
|
|
10
|
-
}
|
|
11
|
-
return await new Promise((res, rej) => {
|
|
12
|
-
babel.transform(
|
|
13
|
-
input,
|
|
14
|
-
{
|
|
15
|
-
filename: path || "file.js",
|
|
16
|
-
presets: [babelPreset],
|
|
17
|
-
plugins: []
|
|
18
|
-
},
|
|
19
|
-
(err, result) => {
|
|
20
|
-
if (!result || err)
|
|
21
|
-
return rej(err || "no res");
|
|
22
|
-
res(result.code);
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
export {
|
|
28
|
-
transformFlowBabel
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=transformFlowBabel.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/transformFlowBabel.ts"],
|
|
4
|
-
"mappings": "AAAA,SAAS,YAAY;AACrB,OAAO,WAAW;AAClB,SAAS,mBAAmB;AAE5B,eAAsB,mBACpB,OACA,EAAE,cAAc,IAAO,KAAK,IAA8C,CAAC,GAC3E;AACA,MAAI,cAAc;AAElB,MAAI;AAGF,UAAM,UAAU,YAAY,4BAA4B;AACxD,KAAK,MAAM,KAAK,OAAO,GAAG,YAAY,MACpC,cAAc;AAAA,EAElB,QAAc;AAAA,EAEd;AAEA,SAAO,MAAM,IAAI,QAAgB,CAAC,KAAK,QAAQ;AAC7C,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,QACE,UAAU,QAAQ;AAAA,QAClB,SAAS,CAAC,WAAW;AAAA,QACrB,SAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,KAAU,WAAW;AACpB,YAAI,CAAC,UAAU;AACb,iBAAO,IAAI,OAAO,QAAQ;AAE5B,YAAI,OAAQ,IAAK;AAAA,MACnB;AAAA,IACF;AAAA,EACF,CAAC;AACH;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|