@vxrn/vite-flow 1.27.0 → 1.27.1-1789509973946

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.
@@ -3,48 +3,44 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
10
  };
11
11
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
19
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
21
  var index_exports = {};
24
22
  __export(index_exports, {
25
- default: () => createFlowPlugin,
26
- transformFlow: () => import_transformFlowBabel2.transformFlow,
27
- transformFlowBabel: () => import_transformFlowBabel2.transformFlowBabel
23
+ default: () => createFlowPlugin,
24
+ transformFlow: () => import_transformFlowBabel2.transformFlow,
25
+ transformFlowBabel: () => import_transformFlowBabel2.transformFlowBabel
28
26
  });
29
27
  module.exports = __toCommonJS(index_exports);
30
28
  var import_vite = require("vite");
31
29
  var import_transformFlowBabel = require("./transformFlowBabel.cjs");
32
30
  var import_transformFlowBabel2 = require("./transformFlowBabel.cjs");
33
31
  function createFlowPlugin(opts) {
34
- if (!opts?.include || Array.isArray(opts.include) && opts.include.length === 0) {
35
- return;
36
- }
37
- const filter = (0, import_vite.createFilter)(opts?.include, opts?.exclude);
38
- return {
39
- name: "@vxrn/vite-flow",
40
- enforce: "pre",
41
- transform(code, id) {
42
- if (filter(id)) {
43
- return (0, import_transformFlowBabel.transformFlow)(code, {
44
- path: id
45
- });
46
- }
47
- return null;
48
- }
49
- };
50
- }
32
+ if (!opts?.include || Array.isArray(opts.include) && opts.include.length === 0) {
33
+ return;
34
+ }
35
+ const filter = (0, import_vite.createFilter)(opts?.include, opts?.exclude);
36
+ return {
37
+ name: "@vxrn/vite-flow",
38
+ enforce: "pre",
39
+ transform(code, id) {
40
+ if (filter(id)) {
41
+ return (0, import_transformFlowBabel.transformFlow)(code, { path: id });
42
+ }
43
+ return null;
44
+ }
45
+ };
46
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var index_exports = {};
24
+ __export(index_exports, {
25
+ default: () => createFlowPlugin,
26
+ transformFlow: () => import_transformFlowBabel2.transformFlow,
27
+ transformFlowBabel: () => import_transformFlowBabel2.transformFlowBabel
28
+ });
29
+ module.exports = __toCommonJS(index_exports);
30
+ var import_vite = require("vite");
31
+ var import_transformFlowBabel = require("./transformFlowBabel.native.js");
32
+ var import_transformFlowBabel2 = require("./transformFlowBabel.native.js");
33
+ function createFlowPlugin(opts) {
34
+ if (!(opts === null || opts === void 0 ? void 0 : opts.include) || Array.isArray(opts.include) && opts.include.length === 0) {
35
+ return;
36
+ }
37
+ var filter = (0, import_vite.createFilter)(opts === null || opts === void 0 ? void 0 : opts.include, opts === null || opts === void 0 ? void 0 : opts.exclude);
38
+ return {
39
+ name: "@vxrn/vite-flow",
40
+ enforce: "pre",
41
+ transform(code, id) {
42
+ if (filter(id)) {
43
+ return (0, import_transformFlowBabel.transformFlow)(code, { path: id });
44
+ }
45
+ return null;
46
+ }
47
+ };
48
+ }
@@ -5,49 +5,46 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
12
  };
13
13
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
21
  };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
23
  var index_exports = {};
26
24
  __export(index_exports, {
27
- default: () => createFlowPlugin,
28
- transformFlow: () => import_transformFlowBabel2.transformFlow,
29
- transformFlowBabel: () => import_transformFlowBabel2.transformFlowBabel
25
+ default: () => createFlowPlugin,
26
+ transformFlow: () => import_transformFlowBabel2.transformFlow,
27
+ transformFlowBabel: () => import_transformFlowBabel2.transformFlowBabel
30
28
  });
31
29
  module.exports = __toCommonJS(index_exports);
32
30
  var import_vite = require("vite");
33
31
  var import_transformFlowBabel = require("./transformFlowBabel.native.js");
34
32
  var import_transformFlowBabel2 = require("./transformFlowBabel.native.js");
35
33
  function createFlowPlugin(opts) {
36
- if (!(opts === null || opts === void 0 ? void 0 : opts.include) || Array.isArray(opts.include) && opts.include.length === 0) {
37
- return;
38
- }
39
- var filter = (0, import_vite.createFilter)(opts === null || opts === void 0 ? void 0 : opts.include, opts === null || opts === void 0 ? void 0 : opts.exclude);
40
- return {
41
- name: "@vxrn/vite-flow",
42
- enforce: "pre",
43
- transform(code, id) {
44
- if (filter(id)) {
45
- return (0, import_transformFlowBabel.transformFlow)(code, {
46
- path: id
47
- });
48
- }
49
- return null;
50
- }
51
- };
34
+ if (!(opts === null || opts === void 0 ? void 0 : opts.include) || Array.isArray(opts.include) && opts.include.length === 0) {
35
+ return;
36
+ }
37
+ var filter = (0, import_vite.createFilter)(opts === null || opts === void 0 ? void 0 : opts.include, opts === null || opts === void 0 ? void 0 : opts.exclude);
38
+ return {
39
+ name: "@vxrn/vite-flow",
40
+ enforce: "pre",
41
+ transform(code, id) {
42
+ if (filter(id)) {
43
+ return (0, import_transformFlowBabel.transformFlow)(code, { path: id });
44
+ }
45
+ return null;
46
+ }
47
+ };
52
48
  }
