@danielx/civet 0.7.13 → 0.7.14
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 +31 -1
- package/dist/browser.js +176 -69
- package/dist/civet +9 -9
- package/dist/config.js +13 -2
- package/dist/esbuild.js +31 -1
- package/dist/main.js +176 -69
- package/dist/main.mjs +176 -69
- package/dist/rollup.js +31 -1
- package/dist/unplugin-shared.mjs +31 -1
- package/dist/unplugin.js +31 -1
- package/dist/vite.js +31 -1
- package/dist/webpack.js +31 -1
- package/package.json +10 -3
package/dist/unplugin-shared.mjs
CHANGED
|
@@ -67,6 +67,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
67
67
|
let compilerOptions, compilerOptionsWithSourceMap;
|
|
68
68
|
let rootDir = process.cwd();
|
|
69
69
|
let esbuildOptions;
|
|
70
|
+
let configErrors;
|
|
70
71
|
const tsPromise = transformTS || options.ts === "tsc" ? import("typescript").then((m) => m.default) : null;
|
|
71
72
|
const getFormatHost = (sys) => {
|
|
72
73
|
return {
|
|
@@ -107,12 +108,13 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
107
108
|
ts.sys,
|
|
108
109
|
process.cwd()
|
|
109
110
|
);
|
|
111
|
+
configErrors = configContents.errors;
|
|
110
112
|
compilerOptions = {
|
|
111
113
|
...configContents.options,
|
|
112
114
|
target: ts.ScriptTarget.ESNext,
|
|
113
115
|
composite: false
|
|
114
116
|
};
|
|
115
|
-
compilerOptions.jsx ?? (compilerOptions.jsx =
|
|
117
|
+
compilerOptions.jsx ?? (compilerOptions.jsx = ts.JsxEmit.Preserve);
|
|
116
118
|
compilerOptionsWithSourceMap = {
|
|
117
119
|
...compilerOptions,
|
|
118
120
|
sourceMap: true
|
|
@@ -133,6 +135,31 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
133
135
|
return systemFileExists(filename.slice(0, -4));
|
|
134
136
|
};
|
|
135
137
|
system.readFile = (filename, encoding = "utf-8") => {
|
|
138
|
+
if (path.basename(filename) === "package.json") {
|
|
139
|
+
let recurse2 = function(node) {
|
|
140
|
+
if (node && typeof node === "object") {
|
|
141
|
+
for (const key in node) {
|
|
142
|
+
const value = node[key];
|
|
143
|
+
if (typeof value === "string") {
|
|
144
|
+
if (value.endsWith(".civet")) {
|
|
145
|
+
node[key] = value + ".tsx";
|
|
146
|
+
modified = true;
|
|
147
|
+
}
|
|
148
|
+
} else if (value) {
|
|
149
|
+
recurse2(value);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
var recurse = recurse2;
|
|
155
|
+
const json = systemReadFile(filename);
|
|
156
|
+
if (!json)
|
|
157
|
+
return json;
|
|
158
|
+
const parsed = JSON.parse(json);
|
|
159
|
+
let modified = false;
|
|
160
|
+
recurse2(parsed.imports);
|
|
161
|
+
return modified ? JSON.stringify(parsed) : json;
|
|
162
|
+
}
|
|
136
163
|
if (!filename.endsWith(".civet.tsx"))
|
|
137
164
|
return systemReadFile(filename);
|
|
138
165
|
if (fsMap.has(filename))
|
|
@@ -183,6 +210,9 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
183
210
|
start: range.start
|
|
184
211
|
};
|
|
185
212
|
});
|
|
213
|
+
if (configErrors?.length) {
|
|
214
|
+
diagnostics.unshift(...configErrors);
|
|
215
|
+
}
|
|
186
216
|
if (diagnostics.length > 0) {
|
|
187
217
|
console.error(
|
|
188
218
|
ts.formatDiagnosticsWithColorAndContext(
|
package/dist/unplugin.js
CHANGED
|
@@ -100,6 +100,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
100
100
|
let compilerOptions, compilerOptionsWithSourceMap;
|
|
101
101
|
let rootDir = process.cwd();
|
|
102
102
|
let esbuildOptions;
|
|
103
|
+
let configErrors;
|
|
103
104
|
const tsPromise = transformTS || options.ts === "tsc" ? import("typescript").then((m) => m.default) : null;
|
|
104
105
|
const getFormatHost = (sys) => {
|
|
105
106
|
return {
|
|
@@ -140,12 +141,13 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
140
141
|
ts.sys,
|
|
141
142
|
process.cwd()
|
|
142
143
|
);
|
|
144
|
+
configErrors = configContents.errors;
|
|
143
145
|
compilerOptions = {
|
|
144
146
|
...configContents.options,
|
|
145
147
|
target: ts.ScriptTarget.ESNext,
|
|
146
148
|
composite: false
|
|
147
149
|
};
|
|
148
|
-
compilerOptions.jsx ?? (compilerOptions.jsx =
|
|
150
|
+
compilerOptions.jsx ?? (compilerOptions.jsx = ts.JsxEmit.Preserve);
|
|
149
151
|
compilerOptionsWithSourceMap = {
|
|
150
152
|
...compilerOptions,
|
|
151
153
|
sourceMap: true
|
|
@@ -166,6 +168,31 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
166
168
|
return systemFileExists(filename.slice(0, -4));
|
|
167
169
|
};
|
|
168
170
|
system.readFile = (filename, encoding = "utf-8") => {
|
|
171
|
+
if (import_path.default.basename(filename) === "package.json") {
|
|
172
|
+
let recurse2 = function(node) {
|
|
173
|
+
if (node && typeof node === "object") {
|
|
174
|
+
for (const key in node) {
|
|
175
|
+
const value = node[key];
|
|
176
|
+
if (typeof value === "string") {
|
|
177
|
+
if (value.endsWith(".civet")) {
|
|
178
|
+
node[key] = value + ".tsx";
|
|
179
|
+
modified = true;
|
|
180
|
+
}
|
|
181
|
+
} else if (value) {
|
|
182
|
+
recurse2(value);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
var recurse = recurse2;
|
|
188
|
+
const json = systemReadFile(filename);
|
|
189
|
+
if (!json)
|
|
190
|
+
return json;
|
|
191
|
+
const parsed = JSON.parse(json);
|
|
192
|
+
let modified = false;
|
|
193
|
+
recurse2(parsed.imports);
|
|
194
|
+
return modified ? JSON.stringify(parsed) : json;
|
|
195
|
+
}
|
|
169
196
|
if (!filename.endsWith(".civet.tsx"))
|
|
170
197
|
return systemReadFile(filename);
|
|
171
198
|
if (fsMap.has(filename))
|
|
@@ -216,6 +243,9 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
216
243
|
start: range.start
|
|
217
244
|
};
|
|
218
245
|
});
|
|
246
|
+
if (configErrors?.length) {
|
|
247
|
+
diagnostics.unshift(...configErrors);
|
|
248
|
+
}
|
|
219
249
|
if (diagnostics.length > 0) {
|
|
220
250
|
console.error(
|
|
221
251
|
ts.formatDiagnosticsWithColorAndContext(
|
package/dist/vite.js
CHANGED
|
@@ -100,6 +100,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
100
100
|
let compilerOptions, compilerOptionsWithSourceMap;
|
|
101
101
|
let rootDir = process.cwd();
|
|
102
102
|
let esbuildOptions;
|
|
103
|
+
let configErrors;
|
|
103
104
|
const tsPromise = transformTS || options.ts === "tsc" ? import("typescript").then((m) => m.default) : null;
|
|
104
105
|
const getFormatHost = (sys) => {
|
|
105
106
|
return {
|
|
@@ -140,12 +141,13 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
140
141
|
ts.sys,
|
|
141
142
|
process.cwd()
|
|
142
143
|
);
|
|
144
|
+
configErrors = configContents.errors;
|
|
143
145
|
compilerOptions = {
|
|
144
146
|
...configContents.options,
|
|
145
147
|
target: ts.ScriptTarget.ESNext,
|
|
146
148
|
composite: false
|
|
147
149
|
};
|
|
148
|
-
compilerOptions.jsx ?? (compilerOptions.jsx =
|
|
150
|
+
compilerOptions.jsx ?? (compilerOptions.jsx = ts.JsxEmit.Preserve);
|
|
149
151
|
compilerOptionsWithSourceMap = {
|
|
150
152
|
...compilerOptions,
|
|
151
153
|
sourceMap: true
|
|
@@ -166,6 +168,31 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
166
168
|
return systemFileExists(filename.slice(0, -4));
|
|
167
169
|
};
|
|
168
170
|
system.readFile = (filename, encoding = "utf-8") => {
|
|
171
|
+
if (import_path.default.basename(filename) === "package.json") {
|
|
172
|
+
let recurse2 = function(node) {
|
|
173
|
+
if (node && typeof node === "object") {
|
|
174
|
+
for (const key in node) {
|
|
175
|
+
const value = node[key];
|
|
176
|
+
if (typeof value === "string") {
|
|
177
|
+
if (value.endsWith(".civet")) {
|
|
178
|
+
node[key] = value + ".tsx";
|
|
179
|
+
modified = true;
|
|
180
|
+
}
|
|
181
|
+
} else if (value) {
|
|
182
|
+
recurse2(value);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
var recurse = recurse2;
|
|
188
|
+
const json = systemReadFile(filename);
|
|
189
|
+
if (!json)
|
|
190
|
+
return json;
|
|
191
|
+
const parsed = JSON.parse(json);
|
|
192
|
+
let modified = false;
|
|
193
|
+
recurse2(parsed.imports);
|
|
194
|
+
return modified ? JSON.stringify(parsed) : json;
|
|
195
|
+
}
|
|
169
196
|
if (!filename.endsWith(".civet.tsx"))
|
|
170
197
|
return systemReadFile(filename);
|
|
171
198
|
if (fsMap.has(filename))
|
|
@@ -216,6 +243,9 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
216
243
|
start: range.start
|
|
217
244
|
};
|
|
218
245
|
});
|
|
246
|
+
if (configErrors?.length) {
|
|
247
|
+
diagnostics.unshift(...configErrors);
|
|
248
|
+
}
|
|
219
249
|
if (diagnostics.length > 0) {
|
|
220
250
|
console.error(
|
|
221
251
|
ts.formatDiagnosticsWithColorAndContext(
|
package/dist/webpack.js
CHANGED
|
@@ -100,6 +100,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
100
100
|
let compilerOptions, compilerOptionsWithSourceMap;
|
|
101
101
|
let rootDir = process.cwd();
|
|
102
102
|
let esbuildOptions;
|
|
103
|
+
let configErrors;
|
|
103
104
|
const tsPromise = transformTS || options.ts === "tsc" ? import("typescript").then((m) => m.default) : null;
|
|
104
105
|
const getFormatHost = (sys) => {
|
|
105
106
|
return {
|
|
@@ -140,12 +141,13 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
140
141
|
ts.sys,
|
|
141
142
|
process.cwd()
|
|
142
143
|
);
|
|
144
|
+
configErrors = configContents.errors;
|
|
143
145
|
compilerOptions = {
|
|
144
146
|
...configContents.options,
|
|
145
147
|
target: ts.ScriptTarget.ESNext,
|
|
146
148
|
composite: false
|
|
147
149
|
};
|
|
148
|
-
compilerOptions.jsx ?? (compilerOptions.jsx =
|
|
150
|
+
compilerOptions.jsx ?? (compilerOptions.jsx = ts.JsxEmit.Preserve);
|
|
149
151
|
compilerOptionsWithSourceMap = {
|
|
150
152
|
...compilerOptions,
|
|
151
153
|
sourceMap: true
|
|
@@ -166,6 +168,31 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
166
168
|
return systemFileExists(filename.slice(0, -4));
|
|
167
169
|
};
|
|
168
170
|
system.readFile = (filename, encoding = "utf-8") => {
|
|
171
|
+
if (import_path.default.basename(filename) === "package.json") {
|
|
172
|
+
let recurse2 = function(node) {
|
|
173
|
+
if (node && typeof node === "object") {
|
|
174
|
+
for (const key in node) {
|
|
175
|
+
const value = node[key];
|
|
176
|
+
if (typeof value === "string") {
|
|
177
|
+
if (value.endsWith(".civet")) {
|
|
178
|
+
node[key] = value + ".tsx";
|
|
179
|
+
modified = true;
|
|
180
|
+
}
|
|
181
|
+
} else if (value) {
|
|
182
|
+
recurse2(value);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
var recurse = recurse2;
|
|
188
|
+
const json = systemReadFile(filename);
|
|
189
|
+
if (!json)
|
|
190
|
+
return json;
|
|
191
|
+
const parsed = JSON.parse(json);
|
|
192
|
+
let modified = false;
|
|
193
|
+
recurse2(parsed.imports);
|
|
194
|
+
return modified ? JSON.stringify(parsed) : json;
|
|
195
|
+
}
|
|
169
196
|
if (!filename.endsWith(".civet.tsx"))
|
|
170
197
|
return systemReadFile(filename);
|
|
171
198
|
if (fsMap.has(filename))
|
|
@@ -216,6 +243,9 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
216
243
|
start: range.start
|
|
217
244
|
};
|
|
218
245
|
});
|
|
246
|
+
if (configErrors?.length) {
|
|
247
|
+
diagnostics.unshift(...configErrors);
|
|
248
|
+
}
|
|
219
249
|
if (diagnostics.length > 0) {
|
|
220
250
|
console.error(
|
|
221
251
|
ts.formatDiagnosticsWithColorAndContext(
|
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.14",
|
|
5
5
|
"description": "CoffeeScript style syntax for TypeScript",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"module": "dist/main.mjs",
|
|
@@ -98,7 +98,13 @@
|
|
|
98
98
|
"vue": "^3.2.45"
|
|
99
99
|
},
|
|
100
100
|
"peerDependencies": {
|
|
101
|
-
"typescript": "^4.5 || ^5.0"
|
|
101
|
+
"typescript": "^4.5 || ^5.0",
|
|
102
|
+
"yaml": "^2.4.5"
|
|
103
|
+
},
|
|
104
|
+
"peerDependenciesMeta": {
|
|
105
|
+
"yaml": {
|
|
106
|
+
"optional": true
|
|
107
|
+
}
|
|
102
108
|
},
|
|
103
109
|
"c8": {
|
|
104
110
|
"all": true,
|
|
@@ -122,5 +128,6 @@
|
|
|
122
128
|
"source/parser/types.civet",
|
|
123
129
|
"source/bun-civet.civet"
|
|
124
130
|
]
|
|
125
|
-
}
|
|
131
|
+
},
|
|
132
|
+
"packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
|
|
126
133
|
}
|