@pikacss/integration 0.0.34 → 0.0.36
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/index.cjs +26 -7
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +26 -7
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -225,7 +225,8 @@ function useConfig({ cwd, tsCodegenFilepath, currentPackageName, autoCreateConfi
|
|
|
225
225
|
__pikacss_core.log.debug("Using inline config");
|
|
226
226
|
return {
|
|
227
227
|
config: (0, klona.klona)(inlineConfig),
|
|
228
|
-
file: null
|
|
228
|
+
file: null,
|
|
229
|
+
content: null
|
|
229
230
|
};
|
|
230
231
|
}
|
|
231
232
|
let resolvedConfigPath$1 = await findFirstExistingConfigPath();
|
|
@@ -235,7 +236,8 @@ function useConfig({ cwd, tsCodegenFilepath, currentPackageName, autoCreateConfi
|
|
|
235
236
|
__pikacss_core.log.warn("Config file not found and autoCreateConfig is false");
|
|
236
237
|
return {
|
|
237
238
|
config: null,
|
|
238
|
-
file: null
|
|
239
|
+
file: null,
|
|
240
|
+
content: null
|
|
239
241
|
};
|
|
240
242
|
}
|
|
241
243
|
resolvedConfigPath$1 = (0, pathe.join)(_cwd, specificConfigPath() ?? "pika.config.js");
|
|
@@ -261,31 +263,36 @@ function useConfig({ cwd, tsCodegenFilepath, currentPackageName, autoCreateConfi
|
|
|
261
263
|
})).default;
|
|
262
264
|
return {
|
|
263
265
|
config: (0, klona.klona)(config),
|
|
264
|
-
file: resolvedConfigPath$1
|
|
266
|
+
file: resolvedConfigPath$1,
|
|
267
|
+
content
|
|
265
268
|
};
|
|
266
269
|
} catch (error) {
|
|
267
270
|
__pikacss_core.log.error(`Failed to load config file: ${error.message}`, error);
|
|
268
271
|
return {
|
|
269
272
|
config: null,
|
|
270
|
-
file: null
|
|
273
|
+
file: null,
|
|
274
|
+
content: null
|
|
271
275
|
};
|
|
272
276
|
}
|
|
273
277
|
}
|
|
274
278
|
const resolvedConfig = (0, alien_signals.signal)(inlineConfig);
|
|
275
279
|
const resolvedConfigPath = (0, alien_signals.signal)(null);
|
|
280
|
+
const resolvedConfigContent = (0, alien_signals.signal)(null);
|
|
276
281
|
async function loadConfig() {
|
|
277
282
|
const result = await _loadConfig();
|
|
278
283
|
resolvedConfig(result.config);
|
|
279
284
|
resolvedConfigPath(result.file);
|
|
285
|
+
resolvedConfigContent(result.content);
|
|
280
286
|
return result;
|
|
281
287
|
}
|
|
282
288
|
return {
|
|
283
289
|
resolvedConfig,
|
|
284
290
|
resolvedConfigPath,
|
|
291
|
+
resolvedConfigContent,
|
|
285
292
|
loadConfig
|
|
286
293
|
};
|
|
287
294
|
}
|
|
288
|
-
function useTransform({ cwd, scan, fnName, usages, engine, transformedFormat, triggerStyleUpdated, triggerTsCodegenUpdated }) {
|
|
295
|
+
function useTransform({ cwd, cssCodegenFilepath, tsCodegenFilepath, scan, fnName, usages, engine, transformedFormat, triggerStyleUpdated, triggerTsCodegenUpdated }) {
|
|
289
296
|
const ESCAPE_REPLACE_RE = /[.*+?^${}()|[\]\\/]/g;
|
|
290
297
|
function createFnUtils(fnName$1) {
|
|
291
298
|
const available = {
|
|
@@ -408,13 +415,20 @@ function useTransform({ cwd, scan, fnName, usages, engine, transformedFormat, tr
|
|
|
408
415
|
}
|
|
409
416
|
}
|
|
410
417
|
return {
|
|
411
|
-
transformFilter:
|
|
418
|
+
transformFilter: {
|
|
419
|
+
include: scan.include,
|
|
420
|
+
exclude: [
|
|
421
|
+
...scan.exclude,
|
|
422
|
+
cssCodegenFilepath(),
|
|
423
|
+
...tsCodegenFilepath() ? [tsCodegenFilepath()] : []
|
|
424
|
+
]
|
|
425
|
+
},
|
|
412
426
|
transform
|
|
413
427
|
};
|
|
414
428
|
}
|
|
415
429
|
function createCtx(options) {
|
|
416
430
|
const { cwd, cssCodegenFilepath, tsCodegenFilepath } = usePaths(options);
|
|
417
|
-
const { resolvedConfig, resolvedConfigPath, loadConfig } = useConfig({
|
|
431
|
+
const { resolvedConfig, resolvedConfigPath, resolvedConfigContent, loadConfig } = useConfig({
|
|
418
432
|
...options,
|
|
419
433
|
cwd,
|
|
420
434
|
tsCodegenFilepath
|
|
@@ -428,6 +442,8 @@ function createCtx(options) {
|
|
|
428
442
|
const { transformFilter, transform } = useTransform({
|
|
429
443
|
...options,
|
|
430
444
|
cwd,
|
|
445
|
+
cssCodegenFilepath,
|
|
446
|
+
tsCodegenFilepath,
|
|
431
447
|
usages,
|
|
432
448
|
engine,
|
|
433
449
|
triggerStyleUpdated: () => hooks.styleUpdated.trigger(),
|
|
@@ -458,6 +474,9 @@ function createCtx(options) {
|
|
|
458
474
|
get resolvedConfigPath() {
|
|
459
475
|
return resolvedConfigPath();
|
|
460
476
|
},
|
|
477
|
+
get resolvedConfigContent() {
|
|
478
|
+
return resolvedConfigContent();
|
|
479
|
+
},
|
|
461
480
|
loadConfig,
|
|
462
481
|
usages,
|
|
463
482
|
hooks,
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -199,7 +199,8 @@ function useConfig({ cwd, tsCodegenFilepath, currentPackageName, autoCreateConfi
|
|
|
199
199
|
log.debug("Using inline config");
|
|
200
200
|
return {
|
|
201
201
|
config: klona(inlineConfig),
|
|
202
|
-
file: null
|
|
202
|
+
file: null,
|
|
203
|
+
content: null
|
|
203
204
|
};
|
|
204
205
|
}
|
|
205
206
|
let resolvedConfigPath$1 = await findFirstExistingConfigPath();
|
|
@@ -209,7 +210,8 @@ function useConfig({ cwd, tsCodegenFilepath, currentPackageName, autoCreateConfi
|
|
|
209
210
|
log.warn("Config file not found and autoCreateConfig is false");
|
|
210
211
|
return {
|
|
211
212
|
config: null,
|
|
212
|
-
file: null
|
|
213
|
+
file: null,
|
|
214
|
+
content: null
|
|
213
215
|
};
|
|
214
216
|
}
|
|
215
217
|
resolvedConfigPath$1 = join(_cwd, specificConfigPath() ?? "pika.config.js");
|
|
@@ -235,31 +237,36 @@ function useConfig({ cwd, tsCodegenFilepath, currentPackageName, autoCreateConfi
|
|
|
235
237
|
})).default;
|
|
236
238
|
return {
|
|
237
239
|
config: klona(config),
|
|
238
|
-
file: resolvedConfigPath$1
|
|
240
|
+
file: resolvedConfigPath$1,
|
|
241
|
+
content
|
|
239
242
|
};
|
|
240
243
|
} catch (error) {
|
|
241
244
|
log.error(`Failed to load config file: ${error.message}`, error);
|
|
242
245
|
return {
|
|
243
246
|
config: null,
|
|
244
|
-
file: null
|
|
247
|
+
file: null,
|
|
248
|
+
content: null
|
|
245
249
|
};
|
|
246
250
|
}
|
|
247
251
|
}
|
|
248
252
|
const resolvedConfig = signal(inlineConfig);
|
|
249
253
|
const resolvedConfigPath = signal(null);
|
|
254
|
+
const resolvedConfigContent = signal(null);
|
|
250
255
|
async function loadConfig() {
|
|
251
256
|
const result = await _loadConfig();
|
|
252
257
|
resolvedConfig(result.config);
|
|
253
258
|
resolvedConfigPath(result.file);
|
|
259
|
+
resolvedConfigContent(result.content);
|
|
254
260
|
return result;
|
|
255
261
|
}
|
|
256
262
|
return {
|
|
257
263
|
resolvedConfig,
|
|
258
264
|
resolvedConfigPath,
|
|
265
|
+
resolvedConfigContent,
|
|
259
266
|
loadConfig
|
|
260
267
|
};
|
|
261
268
|
}
|
|
262
|
-
function useTransform({ cwd, scan, fnName, usages, engine, transformedFormat, triggerStyleUpdated, triggerTsCodegenUpdated }) {
|
|
269
|
+
function useTransform({ cwd, cssCodegenFilepath, tsCodegenFilepath, scan, fnName, usages, engine, transformedFormat, triggerStyleUpdated, triggerTsCodegenUpdated }) {
|
|
263
270
|
const ESCAPE_REPLACE_RE = /[.*+?^${}()|[\]\\/]/g;
|
|
264
271
|
function createFnUtils(fnName$1) {
|
|
265
272
|
const available = {
|
|
@@ -382,13 +389,20 @@ function useTransform({ cwd, scan, fnName, usages, engine, transformedFormat, tr
|
|
|
382
389
|
}
|
|
383
390
|
}
|
|
384
391
|
return {
|
|
385
|
-
transformFilter:
|
|
392
|
+
transformFilter: {
|
|
393
|
+
include: scan.include,
|
|
394
|
+
exclude: [
|
|
395
|
+
...scan.exclude,
|
|
396
|
+
cssCodegenFilepath(),
|
|
397
|
+
...tsCodegenFilepath() ? [tsCodegenFilepath()] : []
|
|
398
|
+
]
|
|
399
|
+
},
|
|
386
400
|
transform
|
|
387
401
|
};
|
|
388
402
|
}
|
|
389
403
|
function createCtx(options) {
|
|
390
404
|
const { cwd, cssCodegenFilepath, tsCodegenFilepath } = usePaths(options);
|
|
391
|
-
const { resolvedConfig, resolvedConfigPath, loadConfig } = useConfig({
|
|
405
|
+
const { resolvedConfig, resolvedConfigPath, resolvedConfigContent, loadConfig } = useConfig({
|
|
392
406
|
...options,
|
|
393
407
|
cwd,
|
|
394
408
|
tsCodegenFilepath
|
|
@@ -402,6 +416,8 @@ function createCtx(options) {
|
|
|
402
416
|
const { transformFilter, transform } = useTransform({
|
|
403
417
|
...options,
|
|
404
418
|
cwd,
|
|
419
|
+
cssCodegenFilepath,
|
|
420
|
+
tsCodegenFilepath,
|
|
405
421
|
usages,
|
|
406
422
|
engine,
|
|
407
423
|
triggerStyleUpdated: () => hooks.styleUpdated.trigger(),
|
|
@@ -432,6 +448,9 @@ function createCtx(options) {
|
|
|
432
448
|
get resolvedConfigPath() {
|
|
433
449
|
return resolvedConfigPath();
|
|
434
450
|
},
|
|
451
|
+
get resolvedConfigContent() {
|
|
452
|
+
return resolvedConfigContent();
|
|
453
|
+
},
|
|
435
454
|
loadConfig,
|
|
436
455
|
usages,
|
|
437
456
|
hooks,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikacss/integration",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.36",
|
|
5
5
|
"author": "DevilTea <ch19980814@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -49,13 +49,14 @@
|
|
|
49
49
|
"micromatch": "^4.0.8",
|
|
50
50
|
"pathe": "^2.0.3",
|
|
51
51
|
"perfect-debounce": "^2.0.0",
|
|
52
|
-
"@pikacss/core": "0.0.
|
|
52
|
+
"@pikacss/core": "0.0.36"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/micromatch": "^4.0.10"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsdown && pnpm exec publint",
|
|
59
|
+
"build:watch": "tsdown --watch",
|
|
59
60
|
"typecheck": "pnpm typecheck:package && pnpm typecheck:test",
|
|
60
61
|
"typecheck:package": "tsc --project ./tsconfig.package.json --noEmit",
|
|
61
62
|
"typecheck:test": "tsc --project ./tsconfig.tests.json --noEmit",
|