49
+
53
50
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","default","createFlowPlugin","transformFlow","import_transformFlowBabel2","transformFlowBabel","module","exports","import_vite","require","import_transformFlowBabel","opts","include","Array","isArray","length","filter","createFilter","exclude","name","enforce","transform","code","id","path"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,OAAA,EAAAA,CAAA,KAAAC,gBAAA;EAAAC,aAAA,EAAAA,CAAA,KAAAC,0BAAA,CAAAD,aAAA;EAAAE,kBAAA,EAAAA,CAAA,KAAAD,0BAAA,CAAAC;AAAA;AACAC,MAAA,CAAAC,OAAA,GAAAb,YAA6B,CAAAK,aAAA;AAC7B,IAAAS,WAAA,GAAAC,OAAA,OAAkD;AAElD,IAAAC,yBAAA,GAAAD,OAAkD;AAOnC,IAAAL,0BAA0B,GAA8BK,OAAA;AACrE,SAAKP,gBAAkBA,CAAAS,IAAM;EAC3B,MAAAA,IAAA,aAAAA,IAAA,uBAAAA,IAAA,CAAAC,OAAA,KAAAC,KAAA,CAAAC,OAAA,CAAAH,IAAA,CAAAC,OAAA,KAAAD,IAAA,CAAAC,OAAA,CAAAG,MAAA;IACF;EAEA;EAEA,IAAAC,MAAO,OAAAR,WAAA,CAAAS,YAAA,EAAAN,IAAA,aAAAA,IAAA,uBAAAA,IAAA,CAAAC,OAAA,EAAAD,IAAA,aAAAA,IAAA,uBAAAA,IAAA,CAAAO,OAAA;EAAA,OACL;IACAC,IAAA,mBAAS;IACTC,OAAA,OAAU;IACRC,SAAIA,CAAAC,IAAO,EAAEC,EAAG;MACd,IAAAP,MAAA,CAAAO,EAAO;QACT,WAAAb,yBAAA,CAAAP,aAAA,EAAAmB,IAAA;UACAE,IAAO,EAAAD;QACT;MACF;MACF","ignoreList":[]}
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\n__export(index_exports, {\n default: () => createFlowPlugin,\n transformFlow: () => import_transformFlowBabel2.transformFlow,\n transformFlowBabel: () => import_transformFlowBabel2.transformFlowBabel\n});\nmodule.exports = __toCommonJS(index_exports);\nvar import_vite = require(\"vite\");\nvar import_transformFlowBabel = require(\"./transformFlowBabel\");\nvar import_transformFlowBabel2 = require(\"./transformFlowBabel\");\nfunction createFlowPlugin(opts) {\n if (!(opts === null || opts === void 0 ? void 0 : opts.include) || Array.isArray(opts.include) && opts.include.length === 0) {\n return;\n }\n var filter = (0, import_vite.createFilter)(opts === null || opts === void 0 ? void 0 : opts.include, opts === null || opts === void 0 ? void 0 : opts.exclude);\n return {\n name: \"@vxrn/vite-flow\",\n enforce: \"pre\",\n transform(code, id) {\n if (filter(id)) {\n return (0, import_transformFlowBabel.transformFlow)(code, {\n path: id\n });\n }\n return null;\n }\n };\n}\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,SAAS,eAAe;CACtB,eAAe;CACf,qBAAqB,2BAA2B;CAChD,0BAA0B,2BAA2B;AACvD,CAAC;AACD,OAAO,UAAU,aAAa,aAAa;AAC3C,IAAI,cAAc,QAAQ,MAAM;AAChC,IAAI,4BAA4B,QAAQ,gCAAsB;AAC9D,IAAI,6BAA6B,QAAQ,gCAAsB;AAC/D,SAAS,iBAAiB,MAAM;CAC9B,IAAI,EAAE,SAAS,QAAQ,SAAS,KAAK,IAAI,KAAK,IAAI,KAAK,YAAY,MAAM,QAAQ,KAAK,OAAO,KAAK,KAAK,QAAQ,WAAW,GAAG;EAC3H;CACF;CACA,IAAI,UAAU,GAAG,YAAY,aAAY,CAAE,SAAS,QAAQ,SAAS,KAAK,IAAI,KAAK,IAAI,KAAK,SAAS,SAAS,QAAQ,SAAS,KAAK,IAAI,KAAK,IAAI,KAAK,OAAO;CAC7J,OAAO;EACL,MAAM;EACN,SAAS;EACT,UAAU,MAAM,IAAI;GAClB,IAAI,OAAO,EAAE,GAAG;IACd,QAAQ,GAAG,0BAA0B,cAAa,CAAE,MAAM,EACxD,MAAM,GACR,CAAC;GACH;GACA,OAAO;EACT;CACF;AACF"}
@@ -1,61 +1,42 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
12
10
  };
13
11
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
21
19
  };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: true
30
- }) : target, mod));
31
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: true
33
- }), mod);
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
21
  var transformFlowBabel_exports = {};
35
22
  __export(transformFlowBabel_exports, {
36
- transformFlow: () => transformFlow,
37
- transformFlowBabel: () => transformFlowBabel
23
+ transformFlow: () => transformFlow,
24
+ transformFlowBabel: () => transformFlowBabel
38
25
  });
39
26
  module.exports = __toCommonJS(transformFlowBabel_exports);
