@teacss/engine 0.8.5-alpha.4 → 0.9.0-alpha.3
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/binding-header.d.ts +20 -0
- package/binding.d.ts +19 -1
- package/binding.js +54 -54
- package/contract.d.ts +246 -0
- package/dist/facade/config-view.d.ts +27 -0
- package/dist/facade/config-view.js +96 -0
- package/dist/facade/constants.d.ts +22 -0
- package/{src/facade/constants.mjs → dist/facade/constants.js} +10 -11
- package/dist/facade/countable-set.d.ts +43 -0
- package/dist/facade/countable-set.js +149 -0
- package/dist/facade/errors.d.ts +11 -0
- package/dist/facade/errors.js +18 -0
- package/dist/facade/generator.d.ts +153 -0
- package/dist/facade/generator.js +777 -0
- package/dist/facade/index.d.ts +6 -0
- package/dist/facade/index.js +9 -0
- package/dist/facade/result.d.ts +68 -0
- package/dist/facade/result.js +134 -0
- package/dist/facade/select.d.ts +175 -0
- package/dist/facade/select.js +680 -0
- package/dist/facade/transformer.d.ts +44 -0
- package/dist/facade/transformer.js +59 -0
- package/dist/facade/ts-fallback.d.ts +32 -0
- package/dist/facade/ts-fallback.js +78 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/index.d.ts +1 -387
- package/index.js +1 -1
- package/package.json +42 -23
- package/src/facade/config-view.mjs +0 -82
- package/src/facade/countable-set.mjs +0 -179
- package/src/facade/errors.mjs +0 -22
- package/src/facade/generator.mjs +0 -812
- package/src/facade/index.mjs +0 -19
- package/src/facade/result.mjs +0 -157
- package/src/facade/select.mjs +0 -635
- package/src/facade/transformer.mjs +0 -56
- package/src/facade/ts-fallback.mjs +0 -88
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* auto-generated by NAPI-RS; header from binding-header.d.ts (v03.1 §3.3) */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
import type {
|
|
4
|
+
CustomDiagnostic,
|
|
5
|
+
EntryConfig,
|
|
6
|
+
EntryDiagnostic,
|
|
7
|
+
ExtractFileResult,
|
|
8
|
+
GenerateInput,
|
|
9
|
+
GenerateOptions,
|
|
10
|
+
GenerateResult,
|
|
11
|
+
InspectEntryRequest,
|
|
12
|
+
InspectEntryResult,
|
|
13
|
+
LoadProjectRequest,
|
|
14
|
+
LoadProjectResult,
|
|
15
|
+
ModuleUpdateResult,
|
|
16
|
+
ResolvedConfigView,
|
|
17
|
+
StringifiedUtil,
|
|
18
|
+
TransformResult,
|
|
19
|
+
UnmatchedDiagnostic,
|
|
20
|
+
} from "./contract.js";
|
package/binding.d.ts
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
/* auto-generated by NAPI-RS */
|
|
1
|
+
/* auto-generated by NAPI-RS; header from binding-header.d.ts (v03.1 §3.3) */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
import type {
|
|
4
|
+
CustomDiagnostic,
|
|
5
|
+
EntryConfig,
|
|
6
|
+
EntryDiagnostic,
|
|
7
|
+
ExtractFileResult,
|
|
8
|
+
GenerateInput,
|
|
9
|
+
GenerateOptions,
|
|
10
|
+
GenerateResult,
|
|
11
|
+
InspectEntryRequest,
|
|
12
|
+
InspectEntryResult,
|
|
13
|
+
LoadProjectRequest,
|
|
14
|
+
LoadProjectResult,
|
|
15
|
+
ModuleUpdateResult,
|
|
16
|
+
ResolvedConfigView,
|
|
17
|
+
StringifiedUtil,
|
|
18
|
+
TransformResult,
|
|
19
|
+
UnmatchedDiagnostic,
|
|
20
|
+
} from "./contract.js";
|
|
3
21
|
|
|
4
22
|
/**
|
|
5
23
|
* Which binding artifact the generated loader actually loaded: `'native'` for
|
package/binding.js
CHANGED
|
@@ -92,8 +92,8 @@ function requireNative() {
|
|
|
92
92
|
try {
|
|
93
93
|
const binding = require('@teacss/engine-android-arm64')
|
|
94
94
|
const bindingPackageVersion = require('@teacss/engine-android-arm64/package.json').version
|
|
95
|
-
if (bindingPackageVersion !== '0.
|
|
96
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
95
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
96
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
97
97
|
}
|
|
98
98
|
return binding
|
|
99
99
|
} catch (e) {
|
|
@@ -108,8 +108,8 @@ function requireNative() {
|
|
|
108
108
|
try {
|
|
109
109
|
const binding = require('@teacss/engine-android-arm-eabi')
|
|
110
110
|
const bindingPackageVersion = require('@teacss/engine-android-arm-eabi/package.json').version
|
|
111
|
-
if (bindingPackageVersion !== '0.
|
|
112
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
111
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
112
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
113
113
|
}
|
|
114
114
|
return binding
|
|
115
115
|
} catch (e) {
|
|
@@ -129,8 +129,8 @@ function requireNative() {
|
|
|
129
129
|
try {
|
|
130
130
|
const binding = require('@teacss/engine-win32-x64-gnu')
|
|
131
131
|
const bindingPackageVersion = require('@teacss/engine-win32-x64-gnu/package.json').version
|
|
132
|
-
if (bindingPackageVersion !== '0.
|
|
133
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
132
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
133
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
134
134
|
}
|
|
135
135
|
return binding
|
|
136
136
|
} catch (e) {
|
|
@@ -145,8 +145,8 @@ function requireNative() {
|
|
|
145
145
|
try {
|
|
146
146
|
const binding = require('@teacss/engine-win32-x64-msvc')
|
|
147
147
|
const bindingPackageVersion = require('@teacss/engine-win32-x64-msvc/package.json').version
|
|
148
|
-
if (bindingPackageVersion !== '0.
|
|
149
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
148
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
149
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
150
150
|
}
|
|
151
151
|
return binding
|
|
152
152
|
} catch (e) {
|
|
@@ -162,8 +162,8 @@ function requireNative() {
|
|
|
162
162
|
try {
|
|
163
163
|
const binding = require('@teacss/engine-win32-ia32-msvc')
|
|
164
164
|
const bindingPackageVersion = require('@teacss/engine-win32-ia32-msvc/package.json').version
|
|
165
|
-
if (bindingPackageVersion !== '0.
|
|
166
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
165
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
166
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
167
167
|
}
|
|
168
168
|
return binding
|
|
169
169
|
} catch (e) {
|
|
@@ -178,8 +178,8 @@ function requireNative() {
|
|
|
178
178
|
try {
|
|
179
179
|
const binding = require('@teacss/engine-win32-arm64-msvc')
|
|
180
180
|
const bindingPackageVersion = require('@teacss/engine-win32-arm64-msvc/package.json').version
|
|
181
|
-
if (bindingPackageVersion !== '0.
|
|
182
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
181
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
182
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
183
183
|
}
|
|
184
184
|
return binding
|
|
185
185
|
} catch (e) {
|
|
@@ -197,8 +197,8 @@ function requireNative() {
|
|
|
197
197
|
try {
|
|
198
198
|
const binding = require('@teacss/engine-darwin-universal')
|
|
199
199
|
const bindingPackageVersion = require('@teacss/engine-darwin-universal/package.json').version
|
|
200
|
-
if (bindingPackageVersion !== '0.
|
|
201
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
200
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
201
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
202
202
|
}
|
|
203
203
|
return binding
|
|
204
204
|
} catch (e) {
|
|
@@ -213,8 +213,8 @@ function requireNative() {
|
|
|
213
213
|
try {
|
|
214
214
|
const binding = require('@teacss/engine-darwin-x64')
|
|
215
215
|
const bindingPackageVersion = require('@teacss/engine-darwin-x64/package.json').version
|
|
216
|
-
if (bindingPackageVersion !== '0.
|
|
217
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
216
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
217
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
218
218
|
}
|
|
219
219
|
return binding
|
|
220
220
|
} catch (e) {
|
|
@@ -229,8 +229,8 @@ function requireNative() {
|
|
|
229
229
|
try {
|
|
230
230
|
const binding = require('@teacss/engine-darwin-arm64')
|
|
231
231
|
const bindingPackageVersion = require('@teacss/engine-darwin-arm64/package.json').version
|
|
232
|
-
if (bindingPackageVersion !== '0.
|
|
233
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
232
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
233
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
234
234
|
}
|
|
235
235
|
return binding
|
|
236
236
|
} catch (e) {
|
|
@@ -249,8 +249,8 @@ function requireNative() {
|
|
|
249
249
|
try {
|
|
250
250
|
const binding = require('@teacss/engine-freebsd-x64')
|
|
251
251
|
const bindingPackageVersion = require('@teacss/engine-freebsd-x64/package.json').version
|
|
252
|
-
if (bindingPackageVersion !== '0.
|
|
253
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
252
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
253
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
254
254
|
}
|
|
255
255
|
return binding
|
|
256
256
|
} catch (e) {
|
|
@@ -265,8 +265,8 @@ function requireNative() {
|
|
|
265
265
|
try {
|
|
266
266
|
const binding = require('@teacss/engine-freebsd-arm64')
|
|
267
267
|
const bindingPackageVersion = require('@teacss/engine-freebsd-arm64/package.json').version
|
|
268
|
-
if (bindingPackageVersion !== '0.
|
|
269
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
268
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
269
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
270
270
|
}
|
|
271
271
|
return binding
|
|
272
272
|
} catch (e) {
|
|
@@ -286,8 +286,8 @@ function requireNative() {
|
|
|
286
286
|
try {
|
|
287
287
|
const binding = require('@teacss/engine-linux-x64-musl')
|
|
288
288
|
const bindingPackageVersion = require('@teacss/engine-linux-x64-musl/package.json').version
|
|
289
|
-
if (bindingPackageVersion !== '0.
|
|
290
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
289
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
290
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
291
291
|
}
|
|
292
292
|
return binding
|
|
293
293
|
} catch (e) {
|
|
@@ -302,8 +302,8 @@ function requireNative() {
|
|
|
302
302
|
try {
|
|
303
303
|
const binding = require('@teacss/engine-linux-x64-gnu')
|
|
304
304
|
const bindingPackageVersion = require('@teacss/engine-linux-x64-gnu/package.json').version
|
|
305
|
-
if (bindingPackageVersion !== '0.
|
|
306
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
305
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
306
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
307
307
|
}
|
|
308
308
|
return binding
|
|
309
309
|
} catch (e) {
|
|
@@ -320,8 +320,8 @@ function requireNative() {
|
|
|
320
320
|
try {
|
|
321
321
|
const binding = require('@teacss/engine-linux-arm64-musl')
|
|
322
322
|
const bindingPackageVersion = require('@teacss/engine-linux-arm64-musl/package.json').version
|
|
323
|
-
if (bindingPackageVersion !== '0.
|
|
324
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
323
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
324
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
325
325
|
}
|
|
326
326
|
return binding
|
|
327
327
|
} catch (e) {
|
|
@@ -336,8 +336,8 @@ function requireNative() {
|
|
|
336
336
|
try {
|
|
337
337
|
const binding = require('@teacss/engine-linux-arm64-gnu')
|
|
338
338
|
const bindingPackageVersion = require('@teacss/engine-linux-arm64-gnu/package.json').version
|
|
339
|
-
if (bindingPackageVersion !== '0.
|
|
340
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
339
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
340
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
341
341
|
}
|
|
342
342
|
return binding
|
|
343
343
|
} catch (e) {
|
|
@@ -354,8 +354,8 @@ function requireNative() {
|
|
|
354
354
|
try {
|
|
355
355
|
const binding = require('@teacss/engine-linux-arm-musleabihf')
|
|
356
356
|
const bindingPackageVersion = require('@teacss/engine-linux-arm-musleabihf/package.json').version
|
|
357
|
-
if (bindingPackageVersion !== '0.
|
|
358
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
357
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
358
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
359
359
|
}
|
|
360
360
|
return binding
|
|
361
361
|
} catch (e) {
|
|
@@ -370,8 +370,8 @@ function requireNative() {
|
|
|
370
370
|
try {
|
|
371
371
|
const binding = require('@teacss/engine-linux-arm-gnueabihf')
|
|
372
372
|
const bindingPackageVersion = require('@teacss/engine-linux-arm-gnueabihf/package.json').version
|
|
373
|
-
if (bindingPackageVersion !== '0.
|
|
374
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
373
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
374
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
375
375
|
}
|
|
376
376
|
return binding
|
|
377
377
|
} catch (e) {
|
|
@@ -388,8 +388,8 @@ function requireNative() {
|
|
|
388
388
|
try {
|
|
389
389
|
const binding = require('@teacss/engine-linux-loong64-musl')
|
|
390
390
|
const bindingPackageVersion = require('@teacss/engine-linux-loong64-musl/package.json').version
|
|
391
|
-
if (bindingPackageVersion !== '0.
|
|
392
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
391
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
392
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
393
393
|
}
|
|
394
394
|
return binding
|
|
395
395
|
} catch (e) {
|
|
@@ -404,8 +404,8 @@ function requireNative() {
|
|
|
404
404
|
try {
|
|
405
405
|
const binding = require('@teacss/engine-linux-loong64-gnu')
|
|
406
406
|
const bindingPackageVersion = require('@teacss/engine-linux-loong64-gnu/package.json').version
|
|
407
|
-
if (bindingPackageVersion !== '0.
|
|
408
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
407
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
408
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
409
409
|
}
|
|
410
410
|
return binding
|
|
411
411
|
} catch (e) {
|
|
@@ -422,8 +422,8 @@ function requireNative() {
|
|
|
422
422
|
try {
|
|
423
423
|
const binding = require('@teacss/engine-linux-riscv64-musl')
|
|
424
424
|
const bindingPackageVersion = require('@teacss/engine-linux-riscv64-musl/package.json').version
|
|
425
|
-
if (bindingPackageVersion !== '0.
|
|
426
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
425
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
426
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
427
427
|
}
|
|
428
428
|
return binding
|
|
429
429
|
} catch (e) {
|
|
@@ -438,8 +438,8 @@ function requireNative() {
|
|
|
438
438
|
try {
|
|
439
439
|
const binding = require('@teacss/engine-linux-riscv64-gnu')
|
|
440
440
|
const bindingPackageVersion = require('@teacss/engine-linux-riscv64-gnu/package.json').version
|
|
441
|
-
if (bindingPackageVersion !== '0.
|
|
442
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
441
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
442
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
443
443
|
}
|
|
444
444
|
return binding
|
|
445
445
|
} catch (e) {
|
|
@@ -455,8 +455,8 @@ function requireNative() {
|
|
|
455
455
|
try {
|
|
456
456
|
const binding = require('@teacss/engine-linux-ppc64-gnu')
|
|
457
457
|
const bindingPackageVersion = require('@teacss/engine-linux-ppc64-gnu/package.json').version
|
|
458
|
-
if (bindingPackageVersion !== '0.
|
|
459
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
458
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
459
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
460
460
|
}
|
|
461
461
|
return binding
|
|
462
462
|
} catch (e) {
|
|
@@ -471,8 +471,8 @@ function requireNative() {
|
|
|
471
471
|
try {
|
|
472
472
|
const binding = require('@teacss/engine-linux-s390x-gnu')
|
|
473
473
|
const bindingPackageVersion = require('@teacss/engine-linux-s390x-gnu/package.json').version
|
|
474
|
-
if (bindingPackageVersion !== '0.
|
|
475
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
474
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
475
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
476
476
|
}
|
|
477
477
|
return binding
|
|
478
478
|
} catch (e) {
|
|
@@ -491,8 +491,8 @@ function requireNative() {
|
|
|
491
491
|
try {
|
|
492
492
|
const binding = require('@teacss/engine-openharmony-arm64')
|
|
493
493
|
const bindingPackageVersion = require('@teacss/engine-openharmony-arm64/package.json').version
|
|
494
|
-
if (bindingPackageVersion !== '0.
|
|
495
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
494
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
495
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
496
496
|
}
|
|
497
497
|
return binding
|
|
498
498
|
} catch (e) {
|
|
@@ -507,8 +507,8 @@ function requireNative() {
|
|
|
507
507
|
try {
|
|
508
508
|
const binding = require('@teacss/engine-openharmony-x64')
|
|
509
509
|
const bindingPackageVersion = require('@teacss/engine-openharmony-x64/package.json').version
|
|
510
|
-
if (bindingPackageVersion !== '0.
|
|
511
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
510
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
511
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
512
512
|
}
|
|
513
513
|
return binding
|
|
514
514
|
} catch (e) {
|
|
@@ -523,8 +523,8 @@ function requireNative() {
|
|
|
523
523
|
try {
|
|
524
524
|
const binding = require('@teacss/engine-openharmony-arm')
|
|
525
525
|
const bindingPackageVersion = require('@teacss/engine-openharmony-arm/package.json').version
|
|
526
|
-
if (bindingPackageVersion !== '0.
|
|
527
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
526
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
527
|
+
throw new Error(`Native binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
528
528
|
}
|
|
529
529
|
return binding
|
|
530
530
|
} catch (e) {
|
|
@@ -664,8 +664,8 @@ if (!nativeBinding || forceWasi) {
|
|
|
664
664
|
if (!candidateFailed) {
|
|
665
665
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
666
666
|
const bindingPackageVersion = require('@teacss/engine-wasm32-wasi/package.json').version
|
|
667
|
-
if (bindingPackageVersion !== '0.
|
|
668
|
-
throw new Error(`WASI binding package version mismatch, expected 0.
|
|
667
|
+
if (bindingPackageVersion !== '0.9.0-alpha.3') {
|
|
668
|
+
throw new Error(`WASI binding package version mismatch, expected 0.9.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
671
|
wasiBinding = require('@teacss/engine-wasm32-wasi')
|
package/contract.d.ts
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
// Mirror of docs/specs/v02.2-engine-contract.md §3 (spec-revision 2). Do not edit without bumping the spec revision.
|
|
2
|
+
export interface InspectEntryRequest {
|
|
3
|
+
/** 项目根(绝对路径)。相对 @source 以声明它的文件所在目录为基准。 */
|
|
4
|
+
root: string;
|
|
5
|
+
/** 入口 CSS 绝对路径。 */
|
|
6
|
+
entryPath: string;
|
|
7
|
+
/** 若宿主已持有入口内容(未保存的编辑器缓冲等),传入以替代磁盘读取。 */
|
|
8
|
+
entryCss?: string | undefined | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface InspectEntryResult {
|
|
12
|
+
/** @presets 列表,按声明顺序、去重(oracle resolvePresetGraph 的输入)。 */
|
|
13
|
+
presets: string[];
|
|
14
|
+
/** @source 声明;glob 已按声明文件目录解析为相对 root 的形式,exclude 以 `!` 前缀表示。 */
|
|
15
|
+
sources: string[];
|
|
16
|
+
/** 入口与本地 @import 图中读取过的文件(绝对路径,深度优先)。 */
|
|
17
|
+
configFiles: string[];
|
|
18
|
+
hasTeacss: boolean;
|
|
19
|
+
/** 入口语法诊断;非空时 loadProject 会以 E_ENTRY_INVALID 失败。 */
|
|
20
|
+
diagnostics: EntryDiagnostic[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface LoadProjectRequest {
|
|
24
|
+
root: string;
|
|
25
|
+
/** null 表示没有入口文件(oracle loadConfig 找不到 entry 的情形)。 */
|
|
26
|
+
entry: { path: string; css?: string | undefined | null } | null;
|
|
27
|
+
/** 已解析顺序的预设(oracle 排序规则:pre、normal、post,见 core/config.ts:209)。 */
|
|
28
|
+
presets: PresetSpec[];
|
|
29
|
+
/** @source 匹配到的 .css 文件(绝对路径),只贡献 @shortcut/@safelist。由 JS 枚举。 */
|
|
30
|
+
declarationFiles: string[];
|
|
31
|
+
/** 内联 UserConfig / defaults 中可静态表示的部分。 */
|
|
32
|
+
inline?: StaticConfig | undefined | null;
|
|
33
|
+
envMode: "dev" | "build";
|
|
34
|
+
unmatched: "warn" | "error" | "off";
|
|
35
|
+
/** 对应 UserConfig.outputToCssLayers;函数形式由 facade 判定回退。 */
|
|
36
|
+
outputToCssLayers?: boolean | { allLayers?: boolean } | undefined | null;
|
|
37
|
+
shortcutsLayer?: string | undefined | null;
|
|
38
|
+
virtualModulePrefix?: string | undefined | null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface LoadProjectResult {
|
|
42
|
+
programKey: string;
|
|
43
|
+
/** 与上一次 loadProject 相比 programKey 是否变化;首次为 true。 */
|
|
44
|
+
changed: boolean;
|
|
45
|
+
/** 声明文件中解析失败的位置(不阻止加载,oracle 行为相同)。 */
|
|
46
|
+
warnings: EntryDiagnostic[];
|
|
47
|
+
/** @custom 中不属于任何命名空间的属性名(oracle `ResolveEntryResult.unknown`),facade 的 `resolveEntryConfig` 透传。 */
|
|
48
|
+
unknownCustom: string[];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type PresetSpec = { kind: "standard"; options?: PresetStandardOptions | undefined | null } | { kind: "official" } | { kind: "icons"; options?: PresetIconsOptions | undefined | null } | { kind: "static"; preset: StaticPreset };
|
|
52
|
+
|
|
53
|
+
export interface PresetStandardOptions {
|
|
54
|
+
modeSelectors?: { dark?: string; light?: string } | undefined | null;
|
|
55
|
+
containers?: Record<string, string> | undefined | null;
|
|
56
|
+
preflight?: boolean | "on-demand" | undefined | null;
|
|
57
|
+
variablePrefix?: string | undefined | null;
|
|
58
|
+
compileClass?: boolean | CompileClassOptions | undefined | null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface CompileClassOptions {
|
|
62
|
+
classPrefix?: string | undefined | null;
|
|
63
|
+
alwaysHash?: boolean | undefined | null;
|
|
64
|
+
keepUnknown?: boolean | undefined | null;
|
|
65
|
+
layer?: string | undefined | null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface PresetIconsOptions {
|
|
69
|
+
scale?: number | undefined | null;
|
|
70
|
+
mode?: "mask" | "bg" | "auto" | undefined | null;
|
|
71
|
+
extraProperties?: Record<string, string> | undefined | null;
|
|
72
|
+
warn?: boolean | undefined | null;
|
|
73
|
+
layer?: string | undefined | null;
|
|
74
|
+
unit?: string | undefined | null;
|
|
75
|
+
/** 只允许内置集合名;其他集合由 facade 判定回退。 */
|
|
76
|
+
collections?: string[] | undefined | null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** 本地/第三方 preset 的可静态表示部分。任何不能表示的字段都由 facade 判定回退,不进入这里。 */
|
|
80
|
+
export interface StaticPreset {
|
|
81
|
+
name: string;
|
|
82
|
+
enforce?: "pre" | "post" | undefined | null;
|
|
83
|
+
layer?: string | undefined | null;
|
|
84
|
+
layers?: Record<string, number> | undefined | null;
|
|
85
|
+
shortcuts?: Array<[string, string]> | undefined | null;
|
|
86
|
+
safelist?: string[] | undefined | null;
|
|
87
|
+
blocklist?: string[] | undefined | null;
|
|
88
|
+
/** 只接受 oracle `Theme` 中的标量叶子;对象按点路径展平后传入。 */
|
|
89
|
+
theme?: Record<string, string> | undefined | null;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface StaticConfig {
|
|
93
|
+
shortcuts?: Array<[string, string]> | undefined | null;
|
|
94
|
+
safelist?: string[] | undefined | null;
|
|
95
|
+
blocklist?: string[] | undefined | null;
|
|
96
|
+
layers?: Record<string, number> | undefined | null;
|
|
97
|
+
theme?: Record<string, string> | undefined | null;
|
|
98
|
+
content?: { filesystem?: string[] | undefined | null } | undefined | null;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface ModuleUpdateResult {
|
|
102
|
+
tokens: string[];
|
|
103
|
+
/** 该模块 token 集或 compile-class 定义相对上一次是否变化。 */
|
|
104
|
+
changed: boolean;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface ExtractFileResult {
|
|
108
|
+
path: string;
|
|
109
|
+
tokens: string[];
|
|
110
|
+
/** 读取失败时的错误码(E_IO);成功为 null。 */
|
|
111
|
+
error: string | null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface TransformResult {
|
|
115
|
+
code: string;
|
|
116
|
+
/** 从原文到 code 的替换序列,UTF-16 code unit 偏移,按 (start, end) 升序且互不重叠。facade 在宿主的 MagicString 上按顺序回放:`start === end ? s.appendLeft(start, text) : s.update(start, end, text)`(magic-string 1.x 的 `update` 与 `overwrite` 除 `storeName` 默认值外相同),使 runtime 生成的 source map 与 0.8.2 完全一致(v02.8 §7)。 */
|
|
117
|
+
edits: Array<{ start: number; end: number; text: string }>;
|
|
118
|
+
/** 独立使用者(无 MagicString)用的 Source Map v3:sources = [id],sourcesContent = [原文]。 */
|
|
119
|
+
map: SourceMap;
|
|
120
|
+
/** oracle SourceCodeTransformer 返回的高亮区间(compileClass 提供)。 */
|
|
121
|
+
highlightAnnotations: HighlightAnnotation[];
|
|
122
|
+
/** transformSource:本次登记的 compile-class 类名(facade 并入 `ctx.tokens`,v02.9 §6);transformStylesheet 为空数组。 */
|
|
123
|
+
compiledClasses: string[];
|
|
124
|
+
/** transformSource:该模块的定义集相对上一次是否变化(facade 据此调用 `ctx.invalidate()`);transformStylesheet 为 false。 */
|
|
125
|
+
definitionsChanged: boolean;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface SourceMap {
|
|
129
|
+
version: 3;
|
|
130
|
+
file: string | null;
|
|
131
|
+
sources: string[];
|
|
132
|
+
sourcesContent: string[];
|
|
133
|
+
names: string[];
|
|
134
|
+
mappings: string;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface HighlightAnnotation {
|
|
138
|
+
offset: number;
|
|
139
|
+
length: number;
|
|
140
|
+
className: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export type GenerateInput = { kind: "tokens"; tokens: string[] } | { kind: "code"; code: string; id?: string | undefined | null } | { kind: "all" };
|
|
144
|
+
|
|
145
|
+
export interface GenerateOptions {
|
|
146
|
+
id?: string | undefined | null;
|
|
147
|
+
/** 默认 true */
|
|
148
|
+
preflights?: boolean | undefined | null;
|
|
149
|
+
/** 默认 true */
|
|
150
|
+
safelist?: boolean | undefined | null;
|
|
151
|
+
/** 默认 false */
|
|
152
|
+
minify?: boolean | undefined | null;
|
|
153
|
+
/** 默认 false;为 true 时填充 matchedInfo */
|
|
154
|
+
extendedInfo?: boolean | undefined | null;
|
|
155
|
+
scope?: string | undefined | null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface GenerateResult {
|
|
159
|
+
/** 与 oracle `result.css` 逐字节相同。 */
|
|
160
|
+
css: string;
|
|
161
|
+
/** 有序层;oracle `result.layers` 与 `getLayer(name)` 的来源。 */
|
|
162
|
+
layers: Array<{ name: string; css: string }>;
|
|
163
|
+
/** oracle `result.matched`(Set)按首次出现顺序。 */
|
|
164
|
+
matched: string[];
|
|
165
|
+
/** extendedInfo 时填充。input 为 {kind:"code"} 时 count 是该 token 在抽取结果中的出现次数(oracle CountableSet 语义);tokens/all 输入时为 -1(oracle 对不可计数输入的语义)。 */
|
|
166
|
+
matchedInfo: Array<{ token: string; data: StringifiedUtil[]; count: number }> | null;
|
|
167
|
+
programKey: string;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** oracle `StringifiedUtil` 元组的对象形式;`context` 字段不跨边界,facade 以 undefined 填充。 */
|
|
171
|
+
export interface StringifiedUtil {
|
|
172
|
+
index: number;
|
|
173
|
+
selector: string | null;
|
|
174
|
+
body: string;
|
|
175
|
+
parent: string | null;
|
|
176
|
+
meta: RuleMeta | null;
|
|
177
|
+
noMerge: boolean | null;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface RuleMeta {
|
|
181
|
+
layer?: string | undefined | null;
|
|
182
|
+
noMerge?: boolean | undefined | null;
|
|
183
|
+
noScope?: boolean | undefined | null;
|
|
184
|
+
sort?: number | undefined | null;
|
|
185
|
+
prefix?: string | string[] | undefined | null;
|
|
186
|
+
internal?: boolean | undefined | null;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface UnmatchedDiagnostic {
|
|
190
|
+
token: string;
|
|
191
|
+
suggestions: string[];
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface EntryConfig {
|
|
195
|
+
presets: string[];
|
|
196
|
+
rolePalettes: Partial<Record<"primary" | "neutral" | "success" | "warning" | "failure" | "general" | "focused", string[]>> | null;
|
|
197
|
+
sources: Array<{ glob: string; exclude: boolean }>;
|
|
198
|
+
custom: Array<{
|
|
199
|
+
alias: { name: string; family: string } | null;
|
|
200
|
+
mode: string | null;
|
|
201
|
+
declarations: Array<{ property: string; value: string }>;
|
|
202
|
+
}>;
|
|
203
|
+
shortcuts: Array<{ name: string; expansion: string }>;
|
|
204
|
+
safelist: string[];
|
|
205
|
+
hasTeacss: boolean;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export interface EntryDiagnostic {
|
|
209
|
+
file: string | null;
|
|
210
|
+
start: number;
|
|
211
|
+
end: number;
|
|
212
|
+
message: string;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface CustomDiagnostic {
|
|
216
|
+
property: string;
|
|
217
|
+
start: number;
|
|
218
|
+
end: number;
|
|
219
|
+
reason: "unknown-prefix" | "illegal-color-step" | "removed-theme";
|
|
220
|
+
message: string;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface ResolvedConfigView {
|
|
224
|
+
presets: Array<{ name: string; enforce: "pre" | "post" | null; layer: string | null }>;
|
|
225
|
+
layers: Record<string, number>;
|
|
226
|
+
content: { filesystem: string[] } | null;
|
|
227
|
+
/** 合并后的 theme(oracle `config.theme`);嵌套对象原样。 */
|
|
228
|
+
theme: Record<string, unknown>;
|
|
229
|
+
shortcuts: Array<[string, string]>;
|
|
230
|
+
safelist: string[];
|
|
231
|
+
blocklist: string[];
|
|
232
|
+
separators: string[];
|
|
233
|
+
envMode: "dev" | "build";
|
|
234
|
+
unmatched: "warn" | "error" | "off";
|
|
235
|
+
shortcutsLayer: string;
|
|
236
|
+
virtualModulePrefix: string;
|
|
237
|
+
mergeSelectors: boolean;
|
|
238
|
+
warn: boolean;
|
|
239
|
+
details: boolean;
|
|
240
|
+
outputToCssLayers: boolean | { allLayers: boolean } | false;
|
|
241
|
+
rulesSize: number;
|
|
242
|
+
transformers: Array<{ name: string; enforce: "pre" | "post" | "default" }>;
|
|
243
|
+
extractors: Array<{ name: string }>;
|
|
244
|
+
standard: { preflight: boolean | "on-demand"; variablePrefix: string; compileClass: boolean } | null;
|
|
245
|
+
icons: { collections: string[]; mode: "mask" | "bg" | "auto"; layer: string } | null;
|
|
246
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Fields the TypeScript generator provides; reading one before materialize throws `E_TS_REQUIRED`. */
|
|
2
|
+
export declare const TS_ONLY_FIELDS: readonly string[];
|
|
3
|
+
/** Fields copied from the Rust `ResolvedConfigView`. */
|
|
4
|
+
export declare const VIEW_FIELDS: readonly string[];
|
|
5
|
+
export interface ConfigViewArgs {
|
|
6
|
+
view: Record<string, any>;
|
|
7
|
+
request: object;
|
|
8
|
+
presets: object[];
|
|
9
|
+
/** The merged config (`mergeDefinedConfig(defaults, userConfig)`) the oracle spreads. */
|
|
10
|
+
userConfig: Record<string, unknown>;
|
|
11
|
+
transformers: object[];
|
|
12
|
+
host: {
|
|
13
|
+
core?: {
|
|
14
|
+
extractorSplit: object;
|
|
15
|
+
} | undefined;
|
|
16
|
+
};
|
|
17
|
+
fallback: {
|
|
18
|
+
peek(): {
|
|
19
|
+
config: Record<string, unknown>;
|
|
20
|
+
} | null;
|
|
21
|
+
};
|
|
22
|
+
engine?: {
|
|
23
|
+
compileClassShortcuts(): unknown[];
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export declare function createConfigView({ view, presets, userConfig, transformers, host, fallback, engine }: ConfigViewArgs): Record<string, unknown>;
|
|
27
|
+
//# sourceMappingURL=config-view.d.ts.map
|