@danielx/civet 0.7.11 → 0.7.13
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/astro.js +10 -0
- package/dist/browser.js +151 -106
- package/dist/bun-civet.mjs +5 -6
- package/dist/esbuild.js +10 -0
- package/dist/main.js +151 -106
- package/dist/main.mjs +151 -106
- package/dist/rollup.js +10 -0
- package/dist/unplugin-shared.mjs +10 -0
- package/dist/unplugin.d.mts +2 -0
- package/dist/unplugin.d.ts +2 -0
- package/dist/unplugin.js +10 -0
- package/dist/vite.js +10 -0
- package/dist/webpack.js +10 -0
- package/package.json +6 -20
package/dist/rollup.js
CHANGED
|
@@ -108,6 +108,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
108
108
|
getCanonicalFileName: sys.useCaseSensitiveFileNames ? (f) => f : (f) => f.toLowerCase()
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
|
+
const cache = options.cache ? /* @__PURE__ */ new Map() : void 0;
|
|
111
112
|
return {
|
|
112
113
|
name: "unplugin-civet",
|
|
113
114
|
enforce: "pre",
|
|
@@ -320,6 +321,14 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
320
321
|
return null;
|
|
321
322
|
const basename = id.slice(0, match.index + match[1].length);
|
|
322
323
|
const filename = import_path.default.resolve(rootDir, basename);
|
|
324
|
+
let mtime;
|
|
325
|
+
if (cache) {
|
|
326
|
+
mtime = (await fs.promises.stat(filename)).mtimeMs;
|
|
327
|
+
const cached = cache?.get(filename);
|
|
328
|
+
if (cached && cached.mtime === mtime) {
|
|
329
|
+
return cached.result;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
323
332
|
const rawCivetSource = await fs.promises.readFile(filename, "utf-8");
|
|
324
333
|
this.addWatchFile(filename);
|
|
325
334
|
let compiled;
|
|
@@ -403,6 +412,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
403
412
|
};
|
|
404
413
|
if (options.transformOutput)
|
|
405
414
|
transformed = await options.transformOutput(transformed.code, id);
|
|
415
|
+
cache?.set(filename, { mtime, result: transformed });
|
|
406
416
|
return transformed;
|
|
407
417
|
},
|
|
408
418
|
esbuild: {
|
package/dist/unplugin-shared.mjs
CHANGED
|
@@ -75,6 +75,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
75
75
|
getCanonicalFileName: sys.useCaseSensitiveFileNames ? (f) => f : (f) => f.toLowerCase()
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
|
+
const cache = options.cache ? /* @__PURE__ */ new Map() : void 0;
|
|
78
79
|
return {
|
|
79
80
|
name: "unplugin-civet",
|
|
80
81
|
enforce: "pre",
|
|
@@ -287,6 +288,14 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
287
288
|
return null;
|
|
288
289
|
const basename = id.slice(0, match.index + match[1].length);
|
|
289
290
|
const filename = path.resolve(rootDir, basename);
|
|
291
|
+
let mtime;
|
|
292
|
+
if (cache) {
|
|
293
|
+
mtime = (await fs.promises.stat(filename)).mtimeMs;
|
|
294
|
+
const cached = cache?.get(filename);
|
|
295
|
+
if (cached && cached.mtime === mtime) {
|
|
296
|
+
return cached.result;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
290
299
|
const rawCivetSource = await fs.promises.readFile(filename, "utf-8");
|
|
291
300
|
this.addWatchFile(filename);
|
|
292
301
|
let compiled;
|
|
@@ -370,6 +379,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
370
379
|
};
|
|
371
380
|
if (options.transformOutput)
|
|
372
381
|
transformed = await options.transformOutput(transformed.code, id);
|
|
382
|
+
cache?.set(filename, { mtime, result: transformed });
|
|
373
383
|
return transformed;
|
|
374
384
|
},
|
|
375
385
|
esbuild: {
|
package/dist/unplugin.d.mts
CHANGED
|
@@ -13,6 +13,8 @@ type PluginOptions = {
|
|
|
13
13
|
js?: boolean;
|
|
14
14
|
/** @deprecated Use "emitDeclaration" instead */
|
|
15
15
|
dts?: boolean;
|
|
16
|
+
/** Cache compilation results based on file mtime (useful for serve or watch mode) */
|
|
17
|
+
cache?: boolean;
|
|
16
18
|
/** config filename, or null to not look for default config file */
|
|
17
19
|
config?: string | null | undefined;
|
|
18
20
|
parseOptions?: ParseOptions;
|
package/dist/unplugin.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ type PluginOptions = {
|
|
|
13
13
|
js?: boolean;
|
|
14
14
|
/** @deprecated Use "emitDeclaration" instead */
|
|
15
15
|
dts?: boolean;
|
|
16
|
+
/** Cache compilation results based on file mtime (useful for serve or watch mode) */
|
|
17
|
+
cache?: boolean;
|
|
16
18
|
/** config filename, or null to not look for default config file */
|
|
17
19
|
config?: string | null | undefined;
|
|
18
20
|
parseOptions?: ParseOptions;
|
package/dist/unplugin.js
CHANGED
|
@@ -108,6 +108,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
108
108
|
getCanonicalFileName: sys.useCaseSensitiveFileNames ? (f) => f : (f) => f.toLowerCase()
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
|
+
const cache = options.cache ? /* @__PURE__ */ new Map() : void 0;
|
|
111
112
|
return {
|
|
112
113
|
name: "unplugin-civet",
|
|
113
114
|
enforce: "pre",
|
|
@@ -320,6 +321,14 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
320
321
|
return null;
|
|
321
322
|
const basename = id.slice(0, match.index + match[1].length);
|
|
322
323
|
const filename = import_path.default.resolve(rootDir, basename);
|
|
324
|
+
let mtime;
|
|
325
|
+
if (cache) {
|
|
326
|
+
mtime = (await fs.promises.stat(filename)).mtimeMs;
|
|
327
|
+
const cached = cache?.get(filename);
|
|
328
|
+
if (cached && cached.mtime === mtime) {
|
|
329
|
+
return cached.result;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
323
332
|
const rawCivetSource = await fs.promises.readFile(filename, "utf-8");
|
|
324
333
|
this.addWatchFile(filename);
|
|
325
334
|
let compiled;
|
|
@@ -403,6 +412,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
403
412
|
};
|
|
404
413
|
if (options.transformOutput)
|
|
405
414
|
transformed = await options.transformOutput(transformed.code, id);
|
|
415
|
+
cache?.set(filename, { mtime, result: transformed });
|
|
406
416
|
return transformed;
|
|
407
417
|
},
|
|
408
418
|
esbuild: {
|
package/dist/vite.js
CHANGED
|
@@ -108,6 +108,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
108
108
|
getCanonicalFileName: sys.useCaseSensitiveFileNames ? (f) => f : (f) => f.toLowerCase()
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
|
+
const cache = options.cache ? /* @__PURE__ */ new Map() : void 0;
|
|
111
112
|
return {
|
|
112
113
|
name: "unplugin-civet",
|
|
113
114
|
enforce: "pre",
|
|
@@ -320,6 +321,14 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
320
321
|
return null;
|
|
321
322
|
const basename = id.slice(0, match.index + match[1].length);
|
|
322
323
|
const filename = import_path.default.resolve(rootDir, basename);
|
|
324
|
+
let mtime;
|
|
325
|
+
if (cache) {
|
|
326
|
+
mtime = (await fs.promises.stat(filename)).mtimeMs;
|
|
327
|
+
const cached = cache?.get(filename);
|
|
328
|
+
if (cached && cached.mtime === mtime) {
|
|
329
|
+
return cached.result;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
323
332
|
const rawCivetSource = await fs.promises.readFile(filename, "utf-8");
|
|
324
333
|
this.addWatchFile(filename);
|
|
325
334
|
let compiled;
|
|
@@ -403,6 +412,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
403
412
|
};
|
|
404
413
|
if (options.transformOutput)
|
|
405
414
|
transformed = await options.transformOutput(transformed.code, id);
|
|
415
|
+
cache?.set(filename, { mtime, result: transformed });
|
|
406
416
|
return transformed;
|
|
407
417
|
},
|
|
408
418
|
esbuild: {
|
package/dist/webpack.js
CHANGED
|
@@ -108,6 +108,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
108
108
|
getCanonicalFileName: sys.useCaseSensitiveFileNames ? (f) => f : (f) => f.toLowerCase()
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
|
+
const cache = options.cache ? /* @__PURE__ */ new Map() : void 0;
|
|
111
112
|
return {
|
|
112
113
|
name: "unplugin-civet",
|
|
113
114
|
enforce: "pre",
|
|
@@ -320,6 +321,14 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
320
321
|
return null;
|
|
321
322
|
const basename = id.slice(0, match.index + match[1].length);
|
|
322
323
|
const filename = import_path.default.resolve(rootDir, basename);
|
|
324
|
+
let mtime;
|
|
325
|
+
if (cache) {
|
|
326
|
+
mtime = (await fs.promises.stat(filename)).mtimeMs;
|
|
327
|
+
const cached = cache?.get(filename);
|
|
328
|
+
if (cached && cached.mtime === mtime) {
|
|
329
|
+
return cached.result;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
323
332
|
const rawCivetSource = await fs.promises.readFile(filename, "utf-8");
|
|
324
333
|
this.addWatchFile(filename);
|
|
325
334
|
let compiled;
|
|
@@ -403,6 +412,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
403
412
|
};
|
|
404
413
|
if (options.transformOutput)
|
|
405
414
|
transformed = await options.transformOutput(transformed.code, id);
|
|
415
|
+
cache?.set(filename, { mtime, result: transformed });
|
|
406
416
|
return transformed;
|
|
407
417
|
},
|
|
408
418
|
esbuild: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielx/civet",
|
|
3
3
|
"type": "commonjs",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.13",
|
|
5
5
|
"description": "CoffeeScript style syntax for TypeScript",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"module": "dist/main.mjs",
|
|
@@ -64,17 +64,18 @@
|
|
|
64
64
|
"docs:build": "yarn build && vitepress build civet.dev",
|
|
65
65
|
"docs:preview": "yarn build && vitepress preview civet.dev",
|
|
66
66
|
"prepublishOnly": "yarn build && yarn test",
|
|
67
|
-
"test": "bash ./build/test.sh"
|
|
67
|
+
"test": "bash ./build/test.sh",
|
|
68
|
+
"test:self": "yarn build && mocha --config .mocharc-self.json"
|
|
68
69
|
},
|
|
69
70
|
"author": "Daniel X. Moore",
|
|
70
71
|
"license": "MIT",
|
|
71
72
|
"dependencies": {
|
|
72
73
|
"@cspotcode/source-map-support": "^0.8.1",
|
|
73
|
-
"@typescript/vfs": "^1.5.
|
|
74
|
+
"@typescript/vfs": "^1.5.3",
|
|
74
75
|
"unplugin": "^1.6.0"
|
|
75
76
|
},
|
|
76
77
|
"devDependencies": {
|
|
77
|
-
"@danielx/civet": "0.7.
|
|
78
|
+
"@danielx/civet": "0.7.11",
|
|
78
79
|
"@danielx/hera": "^0.8.14",
|
|
79
80
|
"@prettier/sync": "^0.5.2",
|
|
80
81
|
"@types/assert": "^1.5.6",
|
|
@@ -89,7 +90,7 @@
|
|
|
89
90
|
"ts-node": "^10.9.1",
|
|
90
91
|
"tslib": "^2.4.0",
|
|
91
92
|
"tsup": "^7.2.0",
|
|
92
|
-
"typescript": "^5.
|
|
93
|
+
"typescript": "^5.5.2",
|
|
93
94
|
"vite": "^4.4.12",
|
|
94
95
|
"vitepress": "^1.0.0-alpha.35",
|
|
95
96
|
"vscode-languageserver": "^8.1.0",
|
|
@@ -121,20 +122,5 @@
|
|
|
121
122
|
"source/parser/types.civet",
|
|
122
123
|
"source/bun-civet.civet"
|
|
123
124
|
]
|
|
124
|
-
},
|
|
125
|
-
"mocha": {
|
|
126
|
-
"extension": [
|
|
127
|
-
"civet",
|
|
128
|
-
"coffee"
|
|
129
|
-
],
|
|
130
|
-
"loader": [
|
|
131
|
-
"@danielx/hera/esm",
|
|
132
|
-
"./node_modules/@danielx/civet/dist/esm.mjs"
|
|
133
|
-
],
|
|
134
|
-
"reporter": "dot",
|
|
135
|
-
"recursive": true,
|
|
136
|
-
"spec": [
|
|
137
|
-
"test"
|
|
138
|
-
]
|
|
139
125
|
}
|
|
140
126
|
}
|