27
+ var import_compiler = require("@vxrn/compiler");
40
28
  async function transformFlow(input, options) {
41
- const path = options?.path;
42
- const fft = await import("fast-flow-transform");
43
- const result = await fft.default({
44
- filename: path || "file.js",
45
- source: input,
46
- sourcemap: true,
47
- dialect: "flow",
48
- format: "pretty"
49
- });
50
- return {
51
- code: result.code,
52
- map: result.map,
53
- toString() {
54
- return result.code;
55
- }
56
- };
29
+ const path = options?.path;
30
+ const result = await (0, import_compiler.stripFlowTypes)(path || "file.js", input);
31
+ return {
32
+ code: result.code,
33
+ map: result.map,
34
+ toString() {
35
+ return result.code;
36
+ }
37
+ };
57
38
  }
58
39
  async function transformFlowBabel(input, options) {
59
- const res = await transformFlow(input, options);
60
- return res.code;
61
- }
40
+ const res = await transformFlow(input, options);
41
+ return res.code;
42
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var transformFlowBabel_exports = {};
24
+ __export(transformFlowBabel_exports, {
25
+ transformFlow: () => transformFlow,
26
+ transformFlowBabel: () => transformFlowBabel
27
+ });
28
+ module.exports = __toCommonJS(transformFlowBabel_exports);
29
+ var import_compiler = require("@vxrn/compiler");
30
+ async function transformFlow(input, options) {
31
+ var path = options === null || options === void 0 ? void 0 : options.path;
32
+ var result = await (0, import_compiler.stripFlowTypes)(path || "file.js", input);
33
+ return {
34
+ code: result.code,
35
+ map: result.map,
36
+ toString() {
37
+ return result.code;
38
+ }
39
+ };
40
+ }
41
+ async function transformFlowBabel(input, options) {
42
+ var res = await transformFlow(input, options);
43
+ return res.code;
44
+ }
@@ -1,64 +1,46 @@
1
1
  "use strict";
2
2
 
3
- var __create = Object.create;
4
3
  var __defProp = Object.defineProperty;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
7
  var __export = (target, all) => {
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: true
13
- });
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
14
12
  };
15
13
  var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
- get: () => from[key],
19
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
- });
21
- }
22
- return to;
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
23
21
  };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
- // If the importer is in node compatibility mode or this is not an ESM
26
- // file that has been converted to a CommonJS file using a Babel-
27
- // compatible transform (i.e. "__esModule" has not been set), then set
28
- // "default" to the CommonJS "module.exports" for node compatibility.
29
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30
- value: mod,
31
- enumerable: true
32
- }) : target, mod));
33
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
34
- value: true
35
- }), mod);
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
23
  var transformFlowBabel_exports = {};
37
24
  __export(transformFlowBabel_exports, {
38
- transformFlow: () => transformFlow,
39
- transformFlowBabel: () => transformFlowBabel
25
+ transformFlow: () => transformFlow,
26
+ transformFlowBabel: () => transformFlowBabel
40
27
  });
41
28
  module.exports = __toCommonJS(transformFlowBabel_exports);
29
+ var import_compiler = require("@vxrn/compiler");
42
30
  async function transformFlow(input, options) {
43
- var path = options === null || options === void 0 ? void 0 : options.path;
44
- var fft = await import("fast-flow-transform");
45
- var result = await fft.default({
46
- filename: path || "file.js",
47
- source: input,
48
- sourcemap: true,
49
- dialect: "flow",
50
- format: "pretty"
51
- });
52
- return {
53
- code: result.code,
54
- map: result.map,
55
- toString() {
56
- return result.code;
57
- }
58
- };
31
+ var path = options === null || options === void 0 ? void 0 : options.path;
32
+ var result = await (0, import_compiler.stripFlowTypes)(path || "file.js", input);
33
+ return {
34
+ code: result.code,
35
+ map: result.map,
36
+ toString() {
37
+ return result.code;
38
+ }
39
+ };
59
40
  }
60
41
  async function transformFlowBabel(input, options) {
61
- var res = await transformFlow(input, options);
62
- return res.code;
42
+ var res = await transformFlow(input, options);
43
+ return res.code;
63
44
  }
45
+
64
46
  //# sourceMappingURL=transformFlowBabel.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","transformFlowBabel_exports","__export","transformFlow","transformFlowBabel","module","exports","input","options","path","fft","result","default","filename","source","sourcemap","dialect","format","code","map","toString","res"],"sources":["../../src/transformFlowBabel.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,0BAAA;AAAAC,QAAA,CAAAD,0BAAA;EAAAE,aAAA,EAAAA,CAAA,KAAAA,aAAA;EAAAC,kBAAA,EAAAA,CAAA,KAAAA;AAAA;AAMAC,MAAA,CAAAC,OAAA,GAAsBV,YACpB,CAAAK,0BAE8B;AAC9B,eAAaE,aAASA,CAAAI,KAAA,EAAAC,OAAA;EACtB,IAAAC,IAAM,GAAAD,OAAY,SAAO,IAAAA,OAAA,UAAqB,aAAAA,OAAA,CAAAC,IAAA;EAC9C,IAAAC,GAAM,SAAS,MAAM,sBAAY;EAAA,IAC/BC,MAAA,GAAU,MAAAD,GAAQ,CAAAE,OAAA;IAClBC,QAAQ,EAAAJ,IAAA;IACRK,MAAA,EAAAP,KAAW;IACXQ,SAAS;IACTC,OAAA,EAAQ;IACTC,MAAA;EACD;EAAO,OACL;IACAC,IAAA,EAAKP,MAAO,CAAAO,IAAA;IACZC,GAAA,EAAAR,MAAW,CAAAQ,GAAA;IACTC,SAAA,EAAO;MACT,OAAAT,MAAA,CAAAO,IAAA;IACF;EACF;AAEA;AAIE,eAAYd,kBAAMA,CAAcG,KAAA,EAAOC,OAAO;EAC9C,IAAAa,GAAO,SAAIlB,aAAA,CAAAI,KAAA,EAAAC,OAAA;EACb,OAAAa,GAAA,CAAAH,IAAA","ignoreList":[]}
