@pikacss/unplugin-pikacss 0.0.54 → 0.0.55

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.
@@ -1,4 +1,4 @@
1
- import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-CooOKDFP.mjs";
1
+ import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-vzKzLeMH.mjs";
2
2
  import * as _$unplugin from "unplugin";
3
3
  export * from "@pikacss/integration";
4
4
 
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-CooOKDFP.mjs";
1
+ import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-vzKzLeMH.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
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from "node:fs";
2
2
  import process from "node:process";
3
- import { DEFAULT_MARKUP_EXTENSIONS, createCtx, log, normalizeMarkupExtensions } from "@pikacss/integration";
3
+ import { createCtx, log } from "@pikacss/integration";
4
4
  import { resolve } from "pathe";
5
5
  import { debounce } from "perfect-debounce";
6
6
  import { createUnplugin } from "unplugin";
@@ -32,26 +32,18 @@ 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", markupExtensions, transformedFormat = "string", autoCreateConfig = true } = options ?? {};
35
+ const { cwd: userCwd, currentPackageName = "@pikacss/unplugin-pikacss", config: configOrPath, tsCodegen = true, cssCodegen = true, scan = {}, fnName = "pika", transformedFormat = "string", autoCreateConfig = true } = options ?? {};
36
36
  log.debug("Creating unplugin factory with options:", options);
37
- const defaultInclude = [`**/*.{${[
38
- "js",
39
- "ts",
40
- "jsx",
41
- "tsx",
42
- ...normalizeMarkupExtensions([...DEFAULT_MARKUP_EXTENSIONS, ...markupExtensions ?? []])
43
- ].join(",")}}`];
44
37
  const resolvedOptions = {
45
38
  currentPackageName,
46
39
  configOrPath,
47
40
  tsCodegen: tsCodegen === true ? "pika.gen.ts" : tsCodegen,
48
41
  cssCodegen: cssCodegen === true ? "pika.gen.css" : cssCodegen,
49
42
  scan: {
50
- include: typeof scan?.include === "string" ? [scan.include] : scan?.include || defaultInclude,
43
+ include: typeof scan?.include === "string" ? [scan.include] : scan?.include || ["**/*.{js,ts,jsx,tsx,vue}"],
51
44
  exclude: typeof scan?.exclude === "string" ? [scan.exclude] : scan?.exclude || ["node_modules/**", "dist/**"]
52
45
  },
53
46
  fnName,
54
- markupExtensions,
55
47
  transformedFormat,
56
48
  autoCreateConfig
57
49
  };
@@ -248,13 +240,15 @@ const unpluginFactory = (options, meta) => {
248
240
  }
249
241
  }
250
242
  },
