@danielx/civet 0.11.4 → 0.11.6
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/CHANGELOG.md +20 -0
- package/README.md +2 -7
- package/dist/babel-plugin.js +7 -6
- package/dist/babel-plugin.mjs +3 -3
- package/dist/browser.js +568 -423
- package/dist/civet +12 -10
- package/dist/config.js +7313 -7
- package/dist/config.mjs +7338 -4
- package/dist/esbuild-plugin.js +7 -6
- package/dist/esm.mjs +10 -16
- package/dist/main.js +1455 -741
- package/dist/main.mjs +1451 -738
- package/dist/node-worker.mjs +1 -2
- package/dist/ts-diagnostic.js +4 -3
- package/dist/types.d.ts +9 -2
- package/dist/unplugin/astro.js +8 -7
- package/dist/unplugin/astro.mjs +5 -3
- package/dist/unplugin/esbuild.js +7 -6
- package/dist/unplugin/esbuild.mjs +3 -1
- package/dist/unplugin/farm.d.ts +3 -1
- package/dist/unplugin/farm.js +7 -6
- package/dist/unplugin/farm.mjs +4 -2
- package/dist/unplugin/rolldown.d.ts +1 -1
- package/dist/unplugin/rolldown.js +7 -6
- package/dist/unplugin/rolldown.mjs +3 -1
- package/dist/unplugin/rollup.d.ts +1 -1
- package/dist/unplugin/rollup.js +7 -6
- package/dist/unplugin/rollup.mjs +3 -1
- package/dist/unplugin/rspack.js +7 -6
- package/dist/unplugin/rspack.mjs +3 -1
- package/dist/unplugin/unplugin.js +59 -46
- package/dist/unplugin/unplugin.mjs +42 -32
- package/dist/unplugin/vite.d.ts +1 -1
- package/dist/unplugin/vite.js +7 -6
- package/dist/unplugin/vite.mjs +3 -1
- package/dist/unplugin/webpack.d.ts +1 -1
- package/dist/unplugin/webpack.js +7 -6
- package/dist/unplugin/webpack.mjs +3 -1
- package/package.json +31 -16
package/dist/esbuild-plugin.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -26,12 +27,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
27
|
));
|
|
27
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
29
|
|
|
29
|
-
//
|
|
30
|
-
var
|
|
31
|
-
__export(
|
|
32
|
-
default: () =>
|
|
30
|
+
// source/esbuild-plugin.civet
|
|
31
|
+
var esbuild_plugin_exports = {};
|
|
32
|
+
__export(esbuild_plugin_exports, {
|
|
33
|
+
default: () => esbuild_plugin_default
|
|
33
34
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
+
module.exports = __toCommonJS(esbuild_plugin_exports);
|
|
35
36
|
var import_promises = require("fs/promises");
|
|
36
37
|
var import_path = __toESM(require("path"));
|
|
37
38
|
var import_main = require("./main.js");
|
|
@@ -126,5 +127,5 @@ var civet = function(options = {}) {
|
|
|
126
127
|
};
|
|
127
128
|
var defaultPlugin = civet();
|
|
128
129
|
civet.setup = defaultPlugin.setup;
|
|
129
|
-
var
|
|
130
|
+
var esbuild_plugin_default = civet;
|
|
130
131
|
module.exports = module.exports.default;
|
package/dist/esm.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
//
|
|
1
|
+
// source/esm.civet
|
|
2
2
|
import { readFile } from "fs/promises";
|
|
3
3
|
import { dirname } from "path";
|
|
4
4
|
import { pathToFileURL, fileURLToPath } from "url";
|
|
5
|
-
import { compile
|
|
5
|
+
import { compile } from "./main.mjs";
|
|
6
6
|
import { findConfig, loadConfig } from "./config.mjs";
|
|
7
7
|
var baseURL = pathToFileURL(process.cwd() + "/").href;
|
|
8
|
-
var extensionsRegex = /\.civet
|
|
8
|
+
var extensionsRegex = /\.civet(?:$|[?#])/;
|
|
9
9
|
var globalOptions = {};
|
|
10
10
|
function initialize(options = {}) {
|
|
11
11
|
return globalOptions = options;
|
|
@@ -35,7 +35,7 @@ async function load(url, context, next) {
|
|
|
35
35
|
}
|
|
36
36
|
const options = {
|
|
37
37
|
filename: path,
|
|
38
|
-
|
|
38
|
+
inlineMap: true,
|
|
39
39
|
js: true
|
|
40
40
|
};
|
|
41
41
|
if (globalOptions.parseOptions) {
|
|
@@ -44,24 +44,18 @@ async function load(url, context, next) {
|
|
|
44
44
|
if (loadedConfig?.parseOptions) {
|
|
45
45
|
options.parseOptions = { ...options.parseOptions, ...loadedConfig.parseOptions };
|
|
46
46
|
}
|
|
47
|
-
let
|
|
47
|
+
let code;
|
|
48
48
|
try {
|
|
49
|
-
|
|
49
|
+
code = await compile(source, options);
|
|
50
50
|
} catch (e) {
|
|
51
51
|
console.error(`Civet failed to compile ${url}:`, e);
|
|
52
52
|
throw e;
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
// ts-node won't transpile unless this is module
|
|
57
|
-
// can't use commonjs since we don't rewrite imports
|
|
54
|
+
return {
|
|
55
|
+
shortCircuit: true,
|
|
58
56
|
format: "module",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
});
|
|
62
|
-
result.responseURL = (result.responseURL ?? transpiledUrl).replace(/.tsx$/, "");
|
|
63
|
-
result.source = SourceMap.remap(result.source, sourceMap, url, result.responseURL);
|
|
64
|
-
return result;
|
|
57
|
+
source: code
|
|
58
|
+
};
|
|
65
59
|
}
|
|
66
60
|
return next(url, context);
|
|
67
61
|
}
|