@zeus-js/vite-plugin 0.0.2 → 0.1.0-canary.20260603.1.2.6bb05ca5

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vite-plugin v0.0.2
2
+ * vite-plugin v0.1.0-canary.20260603.1.2.6bb05ca5
3
3
  * (c) 2026 baicie
4
4
  * Released under the MIT License.
5
5
  **/
@@ -29,17 +29,27 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  enumerable: true
30
30
  }) : target, mod));
31
31
  //#endregion
32
- let node_module = require("node:module");
33
32
  let node_path = require("node:path");
34
33
  node_path = __toESM(node_path, 1);
35
34
  let _babel_core = require("@babel/core");
36
35
  let _zeus_js_compiler = require("@zeus-js/compiler");
37
36
  _zeus_js_compiler = __toESM(_zeus_js_compiler, 1);
38
- //#region packages/vite-plugin/src/index.ts
39
- function createZeus(options = {}) {
37
+ //#region packages/devtools/vite-plugin/src/index.ts
38
+ function normalizePatterns(value) {
39
+ return Array.isArray(value) ? value : [value];
40
+ }
41
+ function createFilter(options = {}) {
40
42
  var _options$include, _options$exclude;
41
- const include = normalizePatterns((_options$include = options.include) !== null && _options$include !== void 0 ? _options$include : /\.[tj]sx$/);
43
+ const include = normalizePatterns((_options$include = options.include) !== null && _options$include !== void 0 ? _options$include : /\.[tj]sx(?:\?.*)?$/);
42
44
  const exclude = normalizePatterns((_options$exclude = options.exclude) !== null && _options$exclude !== void 0 ? _options$exclude : /node_modules/);
45
+ return function shouldTransform(id) {
46
+ const cleanId = id.replace(/[?#].*$/, "");
47
+ if (exclude.some((pattern) => pattern.test(cleanId))) return false;
48
+ return include.some((pattern) => pattern.test(cleanId));
49
+ };
50
+ }
51
+ function createZeus(options = {}) {
52
+ const shouldTransform = createFilter(options);
43
53
  return {
44
54
  name: "vite-plugin-zeus",
45
55
  enforce: "pre",
@@ -58,16 +68,17 @@ function createZeus(options = {}) {
58
68
  };
59
69
  },
60
70
  async transform(code, id) {
61
- var _options$sourcemap, _options$moduleName, _result$map;
62
- if (!shouldTransform(id, include, exclude)) return null;
71
+ var _options$compiler$mod, _options$compiler;
72
+ if (!shouldTransform(id)) return null;
63
73
  const result = await (0, _babel_core.transformAsync)(code, {
64
74
  filename: id,
65
- sourceMaps: (_options$sourcemap = options.sourcemap) !== null && _options$sourcemap !== void 0 ? _options$sourcemap : true,
75
+ sourceMaps: true,
66
76
  plugins: [[_zeus_js_compiler.default, {
67
- moduleName: (_options$moduleName = options.moduleName) !== null && _options$moduleName !== void 0 ? _options$moduleName : "@zeus-js/runtime-dom",
77
+ moduleName: (_options$compiler$mod = (_options$compiler = options.compiler) === null || _options$compiler === void 0 ? void 0 : _options$compiler.moduleName) !== null && _options$compiler$mod !== void 0 ? _options$compiler$mod : "@zeus-js/runtime-dom",
68
78
  generate: "dom",
69
79
  hydratable: false,
70
- delegateEvents: true
80
+ delegateEvents: true,
81
+ ...options.compiler
71
82
  }]],
72
83
  parserOpts: {
73
84
  sourceType: "module",
@@ -82,18 +93,11 @@ function createZeus(options = {}) {
82
93
  if (!(result === null || result === void 0 ? void 0 : result.code)) return null;
83
94
  return {
84
95
  code: result.code,
85
- map: (_result$map = result.map) !== null && _result$map !== void 0 ? _result$map : null
96
+ map: result.map
86
97
  };
87
98
  }
88
99
  };
89
100
  }
90
- function normalizePatterns(value) {
91
- return Array.isArray(value) ? value : [value];
92
- }
93
- function shouldTransform(id, include, exclude) {
94
- if (exclude.some((pattern) => pattern.test(id))) return false;
95
- return include.some((pattern) => pattern.test(id));
96
- }
97
101
  async function isRolldownVite() {
98
102
  try {
99
103
  const vite = await import("vite");
@@ -104,16 +108,17 @@ async function isRolldownVite() {
104
108
  }
105
109
  function resolveRuntimeDOMEntry(root) {
106
110
  const projectRoot = node_path.default.resolve(process.cwd(), root !== null && root !== void 0 ? root : ".");
107
- const requireFromProject = (0, node_module.createRequire)(node_path.default.join(projectRoot, "package.json"));
108
111
  try {
109
- return requireFromProject.resolve("@zeus-js/runtime-dom/dist/runtime-dom.esm-bundler.js");
112
+ return require.resolve("@zeus-js/runtime-dom/dist/runtime-dom.esm-bundler.js", { paths: [projectRoot] });
110
113
  } catch {}
111
114
  try {
112
- return (0, node_module.createRequire)(requireFromProject.resolve("@zeus-js/zeus")).resolve("@zeus-js/runtime-dom/dist/runtime-dom.esm-bundler.js");
115
+ const zeusEntry = require.resolve("@zeus-js/zeus", { paths: [projectRoot] });
116
+ return require.resolve("@zeus-js/runtime-dom/dist/runtime-dom.esm-bundler.js", { paths: [zeusEntry] });
113
117
  } catch {
114
118
  return;
115
119
  }
116
120
  }
117
121
  //#endregion
122
+ exports.createZeus = createZeus;
118
123
  exports.default = createZeus;
119
124
  exports.zeus = createZeus;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vite-plugin v0.0.2
2
+ * vite-plugin v0.1.0-canary.20260603.1.2.6bb05ca5
3
3
  * (c) 2026 baicie
4
4
  * Released under the MIT License.
5
5
  **/
@@ -29,17 +29,27 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  enumerable: true
30
30
  }) : target, mod));
31
31
  //#endregion
32
- let node_module = require("node:module");
33
32
  let node_path = require("node:path");
34
33
  node_path = __toESM(node_path, 1);
35
34
  let _babel_core = require("@babel/core");
36
35
  let _zeus_js_compiler = require("@zeus-js/compiler");
37
36
  _zeus_js_compiler = __toESM(_zeus_js_compiler, 1);
38
- //#region packages/vite-plugin/src/index.ts
39
- function createZeus(options = {}) {
37
+ //#region packages/devtools/vite-plugin/src/index.ts
38
+ function normalizePatterns(value) {
39
+ return Array.isArray(value) ? value : [value];
40
+ }
41
+ function createFilter(options = {}) {
40
42
  var _options$include, _options$exclude;
41
- const include = normalizePatterns((_options$include = options.include) !== null && _options$include !== void 0 ? _options$include : /\.[tj]sx$/);
43
+ const include = normalizePatterns((_options$include = options.include) !== null && _options$include !== void 0 ? _options$include : /\.[tj]sx(?:\?.*)?$/);
42
44
  const exclude = normalizePatterns((_options$exclude = options.exclude) !== null && _options$exclude !== void 0 ? _options$exclude : /node_modules/);
45
+ return function shouldTransform(id) {
46
+ const cleanId = id.replace(/[?#].*$/, "");
47
+ if (exclude.some((pattern) => pattern.test(cleanId))) return false;
48
+ return include.some((pattern) => pattern.test(cleanId));
49
+ };
50
+ }
51
+ function createZeus(options = {}) {
52
+ const shouldTransform = createFilter(options);
43
53
  return {
44
54
  name: "vite-plugin-zeus",
45
55
  enforce: "pre",
@@ -58,16 +68,17 @@ function createZeus(options = {}) {
58
68
  };
59
69
  },
60
70
  async transform(code, id) {
61
- var _options$sourcemap, _options$moduleName, _result$map;
62
- if (!shouldTransform(id, include, exclude)) return null;
71
+ var _options$compiler$mod, _options$compiler;
72
+ if (!shouldTransform(id)) return null;
63
73
  const result = await (0, _babel_core.transformAsync)(code, {
64
74
  filename: id,
65
- sourceMaps: (_options$sourcemap = options.sourcemap) !== null && _options$sourcemap !== void 0 ? _options$sourcemap : true,
75
+ sourceMaps: true,
66
76
  plugins: [[_zeus_js_compiler.default, {
67
- moduleName: (_options$moduleName = options.moduleName) !== null && _options$moduleName !== void 0 ? _options$moduleName : "@zeus-js/runtime-dom",
77
+ moduleName: (_options$compiler$mod = (_options$compiler = options.compiler) === null || _options$compiler === void 0 ? void 0 : _options$compiler.moduleName) !== null && _options$compiler$mod !== void 0 ? _options$compiler$mod : "@zeus-js/runtime-dom",
68
78
  generate: "dom",
69
79
  hydratable: false,
70
- delegateEvents: true
80
+ delegateEvents: true,
81
+ ...options.compiler
71
82
  }]],
72
83
  parserOpts: {
73
84
  sourceType: "module",
@@ -82,18 +93,11 @@ function createZeus(options = {}) {
82
93
  if (!(result === null || result === void 0 ? void 0 : result.code)) return null;
83
94
  return {
84
95
  code: result.code,
85
- map: (_result$map = result.map) !== null && _result$map !== void 0 ? _result$map : null
96
+ map: result.map
86
97
  };
87
98
  }
88
99
  };
89
100
  }
90
- function normalizePatterns(value) {
91
- return Array.isArray(value) ? value : [value];
92
- }
93
- function shouldTransform(id, include, exclude) {
94
- if (exclude.some((pattern) => pattern.test(id))) return false;
95
- return include.some((pattern) => pattern.test(id));
96
- }
97
101
  async function isRolldownVite() {
98
102
  try {
99
103
  const vite = await import("vite");
@@ -104,16 +108,17 @@ async function isRolldownVite() {
104
108
  }
105
109
  function resolveRuntimeDOMEntry(root) {
106
110
  const projectRoot = node_path.default.resolve(process.cwd(), root !== null && root !== void 0 ? root : ".");
107
- const requireFromProject = (0, node_module.createRequire)(node_path.default.join(projectRoot, "package.json"));
108
111
  try {
109
- return requireFromProject.resolve("@zeus-js/runtime-dom/dist/runtime-dom.esm-bundler.js");
112
+ return require.resolve("@zeus-js/runtime-dom/dist/runtime-dom.esm-bundler.js", { paths: [projectRoot] });
110
113
  } catch {}
111
114
  try {
112
- return (0, node_module.createRequire)(requireFromProject.resolve("@zeus-js/zeus")).resolve("@zeus-js/runtime-dom/dist/runtime-dom.esm-bundler.js");
115
+ const zeusEntry = require.resolve("@zeus-js/zeus", { paths: [projectRoot] });
116
+ return require.resolve("@zeus-js/runtime-dom/dist/runtime-dom.esm-bundler.js", { paths: [zeusEntry] });
113
117
  } catch {
114
118
  return;
115
119
  }
116
120
  }
117
121
  //#endregion
122
+ exports.createZeus = createZeus;
118
123
  exports.default = createZeus;
119
124
  exports.zeus = createZeus;
@@ -1,12 +1,12 @@
1
- import type { Plugin } from 'vite';
1
+ import { CompilerOptions } from '@zeus-js/compiler';
2
+ import { Plugin } from 'vite';
3
+
2
4
  export interface ZeusVitePluginOptions {
3
5
  include?: RegExp | RegExp[];
4
6
  exclude?: RegExp | RegExp[];
5
- moduleName?: string;
6
- dev?: boolean;
7
- sourcemap?: boolean;
7
+ compiler?: Partial<CompilerOptions>;
8
+ diagnostics?: boolean;
8
9
  }
9
10
  export declare function createZeus(options?: ZeusVitePluginOptions): Plugin;
10
11
 
11
12
  export { createZeus as default, createZeus as zeus };
12
-
@@ -1,12 +1,17 @@
1
1
  /**
2
- * vite-plugin v0.0.2
2
+ * vite-plugin v0.1.0-canary.20260603.1.2.6bb05ca5
3
3
  * (c) 2026 baicie
4
4
  * Released under the MIT License.
5
5
  **/
6
- import { createRequire } from "node:module";
7
6
  import path from "node:path";
8
7
  import { transformAsync } from "@babel/core";
9
8
  import zeusCompiler from "@zeus-js/compiler";
9
+ //#region \0rolldown/runtime.js
10
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
11
+ if (typeof require !== "undefined") return require.apply(this, arguments);
12
+ throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
13
+ });
14
+ //#endregion
10
15
  //#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
11
16
  function _typeof(o) {
12
17
  "@babel/helpers - typeof";
@@ -94,11 +99,22 @@ function _asyncToGenerator(n) {
94
99
  };
95
100
  }
96
101
  //#endregion
97
- //#region packages/vite-plugin/src/index.ts
98
- function createZeus(options = {}) {
102
+ //#region packages/devtools/vite-plugin/src/index.ts
103
+ function normalizePatterns(value) {
104
+ return Array.isArray(value) ? value : [value];
105
+ }
106
+ function createFilter(options = {}) {
99
107
  var _options$include, _options$exclude;
100
- const include = normalizePatterns((_options$include = options.include) !== null && _options$include !== void 0 ? _options$include : /\.[tj]sx$/);
108
+ const include = normalizePatterns((_options$include = options.include) !== null && _options$include !== void 0 ? _options$include : /\.[tj]sx(?:\?.*)?$/);
101
109
  const exclude = normalizePatterns((_options$exclude = options.exclude) !== null && _options$exclude !== void 0 ? _options$exclude : /node_modules/);
110
+ return function shouldTransform(id) {
111
+ const cleanId = id.replace(/[?#].*$/, "");
112
+ if (exclude.some((pattern) => pattern.test(cleanId))) return false;
113
+ return include.some((pattern) => pattern.test(cleanId));
114
+ };
115
+ }
116
+ function createZeus(options = {}) {
117
+ const shouldTransform = createFilter(options);
102
118
  return {
103
119
  name: "vite-plugin-zeus",
104
120
  enforce: "pre",
@@ -117,17 +133,17 @@ function createZeus(options = {}) {
117
133
  },
118
134
  transform(code, id) {
119
135
  return _asyncToGenerator(function* () {
120
- var _options$sourcemap, _options$moduleName, _result$map;
121
- if (!shouldTransform(id, include, exclude)) return null;
136
+ var _options$compiler$mod, _options$compiler;
137
+ if (!shouldTransform(id)) return null;
122
138
  const result = yield transformAsync(code, {
123
139
  filename: id,
124
- sourceMaps: (_options$sourcemap = options.sourcemap) !== null && _options$sourcemap !== void 0 ? _options$sourcemap : true,
125
- plugins: [[zeusCompiler, {
126
- moduleName: (_options$moduleName = options.moduleName) !== null && _options$moduleName !== void 0 ? _options$moduleName : "@zeus-js/runtime-dom",
140
+ sourceMaps: true,
141
+ plugins: [[zeusCompiler, _objectSpread2({
142
+ moduleName: (_options$compiler$mod = (_options$compiler = options.compiler) === null || _options$compiler === void 0 ? void 0 : _options$compiler.moduleName) !== null && _options$compiler$mod !== void 0 ? _options$compiler$mod : "@zeus-js/runtime-dom",
127
143
  generate: "dom",
128
144
  hydratable: false,
129
145
  delegateEvents: true
130
- }]],
146
+ }, options.compiler)]],
131
147
  parserOpts: {
132
148
  sourceType: "module",
133
149
  plugins: ["typescript", "jsx"]
@@ -141,19 +157,12 @@ function createZeus(options = {}) {
141
157
  if (!(result === null || result === void 0 ? void 0 : result.code)) return null;
142
158
  return {
143
159
  code: result.code,
144
- map: (_result$map = result.map) !== null && _result$map !== void 0 ? _result$map : null
160
+ map: result.map
145
161
  };
146
162
  })();
147
163
  }
148
164
  };
149
165
  }
150
- function normalizePatterns(value) {
151
- return Array.isArray(value) ? value : [value];
152
- }
153
- function shouldTransform(id, include, exclude) {
154
- if (exclude.some((pattern) => pattern.test(id))) return false;
155
- return include.some((pattern) => pattern.test(id));
156
- }
157
166
  function isRolldownVite() {
158
167
  return _isRolldownVite.apply(this, arguments);
159
168
  }
@@ -170,15 +179,15 @@ function _isRolldownVite() {
170
179
  }
171
180
  function resolveRuntimeDOMEntry(root) {
172
181
  const projectRoot = path.resolve(process.cwd(), root !== null && root !== void 0 ? root : ".");
173
- const requireFromProject = createRequire(path.join(projectRoot, "package.json"));
174
182
  try {
175
- return requireFromProject.resolve("@zeus-js/runtime-dom/dist/runtime-dom.esm-bundler.js");
183
+ return __require.resolve("@zeus-js/runtime-dom/dist/runtime-dom.esm-bundler.js", { paths: [projectRoot] });
176
184
  } catch (_unused2) {}
177
185
  try {
178
- return createRequire(requireFromProject.resolve("@zeus-js/zeus")).resolve("@zeus-js/runtime-dom/dist/runtime-dom.esm-bundler.js");
186
+ const zeusEntry = __require.resolve("@zeus-js/zeus", { paths: [projectRoot] });
187
+ return __require.resolve("@zeus-js/runtime-dom/dist/runtime-dom.esm-bundler.js", { paths: [zeusEntry] });
179
188
  } catch (_unused3) {
180
189
  return;
181
190
  }
182
191
  }
183
192
  //#endregion
184
- export { createZeus as default, createZeus as zeus };
193
+ export { createZeus, createZeus as default, createZeus as zeus };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeus-js/vite-plugin",
3
- "version": "0.0.2",
3
+ "version": "0.1.0-canary.20260603.1.2.6bb05ca5",
4
4
  "type": "module",
5
5
  "description": "Vite plugin for Zeus",
6
6
  "main": "index.cjs",
@@ -24,8 +24,8 @@
24
24
  "sideEffects": false,
25
25
  "repository": {
26
26
  "type": "git",
27
- "url": "git+https://github.com/baicie/zeus.git",
28
- "directory": "packages/vite-plugin"
27
+ "url": "https://github.com/baicie/zeus",
28
+ "directory": "packages/devtools/vite-plugin"
29
29
  },
30
30
  "buildOptions": {
31
31
  "name": "ZeusVitePlugin",
@@ -44,10 +44,10 @@
44
44
  "bugs": {
45
45
  "url": "https://github.com/baicie/zeus/issues"
46
46
  },
47
- "homepage": "https://github.com/baicie/zeus/tree/main/packages/vite-plugin#readme",
47
+ "homepage": "https://github.com/baicie/zeus/tree/main/packages/devtools/vite-plugin#readme",
48
48
  "dependencies": {
49
49
  "@babel/core": "^7.29.0",
50
- "@zeus-js/compiler": "0.0.2"
50
+ "@zeus-js/compiler": "0.1.0-canary.20260603.1.2.6bb05ca5"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "vite": "^8.0.5"