@pikacss/unplugin-pikacss 0.0.43 → 0.0.45
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 +3 -3
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +2 -3
- package/dist/rolldown.d.mts +3 -3
- package/dist/rollup.d.mts +3 -3
- package/dist/rspack.d.mts +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/webpack.d.mts +1 -1
- package/package.json +6 -35
- package/dist/esbuild.cjs +0 -15
- package/dist/esbuild.d.cts +0 -8
- package/dist/index.cjs +0 -13
- package/dist/index.d.cts +0 -10
- package/dist/rolldown.cjs +0 -15
- package/dist/rolldown.d.cts +0 -8
- package/dist/rollup.cjs +0 -15
- package/dist/rollup.d.cts +0 -8
- package/dist/rspack.cjs +0 -15
- package/dist/rspack.d.cts +0 -7
- package/dist/src-BsRreiwW.cjs +0 -235
- package/dist/types-CtaD-Nki.d.cts +0 -103
- package/dist/vite.cjs +0 -15
- package/dist/vite.d.cts +0 -9
- package/dist/webpack.cjs +0 -15
- package/dist/webpack.d.cts +0 -7
- /package/dist/{types-BRfLr7ch.d.mts → types-B2IGqPK6.d.mts} +0 -0
package/dist/esbuild.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-
|
|
2
|
-
import * as
|
|
1
|
+
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-B2IGqPK6.mjs";
|
|
2
|
+
import * as unplugin from "unplugin";
|
|
3
3
|
export * from "@pikacss/integration";
|
|
4
4
|
|
|
5
5
|
//#region src/esbuild.d.ts
|
|
6
|
-
declare const _default: (options?: PluginOptions | undefined) =>
|
|
6
|
+
declare const _default: (options?: PluginOptions | undefined) => unplugin.EsbuildPlugin;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { PluginOptions, ResolvedPluginOptions, _default as default };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-
|
|
2
|
-
import * as
|
|
1
|
+
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-B2IGqPK6.mjs";
|
|
2
|
+
import * as unplugin from "unplugin";
|
|
3
3
|
import { UnpluginFactory } from "unplugin";
|
|
4
4
|
export * from "@pikacss/integration";
|
|
5
5
|
|
|
6
6
|
//#region src/index.d.ts
|
|
7
7
|
declare const unpluginFactory: UnpluginFactory<PluginOptions | undefined>;
|
|
8
|
-
declare const
|
|
8
|
+
declare const unpluginPika: unplugin.UnpluginInstance<PluginOptions | undefined, boolean>;
|
|
9
9
|
//#endregion
|
|
10
|
-
export { PluginOptions, ResolvedPluginOptions,
|
|
10
|
+
export { PluginOptions, ResolvedPluginOptions, unpluginPika as default, unpluginPika, unpluginFactory };
|
package/dist/index.mjs
CHANGED
|
@@ -179,8 +179,7 @@ const unpluginFactory = (options, meta) => {
|
|
|
179
179
|
}
|
|
180
180
|
};
|
|
181
181
|
};
|
|
182
|
-
const
|
|
183
|
-
var src_default = unplugin;
|
|
182
|
+
const unpluginPika = /* @__PURE__ */ createUnplugin(unpluginFactory);
|
|
184
183
|
|
|
185
184
|
//#endregion
|
|
186
|
-
export {
|
|
185
|
+
export { unpluginPika as default, unpluginPika, unpluginFactory };
|
package/dist/rolldown.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-
|
|
2
|
-
import * as
|
|
1
|
+
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-B2IGqPK6.mjs";
|
|
2
|
+
import * as unplugin from "unplugin";
|
|
3
3
|
export * from "@pikacss/integration";
|
|
4
4
|
|
|
5
5
|
//#region src/rolldown.d.ts
|
|
6
|
-
declare const _default: (options?: PluginOptions | undefined) =>
|
|
6
|
+
declare const _default: (options?: PluginOptions | undefined) => unplugin.RolldownPlugin<any> | unplugin.RolldownPlugin<any>[];
|
|
7
7
|
//#endregion
|
|
8
8
|
export { PluginOptions, ResolvedPluginOptions, _default as default };
|
package/dist/rollup.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-
|
|
2
|
-
import * as
|
|
1
|
+
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-B2IGqPK6.mjs";
|
|
2
|
+
import * as rollup from "rollup";
|
|
3
3
|
export * from "@pikacss/integration";
|
|
4
4
|
|
|
5
5
|
//#region src/rollup.d.ts
|
|
6
|
-
declare const _default: (options?: PluginOptions | undefined) =>
|
|
6
|
+
declare const _default: (options?: PluginOptions | undefined) => rollup.Plugin<any> | rollup.Plugin<any>[];
|
|
7
7
|
//#endregion
|
|
8
8
|
export { PluginOptions, ResolvedPluginOptions, _default as default };
|
package/dist/rspack.d.mts
CHANGED
package/dist/vite.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-B2IGqPK6.mjs";
|
|
2
2
|
import "./index.mjs";
|
|
3
3
|
import { Plugin } from "vite";
|
|
4
4
|
export * from "@pikacss/integration";
|
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.45",
|
|
5
5
|
"author": "DevilTea <ch19980814@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -30,74 +30,45 @@
|
|
|
30
30
|
"import": {
|
|
31
31
|
"types": "./dist/index.d.mts",
|
|
32
32
|
"default": "./dist/index.mjs"
|
|
33
|
-
},
|
|
34
|
-
"require": {
|
|
35
|
-
"types": "./dist/index.d.cts",
|
|
36
|
-
"default": "./dist/index.cjs"
|
|
37
33
|
}
|
|
38
34
|
},
|
|
39
35
|
"./vite": {
|
|
40
36
|
"import": {
|
|
41
37
|
"types": "./dist/vite.d.mts",
|
|
42
38
|
"default": "./dist/vite.mjs"
|
|
43
|
-
},
|
|
44
|
-
"require": {
|
|
45
|
-
"types": "./dist/vite.d.cts",
|
|
46
|
-
"default": "./dist/vite.cjs"
|
|
47
39
|
}
|
|
48
40
|
},
|
|
49
41
|
"./rollup": {
|
|
50
42
|
"import": {
|
|
51
43
|
"types": "./dist/rollup.d.mts",
|
|
52
44
|
"default": "./dist/rollup.mjs"
|
|
53
|
-
},
|
|
54
|
-
"require": {
|
|
55
|
-
"types": "./dist/rollup.d.cts",
|
|
56
|
-
"default": "./dist/rollup.cjs"
|
|
57
45
|
}
|
|
58
46
|
},
|
|
59
47
|
"./webpack": {
|
|
60
48
|
"import": {
|
|
61
49
|
"types": "./dist/webpack.d.mts",
|
|
62
50
|
"default": "./dist/webpack.mjs"
|
|
63
|
-
},
|
|
64
|
-
"require": {
|
|
65
|
-
"types": "./dist/webpack.d.cts",
|
|
66
|
-
"default": "./dist/webpack.cjs"
|
|
67
51
|
}
|
|
68
52
|
},
|
|
69
53
|
"./esbuild": {
|
|
70
54
|
"import": {
|
|
71
55
|
"types": "./dist/esbuild.d.mts",
|
|
72
56
|
"default": "./dist/esbuild.mjs"
|
|
73
|
-
},
|
|
74
|
-
"require": {
|
|
75
|
-
"types": "./dist/esbuild.d.cts",
|
|
76
|
-
"default": "./dist/esbuild.cjs"
|
|
77
57
|
}
|
|
78
58
|
},
|
|
79
59
|
"./rspack": {
|
|
80
60
|
"import": {
|
|
81
61
|
"types": "./dist/rspack.d.mts",
|
|
82
62
|
"default": "./dist/rspack.mjs"
|
|
83
|
-
},
|
|
84
|
-
"require": {
|
|
85
|
-
"types": "./dist/rspack.d.cts",
|
|
86
|
-
"default": "./dist/rspack.cjs"
|
|
87
63
|
}
|
|
88
64
|
},
|
|
89
65
|
"./rolldown": {
|
|
90
66
|
"import": {
|
|
91
67
|
"types": "./dist/rolldown.d.mts",
|
|
92
68
|
"default": "./dist/rolldown.mjs"
|
|
93
|
-
},
|
|
94
|
-
"require": {
|
|
95
|
-
"types": "./dist/rolldown.d.cts",
|
|
96
|
-
"default": "./dist/rolldown.cjs"
|
|
97
69
|
}
|
|
98
70
|
}
|
|
99
71
|
},
|
|
100
|
-
"main": "dist/index.cjs",
|
|
101
72
|
"module": "dist/index.mjs",
|
|
102
73
|
"types": "dist/index.d.mts",
|
|
103
74
|
"files": [
|
|
@@ -116,14 +87,14 @@
|
|
|
116
87
|
},
|
|
117
88
|
"dependencies": {
|
|
118
89
|
"pathe": "^2.0.3",
|
|
119
|
-
"perfect-debounce": "^2.
|
|
120
|
-
"unplugin": "^
|
|
121
|
-
"@pikacss/integration": "0.0.
|
|
90
|
+
"perfect-debounce": "^2.1.0",
|
|
91
|
+
"unplugin": "^3.0.0",
|
|
92
|
+
"@pikacss/integration": "0.0.45"
|
|
122
93
|
},
|
|
123
94
|
"devDependencies": {
|
|
124
95
|
"@farmfe/core": "^1.7.11",
|
|
125
|
-
"esbuild": "^0.27.
|
|
126
|
-
"vite": "^7.3.
|
|
96
|
+
"esbuild": "^0.27.3",
|
|
97
|
+
"vite": "^7.3.1"
|
|
127
98
|
},
|
|
128
99
|
"scripts": {
|
|
129
100
|
"build": "tsdown",
|
package/dist/esbuild.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const require_src = require('./src-BsRreiwW.cjs');
|
|
2
|
-
let unplugin = require("unplugin");
|
|
3
|
-
|
|
4
|
-
//#region src/esbuild.ts
|
|
5
|
-
var esbuild_default = (0, unplugin.createEsbuildPlugin)(require_src.unpluginFactory);
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
module.exports = esbuild_default;
|
|
9
|
-
var _pikacss_integration = require("@pikacss/integration");
|
|
10
|
-
Object.keys(_pikacss_integration).forEach(function (k) {
|
|
11
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return _pikacss_integration[k]; }
|
|
14
|
-
});
|
|
15
|
-
});
|
package/dist/esbuild.d.cts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-CtaD-Nki.cjs";
|
|
2
|
-
import * as unplugin2 from "unplugin";
|
|
3
|
-
export * from "@pikacss/integration";
|
|
4
|
-
|
|
5
|
-
//#region src/esbuild.d.ts
|
|
6
|
-
declare const _default: (options?: PluginOptions | undefined) => unplugin2.EsbuildPlugin;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { PluginOptions, ResolvedPluginOptions, _default as default };
|
package/dist/index.cjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const require_src = require('./src-BsRreiwW.cjs');
|
|
3
|
-
|
|
4
|
-
exports.default = require_src.src_default;
|
|
5
|
-
exports.unplugin = require_src.unplugin;
|
|
6
|
-
exports.unpluginFactory = require_src.unpluginFactory;
|
|
7
|
-
var _pikacss_integration = require("@pikacss/integration");
|
|
8
|
-
Object.keys(_pikacss_integration).forEach(function (k) {
|
|
9
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () { return _pikacss_integration[k]; }
|
|
12
|
-
});
|
|
13
|
-
});
|
package/dist/index.d.cts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-CtaD-Nki.cjs";
|
|
2
|
-
import * as unplugin0 from "unplugin";
|
|
3
|
-
import { UnpluginFactory } from "unplugin";
|
|
4
|
-
export * from "@pikacss/integration";
|
|
5
|
-
|
|
6
|
-
//#region src/index.d.ts
|
|
7
|
-
declare const unpluginFactory: UnpluginFactory<PluginOptions | undefined>;
|
|
8
|
-
declare const unplugin: unplugin0.UnpluginInstance<PluginOptions | undefined, boolean>;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { PluginOptions, ResolvedPluginOptions, unplugin as default, unplugin, unpluginFactory };
|
package/dist/rolldown.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const require_src = require('./src-BsRreiwW.cjs');
|
|
2
|
-
let unplugin = require("unplugin");
|
|
3
|
-
|
|
4
|
-
//#region src/rolldown.ts
|
|
5
|
-
var rolldown_default = (0, unplugin.createRolldownPlugin)(require_src.unpluginFactory);
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
module.exports = rolldown_default;
|
|
9
|
-
var _pikacss_integration = require("@pikacss/integration");
|
|
10
|
-
Object.keys(_pikacss_integration).forEach(function (k) {
|
|
11
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return _pikacss_integration[k]; }
|
|
14
|
-
});
|
|
15
|
-
});
|
package/dist/rolldown.d.cts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-CtaD-Nki.cjs";
|
|
2
|
-
import * as unplugin0 from "unplugin";
|
|
3
|
-
export * from "@pikacss/integration";
|
|
4
|
-
|
|
5
|
-
//#region src/rolldown.d.ts
|
|
6
|
-
declare const _default: (options?: PluginOptions | undefined) => unplugin0.RolldownPlugin<any> | unplugin0.RolldownPlugin<any>[];
|
|
7
|
-
//#endregion
|
|
8
|
-
export { PluginOptions, ResolvedPluginOptions, _default as default };
|
package/dist/rollup.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const require_src = require('./src-BsRreiwW.cjs');
|
|
2
|
-
let unplugin = require("unplugin");
|
|
3
|
-
|
|
4
|
-
//#region src/rollup.ts
|
|
5
|
-
var rollup_default = (0, unplugin.createRollupPlugin)(require_src.unpluginFactory);
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
module.exports = rollup_default;
|
|
9
|
-
var _pikacss_integration = require("@pikacss/integration");
|
|
10
|
-
Object.keys(_pikacss_integration).forEach(function (k) {
|
|
11
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return _pikacss_integration[k]; }
|
|
14
|
-
});
|
|
15
|
-
});
|
package/dist/rollup.d.cts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-CtaD-Nki.cjs";
|
|
2
|
-
import * as rollup0 from "rollup";
|
|
3
|
-
export * from "@pikacss/integration";
|
|
4
|
-
|
|
5
|
-
//#region src/rollup.d.ts
|
|
6
|
-
declare const _default: (options?: PluginOptions | undefined) => rollup0.Plugin<any> | rollup0.Plugin<any>[];
|
|
7
|
-
//#endregion
|
|
8
|
-
export { PluginOptions, ResolvedPluginOptions, _default as default };
|
package/dist/rspack.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const require_src = require('./src-BsRreiwW.cjs');
|
|
2
|
-
let unplugin = require("unplugin");
|
|
3
|
-
|
|
4
|
-
//#region src/rspack.ts
|
|
5
|
-
var rspack_default = (0, unplugin.createRspackPlugin)(require_src.unpluginFactory);
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
module.exports = rspack_default;
|
|
9
|
-
var _pikacss_integration = require("@pikacss/integration");
|
|
10
|
-
Object.keys(_pikacss_integration).forEach(function (k) {
|
|
11
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return _pikacss_integration[k]; }
|
|
14
|
-
});
|
|
15
|
-
});
|
package/dist/rspack.d.cts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-CtaD-Nki.cjs";
|
|
2
|
-
export * from "@pikacss/integration";
|
|
3
|
-
|
|
4
|
-
//#region src/rspack.d.ts
|
|
5
|
-
declare const _default: (options?: PluginOptions | undefined) => RspackPluginInstance;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { PluginOptions, ResolvedPluginOptions, _default as default };
|
package/dist/src-BsRreiwW.cjs
DELETED
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
-
value: mod,
|
|
24
|
-
enumerable: true
|
|
25
|
-
}) : target, mod));
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
let node_fs = require("node:fs");
|
|
29
|
-
let node_process = require("node:process");
|
|
30
|
-
node_process = __toESM(node_process);
|
|
31
|
-
let _pikacss_integration = require("@pikacss/integration");
|
|
32
|
-
let pathe = require("pathe");
|
|
33
|
-
let perfect_debounce = require("perfect-debounce");
|
|
34
|
-
let unplugin = require("unplugin");
|
|
35
|
-
|
|
36
|
-
//#region src/index.ts
|
|
37
|
-
const RE_VIRTUAL_PIKA_CSS_ID = /^pika\.css$/;
|
|
38
|
-
const PLUGIN_NAME = "unplugin-pikacss";
|
|
39
|
-
const unpluginFactory = (options, meta) => {
|
|
40
|
-
const { currentPackageName = "@pikacss/unplugin-pikacss", config: configOrPath, tsCodegen = true, cssCodegen = true, scan = {}, fnName = "pika", transformedFormat = "string", autoCreateConfig = true } = options ?? {};
|
|
41
|
-
_pikacss_integration.log.debug("Creating unplugin factory with options:", options);
|
|
42
|
-
const resolvedOptions = {
|
|
43
|
-
currentPackageName,
|
|
44
|
-
configOrPath,
|
|
45
|
-
tsCodegen: tsCodegen === true ? "pika.gen.ts" : tsCodegen,
|
|
46
|
-
cssCodegen: cssCodegen === true ? "pika.gen.css" : cssCodegen,
|
|
47
|
-
scan: {
|
|
48
|
-
include: typeof scan?.include === "string" ? [scan.include] : scan?.include || ["**/*.{js,ts,jsx,tsx,vue}"],
|
|
49
|
-
exclude: typeof scan?.exclude === "string" ? [scan.exclude] : scan?.exclude || ["node_modules/**", "dist/**"]
|
|
50
|
-
},
|
|
51
|
-
fnName,
|
|
52
|
-
transformedFormat,
|
|
53
|
-
autoCreateConfig
|
|
54
|
-
};
|
|
55
|
-
_pikacss_integration.log.debug("Resolved plugin options:", resolvedOptions);
|
|
56
|
-
let cwd = (0, pathe.resolve)(node_process.default.cwd());
|
|
57
|
-
let mode = "build";
|
|
58
|
-
const viteServers = [];
|
|
59
|
-
const rspackCompilers = [];
|
|
60
|
-
const farmServers = [];
|
|
61
|
-
const ctx = (0, _pikacss_integration.createCtx)({
|
|
62
|
-
cwd,
|
|
63
|
-
...resolvedOptions
|
|
64
|
-
});
|
|
65
|
-
const debouncedWriteCssCodegenFile = (0, perfect_debounce.debounce)(async () => {
|
|
66
|
-
await ctx.writeCssCodegenFile();
|
|
67
|
-
}, 300);
|
|
68
|
-
const debouncedWriteTsCodegenFile = (0, perfect_debounce.debounce)(async () => {
|
|
69
|
-
await ctx.writeTsCodegenFile();
|
|
70
|
-
}, 300);
|
|
71
|
-
function bindHooks() {
|
|
72
|
-
ctx.hooks.styleUpdated.on(() => {
|
|
73
|
-
_pikacss_integration.log.debug(`Style updated, ${ctx.engine.store.atomicStyleIds.size} atomic styles generated`);
|
|
74
|
-
debouncedWriteCssCodegenFile();
|
|
75
|
-
});
|
|
76
|
-
ctx.hooks.tsCodegenUpdated.on(() => {
|
|
77
|
-
_pikacss_integration.log.debug("TypeScript code generation updated");
|
|
78
|
-
debouncedWriteTsCodegenFile();
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
let setupPromise = Promise.resolve();
|
|
82
|
-
let setupCounter = 0;
|
|
83
|
-
function setup(reload = false) {
|
|
84
|
-
setupPromise = setupPromise.then(async () => {
|
|
85
|
-
_pikacss_integration.log.debug("Setting up integration context...");
|
|
86
|
-
const currentSetup = ++setupCounter;
|
|
87
|
-
const moduleIds = Array.from(ctx.usages.keys());
|
|
88
|
-
await ctx.setup();
|
|
89
|
-
if (currentSetup !== setupCounter) {
|
|
90
|
-
_pikacss_integration.log.debug("Setup outdated, skipping...");
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
await debouncedWriteCssCodegenFile();
|
|
94
|
-
await debouncedWriteTsCodegenFile();
|
|
95
|
-
bindHooks();
|
|
96
|
-
if (reload) {
|
|
97
|
-
if (meta.framework === "vite") {
|
|
98
|
-
const promises = [];
|
|
99
|
-
moduleIds.forEach((id) => {
|
|
100
|
-
viteServers.forEach((server) => {
|
|
101
|
-
const mod = server.moduleGraph.getModuleById(id);
|
|
102
|
-
if (mod) {
|
|
103
|
-
_pikacss_integration.log.debug(`Invalidating and reloading module: ${id}`);
|
|
104
|
-
server.moduleGraph.invalidateModule(mod);
|
|
105
|
-
promises.push(server.reloadModule(mod));
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
await Promise.all(promises);
|
|
110
|
-
} else if (meta.framework === "rspack") rspackCompilers.forEach((compiler) => {
|
|
111
|
-
if (compiler.watching == null) return;
|
|
112
|
-
_pikacss_integration.log.debug("Invalidating rspack compiler due to setup changes");
|
|
113
|
-
compiler.watching.invalidateWithChangesAndRemovals(new Set(moduleIds));
|
|
114
|
-
compiler.watching.invalidate();
|
|
115
|
-
});
|
|
116
|
-
else if (meta.framework === "farm") {
|
|
117
|
-
const promises = [];
|
|
118
|
-
farmServers.forEach((server) => {
|
|
119
|
-
if (server.hmrEngine == null) return;
|
|
120
|
-
promises.push(server.hmrEngine.recompileAndSendResult());
|
|
121
|
-
});
|
|
122
|
-
await Promise.all(promises);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
const debouncedSetup = (0, perfect_debounce.debounce)(setup);
|
|
128
|
-
setup();
|
|
129
|
-
return {
|
|
130
|
-
name: PLUGIN_NAME,
|
|
131
|
-
vite: {
|
|
132
|
-
configResolved: (config) => {
|
|
133
|
-
cwd = (0, pathe.resolve)(config.root);
|
|
134
|
-
mode = config.command === "serve" ? "serve" : "build";
|
|
135
|
-
},
|
|
136
|
-
configureServer(server) {
|
|
137
|
-
viteServers.push(server);
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
webpack: (compiler) => {
|
|
141
|
-
cwd = (0, pathe.resolve)(compiler.options.context || node_process.default.cwd());
|
|
142
|
-
mode = compiler.options.mode === "development" ? "serve" : "build";
|
|
143
|
-
},
|
|
144
|
-
rspack: (compiler) => {
|
|
145
|
-
cwd = (0, pathe.resolve)(compiler.options.context || node_process.default.cwd());
|
|
146
|
-
mode = compiler.options.mode === "development" ? "serve" : "build";
|
|
147
|
-
},
|
|
148
|
-
farm: {
|
|
149
|
-
configResolved: (config) => {
|
|
150
|
-
cwd = (0, pathe.resolve)(config.root || node_process.default.cwd());
|
|
151
|
-
mode = config.envMode === "development" ? "serve" : "build";
|
|
152
|
-
},
|
|
153
|
-
configureDevServer(server) {
|
|
154
|
-
farmServers.push(server);
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
esbuild: { async setup(build) {
|
|
158
|
-
cwd = (0, pathe.resolve)(build.initialOptions.absWorkingDir || node_process.default.cwd());
|
|
159
|
-
build.onResolve({ filter: RE_VIRTUAL_PIKA_CSS_ID }, (args) => {
|
|
160
|
-
_pikacss_integration.log.debug(`Resolved virtual CSS module: ${args.path} -> ${ctx.cssCodegenFilepath}`);
|
|
161
|
-
return {
|
|
162
|
-
path: ctx.cssCodegenFilepath,
|
|
163
|
-
namespace: "file"
|
|
164
|
-
};
|
|
165
|
-
});
|
|
166
|
-
} },
|
|
167
|
-
async buildStart() {
|
|
168
|
-
_pikacss_integration.log.debug("Plugin buildStart hook triggered");
|
|
169
|
-
_pikacss_integration.log.debug(`Current mode: ${mode}, cwd: ${cwd}`);
|
|
170
|
-
await setupPromise;
|
|
171
|
-
if (mode === "build") {
|
|
172
|
-
_pikacss_integration.log.debug("Running full CSS code generation in build mode");
|
|
173
|
-
await ctx.fullyCssCodegen();
|
|
174
|
-
}
|
|
175
|
-
if (ctx.resolvedConfigPath != null) {
|
|
176
|
-
this.addWatchFile(ctx.resolvedConfigPath);
|
|
177
|
-
_pikacss_integration.log.debug(`Added watch file: ${ctx.resolvedConfigPath}`);
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
resolveId: meta.framework === "esbuild" ? void 0 : async function(id) {
|
|
181
|
-
if (RE_VIRTUAL_PIKA_CSS_ID.test(id)) {
|
|
182
|
-
await setupPromise;
|
|
183
|
-
_pikacss_integration.log.debug(`Resolved virtual CSS module: ${id} -> ${ctx.cssCodegenFilepath}`);
|
|
184
|
-
return ctx.cssCodegenFilepath;
|
|
185
|
-
}
|
|
186
|
-
return null;
|
|
187
|
-
},
|
|
188
|
-
transform: {
|
|
189
|
-
filter: { get id() {
|
|
190
|
-
return ctx.transformFilter;
|
|
191
|
-
} },
|
|
192
|
-
handler(code, id) {
|
|
193
|
-
if (meta.framework === "webpack" && ctx.resolvedConfigPath != null) {
|
|
194
|
-
this.addWatchFile(ctx.resolvedConfigPath);
|
|
195
|
-
_pikacss_integration.log.debug(`Added watch file: ${ctx.resolvedConfigPath}`);
|
|
196
|
-
}
|
|
197
|
-
return ctx.transform(code, id);
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
watchChange(id) {
|
|
201
|
-
if (id === ctx.resolvedConfigPath && (0, node_fs.readFileSync)(id, "utf-8") !== ctx.resolvedConfigContent) {
|
|
202
|
-
_pikacss_integration.log.info("Configuration file changed, reloading...");
|
|
203
|
-
debouncedSetup(true);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
};
|
|
208
|
-
const unplugin$1 = /* @__PURE__ */ (0, unplugin.createUnplugin)(unpluginFactory);
|
|
209
|
-
var src_default = unplugin$1;
|
|
210
|
-
|
|
211
|
-
//#endregion
|
|
212
|
-
Object.defineProperty(exports, '__toESM', {
|
|
213
|
-
enumerable: true,
|
|
214
|
-
get: function () {
|
|
215
|
-
return __toESM;
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
Object.defineProperty(exports, 'src_default', {
|
|
219
|
-
enumerable: true,
|
|
220
|
-
get: function () {
|
|
221
|
-
return src_default;
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
Object.defineProperty(exports, 'unplugin', {
|
|
225
|
-
enumerable: true,
|
|
226
|
-
get: function () {
|
|
227
|
-
return unplugin$1;
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
Object.defineProperty(exports, 'unpluginFactory', {
|
|
231
|
-
enumerable: true,
|
|
232
|
-
get: function () {
|
|
233
|
-
return unpluginFactory;
|
|
234
|
-
}
|
|
235
|
-
});
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { EngineConfig, IntegrationContextOptions, Nullish } from "@pikacss/integration";
|
|
2
|
-
|
|
3
|
-
//#region src/types.d.ts
|
|
4
|
-
interface PluginOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Specify file patterns to scan for detecting pika() function calls and generating atomic styles.
|
|
7
|
-
*
|
|
8
|
-
* Default values:
|
|
9
|
-
* - `include`: `['**\/*.{js,ts,jsx,tsx,vue}']` - Scans all JS/TS/Vue files by default
|
|
10
|
-
* - `exclude`: `['node_modules/**']` - Excludes node_modules by default
|
|
11
|
-
* @example
|
|
12
|
-
* scan: {
|
|
13
|
-
* include: ['src/**\/{*.ts,*.tsx,*.vue}'],
|
|
14
|
-
* exclude: ['node_modules/**', 'dist/**']
|
|
15
|
-
* }
|
|
16
|
-
*/
|
|
17
|
-
scan?: {
|
|
18
|
-
/**
|
|
19
|
-
* File glob patterns to scan. Supports a single string or array of strings.
|
|
20
|
-
* @default ['**\/*.{js,ts,jsx,tsx,vue}']
|
|
21
|
-
*/
|
|
22
|
-
include?: string | string[];
|
|
23
|
-
/**
|
|
24
|
-
* File glob patterns to exclude. Supports a single string or array of strings.
|
|
25
|
-
* @default ['node_modules/**', 'dist/**']
|
|
26
|
-
*/
|
|
27
|
-
exclude?: string | string[];
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Configuration object or path to a configuration file for the PikaCSS engine.
|
|
31
|
-
* Can pass a config object directly to define engine options, or a config file path (e.g., 'pika.config.ts').
|
|
32
|
-
*
|
|
33
|
-
* Behavior:
|
|
34
|
-
* - If a file path is specified but the file doesn't exist and autoCreateConfig is true, a config file will be generated at the specified path.
|
|
35
|
-
* - If an inline config object is passed, autoCreateConfig will be ignored.
|
|
36
|
-
* - If not provided and autoCreateConfig is true, a default config file will be created.
|
|
37
|
-
* @example
|
|
38
|
-
* config: { prefix: 'pika-', defaultSelector: '.%' }
|
|
39
|
-
* // or
|
|
40
|
-
* config: './pika.config.ts'
|
|
41
|
-
*/
|
|
42
|
-
config?: EngineConfig | string;
|
|
43
|
-
/**
|
|
44
|
-
* Whether to automatically create a configuration file when needed.
|
|
45
|
-
*
|
|
46
|
-
* Behavior:
|
|
47
|
-
* - If config is not provided: Creates a default 'pika.config.ts' in the project root.
|
|
48
|
-
* - If config is a file path that doesn't exist: Creates a config file at the specified path.
|
|
49
|
-
* - If config is an inline config object: This option is ignored (no file will be created).
|
|
50
|
-
* @default true
|
|
51
|
-
*/
|
|
52
|
-
autoCreateConfig?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* The name of the PikaCSS function in source code. Used to identify function calls that need to be transformed.
|
|
55
|
-
* @default 'pika'
|
|
56
|
-
* @example
|
|
57
|
-
* fnName: 'classname' // Transform classname() function calls to atomic styles
|
|
58
|
-
*/
|
|
59
|
-
fnName?: string;
|
|
60
|
-
/**
|
|
61
|
-
* The format of the generated atomic style class names.
|
|
62
|
-
* - `'string'`: Returns a space-separated string of class names (e.g., "a b c")
|
|
63
|
-
* - `'array'`: Returns an array of class names (e.g., ['a', 'b', 'c'])
|
|
64
|
-
* - `'inline'`: Returns an object format that can be directly used in style objects
|
|
65
|
-
* @default 'string'
|
|
66
|
-
*/
|
|
67
|
-
transformedFormat?: 'string' | 'array' | 'inline';
|
|
68
|
-
/**
|
|
69
|
-
* Configuration for TypeScript code generation file.
|
|
70
|
-
* - `true`: Auto-generate as 'pika.gen.ts'
|
|
71
|
-
* - string: Use the specified file path
|
|
72
|
-
* - `false`: Disable TypeScript code generation
|
|
73
|
-
* The generated TypeScript file provides type hints and auto-completion support.
|
|
74
|
-
* @default true
|
|
75
|
-
* @example
|
|
76
|
-
* tsCodegen: 'src/pika.gen.ts' // Generate to a custom location
|
|
77
|
-
*/
|
|
78
|
-
tsCodegen?: boolean | string;
|
|
79
|
-
/**
|
|
80
|
-
* Configuration for CSS code generation file.
|
|
81
|
-
* - `true`: Auto-generate as 'pika.gen.css'
|
|
82
|
-
* - string: Use the specified file path
|
|
83
|
-
* The generated CSS file contains all scanned atomic styles.
|
|
84
|
-
* @default true
|
|
85
|
-
* @example
|
|
86
|
-
* cssCodegen: 'src/styles/generated.css' // Generate to a custom location
|
|
87
|
-
*/
|
|
88
|
-
cssCodegen?: true | string;
|
|
89
|
-
/** @internal */
|
|
90
|
-
currentPackageName?: string;
|
|
91
|
-
}
|
|
92
|
-
interface ResolvedPluginOptions {
|
|
93
|
-
currentPackageName: string;
|
|
94
|
-
configOrPath: EngineConfig | string | Nullish;
|
|
95
|
-
tsCodegen: false | string;
|
|
96
|
-
cssCodegen: string;
|
|
97
|
-
scan: IntegrationContextOptions['scan'];
|
|
98
|
-
fnName: string;
|
|
99
|
-
transformedFormat: 'string' | 'array' | 'inline';
|
|
100
|
-
autoCreateConfig: boolean;
|
|
101
|
-
}
|
|
102
|
-
//#endregion
|
|
103
|
-
export { ResolvedPluginOptions as n, PluginOptions as t };
|
package/dist/vite.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const require_src = require('./src-BsRreiwW.cjs');
|
|
2
|
-
let unplugin = require("unplugin");
|
|
3
|
-
|
|
4
|
-
//#region src/vite.ts
|
|
5
|
-
var vite_default = (0, unplugin.createVitePlugin)(require_src.unpluginFactory);
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
module.exports = vite_default;
|
|
9
|
-
var _pikacss_integration = require("@pikacss/integration");
|
|
10
|
-
Object.keys(_pikacss_integration).forEach(function (k) {
|
|
11
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return _pikacss_integration[k]; }
|
|
14
|
-
});
|
|
15
|
-
});
|
package/dist/vite.d.cts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-CtaD-Nki.cjs";
|
|
2
|
-
import "./index.cjs";
|
|
3
|
-
import { Plugin } from "vite";
|
|
4
|
-
export * from "@pikacss/integration";
|
|
5
|
-
|
|
6
|
-
//#region src/vite.d.ts
|
|
7
|
-
declare const _default: (options?: PluginOptions) => Plugin;
|
|
8
|
-
//#endregion
|
|
9
|
-
export { PluginOptions, ResolvedPluginOptions, _default as default };
|
package/dist/webpack.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const require_src = require('./src-BsRreiwW.cjs');
|
|
2
|
-
let unplugin = require("unplugin");
|
|
3
|
-
|
|
4
|
-
//#region src/webpack.ts
|
|
5
|
-
var webpack_default = (0, unplugin.createWebpackPlugin)(require_src.unpluginFactory);
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
module.exports = webpack_default;
|
|
9
|
-
var _pikacss_integration = require("@pikacss/integration");
|
|
10
|
-
Object.keys(_pikacss_integration).forEach(function (k) {
|
|
11
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return _pikacss_integration[k]; }
|
|
14
|
-
});
|
|
15
|
-
});
|
package/dist/webpack.d.cts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { n as ResolvedPluginOptions, t as PluginOptions } from "./types-CtaD-Nki.cjs";
|
|
2
|
-
export * from "@pikacss/integration";
|
|
3
|
-
|
|
4
|
-
//#region src/webpack.d.ts
|
|
5
|
-
declare const _default: (options?: PluginOptions | undefined) => WebpackPluginInstance;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { PluginOptions, ResolvedPluginOptions, _default as default };
|
|
File without changes
|