@zeus-js/bundler-plugin 0.1.1-beta.0 → 0.1.1-beta.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.
- package/dist/bundler-plugin.cjs +74 -34
- package/dist/bundler-plugin.d.ts +7 -3
- package/dist/bundler-plugin.esm-bundler.js +73 -31
- package/dist/bundler-plugin.prod.cjs +74 -34
- package/dist/outputPlugins/manifest.cjs +1 -1
- package/dist/outputPlugins/manifest.js +1 -1
- package/dist/outputPlugins/manifest.prod.cjs +1 -1
- package/dist/outputPlugins/manifest.prod.js +1 -1
- package/dist/rolldown.cjs +75 -34
- package/dist/rolldown.d.ts +7 -3
- package/dist/rolldown.js +74 -31
- package/dist/rolldown.prod.cjs +75 -34
- package/dist/rolldown.prod.js +74 -31
- package/dist/rollup.cjs +75 -34
- package/dist/rollup.d.ts +7 -3
- package/dist/rollup.js +74 -31
- package/dist/rollup.prod.cjs +75 -34
- package/dist/rollup.prod.js +74 -31
- package/dist/vite.cjs +74 -34
- package/dist/vite.d.ts +7 -3
- package/dist/vite.js +73 -31
- package/dist/vite.prod.cjs +74 -34
- package/dist/vite.prod.js +73 -31
- package/package.json +7 -6
package/dist/vite.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* bundler-plugin v0.1.1-beta.
|
|
2
|
+
* bundler-plugin v0.1.1-beta.2
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -11,9 +11,9 @@ import { analyzeComponentsWithDependencies } from "@zeus-js/component-analyzer";
|
|
|
11
11
|
import picomatch from "picomatch";
|
|
12
12
|
import fs$1 from "node:fs/promises";
|
|
13
13
|
import fg from "fast-glob";
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import
|
|
14
|
+
import { GenMapping, addSegment, setSourceContent, toEncodedMap } from "@jridgewell/gen-mapping";
|
|
15
|
+
import { TraceMap, decodedMappings, originalPositionFor, sourceContentFor } from "@jridgewell/trace-mapping";
|
|
16
|
+
import ts from "typescript";
|
|
17
17
|
//#region packages/web-c/bundler-plugin/src/filter.ts
|
|
18
18
|
function cleanUrl(id) {
|
|
19
19
|
return id.replace(/[?#].*$/, "");
|
|
@@ -361,6 +361,7 @@ function normalizeTagName(tag, stripPrefix) {
|
|
|
361
361
|
if (stripPrefix && tag.startsWith(stripPrefix)) return tag.slice(stripPrefix.length);
|
|
362
362
|
return tag;
|
|
363
363
|
}
|
|
364
|
+
const { transformModule } = createRequire(import.meta.url)("@zeus-js/compiler-native");
|
|
364
365
|
//#endregion
|
|
365
366
|
//#region packages/web-c/bundler-plugin/src/transform.ts
|
|
366
367
|
function transformZeus(_x) {
|
|
@@ -374,40 +375,81 @@ function _transformZeus() {
|
|
|
374
375
|
const shouldRunCompiler = compiler !== false;
|
|
375
376
|
const shouldStripTs = transpile && isTs;
|
|
376
377
|
if (!shouldRunCompiler && !shouldStripTs) return null;
|
|
377
|
-
const compilerOptions = compiler === false ? {} : compiler
|
|
378
|
-
|
|
378
|
+
const compilerOptions = compiler === false ? {} : compiler !== null && compiler !== void 0 ? compiler : {};
|
|
379
|
+
let transformedCode = code;
|
|
380
|
+
let map = null;
|
|
379
381
|
if (shouldRunCompiler) {
|
|
380
|
-
var _compilerOptions$modu;
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
382
|
+
var _compilerOptions$modu, _compilerOptions$dele;
|
|
383
|
+
const result = transformModule({
|
|
384
|
+
source: code,
|
|
385
|
+
filename,
|
|
386
|
+
target: "dom",
|
|
387
|
+
runtimeModule: (_compilerOptions$modu = compilerOptions.moduleName) !== null && _compilerOptions$modu !== void 0 ? _compilerOptions$modu : "@zeus-js/runtime-dom",
|
|
388
|
+
delegateEvents: (_compilerOptions$dele = compilerOptions.delegateEvents) !== null && _compilerOptions$dele !== void 0 ? _compilerOptions$dele : true,
|
|
389
|
+
sourceMap: sourcemap
|
|
390
|
+
});
|
|
391
|
+
const diagnostic = result.diagnostics.find((entry) => entry.severity === "error");
|
|
392
|
+
if (diagnostic) throw createCompilerError(diagnostic);
|
|
393
|
+
transformedCode = result.code;
|
|
394
|
+
map = result.map;
|
|
395
|
+
}
|
|
396
|
+
if (shouldStripTs) {
|
|
397
|
+
const result = ts.transpileModule(transformedCode, {
|
|
398
|
+
fileName: filename,
|
|
399
|
+
compilerOptions: {
|
|
400
|
+
module: ts.ModuleKind.Preserve,
|
|
401
|
+
target: ts.ScriptTarget.ES2016,
|
|
402
|
+
jsx: ts.JsxEmit.Preserve,
|
|
403
|
+
sourceMap: sourcemap
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
transformedCode = result.outputText.replace(/\n?\/\/# sourceMappingURL=.*$/u, "");
|
|
407
|
+
const transpileMap = result.sourceMapText ? JSON.parse(result.sourceMapText) : null;
|
|
408
|
+
map = transpileMap ? map ? composeSourceMaps(transpileMap, map) : transpileMap : map;
|
|
387
409
|
}
|
|
388
|
-
if (shouldStripTs) plugins.push([transformTypeScript, {}]);
|
|
389
|
-
const result = yield transformAsync(code, {
|
|
390
|
-
filename,
|
|
391
|
-
sourceMaps: sourcemap,
|
|
392
|
-
plugins,
|
|
393
|
-
parserOpts: {
|
|
394
|
-
sourceType: "module",
|
|
395
|
-
plugins: ["typescript", "jsx"]
|
|
396
|
-
},
|
|
397
|
-
generatorOpts: {
|
|
398
|
-
retainLines: false,
|
|
399
|
-
compact: false,
|
|
400
|
-
jsescOption: { minimal: true }
|
|
401
|
-
}
|
|
402
|
-
});
|
|
403
|
-
if (!(result === null || result === void 0 ? void 0 : result.code)) return null;
|
|
404
410
|
return {
|
|
405
|
-
code:
|
|
406
|
-
map
|
|
411
|
+
code: transformedCode,
|
|
412
|
+
map
|
|
407
413
|
};
|
|
408
414
|
});
|
|
409
415
|
return _transformZeus.apply(this, arguments);
|
|
410
416
|
}
|
|
417
|
+
function composeSourceMaps(outer, inner) {
|
|
418
|
+
const outerMap = new TraceMap(outer);
|
|
419
|
+
const innerMap = new TraceMap(inner);
|
|
420
|
+
const generated = new GenMapping({ file: outerMap.file });
|
|
421
|
+
for (const [line, segments] of decodedMappings(outerMap).entries()) for (const segment of segments) {
|
|
422
|
+
if (segment.length < 4) continue;
|
|
423
|
+
const originalLine = segment[2];
|
|
424
|
+
const originalColumn = segment[3];
|
|
425
|
+
if (originalLine == null || originalColumn == null) continue;
|
|
426
|
+
const original = originalPositionFor(innerMap, {
|
|
427
|
+
line: originalLine + 1,
|
|
428
|
+
column: originalColumn
|
|
429
|
+
});
|
|
430
|
+
if (original.source == null || original.line == null || original.column == null) continue;
|
|
431
|
+
addSegment(generated, line, segment[0], original.source, original.line - 1, original.column);
|
|
432
|
+
}
|
|
433
|
+
for (const source of innerMap.sources) {
|
|
434
|
+
if (source == null) continue;
|
|
435
|
+
setSourceContent(generated, source, sourceContentFor(innerMap, source));
|
|
436
|
+
}
|
|
437
|
+
return toEncodedMap(generated);
|
|
438
|
+
}
|
|
439
|
+
function createCompilerError(diagnostic) {
|
|
440
|
+
const error = /* @__PURE__ */ new Error(`${diagnostic.code}: ${diagnostic.message}`);
|
|
441
|
+
error.name = "ZeusCompilerDiagnostic";
|
|
442
|
+
Object.assign(error, {
|
|
443
|
+
code: diagnostic.code,
|
|
444
|
+
filename: diagnostic.filename,
|
|
445
|
+
loc: diagnostic.span ? {
|
|
446
|
+
line: diagnostic.span.start.line,
|
|
447
|
+
column: diagnostic.span.start.column
|
|
448
|
+
} : void 0,
|
|
449
|
+
diagnostic
|
|
450
|
+
});
|
|
451
|
+
return error;
|
|
452
|
+
}
|
|
411
453
|
//#endregion
|
|
412
454
|
//#region packages/web-c/bundler-plugin/src/virtual.ts
|
|
413
455
|
const RESOLVED_VIRTUAL_PREFIX = "\0";
|
package/dist/vite.prod.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* bundler-plugin v0.1.1-beta.
|
|
2
|
+
* bundler-plugin v0.1.1-beta.2
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -42,11 +42,10 @@ let node_fs_promises = require("node:fs/promises");
|
|
|
42
42
|
node_fs_promises = __toESM(node_fs_promises, 1);
|
|
43
43
|
let fast_glob = require("fast-glob");
|
|
44
44
|
fast_glob = __toESM(fast_glob, 1);
|
|
45
|
-
let
|
|
46
|
-
let
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
_zeus_js_compiler = __toESM(_zeus_js_compiler, 1);
|
|
45
|
+
let _jridgewell_gen_mapping = require("@jridgewell/gen-mapping");
|
|
46
|
+
let _jridgewell_trace_mapping = require("@jridgewell/trace-mapping");
|
|
47
|
+
let typescript = require("typescript");
|
|
48
|
+
typescript = __toESM(typescript, 1);
|
|
50
49
|
//#region packages/web-c/bundler-plugin/src/filter.ts
|
|
51
50
|
function cleanUrl(id) {
|
|
52
51
|
return id.replace(/[?#].*$/, "");
|
|
@@ -276,6 +275,7 @@ function normalizeTagName(tag, stripPrefix) {
|
|
|
276
275
|
if (stripPrefix && tag.startsWith(stripPrefix)) return tag.slice(stripPrefix.length);
|
|
277
276
|
return tag;
|
|
278
277
|
}
|
|
278
|
+
const { transformModule } = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href)("@zeus-js/compiler-native");
|
|
279
279
|
//#endregion
|
|
280
280
|
//#region packages/web-c/bundler-plugin/src/transform.ts
|
|
281
281
|
async function transformZeus(options) {
|
|
@@ -285,39 +285,79 @@ async function transformZeus(options) {
|
|
|
285
285
|
const shouldRunCompiler = compiler !== false;
|
|
286
286
|
const shouldStripTs = transpile && isTs;
|
|
287
287
|
if (!shouldRunCompiler && !shouldStripTs) return null;
|
|
288
|
-
const compilerOptions = compiler === false ? {} : compiler
|
|
289
|
-
|
|
288
|
+
const compilerOptions = compiler === false ? {} : compiler !== null && compiler !== void 0 ? compiler : {};
|
|
289
|
+
let transformedCode = code;
|
|
290
|
+
let map = null;
|
|
290
291
|
if (shouldRunCompiler) {
|
|
291
|
-
var _compilerOptions$modu;
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
292
|
+
var _compilerOptions$modu, _compilerOptions$dele;
|
|
293
|
+
const result = transformModule({
|
|
294
|
+
source: code,
|
|
295
|
+
filename,
|
|
296
|
+
target: "dom",
|
|
297
|
+
runtimeModule: (_compilerOptions$modu = compilerOptions.moduleName) !== null && _compilerOptions$modu !== void 0 ? _compilerOptions$modu : "@zeus-js/runtime-dom",
|
|
298
|
+
delegateEvents: (_compilerOptions$dele = compilerOptions.delegateEvents) !== null && _compilerOptions$dele !== void 0 ? _compilerOptions$dele : true,
|
|
299
|
+
sourceMap: sourcemap
|
|
300
|
+
});
|
|
301
|
+
const diagnostic = result.diagnostics.find((entry) => entry.severity === "error");
|
|
302
|
+
if (diagnostic) throw createCompilerError(diagnostic);
|
|
303
|
+
transformedCode = result.code;
|
|
304
|
+
map = result.map;
|
|
305
|
+
}
|
|
306
|
+
if (shouldStripTs) {
|
|
307
|
+
const result = typescript.default.transpileModule(transformedCode, {
|
|
308
|
+
fileName: filename,
|
|
309
|
+
compilerOptions: {
|
|
310
|
+
module: typescript.default.ModuleKind.Preserve,
|
|
311
|
+
target: typescript.default.ScriptTarget.ES2016,
|
|
312
|
+
jsx: typescript.default.JsxEmit.Preserve,
|
|
313
|
+
sourceMap: sourcemap
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
transformedCode = result.outputText.replace(/\n?\/\/# sourceMappingURL=.*$/u, "");
|
|
317
|
+
const transpileMap = result.sourceMapText ? JSON.parse(result.sourceMapText) : null;
|
|
318
|
+
map = transpileMap ? map ? composeSourceMaps(transpileMap, map) : transpileMap : map;
|
|
299
319
|
}
|
|
300
|
-
if (shouldStripTs) plugins.push([_babel_plugin_transform_typescript.default, {}]);
|
|
301
|
-
const result = await (0, _babel_core.transformAsync)(code, {
|
|
302
|
-
filename,
|
|
303
|
-
sourceMaps: sourcemap,
|
|
304
|
-
plugins,
|
|
305
|
-
parserOpts: {
|
|
306
|
-
sourceType: "module",
|
|
307
|
-
plugins: ["typescript", "jsx"]
|
|
308
|
-
},
|
|
309
|
-
generatorOpts: {
|
|
310
|
-
retainLines: false,
|
|
311
|
-
compact: false,
|
|
312
|
-
jsescOption: { minimal: true }
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
if (!(result === null || result === void 0 ? void 0 : result.code)) return null;
|
|
316
320
|
return {
|
|
317
|
-
code:
|
|
318
|
-
map
|
|
321
|
+
code: transformedCode,
|
|
322
|
+
map
|
|
319
323
|
};
|
|
320
324
|
}
|
|
325
|
+
function composeSourceMaps(outer, inner) {
|
|
326
|
+
const outerMap = new _jridgewell_trace_mapping.TraceMap(outer);
|
|
327
|
+
const innerMap = new _jridgewell_trace_mapping.TraceMap(inner);
|
|
328
|
+
const generated = new _jridgewell_gen_mapping.GenMapping({ file: outerMap.file });
|
|
329
|
+
for (const [line, segments] of (0, _jridgewell_trace_mapping.decodedMappings)(outerMap).entries()) for (const segment of segments) {
|
|
330
|
+
if (segment.length < 4) continue;
|
|
331
|
+
const originalLine = segment[2];
|
|
332
|
+
const originalColumn = segment[3];
|
|
333
|
+
if (originalLine == null || originalColumn == null) continue;
|
|
334
|
+
const original = (0, _jridgewell_trace_mapping.originalPositionFor)(innerMap, {
|
|
335
|
+
line: originalLine + 1,
|
|
336
|
+
column: originalColumn
|
|
337
|
+
});
|
|
338
|
+
if (original.source == null || original.line == null || original.column == null) continue;
|
|
339
|
+
(0, _jridgewell_gen_mapping.addSegment)(generated, line, segment[0], original.source, original.line - 1, original.column);
|
|
340
|
+
}
|
|
341
|
+
for (const source of innerMap.sources) {
|
|
342
|
+
if (source == null) continue;
|
|
343
|
+
(0, _jridgewell_gen_mapping.setSourceContent)(generated, source, (0, _jridgewell_trace_mapping.sourceContentFor)(innerMap, source));
|
|
344
|
+
}
|
|
345
|
+
return (0, _jridgewell_gen_mapping.toEncodedMap)(generated);
|
|
346
|
+
}
|
|
347
|
+
function createCompilerError(diagnostic) {
|
|
348
|
+
const error = /* @__PURE__ */ new Error(`${diagnostic.code}: ${diagnostic.message}`);
|
|
349
|
+
error.name = "ZeusCompilerDiagnostic";
|
|
350
|
+
Object.assign(error, {
|
|
351
|
+
code: diagnostic.code,
|
|
352
|
+
filename: diagnostic.filename,
|
|
353
|
+
loc: diagnostic.span ? {
|
|
354
|
+
line: diagnostic.span.start.line,
|
|
355
|
+
column: diagnostic.span.start.column
|
|
356
|
+
} : void 0,
|
|
357
|
+
diagnostic
|
|
358
|
+
});
|
|
359
|
+
return error;
|
|
360
|
+
}
|
|
321
361
|
//#endregion
|
|
322
362
|
//#region packages/web-c/bundler-plugin/src/virtual.ts
|
|
323
363
|
const RESOLVED_VIRTUAL_PREFIX = "\0";
|
package/dist/vite.prod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* bundler-plugin v0.1.1-beta.
|
|
2
|
+
* bundler-plugin v0.1.1-beta.2
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -11,9 +11,9 @@ import { analyzeComponentsWithDependencies } from "@zeus-js/component-analyzer";
|
|
|
11
11
|
import picomatch from "picomatch";
|
|
12
12
|
import fs$1 from "node:fs/promises";
|
|
13
13
|
import fg from "fast-glob";
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import
|
|
14
|
+
import { GenMapping, addSegment, setSourceContent, toEncodedMap } from "@jridgewell/gen-mapping";
|
|
15
|
+
import { TraceMap, decodedMappings, originalPositionFor, sourceContentFor } from "@jridgewell/trace-mapping";
|
|
16
|
+
import ts from "typescript";
|
|
17
17
|
//#region packages/web-c/bundler-plugin/src/filter.ts
|
|
18
18
|
function cleanUrl(id) {
|
|
19
19
|
return id.replace(/[?#].*$/, "");
|
|
@@ -361,6 +361,7 @@ function normalizeTagName(tag, stripPrefix) {
|
|
|
361
361
|
if (stripPrefix && tag.startsWith(stripPrefix)) return tag.slice(stripPrefix.length);
|
|
362
362
|
return tag;
|
|
363
363
|
}
|
|
364
|
+
const { transformModule } = createRequire(import.meta.url)("@zeus-js/compiler-native");
|
|
364
365
|
//#endregion
|
|
365
366
|
//#region packages/web-c/bundler-plugin/src/transform.ts
|
|
366
367
|
function transformZeus(_x) {
|
|
@@ -374,40 +375,81 @@ function _transformZeus() {
|
|
|
374
375
|
const shouldRunCompiler = compiler !== false;
|
|
375
376
|
const shouldStripTs = transpile && isTs;
|
|
376
377
|
if (!shouldRunCompiler && !shouldStripTs) return null;
|
|
377
|
-
const compilerOptions = compiler === false ? {} : compiler
|
|
378
|
-
|
|
378
|
+
const compilerOptions = compiler === false ? {} : compiler !== null && compiler !== void 0 ? compiler : {};
|
|
379
|
+
let transformedCode = code;
|
|
380
|
+
let map = null;
|
|
379
381
|
if (shouldRunCompiler) {
|
|
380
|
-
var _compilerOptions$modu;
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
382
|
+
var _compilerOptions$modu, _compilerOptions$dele;
|
|
383
|
+
const result = transformModule({
|
|
384
|
+
source: code,
|
|
385
|
+
filename,
|
|
386
|
+
target: "dom",
|
|
387
|
+
runtimeModule: (_compilerOptions$modu = compilerOptions.moduleName) !== null && _compilerOptions$modu !== void 0 ? _compilerOptions$modu : "@zeus-js/runtime-dom",
|
|
388
|
+
delegateEvents: (_compilerOptions$dele = compilerOptions.delegateEvents) !== null && _compilerOptions$dele !== void 0 ? _compilerOptions$dele : true,
|
|
389
|
+
sourceMap: sourcemap
|
|
390
|
+
});
|
|
391
|
+
const diagnostic = result.diagnostics.find((entry) => entry.severity === "error");
|
|
392
|
+
if (diagnostic) throw createCompilerError(diagnostic);
|
|
393
|
+
transformedCode = result.code;
|
|
394
|
+
map = result.map;
|
|
395
|
+
}
|
|
396
|
+
if (shouldStripTs) {
|
|
397
|
+
const result = ts.transpileModule(transformedCode, {
|
|
398
|
+
fileName: filename,
|
|
399
|
+
compilerOptions: {
|
|
400
|
+
module: ts.ModuleKind.Preserve,
|
|
401
|
+
target: ts.ScriptTarget.ES2016,
|
|
402
|
+
jsx: ts.JsxEmit.Preserve,
|
|
403
|
+
sourceMap: sourcemap
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
transformedCode = result.outputText.replace(/\n?\/\/# sourceMappingURL=.*$/u, "");
|
|
407
|
+
const transpileMap = result.sourceMapText ? JSON.parse(result.sourceMapText) : null;
|
|
408
|
+
map = transpileMap ? map ? composeSourceMaps(transpileMap, map) : transpileMap : map;
|
|
387
409
|
}
|
|
388
|
-
if (shouldStripTs) plugins.push([transformTypeScript, {}]);
|
|
389
|
-
const result = yield transformAsync(code, {
|
|
390
|
-
filename,
|
|
391
|
-
sourceMaps: sourcemap,
|
|
392
|
-
plugins,
|
|
393
|
-
parserOpts: {
|
|
394
|
-
sourceType: "module",
|
|
395
|
-
plugins: ["typescript", "jsx"]
|
|
396
|
-
},
|
|
397
|
-
generatorOpts: {
|
|
398
|
-
retainLines: false,
|
|
399
|
-
compact: false,
|
|
400
|
-
jsescOption: { minimal: true }
|
|
401
|
-
}
|
|
402
|
-
});
|
|
403
|
-
if (!(result === null || result === void 0 ? void 0 : result.code)) return null;
|
|
404
410
|
return {
|
|
405
|
-
code:
|
|
406
|
-
map
|
|
411
|
+
code: transformedCode,
|
|
412
|
+
map
|
|
407
413
|
};
|
|
408
414
|
});
|
|
409
415
|
return _transformZeus.apply(this, arguments);
|
|
410
416
|
}
|
|
417
|
+
function composeSourceMaps(outer, inner) {
|
|
418
|
+
const outerMap = new TraceMap(outer);
|
|
419
|
+
const innerMap = new TraceMap(inner);
|
|
420
|
+
const generated = new GenMapping({ file: outerMap.file });
|
|
421
|
+
for (const [line, segments] of decodedMappings(outerMap).entries()) for (const segment of segments) {
|
|
422
|
+
if (segment.length < 4) continue;
|
|
423
|
+
const originalLine = segment[2];
|
|
424
|
+
const originalColumn = segment[3];
|
|
425
|
+
if (originalLine == null || originalColumn == null) continue;
|
|
426
|
+
const original = originalPositionFor(innerMap, {
|
|
427
|
+
line: originalLine + 1,
|
|
428
|
+
column: originalColumn
|
|
429
|
+
});
|
|
430
|
+
if (original.source == null || original.line == null || original.column == null) continue;
|
|
431
|
+
addSegment(generated, line, segment[0], original.source, original.line - 1, original.column);
|
|
432
|
+
}
|
|
433
|
+
for (const source of innerMap.sources) {
|
|
434
|
+
if (source == null) continue;
|
|
435
|
+
setSourceContent(generated, source, sourceContentFor(innerMap, source));
|
|
436
|
+
}
|
|
437
|
+
return toEncodedMap(generated);
|
|
438
|
+
}
|
|
439
|
+
function createCompilerError(diagnostic) {
|
|
440
|
+
const error = /* @__PURE__ */ new Error(`${diagnostic.code}: ${diagnostic.message}`);
|
|
441
|
+
error.name = "ZeusCompilerDiagnostic";
|
|
442
|
+
Object.assign(error, {
|
|
443
|
+
code: diagnostic.code,
|
|
444
|
+
filename: diagnostic.filename,
|
|
445
|
+
loc: diagnostic.span ? {
|
|
446
|
+
line: diagnostic.span.start.line,
|
|
447
|
+
column: diagnostic.span.start.column
|
|
448
|
+
} : void 0,
|
|
449
|
+
diagnostic
|
|
450
|
+
});
|
|
451
|
+
return error;
|
|
452
|
+
}
|
|
411
453
|
//#endregion
|
|
412
454
|
//#region packages/web-c/bundler-plugin/src/virtual.ts
|
|
413
455
|
const RESOLVED_VIRTUAL_PREFIX = "\0";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeus-js/bundler-plugin",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.1-beta.
|
|
4
|
+
"version": "0.1.1-beta.2",
|
|
5
5
|
"description": "Zeus bundler plugin host",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"dist"
|
|
48
48
|
],
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"rollup": "^4.0.0",
|
|
51
50
|
"rolldown": "^1.0.0",
|
|
51
|
+
"rollup": "^4.0.0",
|
|
52
52
|
"vite": "^8.0.5"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
@@ -63,12 +63,13 @@
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@
|
|
67
|
-
"@
|
|
66
|
+
"@jridgewell/gen-mapping": "^0.3.13",
|
|
67
|
+
"@jridgewell/trace-mapping": "^0.3.31",
|
|
68
68
|
"fast-glob": "^3.3.3",
|
|
69
69
|
"picomatch": "^4.0.4",
|
|
70
|
-
"
|
|
71
|
-
"@zeus-js/
|
|
70
|
+
"typescript": "^6.0.3",
|
|
71
|
+
"@zeus-js/compiler-native": "0.1.1-beta.2",
|
|
72
|
+
"@zeus-js/component-analyzer": "0.1.1-beta.2"
|
|
72
73
|
},
|
|
73
74
|
"author": "Baicie",
|
|
74
75
|
"buildOptions": {
|