@pikacss/unplugin-pikacss 0.0.55 → 0.0.57
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/esbuild.d.mts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +13 -3
- package/dist/rolldown.d.mts +1 -1
- package/dist/rollup.d.mts +1 -1
- package/dist/rspack.d.mts +1 -1
- package/dist/{types-vzKzLeMH.d.mts → types-ekE7tO8H.d.mts} +13 -6
- package/dist/vite.d.mts +1 -1
- package/dist/webpack.d.mts +1 -1
- package/package.json +2 -2
package/dist/esbuild.d.mts
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-
|
|
1
|
+
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-ekE7tO8H.mjs";
|
|
2
2
|
import * as _$unplugin from "unplugin";
|
|
3
3
|
import { UnpluginFactory } from "unplugin";
|
|
4
4
|
export * from "@pikacss/integration";
|
package/dist/index.mjs
CHANGED
|
@@ -32,7 +32,7 @@ const PLUGIN_NAME = "unplugin-pikacss";
|
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
34
|
const unpluginFactory = (options, meta) => {
|
|
35
|
-
const { cwd: userCwd, currentPackageName = "@pikacss/unplugin-pikacss", config: configOrPath, tsCodegen = true, cssCodegen = true, scan = {}, fnName = "pika", transformedFormat = "string", autoCreateConfig =
|
|
35
|
+
const { cwd: userCwd, currentPackageName = "@pikacss/unplugin-pikacss", config: configOrPath, tsCodegen = true, cssCodegen = true, scan = {}, fnName = "pika", transformedFormat = "string", autoCreateConfig = false } = options ?? {};
|
|
36
36
|
log.debug("Creating unplugin factory with options:", options);
|
|
37
37
|
const resolvedOptions = {
|
|
38
38
|
currentPackageName,
|
|
@@ -40,8 +40,15 @@ const unpluginFactory = (options, meta) => {
|
|
|
40
40
|
tsCodegen: tsCodegen === true ? "pika.gen.ts" : tsCodegen,
|
|
41
41
|
cssCodegen: cssCodegen === true ? "pika.gen.css" : cssCodegen,
|
|
42
42
|
scan: {
|
|
43
|
-
include: typeof scan?.include === "string" ? [scan.include] : scan?.include || ["**/*.{js,
|
|
44
|
-
exclude: typeof scan?.exclude === "string" ? [scan.exclude] : scan?.exclude || [
|
|
43
|
+
include: typeof scan?.include === "string" ? [scan.include] : scan?.include || ["**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue}"],
|
|
44
|
+
exclude: typeof scan?.exclude === "string" ? [scan.exclude] : scan?.exclude || [
|
|
45
|
+
"node_modules/**",
|
|
46
|
+
"dist/**",
|
|
47
|
+
".git/**",
|
|
48
|
+
".nuxt/**",
|
|
49
|
+
".output/**",
|
|
50
|
+
"coverage/**"
|
|
51
|
+
]
|
|
45
52
|
},
|
|
46
53
|
fnName,
|
|
47
54
|
transformedFormat,
|
|
@@ -58,6 +65,7 @@ const unpluginFactory = (options, meta) => {
|
|
|
58
65
|
function applyRuntimeContext(nextCwd, nextMode) {
|
|
59
66
|
if (userCwd == null) ctx.cwd = resolve(nextCwd);
|
|
60
67
|
mode = nextMode;
|
|
68
|
+
ctx.configErrorBehavior = nextMode === "build" ? "throw" : "retain-last-good";
|
|
61
69
|
}
|
|
62
70
|
const debouncedWriteCssCodegenFile = debounce(async () => {
|
|
63
71
|
await ctx.writeCssCodegenFile();
|
|
@@ -158,6 +166,7 @@ const unpluginFactory = (options, meta) => {
|
|
|
158
166
|
});
|
|
159
167
|
}
|
|
160
168
|
}).catch((error) => {
|
|
169
|
+
if (mode === "build") throw error;
|
|
161
170
|
log.error(`Failed to setup integration context: ${error?.message ?? error}`, error);
|
|
162
171
|
});
|
|
163
172
|
return setupPromise;
|
|
@@ -199,6 +208,7 @@ const unpluginFactory = (options, meta) => {
|
|
|
199
208
|
async buildStart() {
|
|
200
209
|
log.debug("Plugin buildStart hook triggered");
|
|
201
210
|
log.debug(`Current mode: ${mode}, cwd: ${ctx.cwd}`);
|
|
211
|
+
ctx.configErrorBehavior = mode === "build" ? "throw" : "retain-last-good";
|
|
202
212
|
await ensureSetup();
|
|
203
213
|
if (mode === "build") {
|
|
204
214
|
log.debug("Running full CSS code generation in build mode");
|
package/dist/rolldown.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-
|
|
1
|
+
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-ekE7tO8H.mjs";
|
|
2
2
|
export * from "@pikacss/integration";
|
|
3
3
|
|
|
4
4
|
//#region ../../node_modules/.pnpm/rolldown@1.0.0-rc.12_@emnapi+core@1.11.1_@emnapi+runtime@1.11.1/node_modules/rolldown/dist/shared/logging-C6h4g8dA.d.mts
|
package/dist/rollup.d.mts
CHANGED
package/dist/rspack.d.mts
CHANGED
|
@@ -37,19 +37,21 @@ interface PluginOptions {
|
|
|
37
37
|
/**
|
|
38
38
|
* Glob patterns controlling which source files are scanned for `pika()` calls.
|
|
39
39
|
*
|
|
40
|
-
* @default `{ include: ['**\/*.{js,
|
|
40
|
+
* @default `{ include: ['**\/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue}'], exclude: ['node_modules/**', 'dist/**', '.git/**', '.nuxt/**', '.output/**', 'coverage/**'] }`
|
|
41
41
|
*/
|
|
42
42
|
scan?: {
|
|
43
43
|
/**
|
|
44
44
|
* File glob patterns to scan. Supports a single string or array of strings.
|
|
45
45
|
* When omitted, the default covers every extension the AST compiler
|
|
46
|
-
* supports: the JS family plus Vue SFCs. An explicit value wins verbatim.
|
|
47
|
-
* @default ['**\/*.{js,
|
|
46
|
+
* supports: the full JS family plus Vue SFCs. An explicit value wins verbatim.
|
|
47
|
+
* @default ['**\/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue}']
|
|
48
48
|
*/
|
|
49
49
|
include?: string | string[];
|
|
50
50
|
/**
|
|
51
51
|
* File glob patterns to exclude. Supports a single string or array of strings.
|
|
52
|
-
*
|
|
52
|
+
* The default skips dependencies, build outputs, coverage, VCS metadata, and
|
|
53
|
+
* framework build dirs (`.nuxt`/`.output`). An explicit value wins verbatim.
|
|
54
|
+
* @default ['node_modules/**', 'dist/**', '.git/**', '.nuxt/**', '.output/**', 'coverage/**']
|
|
53
55
|
*/
|
|
54
56
|
exclude?: string | string[];
|
|
55
57
|
};
|
|
@@ -63,7 +65,12 @@ interface PluginOptions {
|
|
|
63
65
|
/**
|
|
64
66
|
* When `true`, automatically scaffolds a default `pika.config.js` file if no existing config is found.
|
|
65
67
|
*
|
|
66
|
-
* @
|
|
68
|
+
* @remarks
|
|
69
|
+
* Defaults to `false`: a build plugin should not silently write files into the
|
|
70
|
+
* user's repository (a footgun in read-only CI, containers, and installed
|
|
71
|
+
* packages). Scaffold a config explicitly (or opt back in with `true`).
|
|
72
|
+
*
|
|
73
|
+
* @default `false`
|
|
67
74
|
*/
|
|
68
75
|
autoCreateConfig?: boolean;
|
|
69
76
|
/**
|
|
@@ -96,7 +103,7 @@ interface PluginOptions {
|
|
|
96
103
|
cssCodegen?: true | string;
|
|
97
104
|
/**
|
|
98
105
|
* npm package name of the plugin consumer, embedded in generated file headers and import paths.
|
|
99
|
-
* Override when wrapping the unplugin in a framework-specific package (e.g., `@pikacss/nuxt`).
|
|
106
|
+
* Override when wrapping the unplugin in a framework-specific package (e.g., `@pikacss/nuxt-pikacss`).
|
|
100
107
|
*
|
|
101
108
|
* @default `'@pikacss/unplugin-pikacss'`
|
|
102
109
|
*/
|
package/dist/vite.d.mts
CHANGED
package/dist/webpack.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikacss/unplugin-pikacss",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.57",
|
|
5
5
|
"author": "DevilTea <ch19980814@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://pikacss.github.io",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"pathe": "^2.0.3",
|
|
95
95
|
"perfect-debounce": "^2.1.0",
|
|
96
96
|
"unplugin": "^3.3.0",
|
|
97
|
-
"@pikacss/integration": "0.0.
|
|
97
|
+
"@pikacss/integration": "0.0.57"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
100
|
"esbuild": "^0.28.1",
|