1
+ {"version":3,"file":"transformFlowBabel.native.js","names":[],"sources":["cjs/transformFlowBabel.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar transformFlowBabel_exports = {};\n__export(transformFlowBabel_exports, {\n transformFlow: () => transformFlow,\n transformFlowBabel: () => transformFlowBabel\n});\nmodule.exports = __toCommonJS(transformFlowBabel_exports);\nvar import_compiler = require(\"@vxrn/compiler\");\nasync function transformFlow(input, options) {\n var path = options === null || options === void 0 ? void 0 : options.path;\n var result = await (0, import_compiler.stripFlowTypes)(path || \"file.js\", input);\n return {\n code: result.code,\n map: result.map,\n toString() {\n return result.code;\n }\n };\n}\nasync function transformFlowBabel(input, options) {\n var res = await transformFlow(input, options);\n return res.code;\n}\n//# sourceMappingURL=transformFlowBabel.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,6BAA6B,CAAC;AAClC,SAAS,4BAA4B;CACnC,qBAAqB;CACrB,0BAA0B;AAC5B,CAAC;AACD,OAAO,UAAU,aAAa,0BAA0B;AACxD,IAAI,kBAAkB,QAAQ,gBAAgB;AAC9C,eAAe,cAAc,OAAO,SAAS;CAC3C,IAAI,OAAO,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ;CACrE,IAAI,SAAS,OAAO,GAAG,gBAAgB,eAAc,CAAE,QAAQ,WAAW,KAAK;CAC/E,OAAO;EACL,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,WAAW;GACT,OAAO,OAAO;EAChB;CACF;AACF;AACA,eAAe,mBAAmB,OAAO,SAAS;CAChD,IAAI,MAAM,MAAM,cAAc,OAAO,OAAO;CAC5C,OAAO,IAAI;AACb"}
package/dist/esm/index.js CHANGED
@@ -1,23 +1,22 @@
1
1
  import { createFilter } from "vite";
2
- import { transformFlow } from "./transformFlowBabel.mjs";
3
- import { transformFlow as transformFlow2, transformFlowBabel as transformFlowBabel2 } from "./transformFlowBabel.mjs";
2
+ import { transformFlow, transformFlow as transformFlow2, transformFlowBabel as transformFlowBabel2 } from "./transformFlowBabel.mjs";
3
+
4
4
  function createFlowPlugin(opts) {
5
- if (!opts?.include || Array.isArray(opts.include) && opts.include.length === 0) {
6
- return;
7
- }
8
- const filter = createFilter(opts?.include, opts?.exclude);
9
- return {
10
- name: "@vxrn/vite-flow",
11
- enforce: "pre",
12
- transform(code, id) {
13
- if (filter(id)) {
14
- return transformFlow(code, {
15
- path: id
16
- });
17
- }
18
- return null;
19
- }
20
- };
5
+ if (!opts?.include || Array.isArray(opts.include) && opts.include.length === 0) {
6
+ return;
7
+ }
8
+ const filter = createFilter(opts?.include, opts?.exclude);
9
+ return {
10
+ name: "@vxrn/vite-flow",
11
+ enforce: "pre",
12
+ transform(code, id) {
13
+ if (filter(id)) {
14
+ return transformFlow(code, { path: id });
15
+ }
16
+ return null;
17
+ }
18
+ };
21
19
  }
20
+
22
21
  export { createFlowPlugin as default, transformFlow2 as transformFlow, transformFlowBabel2 as transformFlowBabel };
23
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createFilter","transformFlow","transformFlow2","transformFlowBabel","transformFlowBabel2","createFlowPlugin","opts","include","Array","isArray","length","filter","exclude","name","enforce","transform","code","id","path"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AACA,SAASA,YAAA,QAAoB;AAC7B,SAASC,aAAA,QAAyC;AAElD,SAASA,aAAA,IAAAC,cAAA,EAAeC,kBAAA,IAAAC,mBAAA,QAA0B;AAOnC,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,GAAI;IAChF;EACF;EAEA,MAAMC,MAAA,GAASX,YAAA,CAAaM,IAAA,EAAMC,OAAA,EAASD,IAAA,EAAMM,OAAO;EAExD,OAAO;IACLC,IAAA,EAAM;IACNC,OAAA,EAAS;IACTC,UAAUC,IAAA,EAAMC,EAAA,EAAI;MAClB,IAAIN,MAAA,CAAOM,EAAE,GAAG;QACd,OAAOhB,aAAA,CAAce,IAAA,EAAM;UAAEE,IAAA,EAAMD;QAAG,CAAC;MACzC;MACA,OAAO;IACT;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["esm/index.js"],"sourcesContent":["import { createFilter } from \"vite\";\nimport { transformFlow } from \"./transformFlowBabel\";\nimport { transformFlow as transformFlow2, transformFlowBabel as transformFlowBabel2 } from \"./transformFlowBabel\";\nfunction createFlowPlugin(opts) {\n if (!opts?.include || Array.isArray(opts.include) && opts.include.length === 0) {\n return;\n }\n const filter = createFilter(opts?.include, opts?.exclude);\n return {\n name: \"@vxrn/vite-flow\",\n enforce: \"pre\",\n transform(code, id) {\n if (filter(id)) {\n return transformFlow(code, { path: id });\n }\n return null;\n }\n };\n}\nexport {\n createFlowPlugin as default,\n transformFlow2 as transformFlow,\n transformFlowBabel2 as transformFlowBabel\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AAGA,SAAS,iBAAiB,MAAM;CAC9B,IAAI,CAAC,MAAM,WAAW,MAAM,QAAQ,KAAK,OAAO,KAAK,KAAK,QAAQ,WAAW,GAAG;EAC9E;CACF;CACA,MAAM,SAAS,aAAa,MAAM,SAAS,MAAM,OAAO;CACxD,OAAO;EACL,MAAM;EACN,SAAS;EACT,UAAU,MAAM,IAAI;GAClB,IAAI,OAAO,EAAE,GAAG;IACd,OAAO,cAAc,MAAM,EAAE,MAAM,GAAG,CAAC;GACzC;GACA,OAAO;EACT;CACF;AACF"}
@@ -1,23 +1,22 @@
1
1
  import { createFilter } from "vite";
