@clayroach/unplugin 0.1.0-source-trace.2

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.
Files changed (79) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +93 -0
  3. package/dist/cjs/esbuild.js +34 -0
  4. package/dist/cjs/esbuild.js.map +1 -0
  5. package/dist/cjs/index.js +113 -0
  6. package/dist/cjs/index.js.map +1 -0
  7. package/dist/cjs/rollup.js +33 -0
  8. package/dist/cjs/rollup.js.map +1 -0
  9. package/dist/cjs/rspack.js +33 -0
  10. package/dist/cjs/rspack.js.map +1 -0
  11. package/dist/cjs/transformers/index.js +17 -0
  12. package/dist/cjs/transformers/index.js.map +1 -0
  13. package/dist/cjs/transformers/sourceTrace.js +57 -0
  14. package/dist/cjs/transformers/sourceTrace.js.map +1 -0
  15. package/dist/cjs/utils/effectDetection.js +58 -0
  16. package/dist/cjs/utils/effectDetection.js.map +1 -0
  17. package/dist/cjs/utils/hoisting.js +71 -0
  18. package/dist/cjs/utils/hoisting.js.map +1 -0
  19. package/dist/cjs/vite.js +33 -0
  20. package/dist/cjs/vite.js.map +1 -0
  21. package/dist/cjs/webpack.js +33 -0
  22. package/dist/cjs/webpack.js.map +1 -0
  23. package/dist/dts/esbuild.d.ts +30 -0
  24. package/dist/dts/esbuild.d.ts.map +1 -0
  25. package/dist/dts/index.d.ts +46 -0
  26. package/dist/dts/index.d.ts.map +1 -0
  27. package/dist/dts/rollup.d.ts +29 -0
  28. package/dist/dts/rollup.d.ts.map +1 -0
  29. package/dist/dts/rspack.d.ts +29 -0
  30. package/dist/dts/rspack.d.ts.map +1 -0
  31. package/dist/dts/transformers/index.d.ts +7 -0
  32. package/dist/dts/transformers/index.d.ts.map +1 -0
  33. package/dist/dts/transformers/sourceTrace.d.ts +41 -0
  34. package/dist/dts/transformers/sourceTrace.d.ts.map +1 -0
  35. package/dist/dts/utils/effectDetection.d.ts +35 -0
  36. package/dist/dts/utils/effectDetection.d.ts.map +1 -0
  37. package/dist/dts/utils/hoisting.d.ts +41 -0
  38. package/dist/dts/utils/hoisting.d.ts.map +1 -0
  39. package/dist/dts/vite.d.ts +29 -0
  40. package/dist/dts/vite.d.ts.map +1 -0
  41. package/dist/dts/webpack.d.ts +29 -0
  42. package/dist/dts/webpack.d.ts.map +1 -0
  43. package/dist/esm/esbuild.js +28 -0
  44. package/dist/esm/esbuild.js.map +1 -0
  45. package/dist/esm/index.js +109 -0
  46. package/dist/esm/index.js.map +1 -0
  47. package/dist/esm/package.json +4 -0
  48. package/dist/esm/rollup.js +27 -0
  49. package/dist/esm/rollup.js.map +1 -0
  50. package/dist/esm/rspack.js +27 -0
  51. package/dist/esm/rspack.js.map +1 -0
  52. package/dist/esm/transformers/index.js +7 -0
  53. package/dist/esm/transformers/index.js.map +1 -0
  54. package/dist/esm/transformers/sourceTrace.js +50 -0
  55. package/dist/esm/transformers/sourceTrace.js.map +1 -0
  56. package/dist/esm/utils/effectDetection.js +59 -0
  57. package/dist/esm/utils/effectDetection.js.map +1 -0
  58. package/dist/esm/utils/hoisting.js +70 -0
  59. package/dist/esm/utils/hoisting.js.map +1 -0
  60. package/dist/esm/vite.js +27 -0
  61. package/dist/esm/vite.js.map +1 -0
  62. package/dist/esm/webpack.js +27 -0
  63. package/dist/esm/webpack.js.map +1 -0
  64. package/esbuild/package.json +6 -0
  65. package/package.json +81 -0
  66. package/rollup/package.json +6 -0
  67. package/rspack/package.json +6 -0
  68. package/src/esbuild.ts +30 -0
  69. package/src/index.ts +218 -0
  70. package/src/rollup.ts +29 -0
  71. package/src/rspack.ts +29 -0
  72. package/src/transformers/index.ts +6 -0
  73. package/src/transformers/sourceTrace.ts +102 -0
  74. package/src/utils/effectDetection.ts +81 -0
  75. package/src/utils/hoisting.ts +132 -0
  76. package/src/vite.ts +29 -0
  77. package/src/webpack.ts +29 -0
  78. package/vite/package.json +6 -0
  79. package/webpack/package.json +6 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Effectful Technologies Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # @effect/unplugin
