@danielx/civet 0.11.7 → 0.11.9
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 +63 -0
- package/README.md +3 -7
- package/dist/browser.js +23987 -9251
- package/dist/browser.min.js +1 -0
- package/dist/cache.js +128 -0
- package/dist/cache.mjs +89 -0
- package/dist/civet +56 -8
- package/dist/main.js +37701 -12214
- package/dist/main.mjs +37701 -12214
- package/dist/ts-diagnostic.js +41 -0
- package/dist/ts-diagnostic.mjs +40 -0
- package/dist/ts-service/index.js +1239 -0
- package/dist/ts-service/index.js.map +7 -0
- package/dist/ts-service/index.mjs +1188 -0
- package/dist/ts-service/index.mjs.map +7 -0
- package/dist/types.d.ts +0 -14
- package/dist/unplugin/unplugin.d.ts +28 -1
- package/dist/unplugin/unplugin.js +269 -276
- package/dist/unplugin/unplugin.mjs +270 -282
- package/package.json +43 -26
- package/dist/esbuild-plugin.js +0 -131
package/package.json
CHANGED
|
@@ -1,8 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielx/civet",
|
|
3
3
|
"type": "commonjs",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.9",
|
|
5
5
|
"description": "CoffeeScript style syntax for TypeScript",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "bash ./build/build.sh",
|
|
8
|
+
"build:self": "pnpm build && bash ./build/build-self.sh",
|
|
9
|
+
"clean:cache": "rm -rf .cache",
|
|
10
|
+
"clean:cache:prune": "bash -c 'find .cache/build -type f -mtime +\"${1:-14}\" -delete 2>/dev/null || true' --",
|
|
11
|
+
"docs:dev": "pnpm build && pnpm -C lsp/server build && pnpm -C lsp/monaco build && pnpm -C civet.dev dev",
|
|
12
|
+
"docs:build": "pnpm build && pnpm -C lsp/server build && pnpm -C lsp/monaco build && pnpm -C civet.dev build",
|
|
13
|
+
"docs:preview": "pnpm build && pnpm -C lsp/server build && pnpm -C lsp/monaco build && pnpm -C civet.dev preview",
|
|
14
|
+
"prepublishOnly": "pnpm build && pnpm test:coverage && pnpm changelog --verify",
|
|
15
|
+
"test": "bash ./build/test.sh",
|
|
16
|
+
"typecheck": "./dist/civet --typecheck --tsbuildinfo .cache/typecheck.tsbuildinfo",
|
|
17
|
+
"typecheck:diff": "civet scripts/typecheck-diff.civet",
|
|
18
|
+
"probe-shapes": "civet scripts/probe-shapes.civet",
|
|
19
|
+
"test:coverage": "cross-env CIVET_COVERAGE=1 bash ./build/test.sh",
|
|
20
|
+
"coverage": "pnpm coverage:run && pnpm coverage:merge",
|
|
21
|
+
"coverage:run": "civet scripts/coverage-run.civet",
|
|
22
|
+
"coverage:merge": "civet scripts/coverage-merge.civet",
|
|
23
|
+
"coverage:check": "civet scripts/coverage-check.civet",
|
|
24
|
+
"coverage:show": "civet scripts/show-uncovered.civet",
|
|
25
|
+
"show-uncovered": "civet scripts/show-uncovered.civet",
|
|
26
|
+
"test:self": "cross-env CIVET_SOURCE=./dist/main.js pnpm test",
|
|
27
|
+
"test:brk": "cross-env CIVET_THREADS=0 pnpm test --inspect-brk",
|
|
28
|
+
"changelog": "civet build/changelog.civet",
|
|
29
|
+
"release": "pnpm changelog --release"
|
|
30
|
+
},
|
|
6
31
|
"main": "dist/main.js",
|
|
7
32
|
"module": "dist/main.mjs",
|
|
8
33
|
"repository": {
|
|
@@ -19,9 +44,10 @@
|
|
|
19
44
|
"require": "./dist/babel-plugin.js",
|
|
20
45
|
"import": "./dist/babel-plugin.mjs"
|
|
21
46
|
},
|
|
47
|
+
"./browser": "./dist/browser.js",
|
|
48
|
+
"./browser.min": "./dist/browser.min.js",
|
|
22
49
|
"./bun-civet": "./dist/bun-civet.mjs",
|
|
23
50
|
"./esm": "./dist/esm.mjs",
|
|
24
|
-
"./esbuild-plugin": "./dist/esbuild-plugin.js",
|
|
25
51
|
"./register": "./register.js",
|
|
26
52
|
"./register-noconfig": "./register-noconfig.js",
|
|
27
53
|
"./config": {
|
|
@@ -78,6 +104,10 @@
|
|
|
78
104
|
"require": "./dist/ts-diagnostic.js",
|
|
79
105
|
"import": "./dist/ts-diagnostic.mjs"
|
|
80
106
|
},
|
|
107
|
+
"./ts-service": {
|
|
108
|
+
"require": "./dist/ts-service/index.js",
|
|
109
|
+
"import": "./dist/ts-service/index.mjs"
|
|
110
|
+
},
|
|
81
111
|
"./*": "./*",
|
|
82
112
|
"./dist/*": "./dist/*"
|
|
83
113
|
},
|
|
@@ -93,21 +123,6 @@
|
|
|
93
123
|
"engines": {
|
|
94
124
|
"node": ">=19 || ^18.6.0 || ^16.17.0"
|
|
95
125
|
},
|
|
96
|
-
"scripts": {
|
|
97
|
-
"build": "bash ./build/build.sh",
|
|
98
|
-
"build:self": "pnpm build && bash ./build/build-self.sh",
|
|
99
|
-
"clean:cache": "rm -rf .cache",
|
|
100
|
-
"docs:dev": "pnpm build && vitepress dev civet.dev",
|
|
101
|
-
"docs:build": "pnpm build && vitepress build civet.dev",
|
|
102
|
-
"docs:preview": "pnpm build && vitepress preview civet.dev",
|
|
103
|
-
"prepublishOnly": "pnpm build && pnpm test:coverage && pnpm changelog --verify",
|
|
104
|
-
"test": "bash ./build/test.sh",
|
|
105
|
-
"test:coverage": "cross-env CIVET_COVERAGE=1 bash ./build/test.sh",
|
|
106
|
-
"test:self": "cross-env CIVET_SOURCE=./dist/main.js pnpm test",
|
|
107
|
-
"test:brk": "cross-env CIVET_THREADS=0 pnpm test --inspect-brk",
|
|
108
|
-
"changelog": "civet build/changelog.civet",
|
|
109
|
-
"release": "pnpm changelog --release"
|
|
110
|
-
},
|
|
111
126
|
"author": "Daniel X. Moore",
|
|
112
127
|
"license": "MIT",
|
|
113
128
|
"dependencies": {
|
|
@@ -118,9 +133,9 @@
|
|
|
118
133
|
"@babel/core": "^7.29.0",
|
|
119
134
|
"@babel/parser": "^7.29.2",
|
|
120
135
|
"@danielx/civet": "0.11.6",
|
|
121
|
-
"@danielx/hera": "0.
|
|
122
|
-
"@prettier/sync": "^0.5.2",
|
|
136
|
+
"@danielx/hera": "0.9.2",
|
|
123
137
|
"@types/assert": "^1.5.6",
|
|
138
|
+
"@types/babel__core": "7.20.5",
|
|
124
139
|
"@types/mocha": "^10.0.8",
|
|
125
140
|
"@types/node": "^22.10.2",
|
|
126
141
|
"@typescript/vfs": "^1.6.4",
|
|
@@ -129,22 +144,22 @@
|
|
|
129
144
|
"esbuild": "0.27.5",
|
|
130
145
|
"marked": "^4.2.4",
|
|
131
146
|
"mocha": "^10.7.3",
|
|
132
|
-
"prettier": "^3.2.5",
|
|
133
|
-
"shiki": "^3.0.0",
|
|
134
147
|
"terser": "^5.16.1",
|
|
135
148
|
"tslib": "^2.4.0",
|
|
136
|
-
"typescript": "^
|
|
149
|
+
"typescript": "^6.0.2",
|
|
137
150
|
"vite": "^8.0.8",
|
|
138
|
-
"vitepress": "^1.0.0-alpha.35",
|
|
139
151
|
"vscode-languageserver": "^8.1.0",
|
|
140
|
-
"vscode-languageserver-textdocument": "^1.0.8"
|
|
141
|
-
"vue": "^3.2.45"
|
|
152
|
+
"vscode-languageserver-textdocument": "^1.0.8"
|
|
142
153
|
},
|
|
143
154
|
"peerDependencies": {
|
|
155
|
+
"@danielx/hera": "^0.9.2",
|
|
144
156
|
"typescript": ">=4.5",
|
|
145
157
|
"yaml": "^2.4.5"
|
|
146
158
|
},
|
|
147
159
|
"peerDependenciesMeta": {
|
|
160
|
+
"@danielx/hera": {
|
|
161
|
+
"optional": true
|
|
162
|
+
},
|
|
148
163
|
"typescript": {
|
|
149
164
|
"optional": true
|
|
150
165
|
},
|
|
@@ -156,6 +171,7 @@
|
|
|
156
171
|
"all": true,
|
|
157
172
|
"reporter": [
|
|
158
173
|
"lcov",
|
|
174
|
+
"json",
|
|
159
175
|
"text"
|
|
160
176
|
],
|
|
161
177
|
"extension": [
|
|
@@ -172,7 +188,8 @@
|
|
|
172
188
|
],
|
|
173
189
|
"exclude": [
|
|
174
190
|
"source/parser/types.civet",
|
|
175
|
-
"source/bun-civet.civet"
|
|
191
|
+
"source/bun-civet.civet",
|
|
192
|
+
"source/node-worker.civet"
|
|
176
193
|
]
|
|
177
194
|
},
|
|
178
195
|
"packageManager": "pnpm@10.33.0",
|
package/dist/esbuild-plugin.js
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// source/esbuild-plugin.civet
|
|
31
|
-
var esbuild_plugin_exports = {};
|
|
32
|
-
__export(esbuild_plugin_exports, {
|
|
33
|
-
default: () => esbuild_plugin_default
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(esbuild_plugin_exports);
|
|
36
|
-
var import_promises = require("fs/promises");
|
|
37
|
-
var import_path = __toESM(require("path"));
|
|
38
|
-
var import_main = require("./main.js");
|
|
39
|
-
var civet = function(options = {}) {
|
|
40
|
-
const {
|
|
41
|
-
filter = /\.civet$/,
|
|
42
|
-
inlineMap = true,
|
|
43
|
-
js = true,
|
|
44
|
-
next
|
|
45
|
-
} = options;
|
|
46
|
-
let nextTransform;
|
|
47
|
-
let tmpPath;
|
|
48
|
-
if (next) {
|
|
49
|
-
next.setup({
|
|
50
|
-
onEnd() {
|
|
51
|
-
;
|
|
52
|
-
},
|
|
53
|
-
onStart() {
|
|
54
|
-
;
|
|
55
|
-
},
|
|
56
|
-
resolve() {
|
|
57
|
-
;
|
|
58
|
-
},
|
|
59
|
-
onResolve() {
|
|
60
|
-
;
|
|
61
|
-
},
|
|
62
|
-
initialOptions() {
|
|
63
|
-
;
|
|
64
|
-
},
|
|
65
|
-
esbuild() {
|
|
66
|
-
;
|
|
67
|
-
},
|
|
68
|
-
onLoad(_, handler) {
|
|
69
|
-
return nextTransform = handler;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
name: "civet",
|
|
75
|
-
setup(build) {
|
|
76
|
-
build.onStart(async function() {
|
|
77
|
-
if (next) {
|
|
78
|
-
const { tmpdir } = require("os");
|
|
79
|
-
tmpPath = await (0, import_promises.mkdtemp)(import_path.default.join(tmpdir(), "civet-"));
|
|
80
|
-
}
|
|
81
|
-
return;
|
|
82
|
-
});
|
|
83
|
-
build.onEnd(async function() {
|
|
84
|
-
if (tmpPath) {
|
|
85
|
-
await (0, import_promises.rmdir)(tmpPath, { recursive: true });
|
|
86
|
-
}
|
|
87
|
-
return;
|
|
88
|
-
});
|
|
89
|
-
return build.onLoad({ filter }, async function(args) {
|
|
90
|
-
try {
|
|
91
|
-
const source = await (0, import_promises.readFile)(args.path);
|
|
92
|
-
const filename = import_path.default.relative(process.cwd(), args.path);
|
|
93
|
-
const compiled = await (0, import_main.compile)(source, {
|
|
94
|
-
filename,
|
|
95
|
-
inlineMap,
|
|
96
|
-
js
|
|
97
|
-
});
|
|
98
|
-
if (next && tmpPath) {
|
|
99
|
-
const outputFileName = filename + js ? ".jsx" : ".tsx";
|
|
100
|
-
const outputFilePath = import_path.default.join(tmpPath, outputFileName);
|
|
101
|
-
await (0, import_promises.writeFile)(outputFilePath, compiled);
|
|
102
|
-
return await nextTransform({
|
|
103
|
-
...args,
|
|
104
|
-
path: outputFilePath
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
contents: compiled
|
|
109
|
-
};
|
|
110
|
-
} catch (e) {
|
|
111
|
-
return {
|
|
112
|
-
errors: [{
|
|
113
|
-
text: e.message,
|
|
114
|
-
location: {
|
|
115
|
-
file: args.path,
|
|
116
|
-
namespace: args.namespace,
|
|
117
|
-
line: e.line,
|
|
118
|
-
column: e.column
|
|
119
|
-
},
|
|
120
|
-
detail: e
|
|
121
|
-
}]
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
var defaultPlugin = civet();
|
|
129
|
-
civet.setup = defaultPlugin.setup;
|
|
130
|
-
var esbuild_plugin_default = civet;
|
|
131
|
-
module.exports = module.exports.default;
|