2
- import { transformFlow } from "./transformFlowBabel.mjs";
3
- import { transformFlow as transformFlow2, transformFlowBabel as transformFlowBabel2 } from "./transformFlowBabel.mjs";
2
+ import { transformFlow, transformFlow as transformFlow2, transformFlowBabel as transformFlowBabel2 } from "./transformFlowBabel.mjs";
3
+
4
4
  function createFlowPlugin(opts) {
5
- if (!opts?.include || Array.isArray(opts.include) && opts.include.length === 0) {
6
- return;
7
- }
8
- const filter = createFilter(opts?.include, opts?.exclude);
9
- return {
10
- name: "@vxrn/vite-flow",
11
- enforce: "pre",
12
- transform(code, id) {
13
- if (filter(id)) {
14
- return transformFlow(code, {
15
- path: id
16
- });
17
- }
18
- return null;
19
- }
20
- };
5
+ if (!opts?.include || Array.isArray(opts.include) && opts.include.length === 0) {
6
+ return;
7
+ }
8
+ const filter = createFilter(opts?.include, opts?.exclude);
9
+ return {
10
+ name: "@vxrn/vite-flow",
11
+ enforce: "pre",
12
+ transform(code, id) {
13
+ if (filter(id)) {
14
+ return transformFlow(code, { path: id });
15
+ }
16
+ return null;
17
+ }
18
+ };
21
19
  }
20
+
22
21
  export { createFlowPlugin as default, transformFlow2 as transformFlow, transformFlowBabel2 as transformFlowBabel };