2
+
3
+ Universal bundler plugin for Effect transformations.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @effect/unplugin
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Vite
14
+
15
+ ```typescript
16
+ // vite.config.ts
17
+ import effectPlugin from "@effect/unplugin/vite"
18
+
19
+ export default {
20
+ plugins: [
21
+ effectPlugin({
22
+ sourceTrace: true
23
+ })
24
+ ]
25
+ }
26
+ ```
27
+
28
+ ### Rollup
29
+
30
+ ```typescript
31
+ // rollup.config.js
32
+ import effectPlugin from "@effect/unplugin/rollup"
33
+
34
+ export default {
35
+ plugins: [
36
+ effectPlugin({
37
+ sourceTrace: true
38
+ })
39
+ ]
40
+ }
41
+ ```
42
+
43
+ ### Webpack
44
+
45
+ ```javascript
46
+ // webpack.config.js
47
+ const effectPlugin = require("@effect/unplugin/webpack").default
48
+
49
+ module.exports = {
50
+ plugins: [
51
+ effectPlugin({
52
+ sourceTrace: true
53
+ })
54
+ ]
55
+ }
56
+ ```
57
+
58
+ ### esbuild
59
+
60
+ ```typescript
61
+ import * as esbuild from "esbuild"
62
+ import effectPlugin from "@effect/unplugin/esbuild"
63
+
64
+ await esbuild.build({
65
+ plugins: [
66
+ effectPlugin({
67
+ sourceTrace: true
68
+ })
69
+ ]
70
+ })
71
+ ```
72
+
73
+ ### Rspack
74
+
75
+ ```javascript
76
+ // rspack.config.js
77
+ const effectPlugin = require("@effect/unplugin/rspack").default
78
+
79
+ module.exports = {
80
+ plugins: [
81
+ effectPlugin({
82
+ sourceTrace: true
83
+ })
84
+ ]
85
+ }
86
+ ```
87
+
88
+ ## Options
89
+
90
+ - `sourceTrace` (boolean, default: `true`) - Enable source trace injection into Effect.gen yields
91
+ - `annotateEffects` (boolean, default: `false`) - Enable @__PURE__ annotations for tree-shaking
92
+ - `include` (string[], default: `["**/*.ts", "**/*.tsx"]`) - Glob patterns to include
93
+ - `exclude` (string[], default: `["**/node_modules/**", "**/*.d.ts"]`) - Glob patterns to exclude
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _index = require("./index.js");
8
+ /**
9
+ * esbuild plugin export for @effect/unplugin.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // build.js
14
+ * import * as esbuild from "esbuild"
15
+ * import effectPlugin from "@effect/unplugin/esbuild"
16
+ *
17
+ * await esbuild.build({
18
+ * plugins: [
19
+ * effectPlugin({
20
+ * sourceTrace: true
21
+ * })
22
+ * ]
23
+ * })
24
+ * ```
25
+ *
26
+ * @since 0.1.0
27
+ */
28
+ /**
29
+ * esbuild plugin for Effect transformations.
30
+ *
31
+ * @since 0.1.0
32
+ */
33
+ var _default = exports.default = _index.unplugin.esbuild;
34
+ //# sourceMappingURL=esbuild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esbuild.js","names":["_index","require","_default","exports","default","unplugin","esbuild"],"sources":["../../src/esbuild.ts"],"sourcesContent":[null],"mappings":";;;;;;AAoBA,IAAAA,MAAA,GAAAC,OAAA;AApBA;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKeC,eAAQ,CAACC,OAAO","ignoreList":[]}
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.unplugin = exports.default = void 0;
7
+ var _generator = _interopRequireDefault(require("@babel/generator"));
8
+ var _parser = require("@babel/parser");
9
+ var _traverse2 = _interopRequireDefault(require("@babel/traverse"));
10
+ var _unplugin = require("unplugin");
11
+ var _sourceTrace = require("./transformers/sourceTrace.js");
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ // Handle both ESM and CJS module exports for Babel packages
14
+ const traverse = typeof _traverse2.default === "function" ? _traverse2.default : _traverse2.default.default;
15
+ const generate = typeof _generator.default === "function" ? _generator.default : _generator.default.default;
16
+ /**
17
+ * Default file patterns to include.
18
+ */
19
+ const DEFAULT_INCLUDE = [/\.[jt]sx?$/];
20
+ /**
21
+ * Default file patterns to exclude.
22
+ */
23
+ const DEFAULT_EXCLUDE = [/node_modules/, /\.d\.ts$/];
24
+ /**
25
+ * Checks if a file should be transformed based on include/exclude patterns.
26
+ */
27
+ function shouldTransform(id, include, exclude) {
28
+ // Check excludes first
29
+ for (const pattern of exclude) {
30
+ if (typeof pattern === "string") {
31
+ if (id.includes(pattern)) return false;
32
+ } else if (pattern.test(id)) {
33
+ return false;
34
+ }
35
+ }
36
+ // Check includes
37
+ for (const pattern of include) {
38
+ if (typeof pattern === "string") {
39
+ if (id.includes(pattern)) return true;
40
+ } else if (pattern.test(id)) {
41
+ return true;
42
+ }
43
+ }
44
+ return false;
45
+ }
46
+ /**
47
+ * Creates the unplugin factory.
48
+ */
49
+ const unpluginFactory = (options = {}) => {
50
+ const {
51
+ annotateEffects: _annotateEffects = false,
52
+ exclude = DEFAULT_EXCLUDE,
53
+ include = DEFAULT_INCLUDE,
54
+ sourceTrace = true
55
+ } = options;
56
+ return {
57
+ name: "@effect/unplugin",
58
+ transformInclude(id) {
59
+ return shouldTransform(id, include, exclude);
60
+ },
61
+ transform(code, id) {
62
+ // Parse the source code
63
+ const ast = (0, _parser.parse)(code, {
64
+ sourceType: "module",
65
+ plugins: ["typescript", "jsx"]
66
+ });
67
+ // Collect visitors
68
+ const visitors = [];
69
+ if (sourceTrace) {
70
+ visitors.push((0, _sourceTrace.createSourceTraceVisitor)(id));
71
+ }
72
+ // Combine visitors
73
+ if (visitors.length === 0) {
74
+ return null;
75
+ }
76
+ // Initialize state for each visitor
77
+ const states = visitors.map(() => ({
78
+ filename: id,
79
+ hoisting: {
80
+ hoistedTraces: new Map(),
81
+ counter: 0,
82
+ statements: []
83
+ }
84
+ }));
85
+ // Run each visitor
86
+ for (let i = 0; i < visitors.length; i++) {
87
+ traverse(ast, visitors[i], undefined, states[i]);
88
+ }
89
+ // Generate output
90
+ const output = generate(ast, {
91
+ sourceMaps: true,
92
+ sourceFileName: id
93
+ }, code);
94
+ return {
95
+ code: output.code,
96
+ map: output.map
97
+ };
98
+ }
99
+ };
100
+ };
101
+ /**
102
+ * The unplugin instance.
103
+ *
104
+ * @since 0.1.0
105
+ */
106
+ const unplugin = exports.unplugin = (0, _unplugin.createUnplugin)(unpluginFactory);
107
+ /**
108
+ * Default export for convenience.
109
+ *
110
+ * @since 0.1.0
111
+ */
112
+ var _default = exports.default = unplugin;
113
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_generator","_interopRequireDefault","require","_parser","_traverse2","_unplugin","_sourceTrace","e","__esModule","default","traverse","_traverse","generate","_generate","DEFAULT_INCLUDE","DEFAULT_EXCLUDE","shouldTransform","id","include","exclude","pattern","includes","test","unpluginFactory","options","annotateEffects","_annotateEffects","sourceTrace","name","transformInclude","transform","code","ast","parse","sourceType","plugins","visitors","push","createSourceTraceVisitor","length","states","map","filename","hoisting","hoistedTraces","Map","counter","statements","i","undefined","output","sourceMaps","sourceFileName","unplugin","exports","createUnplugin","_default"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;AAwBA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAAwE,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAiBxE;AACA,MAAMG,QAAQ,GAAe,OAAOC,kBAAS,KAAK,UAAU,GACxDA,kBAAuB,GACtBA,kBAAgD,CAACF,OAAO;AAE7D,MAAMG,QAAQ,GAAe,OAAOC,kBAAS,KAAK,UAAU,GACxDA,kBAAuB,GACtBA,kBAAgD,CAACJ,OAAO;AA8C7D;;;AAGA,MAAMK,eAAe,GAAG,CAAC,YAAY,CAAC;AAEtC;;;AAGA,MAAMC,eAAe,GAAG,CAAC,cAAc,EAAE,UAAU,CAAC;AAEpD;;;AAGA,SAASC,eAAeA,CACtBC,EAAU,EACVC,OAAuC,EACvCC,OAAuC;EAEvC;EACA,KAAK,MAAMC,OAAO,IAAID,OAAO,EAAE;IAC7B,IAAI,OAAOC,OAAO,KAAK,QAAQ,EAAE;MAC/B,IAAIH,EAAE,CAACI,QAAQ,CAACD,OAAO,CAAC,EAAE,OAAO,KAAK;IACxC,CAAC,MAAM,IAAIA,OAAO,CAACE,IAAI,CAACL,EAAE,CAAC,EAAE;MAC3B,OAAO,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O,EAAE,CAAC;UACVC,UAAU,EAAE;;OAEf,CAAC,CAAC;MAEH;MACA,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGZ,QAAQ,CAACG,MAAM,EAAES,CAAC,EAAE,EAAE;QACxCtC,QAAQ,CAACsB,GAAG,EAAEI,QAAQ,CAACY,CAAC,CAAC,EAAEC,SAAS,EAAET,MAAM,CAACQ,CAAC,CAAC,CAAC;MAClD;MAEA;MACA,MAAME,MAAM,GAAGtC,QAAQ,CAACoB,GAAG,EAAE;QAC3BmB,UAAU,EAAE,IAAI;QAChBC,cAAc,EAAEnC;OACjB,EAAEc,IAAI,CAAC;MAER,OAAO;QACLA,IAAI,EAAEmB,MAAM,CAACnB,IAAI;QACjBU,GAAG,EAAES,MAAM,CAACT;OACb;IACH;GACD;AACH,CAAC;AAED;;;;;AAKO,MAAMY,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAA+D,IAAAE,wBAAc,EAAChC,eAAe,CAAC;AAEnH;;;;;AAAA,IAAAiC,QAAA,GAAAF,OAAA,CAAA7C,OAAA,GAKe4C,QAAQ","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _index = require("./index.js");
8
+ /**
9
+ * Rollup plugin export for @effect/unplugin.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // rollup.config.js
14
+ * import effectPlugin from "@effect/unplugin/rollup"
15
+ *
16
+ * export default {
17
+ * plugins: [
18
+ * effectPlugin({
19
+ * sourceTrace: true
20
+ * })
21
+ * ]
22
+ * }
23
+ * ```
24
+ *
25
+ * @since 0.1.0
26
+ */
27
+ /**
28
+ * Rollup plugin for Effect transformations.
29
+ *
30
+ * @since 0.1.0
31
+ */
32
+ var _default = exports.default = _index.unplugin.rollup;
33
+ //# sourceMappingURL=rollup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollup.js","names":["_index","require","_default","exports","default","unplugin","rollup"],"sources":["../../src/rollup.ts"],"sourcesContent":[null],"mappings":";;;;;;AAmBA,IAAAA,MAAA,GAAAC,OAAA;AAnBA;;;;;;;;;;;;;;;;;;;AAqBA;;;;;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKeC,eAAQ,CAACC,MAAM","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _index = require("./index.js");
8
+ /**
9
+ * Rspack plugin export for @effect/unplugin.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // rspack.config.js
14
+ * const effectPlugin = require("@effect/unplugin/rspack").default
15
+ *
16
+ * module.exports = {
17
+ * plugins: [
18
+ * effectPlugin({
19
+ * sourceTrace: true
20
+ * })
21
+ * ]
22
+ * }
23
+ * ```
24
+ *
25
+ * @since 0.1.0
26
+ */
27
+ /**
28
+ * Rspack plugin for Effect transformations.
29
+ *
30
+ * @since 0.1.0
31
+ */
32
+ var _default = exports.default = _index.unplugin.rspack;
33
+ //# sourceMappingURL=rspack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rspack.js","names":["_index","require","_default","exports","default","unplugin","rspack"],"sources":["../../src/rspack.ts"],"sourcesContent":[null],"mappings":";;;;;;AAmBA,IAAAA,MAAA,GAAAC,OAAA;AAnBA;;;;;;;;;;;;;;;;;;;AAqBA;;;;;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKeC,eAAQ,CAACC,MAAM","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _sourceTrace = require("./sourceTrace.js");
7
+ Object.keys(_sourceTrace).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _sourceTrace[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _sourceTrace[key];
14
+ }
15
+ });
16
+ });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_sourceTrace","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../src/transformers/index.ts"],"sourcesContent":[null],"mappings":";;;;;AAKA,IAAAA,YAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,YAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,YAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,YAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createSourceTraceVisitor = createSourceTraceVisitor;
7
+ exports.sourceTraceTransformer = sourceTraceTransformer;
8
+ var t = _interopRequireWildcard(require("@babel/types"));
9
+ var _effectDetection = require("../utils/effectDetection.js");
10
+ var _hoisting = require("../utils/hoisting.js");
11
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
12
+ /**
13
+ * Creates a Babel visitor that injects source trace metadata into Effect.gen yields.
14
+ */
15
+ function createSourceTraceVisitor(filename, _options) {
16
+ return {
17
+ Program: {
18
+ enter(_path, state) {
19
+ state.filename = filename;
20
+ state.hoisting = (0, _hoisting.createHoistingState)();
21
+ },
22
+ exit(path, state) {
23
+ // Prepend all hoisted statements to the program body
24
+ if (state.hoisting.statements.length > 0) {
25
+ path.unshiftContainer("body", state.hoisting.statements);
26
+ }
27
+ }
28
+ },
29
+ YieldExpression(path, state) {
30
+ const node = path.node;
31
+ // Only transform yield* _(effect) patterns
32
+ if (!(0, _effectDetection.isYieldAdapterCall)(node)) {
33
+ return;
34
+ }
35
+ // Get source location
36
+ const loc = node.loc;
37
+ if (!loc) return;
38
+ // Extract label from parent (e.g., `const user = yield* _(...)`)
39
+ const label = (0, _hoisting.extractLabelFromParent)(path);
40
+ // Get or create hoisted trace identifier
41
+ const traceId = (0, _hoisting.getOrCreateTraceIdentifier)(state.hoisting, state.filename, loc.start.line, loc.start.column, label);
42
+ // Inject trace as second argument: _(effect) -> _(effect, trace)
43
+ const callExpr = node.argument;
44
+ callExpr.arguments.push(t.cloneNode(traceId));
45
+ }
46
+ };
47
+ }
48
+ /**
49
+ * Creates the source trace transformer plugin.
50
+ */
51
+ function sourceTraceTransformer(options) {
52
+ return {
53
+ name: "effect-source-trace",
54
+ visitor: createSourceTraceVisitor("", options)
55
+ };
56
+ }
57
+ //# sourceMappingURL=sourceTrace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourceTrace.js","names":["t","_interopRequireWildcard","require","_effectDetection","_hoisting","e","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","createSourceTraceVisitor","filename","_options","Program","enter","_path","state","hoisting","createHoistingState","exit","path","statements","length","unshiftContainer","YieldExpression","node","isYieldAdapterCall","loc","label","extractLabelFromParent","traceId","getOrCreateTraceIdentifier","start","line","column","callExpr","argument","arguments","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";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isAdapterCall = isAdapterCall;
7
+ exports.isEffectGenCall = isEffectGenCall;
8
+ exports.isInsideEffectGen = isInsideEffectGen;
9
+ exports.isYieldAdapterCall = isYieldAdapterCall;
10
+ /**
11
+ * Checks if a CallExpression is `Effect.gen(...)`.
12
+ */
13
+ function isEffectGenCall(node) {
14
+ if (node.type !== "CallExpression") return false;
15
+ const callee = node.callee;
16
+ // Match Effect.gen(...)
17
+ if (callee.type === "MemberExpression" && callee.object.type === "Identifier" && callee.object.name === "Effect" && callee.property.type === "Identifier" && callee.property.name === "gen") {
18
+ return true;
19
+ }
20
+ // Match _.gen(...) where _ is an alias for Effect
21
+ if (callee.type === "MemberExpression" && callee.property.type === "Identifier" && callee.property.name === "gen") {
22
+ return true;
23
+ }
24
+ return false;
25
+ }
26
+ /**
27
+ * Checks if a node is inside an Effect.gen generator function.
28
+ * This walks up the AST to find if there's an enclosing generator function
29
+ * that is an argument to Effect.gen.
30
+ */
31
+ function isInsideEffectGen(path) {
32
+ let current = path.parentPath;
33
+ while (current) {
34
+ const node = current.parent;
35
+ if (node && isEffectGenCall(node)) {
36
+ return true;
37
+ }
38
+ current = current.parentPath;
39
+ }
40
+ return false;
41
+ }
42
+ /**
43
+ * Checks if a CallExpression is a call to the adapter function `_()`.
44
+ * The adapter is the first argument passed to the generator function.
45
+ */
46
+ function isAdapterCall(node) {
47
+ return node.callee.type === "Identifier" && node.callee.name === "_";
48
+ }
49
+ /**
50
+ * Checks if a YieldExpression is a `yield* _(effect)` pattern.
51
+ */
52
+ function isYieldAdapterCall(node) {
53
+ if (!node.delegate) return false; // Must be yield*, not yield
54
+ if (!node.argument) return false;
55
+ if (node.argument.type !== "CallExpression") return false;
56
+ return isAdapterCall(node.argument);
57
+ }
58
+ //# sourceMappingURL=effectDetection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effectDetection.js","names":["isEffectGenCall","node","type","callee","object","name","property","isInsideEffectGen","path","current","parentPath","parent","isAdapterCall","isYieldAdapterCall","delegate","argument"],"sources":["../../../src/utils/effectDetection.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;AAOA;;;AAGM,SAAUA,eAAeA,CAACC,IAAY;EAC1C,IAAIA,IAAI,CAACC,IAAI,KAAK,gBAAgB,EAAE,OAAO,KAAK;EAEhD,MAAMC,MAAM,GAAGF,IAAI,CAACE,MAAM;EAE1B;EACA,IACEA,MAAM,CAACD,IAAI,KAAK,kBAAkB,IAClCC,MAAM,CAACC,MAAM,CAACF,IAAI,KAAK,YAAY,IACnCC,MAAM,CAACC,MAAM,CAACC,IAAI,KAAK,QAAQ,IAC/BF,MAAM,CAACG,QAAQ,CAACJ,IAAI,KAAK,YAAY,IACrCC,MAAM,CAACG,QAAQ,CAACD,IAAI,KAAK,KAAK,EAC9B;IACA,OAAO,IAAI;EACb;EAEA;EACA,IACEF,MAAM,CAACD,IAAI,KAAK,kBAAkB,IAClCC,MAAM,CAACG,QAAQ,CAACJ,IAAI,KAAK,YAAY,IACrCC,MAAM,CAACG,QAAQ,CAACD,IAAI,KAAK,KAAK,EAC9B;IACA,OAAO,IAAI;EACb;EAEA,OAAO,KAAK;AACd;AAWA;;;;;AAKM,SAAUE,iBAAiBA,CAACC,IAAc;EAC9C,IAAIC,OAAO,GAAGD,IAAI,CAACE,UAAU;EAC7B,OAAOD,OAAO,EAAE;IACd,MAAMR,IAAI,GAAGQ,OAAO,CAACE,MAA4B;IACjD,IAAIV,IAAI,IAAID,eAAe,CAACC,IAAI,CAAC,EAAE;MACjC,OAAO,IAAI;IACb;IACAQ,OAAO,GAAGA,OAAO,CAACC,UAAU;EAC9B;EACA,OAAO,KAAK;AACd;AAEA;;;;AAIM,SAAUE,aAAaA,CAACX,IAAsB;EAClD,OAAOA,IAAI,CAACE,MAAM,CAACD,IAAI,KAAK,YAAY,IAAID,IAAI,CAACE,MAAM,CAACE,IAAI,KAAK,GAAG;AACtE;AAEA;;;AAGM,SAAUQ,kBAAkBA,CAACZ,IAAuB;EACxD,IAAI,CAACA,IAAI,CAACa,QAAQ,EAAE,OAAO,KAAK,EAAC;EACjC,IAAI,CAACb,IAAI,CAACc,QAAQ,EAAE,OAAO,KAAK;EAChC,IAAId,IAAI,CAACc,QAAQ,CAACb,IAAI,KAAK,gBAAgB,EAAE,OAAO,KAAK;EACzD,OAAOU,aAAa,CAACX,IAAI,CAACc,QAAQ,CAAC;AACrC","ignoreList":[]}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createDedupKey = createDedupKey;
7
+ exports.createHoistingState = createHoistingState;
8
+ exports.extractLabelFromParent = extractLabelFromParent;
9
+ exports.getOrCreateTraceIdentifier = getOrCreateTraceIdentifier;
10
+ var t = _interopRequireWildcard(require("@babel/types"));
11
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
12
+ /**
13
+ * Utilities for hoisting trace metadata to module scope.
14
+ *
15
+ * @since 0.1.0
16
+ */
17
+
18
+ /**
19
+ * Creates a new hoisting state.
20
+ */
21
+ function createHoistingState() {
22
+ return {
23
+ hoistedTraces: new Map(),
24
+ counter: 0,
25
+ statements: []
26
+ };
27
+ }
28
+ /**
29
+ * Creates a unique deduplication key for a source location.
30
+ * Uses line:column to disambiguate multiple yields on the same line.
31
+ */
32
+ function createDedupKey(filename, line, column) {
33
+ return `${filename}:${line}:${column}`;
34
+ }
35
+ /**
36
+ * Gets or creates a hoisted trace identifier for the given source location.
37
+ */
38
+ function getOrCreateTraceIdentifier(state, filename, line, column, label) {
39
+ const key = createDedupKey(filename, line, column);
40
+ let identifier = state.hoistedTraces.get(key);
41
+ if (identifier) {
42
+ return identifier;
43
+ }
44
+ // Create new identifier
45
+ identifier = t.identifier(`_trace${state.counter++}`);
46
+ state.hoistedTraces.set(key, identifier);
47
+ // Create the SourceLocation object literal
48
+ const properties = [t.objectProperty(t.identifier("_tag"), t.stringLiteral("SourceLocation")), t.objectProperty(t.identifier("path"), t.stringLiteral(filename)), t.objectProperty(t.identifier("line"), t.numericLiteral(line)), t.objectProperty(t.identifier("column"), t.numericLiteral(column))];
49
+ if (label) {
50
+ properties.push(t.objectProperty(t.identifier("label"), t.stringLiteral(label)));
51
+ }
52
+ // Wrap in Symbol.for call to add the type tag
53
+ const traceObject = t.objectExpression([t.objectProperty(t.callExpression(t.memberExpression(t.identifier("Symbol"), t.identifier("for")), [t.stringLiteral("effect/SourceLocation")]), t.callExpression(t.memberExpression(t.identifier("Symbol"), t.identifier("for")), [t.stringLiteral("effect/SourceLocation")]), true // computed property
54
+ ), ...properties]);
55
+ // Create variable declaration
56
+ const declaration = t.variableDeclaration("const", [t.variableDeclarator(identifier, traceObject)]);
57
+ state.statements.push(declaration);
58
+ return identifier;
59
+ }
60
+ /**
61
+ * Extracts a label from a VariableDeclarator if the yield is part of an assignment.
62
+ * For example: `const user = yield* _(fetchUser(id))` extracts "user"
63
+ */
64
+ function extractLabelFromParent(path) {
65
+ const parent = path.parent;
66
+ if (parent?.type === "VariableDeclarator" && parent.id.type === "Identifier") {
67
+ return parent.id.name;
68
+ }
69
+ return undefined;
70
+ }
71
+ //# sourceMappingURL=hoisting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hoisting.js","names":["t","_interopRequireWildcard","require","e","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","createHoistingState","hoistedTraces","Map","counter","statements","createDedupKey","filename","line","column","getOrCreateTraceIdentifier","state","label","key","identifier","properties","objectProperty","stringLiteral","numericLiteral","push","traceObject","objectExpression","callExpression","memberExpression","declaration","variableDeclaration","variableDeclarator","extractLabelFromParent","path","parent","type","id","name","undefined"],"sources":["../../../src/utils/hoisting.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;AAKA,IAAAA,CAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAiC,SAAAD,wBAAAE,CAAA,EAAAH,CAAA,6BAAAI,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,CAAAE,CAAA,EAAAH,CAAA,SAAAA,CAAA,IAAAG,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,MAAAK,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAT,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAO,CAAA,MAAAF,CAAA,GAAAR,CAAA,GAAAM,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAV,CAAA,UAAAK,CAAA,CAAAM,GAAA,CAAAX,CAAA,GAAAK,CAAA,CAAAO,GAAA,CAAAZ,CAAA,EAAAO,CAAA,gBAAAV,CAAA,IAAAG,CAAA,gBAAAH,CAAA,OAAAgB,cAAA,CAAAC,IAAA,CAAAd,CAAA,EAAAH,CAAA,OAAAS,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAjB,CAAA,EAAAH,CAAA,OAAAS,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAV,CAAA,EAAAS,CAAA,IAAAC,CAAA,CAAAV,CAAA,IAAAG,CAAA,CAAAH,CAAA,WAAAU,CAAA,KAAAP,CAAA,EAAAH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AAI,KAAK,YAAY,EAAE;IAC5E,OAAOD,MAAM,CAACE,EAAE,CAACC,IAAI;EACvB;EACA,OAAOC,SAAS;AAClB","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _index = require("./index.js");
8
+ /**
9
+ * Vite plugin export for @effect/unplugin.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // vite.config.ts
14
+ * import effectPlugin from "@effect/unplugin/vite"
15
+ *
16
+ * export default {
17
+ * plugins: [
18
+ * effectPlugin({
19
+ * sourceTrace: true
20
+ * })
21
+ * ]
22
+ * }
23
+ * ```
24
+ *
25
+ * @since 0.1.0
26
+ */
27
+ /**
28
+ * Vite plugin for Effect transformations.
29
+ *
30
+ * @since 0.1.0
31
+ */
32
+ var _default = exports.default = _index.unplugin.vite;
33
+ //# sourceMappingURL=vite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite.js","names":["_index","require","_default","exports","default","unplugin","vite"],"sources":["../../src/vite.ts"],"sourcesContent":[null],"mappings":";;;;;;AAmBA,IAAAA,MAAA,GAAAC,OAAA;AAnBA;;;;;;;;;;;;;;;;;;;AAqBA;;;;;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKeC,eAAQ,CAACC,IAAI","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _index = require("./index.js");
8
+ /**
9
+ * Webpack plugin export for @effect/unplugin.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // webpack.config.js
14
+ * const effectPlugin = require("@effect/unplugin/webpack").default
15
+ *
16
+ * module.exports = {
17
+ * plugins: [
18
+ * effectPlugin({
19
+ * sourceTrace: true
20
+ * })
21
+ * ]
22
+ * }
23
+ * ```
24
+ *
25
+ * @since 0.1.0
26
+ */
27
+ /**
28
+ * Webpack plugin for Effect transformations.
29
+ *
30
+ * @since 0.1.0
31
+ */
32
+ var _default = exports.default = _index.unplugin.webpack;
33
+ //# sourceMappingURL=webpack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webpack.js","names":["_index","require","_default","exports","default","unplugin","webpack"],"sources":["../../src/webpack.ts"],"sourcesContent":[null],"mappings":";;;;;;AAmBA,IAAAA,MAAA,GAAAC,OAAA;AAnBA;;;;;;;;;;;;;;;;;;;AAqBA;;;;;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKeC,eAAQ,CAACC,OAAO","ignoreList":[]}