243
+ async buildEnd() {
244
+ if (mode !== "build") return;
245
+ await ctx.waitForIdle();
246
+ for (const file of ctx.getScannedButNotTransformedFiles()) log.warn(`Styles from ${file} were included in the generated CSS but the file was never reached by the bundler — dead file or missing import?`);
247
+ },
251
248
  watchChange(id, change) {
252
- if (change?.event === "delete" && (ctx.usages.has(id) || ctx.previewUsages.has(id))) {
253
- log.debug(`Source file deleted, dropping its usages: ${id}`);
254
- ctx.usages.delete(id);
255
- ctx.previewUsages.delete(id);
256
- queueCssWrite();
257
- queueTsWrite();
249
+ if (change?.event === "delete") {
250
+ log.debug(`Source file deleted, dropping its state: ${id}`);
251
+ ctx.dropModule(id);
258
252
  }
259
253
  if (id === ctx.resolvedConfigPath) {
260
254
  let currentContent = null;
@@ -1,4 +1,4 @@
1
- import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-CooOKDFP.mjs";
1
+ import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-vzKzLeMH.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
@@ -1,4 +1,4 @@
1
- import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-CooOKDFP.mjs";
1
+ import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-vzKzLeMH.mjs";
2
2
  import * as _$unplugin from "unplugin";
3
3
  export * from "@pikacss/integration";
4
4
 
package/dist/rspack.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-CooOKDFP.mjs";
1
+ import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-vzKzLeMH.mjs";
2
2
  export * from "@pikacss/integration";
3
3
 
4
4
  //#region src/rspack.d.ts
@@ -37,15 +37,14 @@ interface PluginOptions {
37
37
  /**
38
38
  * Glob patterns controlling which source files are scanned for `pika()` calls.
39
39
  *
40
- * @default `{ include: ['**\/*.{js,ts,jsx,tsx,vue,svelte,astro,html,htm}'], exclude: ['node_modules/**', 'dist/**'] }`
40
+ * @default `{ include: ['**\/*.{js,ts,jsx,tsx,vue}'], exclude: ['node_modules/**', 'dist/**'] }`
41
41
  */
42
42
  scan?: {
43
43
  /**
44
44
  * File glob patterns to scan. Supports a single string or array of strings.
45
- * When omitted, the default covers the JS family plus every supported markup
46
- * extension (the built-in markup defaults merged with `markupExtensions`).
47
- * An explicit value wins verbatim and is not extended by `markupExtensions`.
48
- * @default ['**\/*.{js,ts,jsx,tsx,vue,svelte,astro,html,htm}']
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,ts,jsx,tsx,vue}']
49
48
  */
50
49
  include?: string | string[];
51
50
  /**
@@ -74,19 +73,6 @@ interface PluginOptions {
74
73
  * @default `'pika'`
75
74
  */
76
75
  fnName?: string;
77
- /**
78
- * Additional file extensions (leading dots optional) whose sources are scanned in markup
79
- * mode. Markup files' top-level syntax is not JavaScript — `pika()` calls live inside
80
- * quoted template attributes (e.g., `:class="pika({...})"` in Vue SFCs) — so string and
81
- * comment detection works differently there. Extensions listed here are merged with the
82
- * built-in defaults `['vue', 'svelte', 'astro', 'html', 'htm']`; pass `['riot']` to also
83
- * scan `.riot` files in markup mode. When `scan.include` is not set, the default include
84
- * glob is extended with these extensions too, so the files are actually selected for
85
- * scanning without further configuration.
86
- *
87
- * @default `undefined` (built-in defaults only)
88
- */
89
- markupExtensions?: string[];
90
76
  /**
91
77
  * Default output format for normal `pika()` calls. `'string'` produces a space-joined class string;
92
78
  * `'array'` produces a string array of class names.
@@ -137,8 +123,6 @@ interface ResolvedPluginOptions {
137
123
  scan: IntegrationContextOptions['scan'];
138
124
  /** Base function name to recognize in source transforms (e.g., `'pika'`). */
139
125
  fnName: string;
140
- /** Additional file extensions scanned in markup mode, merged with the integration defaults. */
141
- markupExtensions?: string[];
142
126
  /** Default output format for normal `pika()` calls: `'string'` or `'array'`. */
143
127
  transformedFormat: 'string' | 'array';
144
128
  /** Whether to scaffold a default config file when none is found. */
package/dist/vite.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-CooOKDFP.mjs";
1
+ import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-vzKzLeMH.mjs";
2
2
  import { Plugin } from "vite";
3
3
  export * from "@pikacss/integration";
4
4
 
@@ -1,4 +1,4 @@
1
- import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-CooOKDFP.mjs";
1
+ import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-vzKzLeMH.mjs";
2
2
  export * from "@pikacss/integration";
3
3
 
4
4
  //#region src/webpack.d.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pikacss/unplugin-pikacss",
3
3
  "type": "module",
4
- "version": "0.0.54",
4
+ "version": "0.0.55",
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.54"
97
+ "@pikacss/integration": "0.0.55"
98
98
  },
99
99
  "devDependencies": {
100
100
  "esbuild": "^0.28.1",