23
22
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["createFilter","transformFlow","transformFlow2","transformFlowBabel","transformFlowBabel2","createFlowPlugin","opts","include","Array","isArray","length","filter","exclude","name","enforce","transform","code","id","path"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AACA,SAASA,YAAA,QAAoB;AAC7B,SAASC,aAAA,QAAyC;AAElD,SAASA,aAAA,IAAAC,cAAA,EAAeC,kBAAA,IAAAC,mBAAA,QAA0B;AAOnC,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,GAAI;IAChF;EACF;EAEA,MAAMC,MAAA,GAASX,YAAA,CAAaM,IAAA,EAAMC,OAAA,EAASD,IAAA,EAAMM,OAAO;EAExD,OAAO;IACLC,IAAA,EAAM;IACNC,OAAA,EAAS;IACTC,UAAUC,IAAA,EAAMC,EAAA,EAAI;MAClB,IAAIN,MAAA,CAAOM,EAAE,GAAG;QACd,OAAOhB,aAAA,CAAce,IAAA,EAAM;UAAEE,IAAA,EAAMD;QAAG,CAAC;MACzC;MACA,OAAO;IACT;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["esm/index.js"],"sourcesContent":["import { createFilter } from \"vite\";\nimport { transformFlow } from \"./transformFlowBabel\";\nimport { transformFlow as transformFlow2, transformFlowBabel as transformFlowBabel2 } from \"./transformFlowBabel\";\nfunction createFlowPlugin(opts) {\n if (!opts?.include || Array.isArray(opts.include) && opts.include.length === 0) {\n return;\n }\n const filter = createFilter(opts?.include, opts?.exclude);\n return {\n name: \"@vxrn/vite-flow\",\n enforce: \"pre\",\n transform(code, id) {\n if (filter(id)) {\n return transformFlow(code, { path: id });\n }\n return null;\n }\n };\n}\nexport {\n createFlowPlugin as default,\n transformFlow2 as transformFlow,\n transformFlowBabel2 as transformFlowBabel\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AAGA,SAAS,iBAAiB,MAAM;CAC9B,IAAI,CAAC,MAAM,WAAW,MAAM,QAAQ,KAAK,OAAO,KAAK,KAAK,QAAQ,WAAW,GAAG;EAC9E;CACF;CACA,MAAM,SAAS,aAAa,MAAM,SAAS,MAAM,OAAO;CACxD,OAAO;EACL,MAAM;EACN,SAAS;EACT,UAAU,MAAM,IAAI;GAClB,IAAI,OAAO,EAAE,GAAG;IACd,OAAO,cAAc,MAAM,EAAE,MAAM,GAAG,CAAC;GACzC;GACA,OAAO;EACT;CACF;AACF"}
@@ -1,23 +1,22 @@
1
1
  import { createFilter } from "vite";
2
- import { transformFlow } from "./transformFlowBabel.native.js";
3
- import { transformFlow as transformFlow2, transformFlowBabel } from "./transformFlowBabel.native.js";
2
+ import { transformFlow, transformFlow as transformFlow2, transformFlowBabel } from "./transformFlowBabel.native.js";
3
+
4
4
  function createFlowPlugin(opts) {
5
- if (!(opts === null || opts === void 0 ? void 0 : opts.include) || Array.isArray(opts.include) && opts.include.length === 0) {
6
- return;
7
- }
8
- var filter = createFilter(opts === null || opts === void 0 ? void 0 : opts.include, opts === null || opts === void 0 ? void 0 : opts.exclude);
9
- return {
10
- name: "@vxrn/vite-flow",
11
- enforce: "pre",
12
- transform(code, id) {
13
- if (filter(id)) {
14
- return transformFlow(code, {
15
- path: id
16
- });
17
- }
18
- return null;
19
- }
20
- };
5
+ if (!(opts === null || opts === void 0 ? void 0 : opts.include) || Array.isArray(opts.include) && opts.include.length === 0) {
6
+ return;
7
+ }
8
+ var filter = createFilter(opts === null || opts === void 0 ? void 0 : opts.include, opts === null || opts === void 0 ? void 0 : opts.exclude);
9
+ return {
10
+ name: "@vxrn/vite-flow",
11
+ enforce: "pre",
12
+ transform(code, id) {
13
+ if (filter(id)) {
14
+ return transformFlow(code, { path: id });
15
+ }
16
+ return null;
17
+ }
18
+ };
21
19
  }
20
+
22
21
  export { createFlowPlugin as default, transformFlow2 as transformFlow, transformFlowBabel };
23
22
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createFilter","transformFlow","transformFlow2","transformFlowBabel","createFlowPlugin","opts","include","Array","isArray","length","filter","exclude","name","enforce","transform","code","id","path"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AACA,SAASA,YAAA,QAAoB;AAC7B,SAASC,aAAA,QAAyC;AAElD,SAASA,aAAA,IAAAC,cAAA,EAAeC,kBAAA;AAOT,SAARC,iBAAkCC,IAAA,EAA8B;EACrE,IAAI,EAACA,IAAA,KAAM,QAAYA,IAAA,KAAM,KAAQ,IAAK,SAAOA,IAAK,CAAAC,OAAK,KAAQC,KAAA,CAAAC,OAAe,CAAAH,IAAA,CAAAC,OAAA,KAAAD,IAAA,CAAAC,OAAA,CAAAG,MAAA;IAChF;EACF;EAEA,IAAAC,MAAM,GAAAV,YAAS,CAAAK,IAAa,KAAM,QAASA,IAAA,KAAM,KAAO,aAAAA,IAAA,CAAAC,OAAA,EAAAD,IAAA,aAAAA,IAAA,uBAAAA,IAAA,CAAAM,OAAA;EAExD,OAAO;IACLC,IAAA,EAAM;IACNC,OAAA,EAAS;IACTC,UAAUC,IAAA,EAAMC,EAAA,EAAI;MAClB,IAAIN,MAAA,CAAOM,EAAE,GAAG;QACd,OAAOf,aAAA,CAAcc,IAAA,EAAM;UAC7BE,IAAA,EAAAD;QACA;MACF;MACF;IACF","ignoreList":[]}
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["esm/index.native.js"],"sourcesContent":["import { createFilter } from \"vite\";\nimport { transformFlow } from \"./transformFlowBabel\";\nimport { transformFlow as transformFlow2, transformFlowBabel } from \"./transformFlowBabel\";\nfunction createFlowPlugin(opts) {\n if (!(opts === null || opts === void 0 ? void 0 : opts.include) || Array.isArray(opts.include) && opts.include.length === 0) {\n return;\n }\n var filter = createFilter(opts === null || opts === void 0 ? void 0 : opts.include, opts === null || opts === void 0 ? void 0 : opts.exclude);\n return {\n name: \"@vxrn/vite-flow\",\n enforce: \"pre\",\n transform(code, id) {\n if (filter(id)) {\n return transformFlow(code, {\n path: id\n });\n }\n return null;\n }\n };\n}\nexport {\n createFlowPlugin as default,\n transformFlow2 as transformFlow,\n transformFlowBabel\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AAGA,SAAS,iBAAiB,MAAM;CAC9B,IAAI,EAAE,SAAS,QAAQ,SAAS,KAAK,IAAI,KAAK,IAAI,KAAK,YAAY,MAAM,QAAQ,KAAK,OAAO,KAAK,KAAK,QAAQ,WAAW,GAAG;EAC3H;CACF;CACA,IAAI,SAAS,aAAa,SAAS,QAAQ,SAAS,KAAK,IAAI,KAAK,IAAI,KAAK,SAAS,SAAS,QAAQ,SAAS,KAAK,IAAI,KAAK,IAAI,KAAK,OAAO;CAC5I,OAAO;EACL,MAAM;EACN,SAAS;EACT,UAAU,MAAM,IAAI;GAClB,IAAI,OAAO,EAAE,GAAG;IACd,OAAO,cAAc,MAAM,EACzB,MAAM,GACR,CAAC;GACH;GACA,OAAO;EACT;CACF;AACF"}
@@ -1,24 +1,20 @@
1
+ import { stripFlowTypes } from "@vxrn/compiler";
2
+
1
3
  async function transformFlow(input, options) {
2
- const path = options?.path;
3
- const fft = await import("fast-flow-transform");
4
- const result = await fft.default({
5
- filename: path || "file.js",
6
- source: input,
7
- sourcemap: true,
8
- dialect: "flow",
9
- format: "pretty"
10
- });
11
- return {
12
- code: result.code,
13
- map: result.map,
14
- toString() {
15
- return result.code;
16
- }
17
- };
4
+ const path = options?.path;
5
+ const result = await stripFlowTypes(path || "file.js", input);
6
+ return {
7
+ code: result.code,
8
+ map: result.map,
9
+ toString() {
10
+ return result.code;
11
+ }
12
+ };
18
13
  }
