@teacss/engine 0.9.3 → 0.10.2
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/LICENSE +22 -0
- package/README.md +28 -109
- package/binding-header.d.ts +9 -0
- package/binding.d.ts +29 -0
- package/binding.js +56 -55
- package/contract.d.ts +121 -16
- package/dist/entry.d.ts +20 -0
- package/dist/entry.js +279 -0
- package/dist/errors.d.ts +1 -7
- package/dist/errors.js +1 -13
- package/dist/fonts.d.ts +21 -0
- package/dist/fonts.js +32 -0
- package/dist/index.d.ts +3 -4
- package/dist/index.js +4 -7
- package/dist/project.d.ts +80 -0
- package/dist/project.js +136 -0
- package/package.json +19 -49
- package/dist/config-view.d.ts +0 -36
- package/dist/config-view.js +0 -135
- package/dist/constants.d.ts +0 -22
- package/dist/constants.js +0 -23
- package/dist/countable-set.d.ts +0 -57
- package/dist/countable-set.js +0 -205
- package/dist/generator.d.ts +0 -163
- package/dist/generator.js +0 -893
- package/dist/result.d.ts +0 -83
- package/dist/result.js +0 -142
- package/dist/select.d.ts +0 -183
- package/dist/select.js +0 -741
- package/dist/transformer.d.ts +0 -44
- package/dist/transformer.js +0 -59
- package/dist/ts-fallback.d.ts +0 -41
- package/dist/ts-fallback.js +0 -79
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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2' && 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.10.2 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.10.2') {
|
|
668
|
+
throw new Error(`WASI binding package version mismatch, expected 0.10.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
671
|
wasiBinding = require('@teacss/engine-wasm32-wasi')
|
|
@@ -716,12 +716,13 @@ if (!nativeBinding) {
|
|
|
716
716
|
throw new Error(`Failed to load native binding`)
|
|
717
717
|
}
|
|
718
718
|
|
|
719
|
-
const { Engine, diagnoseCustom, diagnoseEntry, expandClassGroups, hash, parseEntry, splitClassTokens, version } = nativeBinding
|
|
719
|
+
const { Engine, diagnoseCustom, diagnoseEntry, expandClassGroups, hash, markers, parseEntry, splitClassTokens, version } = nativeBinding
|
|
720
720
|
export { Engine }
|
|
721
721
|
export { diagnoseCustom }
|
|
722
722
|
export { diagnoseEntry }
|
|
723
723
|
export { expandClassGroups }
|
|
724
724
|
export { hash }
|
|
725
|
+
export { markers }
|
|
725
726
|
export { parseEntry }
|
|
726
727
|
export { splitClassTokens }
|
|
727
728
|
export { version }
|
package/contract.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Mirror of
|
|
1
|
+
// Mirror of notes/specs/v02.2-engine-contract.md §3 (spec-revision 24). Do not edit without bumping the spec revision.
|
|
2
2
|
export interface InspectEntryRequest {
|
|
3
3
|
/** 项目根(绝对路径)。相对 @source 以声明它的文件所在目录为基准。 */
|
|
4
4
|
root: string;
|
|
@@ -32,10 +32,9 @@ export interface LoadProjectRequest {
|
|
|
32
32
|
inline?: StaticConfig | undefined | null;
|
|
33
33
|
envMode: "dev" | "build";
|
|
34
34
|
unmatched: "warn" | "error" | "off";
|
|
35
|
-
/** 对应 UserConfig.outputToCssLayers
|
|
36
|
-
outputToCssLayers?: boolean |
|
|
35
|
+
/** 对应 UserConfig.outputToCssLayers;cssLayerName 只有静态表的形状(v10.2 §2.1)。 */
|
|
36
|
+
outputToCssLayers?: boolean | OutputToCssLayersOptions | undefined | null;
|
|
37
37
|
shortcutsLayer?: string | undefined | null;
|
|
38
|
-
virtualModulePrefix?: string | undefined | null;
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
export interface LoadProjectResult {
|
|
@@ -44,10 +43,47 @@ export interface LoadProjectResult {
|
|
|
44
43
|
changed: boolean;
|
|
45
44
|
/** 声明文件中解析失败的位置(不阻止加载,oracle 行为相同)。 */
|
|
46
45
|
warnings: EntryDiagnostic[];
|
|
47
|
-
/** @custom 中不属于任何命名空间的属性名(oracle `ResolveEntryResult.unknown
|
|
46
|
+
/** @custom 中不属于任何命名空间的属性名(oracle `ResolveEntryResult.unknown`),调用方原样透传。 */
|
|
48
47
|
unknownCustom: string[];
|
|
49
48
|
}
|
|
50
49
|
|
|
50
|
+
/** 修订 18:未知键报 E_INVALID_ARGUMENT(details.path 为 "request")。 */
|
|
51
|
+
export interface LoadProjectFromRootRequest {
|
|
52
|
+
/** 项目根(绝对路径)。 */
|
|
53
|
+
root: string;
|
|
54
|
+
/** 入口文件(绝对路径)或 null:null 时按 v10.1 §4.1 发现;找不到入口时 entry 为 null、presets 为空。 */
|
|
55
|
+
entry?: string | undefined | null;
|
|
56
|
+
/** 入口内容(未保存的编辑器缓冲等),只在 entry 给定时有意义。 */
|
|
57
|
+
entryCss?: string | undefined | null;
|
|
58
|
+
/** 与 LoadProjectRequest 相同;presets 不能传,由入口的 @presets 决定。 */
|
|
59
|
+
inline?: StaticConfig | undefined | null;
|
|
60
|
+
envMode: "dev" | "build";
|
|
61
|
+
unmatched: "warn" | "error" | "off";
|
|
62
|
+
outputToCssLayers?: boolean | OutputToCssLayersOptions | undefined | null;
|
|
63
|
+
shortcutsLayer?: string | undefined | null;
|
|
64
|
+
/** 覆盖内置预设的选项(没有入口的项目也能开 Standard):键是预设名。 */
|
|
65
|
+
presetOptions?: { standard?: PresetStandardOptions; icons?: PresetIconsOptions } | undefined | null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface LoadProjectFromRootResult extends LoadProjectResult {
|
|
69
|
+
/** 实际用的入口;null 表示没有入口。 */
|
|
70
|
+
entryPath: string | null;
|
|
71
|
+
/** @presets 展开后的 PresetSpec 的名字,顺序即加载顺序。 */
|
|
72
|
+
presets: string[];
|
|
73
|
+
/** @source 枚举得到并归一化后的声明文件(architecture §5)。 */
|
|
74
|
+
declarationFiles: string[];
|
|
75
|
+
/** 入口、import、声明文件之外,@source 的 glob 匹配到的全部文件(绝对路径,排序),供壳子的 watch 与 extractFilesUnion 用。 */
|
|
76
|
+
sourceFiles: string[];
|
|
77
|
+
/** @source 的 glob 起点下列不出内容的目录(绝对路径,排序):里面的文件不在 sourceFiles 里,壳子像读不了的文件一样警告。 */
|
|
78
|
+
unreadableDirectories: string[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface OutputToCssLayersOptions {
|
|
82
|
+
allLayers?: boolean | undefined | null;
|
|
83
|
+
/** 内部层名 → 输出的 @layer 名;null 表示该层不写 @layer;没列出的层用内部名。 */
|
|
84
|
+
cssLayerName?: Record<string, string | null> | undefined | null;
|
|
85
|
+
}
|
|
86
|
+
|
|
51
87
|
export type PresetSpec = { kind: "standard"; options?: PresetStandardOptions | undefined | null } | { kind: "official" } | { kind: "icons"; options?: PresetIconsOptions | undefined | null } | { kind: "static"; preset: StaticPreset };
|
|
52
88
|
|
|
53
89
|
export interface PresetStandardOptions {
|
|
@@ -72,11 +108,14 @@ export interface PresetIconsOptions {
|
|
|
72
108
|
warn?: boolean | undefined | null;
|
|
73
109
|
layer?: string | undefined | null;
|
|
74
110
|
unit?: string | undefined | null;
|
|
75
|
-
/**
|
|
76
|
-
collections?: string[] | undefined | null;
|
|
111
|
+
/** 内置集合名列表(每项视为 true),或对象:内置集合名为 true,自定义集合的值是 Iconify JSON 对象或 .json 文件的绝对路径。 */
|
|
112
|
+
collections?: string[] | Record<string, true | string | IconifyJson> | undefined | null;
|
|
77
113
|
}
|
|
78
114
|
|
|
79
|
-
/**
|
|
115
|
+
/** 一个 Iconify JSON 集合(`IconifyJSON`);字段以 Iconify JSON 规范为准,合同不展开。 */
|
|
116
|
+
export type IconifyJson = Record<string, unknown>;
|
|
117
|
+
|
|
118
|
+
/** 本地/第三方 preset 的可静态表示部分;不能静态表示的字段没有形状,不进入这里。v10.2 起壳子不传 preset 对象,只有 `loadProject` 的直接调用方用到它。 */
|
|
80
119
|
export interface StaticPreset {
|
|
81
120
|
name: string;
|
|
82
121
|
enforce?: "pre" | "post" | undefined | null;
|
|
@@ -95,7 +134,16 @@ export interface StaticConfig {
|
|
|
95
134
|
blocklist?: string[] | undefined | null;
|
|
96
135
|
layers?: Record<string, number> | undefined | null;
|
|
97
136
|
theme?: Record<string, string> | undefined | null;
|
|
98
|
-
|
|
137
|
+
/** 变体与 token 的分隔符;省略为 [":", "-"]。每项非空、互不为前缀。 */
|
|
138
|
+
separators?: string[] | undefined | null;
|
|
139
|
+
content?:
|
|
140
|
+
| {
|
|
141
|
+
filesystem?: string[] | undefined | null;
|
|
142
|
+
/** 内联内容:字符串即代码,id 省略时为 "inline:<序号>"。 */
|
|
143
|
+
inline?: Array<string | { code: string; id?: string | undefined | null }> | undefined | null;
|
|
144
|
+
}
|
|
145
|
+
| undefined
|
|
146
|
+
| null;
|
|
99
147
|
}
|
|
100
148
|
|
|
101
149
|
export interface ModuleUpdateResult {
|
|
@@ -111,17 +159,24 @@ export interface ExtractFileResult {
|
|
|
111
159
|
error: string | null;
|
|
112
160
|
}
|
|
113
161
|
|
|
162
|
+
export interface ExtractFilesUnionResult {
|
|
163
|
+
/** 成功读取的文件的 token 并集,顺序见 extractFilesUnion。 */
|
|
164
|
+
tokens: string[];
|
|
165
|
+
/** 读失败的文件,按输入顺序;error 与 ExtractFileResult.error 取值相同。 */
|
|
166
|
+
failed: Array<{ path: string; error: string }>;
|
|
167
|
+
}
|
|
168
|
+
|
|
114
169
|
export interface TransformResult {
|
|
115
170
|
code: string;
|
|
116
|
-
/** 从原文到 code 的替换序列,UTF-16 code unit 偏移,按 (start, end)
|
|
171
|
+
/** 从原文到 code 的替换序列,UTF-16 code unit 偏移,按 (start, end) 升序且互不重叠。自己持有字符串的宿主按顺序回放(`replayEdits`,或 MagicString 的 `start === end ? s.appendLeft(start, text) : s.update(start, end, text)`;magic-string 1.x 的 `update` 与 `overwrite` 除 `storeName` 默认值外相同),使宿主生成的 source map 与 0.8.2 完全一致(v02.8 §7)。 */
|
|
117
172
|
edits: Array<{ start: number; end: number; text: string }>;
|
|
118
173
|
/** 独立使用者(无 MagicString)用的 Source Map v3:sources = [id],sourcesContent = [原文]。 */
|
|
119
174
|
map: SourceMap;
|
|
120
175
|
/** oracle SourceCodeTransformer 返回的高亮区间(compileClass 提供)。 */
|
|
121
176
|
highlightAnnotations: HighlightAnnotation[];
|
|
122
|
-
/** transformSource:本次登记的 compile-class
|
|
177
|
+
/** transformSource:本次登记的 compile-class 类名(已进该模块的 token 集,v02.9 §6);transformStylesheet 为空数组。 */
|
|
123
178
|
compiledClasses: string[];
|
|
124
|
-
/** transformSource
|
|
179
|
+
/** transformSource:该模块的定义集相对上一次是否变化(壳子据此失效生成的样式表);transformStylesheet 为 false。 */
|
|
125
180
|
definitionsChanged: boolean;
|
|
126
181
|
}
|
|
127
182
|
|
|
@@ -153,7 +208,7 @@ export interface GenerateOptions {
|
|
|
153
208
|
/** 默认 false;为 true 时填充 matchedInfo */
|
|
154
209
|
extendedInfo?: boolean | undefined | null;
|
|
155
210
|
scope?: string | undefined | null;
|
|
156
|
-
/** 默认 true;false 时不拼、不传整表 css,result.css 为 ""
|
|
211
|
+
/** 默认 true;false 时不拼、不传整表 css,result.css 为 ""。自己用 layers 拼样式表的调用方传 false。 */
|
|
157
212
|
css?: boolean | undefined | null;
|
|
158
213
|
}
|
|
159
214
|
|
|
@@ -167,7 +222,7 @@ export interface GenerateResult {
|
|
|
167
222
|
/** extendedInfo 时填充。input 为 {kind:"code"} 时 count 是该 token 在抽取结果中的出现次数(oracle CountableSet 语义);tokens/all 输入时为 -1(oracle 对不可计数输入的语义)。 */
|
|
168
223
|
matchedInfo: Array<{ token: string; data: StringifiedUtil[]; count: number }> | null;
|
|
169
224
|
programKey: string;
|
|
170
|
-
/** 有 shortcut 留下警告时才有这个键,按 token 的访问顺序(输入,再 safelist),每个 token
|
|
225
|
+
/** 有 shortcut 留下警告时才有这个键,按 token 的访问顺序(输入,再 safelist),每个 token 至多一项。调用方据此打印 oracle `stringifyShortcuts` 文本的警告(§6.8)。 */
|
|
171
226
|
shortcutWarnings?: ShortcutWarning[];
|
|
172
227
|
}
|
|
173
228
|
|
|
@@ -178,7 +233,7 @@ export interface GenerateResult {
|
|
|
178
233
|
*/
|
|
179
234
|
export type ShortcutWarning = { shortcut: string; unmatched: string[] } | { shortcut: string; leafLimit: number };
|
|
180
235
|
|
|
181
|
-
/** oracle `StringifiedUtil` 元组的对象形式;`context`
|
|
236
|
+
/** oracle `StringifiedUtil` 元组的对象形式;`context` 字段不跨边界,需要时由调用方以 undefined 填充。 */
|
|
182
237
|
export interface StringifiedUtil {
|
|
183
238
|
index: number;
|
|
184
239
|
selector: string | null;
|
|
@@ -244,7 +299,6 @@ export interface ResolvedConfigView {
|
|
|
244
299
|
envMode: "dev" | "build";
|
|
245
300
|
unmatched: "warn" | "error" | "off";
|
|
246
301
|
shortcutsLayer: string;
|
|
247
|
-
virtualModulePrefix: string;
|
|
248
302
|
mergeSelectors: boolean;
|
|
249
303
|
warn: boolean;
|
|
250
304
|
details: boolean;
|
|
@@ -266,6 +320,8 @@ export interface RuleInfo {
|
|
|
266
320
|
/** `MatcherKey` 的变体:Property、PropertyPrefix、Keyword;shortcut 按名作 keyword。 */
|
|
267
321
|
matcher: { kind: "property" | "prefix" | "keyword"; value: string };
|
|
268
322
|
source: "standard" | "official" | "icons" | "shortcut";
|
|
323
|
+
/** `RuleDescriptor` 的补全模板(teacss-ts `parseAutocomplete` 语法,v10.3 §2.1);一条 teacss-ts 规则拆成多个描述符时只在第一个上,shortcut 与没有模板的规则为空数组。 */
|
|
324
|
+
autocomplete: string[];
|
|
269
325
|
}
|
|
270
326
|
|
|
271
327
|
export interface VariantInfo {
|
|
@@ -274,6 +330,8 @@ export interface VariantInfo {
|
|
|
274
330
|
/** 接受它的解析器:pseudo、relational、attribute、language、media、at-rule、container、breakpoint、arbitrary。 */
|
|
275
331
|
kind: string;
|
|
276
332
|
source: RuleInfo["source"];
|
|
333
|
+
/** 变体的补全模板;teacss-ts 0.9.4 没有声明任何变体模板,今天全为空数组。 */
|
|
334
|
+
autocomplete: string[];
|
|
277
335
|
}
|
|
278
336
|
|
|
279
337
|
export interface EngineStats {
|
|
@@ -288,3 +346,50 @@ export interface EngineStats {
|
|
|
288
346
|
/** 上一次 generate 结果:css、各层 css、matched 的字节和;没有时为 0。 */
|
|
289
347
|
memoBytes: number;
|
|
290
348
|
}
|
|
349
|
+
|
|
350
|
+
/** 修订 21:`Engine.suggest` 的选项;未知键报 E_INVALID_ARGUMENT(details.path 为 "options")。 */
|
|
351
|
+
export interface SuggestOptions {
|
|
352
|
+
/** 默认 "prefix":候选以输入开头(无匹配时两边去掉 `-` 再比);"fuzzy" 用 nucleo-matcher 对整个输入打分。 */
|
|
353
|
+
matchType?: "prefix" | "fuzzy" | undefined | null;
|
|
354
|
+
/** 默认 false;true 只留引擎能编译的候选(`alc:$`、`alc:[]` 这类占位候选不出现)。 */
|
|
355
|
+
strict?: boolean | undefined | null;
|
|
356
|
+
/** 截断条数,默认 1000(LSP 设置 `autocomplete.maxItems` 的默认值);0 返回空;负数或非整数报 E_INVALID_ARGUMENT。 */
|
|
357
|
+
limit?: number | undefined | null;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/** 修订 21:一条补全候选(v10.3 §2.2)。 */
|
|
361
|
+
export interface Suggestion {
|
|
362
|
+
/** 要插入的完整文本,输入里剥掉的变体(`@hover`、结尾 `!`)已接回。 */
|
|
363
|
+
text: string;
|
|
364
|
+
/** utility:规则模板展开、静态规则 token 或输入本身;shortcut:配置的 shortcut 名;variant:补全最后一个 `@` 段的条件名;themeValue:`$theme.path` 模板部分贡献的展开。 */
|
|
365
|
+
kind: "utility" | "shortcut" | "variant" | "themeValue";
|
|
366
|
+
/** themeValue 给主题值,variant 给解析器种类,其余 null。 */
|
|
367
|
+
detail: string | null;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/** 修订 21:sRGB 颜色,各通道 0–1。 */
|
|
371
|
+
export interface Rgba {
|
|
372
|
+
r: number;
|
|
373
|
+
g: number;
|
|
374
|
+
b: number;
|
|
375
|
+
a: number;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/** 修订 21:一个匹配的 token 在编辑器里展示的信息(v10.3 §2.2)。 */
|
|
379
|
+
export interface TokenInfo {
|
|
380
|
+
/** `generate({kind:"tokens"})` 只对这一个 token 的输出:不出 preflight、不包 `@layer`、不加 scope,每层去掉 `/* layer: … *\/` 注释后以 `\n` 连接。 */
|
|
381
|
+
css: string;
|
|
382
|
+
/** 第一个 util 的层(规则没写时为 "utilities")。 */
|
|
383
|
+
layer: string;
|
|
384
|
+
/** 第一个 util 的 parent at-rule 链(如 "@media (min-width: 1024px)");没有为 null。 */
|
|
385
|
+
parent: string | null;
|
|
386
|
+
/** 声明里解析出的第一个颜色(经 util 的自定义属性与主题取值),没有为 null。 */
|
|
387
|
+
color: Rgba | null;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/** 修订 21:源码里一个被抽取 token 的 UTF-16 区间与它是否匹配当前 program(v10.3 §2.2)。 */
|
|
391
|
+
export interface MatchedPosition {
|
|
392
|
+
start: number;
|
|
393
|
+
end: number;
|
|
394
|
+
matched: boolean;
|
|
395
|
+
}
|
package/dist/entry.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SourceMap } from "../contract.js";
|
|
2
|
+
/** `css` with its first top-level `@teacss;` replaced by `generate()` and the entry directives removed; null when it has no `@teacss;`. */
|
|
3
|
+
export declare function replaceEntry(css: string, generate: () => string): string | null;
|
|
4
|
+
export interface EntrySource {
|
|
5
|
+
/** The id the map names as its source. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** The stylesheet as read, before the transform that produced the `css` handed to `replaceEntryWithMap`. */
|
|
8
|
+
original: string;
|
|
9
|
+
/** The transform's map from `original` to that `css`; null when the transform left it unchanged. */
|
|
10
|
+
map: SourceMap | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* `replaceEntry` with a source map back to `source.original`: hand-written CSS keeps its original lines and
|
|
14
|
+
* columns, and every line of the generated CSS maps to the `@teacss;` it replaced.
|
|
15
|
+
*/
|
|
16
|
+
export declare function replaceEntryWithMap(css: string, generate: () => string, source: EntrySource): {
|
|
17
|
+
code: string;
|
|
18
|
+
map: SourceMap;
|
|
19
|
+
} | null;
|
|
20
|
+
//# sourceMappingURL=entry.d.ts.map
|