@danielx/civet 0.11.7 → 0.11.8
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 +52 -0
- package/README.md +3 -7
- package/dist/browser.js +23954 -9243
- 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 +37647 -12195
- package/dist/main.mjs +37647 -12195
- 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 -20
- package/dist/esbuild-plugin.js +0 -131
package/package.json
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielx/civet",
|
|
3
3
|
"type": "commonjs",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.8",
|
|
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
|
+
"docs:dev": "pnpm build && pnpm -C lsp/server build && pnpm -C lsp/monaco build && vitepress dev civet.dev",
|
|
11
|
+
"docs:build": "pnpm build && pnpm -C lsp/server build && pnpm -C lsp/monaco build && vitepress build civet.dev",
|
|
12
|
+
"docs:preview": "pnpm build && pnpm -C lsp/server build && pnpm -C lsp/monaco build && vitepress preview civet.dev",
|
|
13
|
+
"prepublishOnly": "pnpm build && pnpm test:coverage && pnpm changelog --verify",
|
|
14
|
+
"test": "bash ./build/test.sh",
|
|
15
|
+
"typecheck": "./dist/civet --typecheck --tsbuildinfo .cache/typecheck.tsbuildinfo",
|
|
16
|
+
"typecheck:diff": "civet scripts/typecheck-diff.civet",
|
|
17
|
+
"probe-shapes": "civet scripts/probe-shapes.civet",
|
|
18
|
+
"test:coverage": "cross-env CIVET_COVERAGE=1 bash ./build/test.sh",
|
|
19
|
+
"coverage": "pnpm coverage:run && pnpm coverage:merge",
|
|
20
|
+
"coverage:run": "civet scripts/coverage-run.civet",
|
|
21
|
+
"coverage:merge": "civet scripts/coverage-merge.civet",
|
|
22
|
+
"coverage:check": "civet scripts/coverage-check.civet",
|
|
23
|
+
"coverage:show": "civet scripts/show-uncovered.civet",
|
|
24
|
+
"show-uncovered": "civet scripts/show-uncovered.civet",
|
|
25
|
+
"test:self": "cross-env CIVET_SOURCE=./dist/main.js pnpm test",
|
|
26
|
+
"test:brk": "cross-env CIVET_THREADS=0 pnpm test --inspect-brk",
|
|
27
|
+
"changelog": "civet build/changelog.civet",
|
|
28
|
+
"release": "pnpm changelog --release"
|
|
29
|
+
},
|
|
6
30
|
"main": "dist/main.js",
|
|
7
31
|
"module": "dist/main.mjs",
|
|
8
32
|
"repository": {
|
|
@@ -19,9 +43,10 @@
|
|
|
19
43
|
"require": "./dist/babel-plugin.js",
|
|
20
44
|
"import": "./dist/babel-plugin.mjs"
|
|
21
45
|
},
|
|
46
|
+
"./browser": "./dist/browser.js",
|
|
47
|
+
"./browser.min": "./dist/browser.min.js",
|
|
22
48
|
"./bun-civet": "./dist/bun-civet.mjs",
|
|
23
49
|
"./esm": "./dist/esm.mjs",
|
|
24
|
-
"./esbuild-plugin": "./dist/esbuild-plugin.js",
|
|
25
50
|
"./register": "./register.js",
|
|
26
51
|
"./register-noconfig": "./register-noconfig.js",
|
|
27
52
|
"./config": {
|
|
@@ -78,6 +103,10 @@
|
|
|
78
103
|
"require": "./dist/ts-diagnostic.js",
|
|
79
104
|
"import": "./dist/ts-diagnostic.mjs"
|
|
80
105
|
},
|
|
106
|
+
"./ts-service": {
|
|
107
|
+
"require": "./dist/ts-service/index.js",
|
|
108
|
+
"import": "./dist/ts-service/index.mjs"
|
|
109
|
+
},
|
|
81
110
|
"./*": "./*",
|
|
82
111
|
"./dist/*": "./dist/*"
|
|
83
112
|
},
|
|
@@ -93,21 +122,6 @@
|
|
|
93
122
|
"engines": {
|
|
94
123
|
"node": ">=19 || ^18.6.0 || ^16.17.0"
|
|
95
124
|
},
|
|
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
125
|
"author": "Daniel X. Moore",
|
|
112
126
|
"license": "MIT",
|
|
113
127
|
"dependencies": {
|
|
@@ -118,9 +132,11 @@
|
|
|
118
132
|
"@babel/core": "^7.29.0",
|
|
119
133
|
"@babel/parser": "^7.29.2",
|
|
120
134
|
"@danielx/civet": "0.11.6",
|
|
121
|
-
"@danielx/hera": "0.
|
|
135
|
+
"@danielx/hera": "0.9.2",
|
|
122
136
|
"@prettier/sync": "^0.5.2",
|
|
137
|
+
"@shikijs/monaco": "3.23.0",
|
|
123
138
|
"@types/assert": "^1.5.6",
|
|
139
|
+
"@types/babel__core": "7.20.5",
|
|
124
140
|
"@types/mocha": "^10.0.8",
|
|
125
141
|
"@types/node": "^22.10.2",
|
|
126
142
|
"@typescript/vfs": "^1.6.4",
|
|
@@ -129,11 +145,12 @@
|
|
|
129
145
|
"esbuild": "0.27.5",
|
|
130
146
|
"marked": "^4.2.4",
|
|
131
147
|
"mocha": "^10.7.3",
|
|
148
|
+
"monaco-editor": "^0.55.1",
|
|
132
149
|
"prettier": "^3.2.5",
|
|
133
150
|
"shiki": "^3.0.0",
|
|
134
151
|
"terser": "^5.16.1",
|
|
135
152
|
"tslib": "^2.4.0",
|
|
136
|
-
"typescript": "^
|
|
153
|
+
"typescript": "^6.0.2",
|
|
137
154
|
"vite": "^8.0.8",
|
|
138
155
|
"vitepress": "^1.0.0-alpha.35",
|
|
139
156
|
"vscode-languageserver": "^8.1.0",
|
|
@@ -141,10 +158,14 @@
|
|
|
141
158
|
"vue": "^3.2.45"
|
|
142
159
|
},
|
|
143
160
|
"peerDependencies": {
|
|
161
|
+
"@danielx/hera": "^0.9.2",
|
|
144
162
|
"typescript": ">=4.5",
|
|
145
163
|
"yaml": "^2.4.5"
|
|
146
164
|
},
|
|
147
165
|
"peerDependenciesMeta": {
|
|
166
|
+
"@danielx/hera": {
|
|
167
|
+
"optional": true
|
|
168
|
+
},
|
|
148
169
|
"typescript": {
|
|
149
170
|
"optional": true
|
|
150
171
|
},
|
|
@@ -156,6 +177,7 @@
|
|
|
156
177
|
"all": true,
|
|
157
178
|
"reporter": [
|
|
158
179
|
"lcov",
|
|
180
|
+
"json",
|
|
159
181
|
"text"
|
|
160
182
|
],
|
|
161
183
|
"extension": [
|
|
@@ -172,7 +194,8 @@
|
|
|
172
194
|
],
|
|
173
195
|
"exclude": [
|
|
174
196
|
"source/parser/types.civet",
|
|
175
|
-
"source/bun-civet.civet"
|
|
197
|
+
"source/bun-civet.civet",
|
|
198
|
+
"source/node-worker.civet"
|
|
176
199
|
]
|
|
177
200
|
},
|
|
178
201
|
"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;
|