19
14
  async function transformFlowBabel(input, options) {
20
- const res = await transformFlow(input, options);
21
- return res.code;
15
+ const res = await transformFlow(input, options);
16
+ return res.code;
22
17
  }
18
+
23
19
  export { transformFlow, transformFlowBabel };
24
20
  //# sourceMappingURL=transformFlowBabel.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["transformFlow","input","options","path","fft","result","default","filename","source","sourcemap","dialect","format","code","map","toString","transformFlowBabel","res"],"sources":["../../src/transformFlowBabel.ts"],"sourcesContent":[null],"mappings":"AAMA,eAAsBA,cACpBC,KAAA,EACAC,OAAA,EAC8B;EAC9B,MAAMC,IAAA,GAAOD,OAAA,EAASC,IAAA;EACtB,MAAMC,GAAA,GAAM,MAAM,OAAO,qBAAqB;EAC9C,MAAMC,MAAA,GAAS,MAAMD,GAAA,CAAIE,OAAA,CAAQ;IAC/BC,QAAA,EAAUJ,IAAA,IAAQ;IAClBK,MAAA,EAAQP,KAAA;IACRQ,SAAA,EAAW;IACXC,OAAA,EAAS;IACTC,MAAA,EAAQ;EACV,CAAC;EACD,OAAO;IACLC,IAAA,EAAMP,MAAA,CAAOO,IAAA;IACbC,GAAA,EAAKR,MAAA,CAAOQ,GAAA;IACZC,SAAA,EAAW;MACT,OAAOT,MAAA,CAAOO,IAAA;IAChB;EACF;AACF;AAEA,eAAsBG,mBACpBd,KAAA,EACAC,OAAA,EACiB;EACjB,MAAMc,GAAA,GAAM,MAAMhB,aAAA,CAAcC,KAAA,EAAOC,OAAO;EAC9C,OAAOc,GAAA,CAAIJ,IAAA;AACb","ignoreList":[]}
1
+ {"version":3,"file":"transformFlowBabel.js","names":[],"sources":["esm/transformFlowBabel.js"],"sourcesContent":["import { stripFlowTypes } from \"@vxrn/compiler\";\nasync function transformFlow(input, options) {\n const path = options?.path;\n const result = await stripFlowTypes(path || \"file.js\", input);\n return {\n code: result.code,\n map: result.map,\n toString() {\n return result.code;\n }\n };\n}\nasync function transformFlowBabel(input, options) {\n const res = await transformFlow(input, options);\n return res.code;\n}\nexport {\n transformFlow,\n transformFlowBabel\n};\n//# sourceMappingURL=transformFlowBabel.js.map\n"],"mappings":";;;AACA,eAAe,cAAc,OAAO,SAAS;CAC3C,MAAM,OAAO,SAAS;CACtB,MAAM,SAAS,MAAM,eAAe,QAAQ,WAAW,KAAK;CAC5D,OAAO;EACL,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,WAAW;GACT,OAAO,OAAO;EAChB;CACF;AACF;AACA,eAAe,mBAAmB,OAAO,SAAS;CAChD,MAAM,MAAM,MAAM,cAAc,OAAO,OAAO;CAC9C,OAAO,IAAI;AACb"}
@@ -1,24 +1,20 @@
1
+ import { stripFlowTypes } from "@vxrn/compiler";
2
+
1
3
  async function transformFlow(input, options) {
2
- var path = options === null || options === void 0 ? void 0 : options.path;
3
- var fft = await import("fast-flow-transform");
4
- var result = await fft.default({
5
- filename: path || "file.js",
6
- source: input,
7
- sourcemap: true,
8
- dialect: "flow",
9
- format: "pretty"
10
- });
11
- return {
12
- code: result.code,
13
- map: result.map,
14
- toString() {
15
- return result.code;
16
- }
17
- };
4
+ var path = options === null || options === void 0 ? void 0 : options.path;
5
+ var result = await stripFlowTypes(path || "file.js", input);
6
+ return {
7
+ code: result.code,
8
+ map: result.map,
9
+ toString() {
10
+ return result.code;
11
+ }
12
+ };
18
13
  }
19
14
  async function transformFlowBabel(input, options) {
20
- var res = await transformFlow(input, options);
21
- return res.code;
15
+ var res = await transformFlow(input, options);
16
+ return res.code;
22
17
  }
18
+
23
19
  export { transformFlow, transformFlowBabel };
24
20
  //# sourceMappingURL=transformFlowBabel.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["transformFlow","input","options","path","fft","result","default","filename","source","sourcemap","dialect","format","code","map","toString","transformFlowBabel","res"],"sources":["../../src/transformFlowBabel.ts"],"sourcesContent":[null],"mappings":"AAMA,eAAsBA,cACpBC,KAAA,EACAC,OAAA,EAC8B;EAC9B,IAAAC,IAAM,GAAAD,OAAO,KAAS,QAAAA,OAAA,uBAAAA,OAAA,CAAAC,IAAA;EACtB,IAAAC,GAAM,SAAM,MAAM,sBAAO;EACzB,IAAAC,MAAM,SAASD,GAAM,CAAAE,OAAI;IACvBC,QAAA,EAAUJ,IAAA,IAAQ;IAClBK,MAAA,EAAQP,KAAA;IACRQ,SAAA,EAAW;IACXC,OAAA,EAAS;IACTC,MAAA,EAAQ;EACV,CAAC;EACD,OAAO;IACLC,IAAA,EAAMP,MAAA,CAAOO,IAAA;IACbC,GAAA,EAAKR,MAAA,CAAOQ,GAAA;IACZC,SAAA,EAAW;MACT,OAAOT,MAAA,CAAOO,IAAA;IAChB;EACF;AACF;AAEA,eAAsBG,mBACpBd,KAAA,EACAC,OAAA,EACiB;EACjB,IAAAc,GAAM,SAAMhB,aAAM,CAAAC,KAAc,EAAAC,OAAO;EACvC,OAAOc,GAAA,CAAIJ,IAAA;AACb","ignoreList":[]}
1
+ {"version":3,"file":"transformFlowBabel.native.js","names":[],"sources":["esm/transformFlowBabel.native.js"],"sourcesContent":["import { stripFlowTypes } from \"@vxrn/compiler\";\nasync function transformFlow(input, options) {\n var path = options === null || options === void 0 ? void 0 : options.path;\n var result = await stripFlowTypes(path || \"file.js\", input);\n return {\n code: result.code,\n map: result.map,\n toString() {\n return result.code;\n }\n };\n}\nasync function transformFlowBabel(input, options) {\n var res = await transformFlow(input, options);\n return res.code;\n}\nexport {\n transformFlow,\n transformFlowBabel\n};\n//# sourceMappingURL=transformFlowBabel.js.map\n"],"mappings":";;;AACA,eAAe,cAAc,OAAO,SAAS;CAC3C,IAAI,OAAO,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ;CACrE,IAAI,SAAS,MAAM,eAAe,QAAQ,WAAW,KAAK;CAC1D,OAAO;EACL,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,WAAW;GACT,OAAO,OAAO;EAChB;CACF;AACF;AACA,eAAe,mBAAmB,OAAO,SAAS;CAChD,IAAI,MAAM,MAAM,cAAc,OAAO,OAAO;CAC5C,OAAO,IAAI;AACb"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vxrn/vite-flow",
3
- "version": "1.27.0",
3
+ "version": "1.27.1-1789509973946",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./package.json": "./package.json",
@@ -28,13 +28,13 @@
28
28
  "watch": "tamagui-build --watch"
29
29
  },
30
30
  "dependencies": {
31
- "@vxrn/resolve": "1.27.0",
32
- "fast-flow-transform": "^0.0.3",
31
+ "@vxrn/compiler": "1.27.1-1789509973946",
32
+ "@vxrn/resolve": "1.27.1-1789509973946",
33
33
  "vite": "^8.2.2"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@biomejs/biome": "2.3.3",
37
- "@tamagui/build": "2.6.2"
37
+ "@tamagui/build": "3.0.0-beta.1309.1"
38
38
  },
39
39
  "publishConfig": {
40
40
  "access": "public"
@@ -9,14 +9,7 @@ export async function transformFlow(
9
9
  options?: { development?: boolean; path?: string }
10
10
  ): Promise<TransformFlowResult> {
11
11
  const path = options?.path
12
- const fft = await import('fast-flow-transform')
13
- const result = await fft.default({
14
- filename: path || 'file.js',
15
- source: input,
16
- sourcemap: true,
17
- dialect: 'flow',
18
- format: 'pretty',
19
- })
12
+ const result = await stripFlowTypes(path || 'file.js', input)
20
13
  return {
21
14
  code: result.code,
22
15
  map: result.map,
@@ -33,3 +26,4 @@ export async function transformFlowBabel(
33
26
  const res = await transformFlow(input, options)
34
27
  return res.code
35
28
  }
29
+ import { stripFlowTypes } from '@vxrn/compiler'
@@ -1 +1 @@
1
- {"version":3,"file":"transformFlowBabel.d.ts","sourceRoot":"","sources":["../src/transformFlowBabel.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,GAAG,CAAA;IACR,QAAQ,IAAI,MAAM,CAAA;CACnB;AAED,wBAAsB,aAAa,CACjC,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GACjD,OAAO,CAAC,mBAAmB,CAAC,CAiB9B;AAED,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GACjD,OAAO,CAAC,MAAM,CAAC,CAGjB"}
1
+ {"version":3,"file":"transformFlowBabel.d.ts","sourceRoot":"","sources":["../src/transformFlowBabel.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,GAAG,CAAA;IACR,QAAQ,IAAI,MAAM,CAAA;CACnB;AAED,wBAAsB,aAAa,CACjC,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GACjD,OAAO,CAAC,mBAAmB,CAAC,CAU9B;AAED,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GACjD,OAAO,CAAC,MAAM,CAAC,CAGjB"}