@powerlines/plugin-plugin 0.12.240 → 0.12.242
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 +1 -0
- package/dist/index.d.cts +34 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +34 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +5 -21
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +0 -12
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +0 -10
- package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/index.cjs +0 -70
- package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/index.js +0 -68
- package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/parse-CRORloGP.cjs +0 -111
- package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/parse-CRORloGP.js +0 -108
- package/dist/src/index.cjs +0 -106
- package/dist/src/index.d.ts +0 -8
- package/dist/src/index.js +0 -101
- package/dist/src/types/index.cjs +0 -12
- package/dist/src/types/index.d.ts +0 -2
- package/dist/src/types/index.js +0 -2
- package/dist/src/types/plugin.cjs +0 -31
- package/dist/src/types/plugin.d.ts +0 -34
- package/dist/src/types/plugin.js +0 -25
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,`__esModule`,{value:!0});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@powerlines/plugin-tsdown`);c=s(c);let l=require(`@stryke/path/join`);const u=(e={})=>[(0,c.default)(e),{name:`plugin`,config(){return this.debug(`Providing default configuration for the Powerlines plugin.`),{type:`library`,output:{format:[`cjs`,`esm`],dts:!1},tsdown:{variant:`tsdown`,platform:`node`,target:`node22`,nodeProtocol:!0,minify:!1,exports:{all:!0},unbundle:!0,external:[`powerlines`,/^powerlines\/.*$/,/^@powerlines\//]}}},async configResolved(){if(!this.config.input||Array.isArray(this.config.input)&&this.config.input.length===0){let e=`src/index.tsx`;this.fs.existsSync((0,l.joinPaths)(this.config.root,e))||(e=`src/index.ts`),this.config.input=e}}}];var d=u;exports.default=d,exports.plugin=u;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Plugin } from "powerlines";
|
|
2
|
+
import { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig } from "@powerlines/plugin-tsdown/types/plugin";
|
|
3
|
+
import { TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
4
|
+
|
|
5
|
+
//#region src/types/plugin.d.ts
|
|
6
|
+
interface PluginPluginTypesOptions {
|
|
7
|
+
/**
|
|
8
|
+
* The type definition for the plugin's options.
|
|
9
|
+
*/
|
|
10
|
+
options?: TypeDefinitionParameter;
|
|
11
|
+
/**
|
|
12
|
+
* The type definition for the plugin's user config.
|
|
13
|
+
*/
|
|
14
|
+
userConfig?: TypeDefinitionParameter;
|
|
15
|
+
}
|
|
16
|
+
interface PluginPluginOptions extends TsdownPluginOptions {
|
|
17
|
+
/**
|
|
18
|
+
* The type definitions for the Plugin plugin.
|
|
19
|
+
*/
|
|
20
|
+
types?: PluginPluginTypesOptions;
|
|
21
|
+
}
|
|
22
|
+
interface PluginPluginResolvedConfig extends TsdownPluginResolvedConfig {
|
|
23
|
+
plugin: PluginPluginOptions;
|
|
24
|
+
}
|
|
25
|
+
type PluginPluginContext<TResolvedConfig extends PluginPluginResolvedConfig = PluginPluginResolvedConfig> = TsdownPluginContext<TResolvedConfig>;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/index.d.ts
|
|
28
|
+
/**
|
|
29
|
+
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
30
|
+
*/
|
|
31
|
+
declare const plugin: <TContext extends PluginPluginContext = PluginPluginContext>(options?: PluginPluginOptions) => Plugin<TContext>[];
|
|
32
|
+
//#endregion
|
|
33
|
+
export { plugin as default, plugin };
|
|
34
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types/plugin.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;;;UA0BiB,wBAAA;;;AAAjB;EAYiB,OAAA,CAAA,EARL,uBAYF;EAOO;AAIjB;;EAEI,UAAA,CAAA,EApBW,uBAoBX;;AACA,UAlBa,mBAAA,SAA4B,mBAkBzC,CAAA;EAAmB;;;UAdb;AChBV;AAIU,UDmBO,0BAAA,SAAmC,0BCnB1C,CAAA;EAAP,MAAA,EDoBO,mBCpBP;;KDuBS,4CACc,6BACtB,8BACA,oBAAoB;;;;;;AA9BP,cCAJ,MDAI,EAAA,CAAA,iBCCE,mBDGP,GCH6B,mBDQ1B,CAAA,CAAA,OAAuB,CAAA,ECN3B,mBDM2B,EAAA,GCLnC,MDKmC,CCL5B,QDK4B,CAAA,EAAA"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Plugin } from "powerlines";
|
|
2
|
+
import { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig } from "@powerlines/plugin-tsdown/types/plugin";
|
|
3
|
+
import { TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
4
|
+
|
|
5
|
+
//#region src/types/plugin.d.ts
|
|
6
|
+
interface PluginPluginTypesOptions {
|
|
7
|
+
/**
|
|
8
|
+
* The type definition for the plugin's options.
|
|
9
|
+
*/
|
|
10
|
+
options?: TypeDefinitionParameter;
|
|
11
|
+
/**
|
|
12
|
+
* The type definition for the plugin's user config.
|
|
13
|
+
*/
|
|
14
|
+
userConfig?: TypeDefinitionParameter;
|
|
15
|
+
}
|
|
16
|
+
interface PluginPluginOptions extends TsdownPluginOptions {
|
|
17
|
+
/**
|
|
18
|
+
* The type definitions for the Plugin plugin.
|
|
19
|
+
*/
|
|
20
|
+
types?: PluginPluginTypesOptions;
|
|
21
|
+
}
|
|
22
|
+
interface PluginPluginResolvedConfig extends TsdownPluginResolvedConfig {
|
|
23
|
+
plugin: PluginPluginOptions;
|
|
24
|
+
}
|
|
25
|
+
type PluginPluginContext<TResolvedConfig extends PluginPluginResolvedConfig = PluginPluginResolvedConfig> = TsdownPluginContext<TResolvedConfig>;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/index.d.ts
|
|
28
|
+
/**
|
|
29
|
+
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
30
|
+
*/
|
|
31
|
+
declare const plugin: <TContext extends PluginPluginContext = PluginPluginContext>(options?: PluginPluginOptions) => Plugin<TContext>[];
|
|
32
|
+
//#endregion
|
|
33
|
+
export { plugin as default, plugin };
|
|
34
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types/plugin.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;;;UA0BiB,wBAAA;;;AAAjB;EAYiB,OAAA,CAAA,EARL,uBAYF;EAOO;AAIjB;;EAEI,UAAA,CAAA,EApBW,uBAoBX;;AACA,UAlBa,mBAAA,SAA4B,mBAkBzC,CAAA;EAAmB;;;UAdb;AChBV;AAIU,UDmBO,0BAAA,SAAmC,0BCnB1C,CAAA;EAAP,MAAA,EDoBO,mBCpBP;;KDuBS,4CACc,6BACtB,8BACA,oBAAoB;;;;;;AA9BP,cCAJ,MDAI,EAAA,CAAA,iBCCE,mBDGP,GCH6B,mBDQ1B,CAAA,CAAA,OAAuB,CAAA,ECN3B,mBDM2B,EAAA,GCLnC,MDKmC,CCL5B,QDK4B,CAAA,EAAA"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"@powerlines/plugin-tsdown";import{joinPaths as t}from"@stryke/path/join";const n=(n={})=>[e(n),{name:`plugin`,config(){return this.debug(`Providing default configuration for the Powerlines plugin.`),{type:`library`,output:{format:[`cjs`,`esm`],dts:!1},tsdown:{variant:`tsdown`,platform:`node`,target:`node22`,nodeProtocol:!0,minify:!1,exports:{all:!0},unbundle:!0,external:[`powerlines`,/^powerlines\/.*$/,/^@powerlines\//]}}},async configResolved(){if(!this.config.input||Array.isArray(this.config.input)&&this.config.input.length===0){let e=`src/index.tsx`;this.fs.existsSync(t(this.config.root,e))||(e=`src/index.ts`),this.config.input=e}}}];var r=n;export{r as default,n as plugin};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport tsdown from \"@powerlines/plugin-tsdown\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { Plugin } from \"powerlines\";\nimport type { PluginPluginContext, PluginPluginOptions } from \"./types/plugin\";\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <\n TContext extends PluginPluginContext = PluginPluginContext\n>(\n options: PluginPluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n tsdown(options),\n {\n name: \"plugin\",\n config() {\n this.debug(\n \"Providing default configuration for the Powerlines plugin.\"\n );\n\n return {\n type: \"library\",\n output: {\n format: [\"cjs\", \"esm\"],\n dts: false\n },\n tsdown: {\n variant: \"tsdown\",\n platform: \"node\",\n target: \"node22\",\n nodeProtocol: true,\n minify: false,\n exports: {\n all: true\n },\n unbundle: true,\n external: [\"powerlines\", /^powerlines\\/.*$/, /^@powerlines\\//]\n }\n };\n },\n async configResolved() {\n if (\n !this.config.input ||\n (Array.isArray(this.config.input) && this.config.input.length === 0)\n ) {\n let input = \"src/index.tsx\";\n if (!this.fs.existsSync(joinPaths(this.config.root, input))) {\n input = \"src/index.ts\";\n }\n\n this.config.input = input;\n }\n }\n }\n ];\n};\n\nexport default plugin;\n"],"mappings":"uFA0BA,MAAa,GAGX,EAA+B,EAAE,GAE1B,CACL,EAAO,EAAQ,CACf,CACE,KAAM,SACN,QAAS,CAKP,OAJA,KAAK,MACH,6DACD,CAEM,CACL,KAAM,UACN,OAAQ,CACN,OAAQ,CAAC,MAAO,MAAM,CACtB,IAAK,GACN,CACD,OAAQ,CACN,QAAS,SACT,SAAU,OACV,OAAQ,SACR,aAAc,GACd,OAAQ,GACR,QAAS,CACP,IAAK,GACN,CACD,SAAU,GACV,SAAU,CAAC,aAAc,mBAAoB,iBAAiB,CAC/D,CACF,EAEH,MAAM,gBAAiB,CACrB,GACE,CAAC,KAAK,OAAO,OACZ,MAAM,QAAQ,KAAK,OAAO,MAAM,EAAI,KAAK,OAAO,MAAM,SAAW,EAClE,CACA,IAAI,EAAQ,gBACP,KAAK,GAAG,WAAW,EAAU,KAAK,OAAO,KAAM,EAAM,CAAC,GACzD,EAAQ,gBAGV,KAAK,OAAO,MAAQ,IAGzB,CACF,CAGH,IAAA,EAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-plugin",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.242",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"repository": {
|
|
@@ -117,27 +117,11 @@
|
|
|
117
117
|
"files": ["dist/**/*"],
|
|
118
118
|
"keywords": ["powerlines", "storm-software", "powerlines-plugin"],
|
|
119
119
|
"dependencies": {
|
|
120
|
-
"@stryke/convert": "^0.6.40",
|
|
121
|
-
"@stryke/fs": "^0.33.43",
|
|
122
|
-
"@stryke/json": "^0.9.43",
|
|
123
120
|
"@stryke/path": "^0.26.6",
|
|
124
|
-
"
|
|
125
|
-
"@
|
|
126
|
-
"@stryke/types": "^0.10.39",
|
|
127
|
-
"defu": "^6.1.4",
|
|
128
|
-
"jiti": "^2.6.1",
|
|
129
|
-
"powerlines": "^0.38.56",
|
|
130
|
-
"tsdown": "0.17.0-beta.5",
|
|
131
|
-
"unplugin": "3.0.0-beta.3"
|
|
132
|
-
},
|
|
133
|
-
"devDependencies": {
|
|
134
|
-
"@rollup/plugin-commonjs": "^28.0.9",
|
|
135
|
-
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
136
|
-
"@types/babel__helper-plugin-utils": "^7.10.3",
|
|
137
|
-
"@types/node": "^25.3.0",
|
|
138
|
-
"rollup": "^4.59.0",
|
|
139
|
-
"rollup-plugin-typescript2": "^0.36.0"
|
|
121
|
+
"powerlines": "^0.39.0",
|
|
122
|
+
"@powerlines/plugin-tsdown": "^0.1.244"
|
|
140
123
|
},
|
|
124
|
+
"devDependencies": { "@stryke/types": "^0.10.39", "@types/node": "^25.3.2" },
|
|
141
125
|
"publishConfig": { "access": "public" },
|
|
142
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "0dcb16f054b8a69915b074578e6d4dfa3ecc1529"
|
|
143
127
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// src/vlq.ts
|
|
4
|
-
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
5
|
-
var intToChar = new Uint8Array(64);
|
|
6
|
-
var charToInt = new Uint8Array(128);
|
|
7
|
-
for (let i = 0; i < chars.length; i++) {
|
|
8
|
-
const c = chars.charCodeAt(i);
|
|
9
|
-
intToChar[i] = c;
|
|
10
|
-
charToInt[c] = i;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=sourcemap-codec.cjs.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// src/vlq.ts
|
|
2
|
-
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
3
|
-
var intToChar = new Uint8Array(64);
|
|
4
|
-
var charToInt = new Uint8Array(128);
|
|
5
|
-
for (let i = 0; i < chars.length; i++) {
|
|
6
|
-
const c = chars.charCodeAt(i);
|
|
7
|
-
intToChar[i] = c;
|
|
8
|
-
charToInt[c] = i;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=sourcemap-codec.js.map
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var parseCRORloGP = require('./parse-CRORloGP.cjs');
|
|
4
|
-
var path = require('node:path');
|
|
5
|
-
require('node:fs');
|
|
6
|
-
require('node:buffer');
|
|
7
|
-
require('../../../../@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs');
|
|
8
|
-
require('node:querystring');
|
|
9
|
-
require('node:process');
|
|
10
|
-
require('webpack-virtual-modules');
|
|
11
|
-
|
|
12
|
-
function toRollupPlugin(plugin, key) {
|
|
13
|
-
if (plugin.resolveId && false) ;
|
|
14
|
-
if (plugin.load && (plugin.loadInclude || false)) {
|
|
15
|
-
const loadHook = plugin.load;
|
|
16
|
-
const { handler, filter } = parseCRORloGP.r("load", loadHook);
|
|
17
|
-
replaceHookHandler("load", loadHook, function(...args) {
|
|
18
|
-
const [id] = args;
|
|
19
|
-
if (plugin.loadInclude && !plugin.loadInclude(id)) return;
|
|
20
|
-
if (!supportNativeFilter() && !filter(id)) return;
|
|
21
|
-
return handler.apply(this, args);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
if (plugin.transform && (plugin.transformInclude || false)) {
|
|
25
|
-
const transformHook = plugin.transform;
|
|
26
|
-
const { handler, filter } = parseCRORloGP.r("transform", transformHook);
|
|
27
|
-
replaceHookHandler("transform", transformHook, function(...args) {
|
|
28
|
-
const [code, id] = args;
|
|
29
|
-
if (plugin.transformInclude && !plugin.transformInclude(id)) return;
|
|
30
|
-
if (!supportNativeFilter() && !filter(id, code)) return;
|
|
31
|
-
return handler.apply(this, args);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
if (plugin[key]) Object.assign(plugin, plugin[key]);
|
|
35
|
-
return plugin;
|
|
36
|
-
function replaceHookHandler(name, hook, handler) {
|
|
37
|
-
if (typeof hook === "function") plugin[name] = handler;
|
|
38
|
-
else hook.handler = handler;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function supportNativeFilter(context, framework) {
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
//#endregion
|
|
46
|
-
//#region src/rolldown/index.ts
|
|
47
|
-
function getRolldownPlugin(factory) {
|
|
48
|
-
return ((userOptions) => {
|
|
49
|
-
const plugins = parseCRORloGP.i(factory(userOptions, { framework: "rolldown" })).map((rawPlugin) => {
|
|
50
|
-
return toRollupPlugin(rawPlugin, "rolldown");
|
|
51
|
-
});
|
|
52
|
-
return plugins.length === 1 ? plugins[0] : plugins;
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region src/rspack/index.ts
|
|
58
|
-
path.resolve(undefined, "rspack/loaders/transform.mjs");
|
|
59
|
-
path.resolve(undefined, "rspack/loaders/load.mjs");
|
|
60
|
-
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/webpack/index.ts
|
|
63
|
-
path.resolve(undefined, "webpack/loaders/transform.mjs");
|
|
64
|
-
path.resolve(undefined, "webpack/loaders/load.mjs");
|
|
65
|
-
function createRolldownPlugin(factory) {
|
|
66
|
-
return getRolldownPlugin(factory);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
exports.createRolldownPlugin = createRolldownPlugin;
|
|
70
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { i as toArray, r as normalizeObjectHook } from './parse-CRORloGP.js';
|
|
2
|
-
import { resolve } from 'node:path';
|
|
3
|
-
import 'node:fs';
|
|
4
|
-
import 'node:buffer';
|
|
5
|
-
import '../../../../@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js';
|
|
6
|
-
import 'node:querystring';
|
|
7
|
-
import 'node:process';
|
|
8
|
-
import 'webpack-virtual-modules';
|
|
9
|
-
|
|
10
|
-
function toRollupPlugin(plugin, key) {
|
|
11
|
-
if (plugin.resolveId && false) ;
|
|
12
|
-
if (plugin.load && (plugin.loadInclude || false)) {
|
|
13
|
-
const loadHook = plugin.load;
|
|
14
|
-
const { handler, filter } = normalizeObjectHook("load", loadHook);
|
|
15
|
-
replaceHookHandler("load", loadHook, function(...args) {
|
|
16
|
-
const [id] = args;
|
|
17
|
-
if (plugin.loadInclude && !plugin.loadInclude(id)) return;
|
|
18
|
-
if (!supportNativeFilter() && !filter(id)) return;
|
|
19
|
-
return handler.apply(this, args);
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
if (plugin.transform && (plugin.transformInclude || false)) {
|
|
23
|
-
const transformHook = plugin.transform;
|
|
24
|
-
const { handler, filter } = normalizeObjectHook("transform", transformHook);
|
|
25
|
-
replaceHookHandler("transform", transformHook, function(...args) {
|
|
26
|
-
const [code, id] = args;
|
|
27
|
-
if (plugin.transformInclude && !plugin.transformInclude(id)) return;
|
|
28
|
-
if (!supportNativeFilter() && !filter(id, code)) return;
|
|
29
|
-
return handler.apply(this, args);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
if (plugin[key]) Object.assign(plugin, plugin[key]);
|
|
33
|
-
return plugin;
|
|
34
|
-
function replaceHookHandler(name, hook, handler) {
|
|
35
|
-
if (typeof hook === "function") plugin[name] = handler;
|
|
36
|
-
else hook.handler = handler;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
function supportNativeFilter(context, framework) {
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
//#endregion
|
|
44
|
-
//#region src/rolldown/index.ts
|
|
45
|
-
function getRolldownPlugin(factory) {
|
|
46
|
-
return ((userOptions) => {
|
|
47
|
-
const plugins = toArray(factory(userOptions, { framework: "rolldown" })).map((rawPlugin) => {
|
|
48
|
-
return toRollupPlugin(rawPlugin, "rolldown");
|
|
49
|
-
});
|
|
50
|
-
return plugins.length === 1 ? plugins[0] : plugins;
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region src/rspack/index.ts
|
|
56
|
-
resolve(import.meta.dirname, "rspack/loaders/transform.mjs");
|
|
57
|
-
resolve(import.meta.dirname, "rspack/loaders/load.mjs");
|
|
58
|
-
|
|
59
|
-
//#endregion
|
|
60
|
-
//#region src/webpack/index.ts
|
|
61
|
-
resolve(import.meta.dirname, "webpack/loaders/transform.mjs");
|
|
62
|
-
resolve(import.meta.dirname, "webpack/loaders/load.mjs");
|
|
63
|
-
function createRolldownPlugin(factory) {
|
|
64
|
-
return getRolldownPlugin(factory);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export { createRolldownPlugin };
|
|
68
|
-
//# sourceMappingURL=index.js.map
|
package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/parse-CRORloGP.cjs
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var path = require('node:path');
|
|
4
|
-
var picomatch = require('picomatch');
|
|
5
|
-
|
|
6
|
-
//#region src/utils/general.ts
|
|
7
|
-
function toArray(array) {
|
|
8
|
-
array = array || [];
|
|
9
|
-
if (Array.isArray(array)) return array;
|
|
10
|
-
return [array];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/utils/filter.ts
|
|
15
|
-
const BACKSLASH_REGEX = /\\/g;
|
|
16
|
-
function normalize$1(path$1) {
|
|
17
|
-
return path$1.replace(BACKSLASH_REGEX, "/");
|
|
18
|
-
}
|
|
19
|
-
const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Z]:)?[/\\|])/i;
|
|
20
|
-
function isAbsolute$1(path$1) {
|
|
21
|
-
return ABSOLUTE_PATH_REGEX.test(path$1);
|
|
22
|
-
}
|
|
23
|
-
function getMatcherString(glob, cwd) {
|
|
24
|
-
if (glob.startsWith("**") || isAbsolute$1(glob)) return normalize$1(glob);
|
|
25
|
-
return normalize$1(path.resolve(cwd, glob));
|
|
26
|
-
}
|
|
27
|
-
function patternToIdFilter(pattern) {
|
|
28
|
-
if (pattern instanceof RegExp) return (id) => {
|
|
29
|
-
const normalizedId = normalize$1(id);
|
|
30
|
-
const result = pattern.test(normalizedId);
|
|
31
|
-
pattern.lastIndex = 0;
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
const matcher = picomatch(getMatcherString(pattern, process.cwd()), { dot: true });
|
|
35
|
-
return (id) => {
|
|
36
|
-
return matcher(normalize$1(id));
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
function patternToCodeFilter(pattern) {
|
|
40
|
-
if (pattern instanceof RegExp) return (code) => {
|
|
41
|
-
const result = pattern.test(code);
|
|
42
|
-
pattern.lastIndex = 0;
|
|
43
|
-
return result;
|
|
44
|
-
};
|
|
45
|
-
return (code) => code.includes(pattern);
|
|
46
|
-
}
|
|
47
|
-
function createFilter(exclude, include) {
|
|
48
|
-
if (!exclude && !include) return;
|
|
49
|
-
return (input) => {
|
|
50
|
-
if (exclude?.some((filter) => filter(input))) return false;
|
|
51
|
-
if (include?.some((filter) => filter(input))) return true;
|
|
52
|
-
return !(include && include.length > 0);
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function normalizeFilter(filter) {
|
|
56
|
-
if (typeof filter === "string" || filter instanceof RegExp) return { include: [filter] };
|
|
57
|
-
if (Array.isArray(filter)) return { include: filter };
|
|
58
|
-
return {
|
|
59
|
-
exclude: filter.exclude ? toArray(filter.exclude) : void 0,
|
|
60
|
-
include: filter.include ? toArray(filter.include) : void 0
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
function createIdFilter(filter) {
|
|
64
|
-
if (!filter) return;
|
|
65
|
-
const { exclude, include } = normalizeFilter(filter);
|
|
66
|
-
const excludeFilter = exclude?.map(patternToIdFilter);
|
|
67
|
-
const includeFilter = include?.map(patternToIdFilter);
|
|
68
|
-
return createFilter(excludeFilter, includeFilter);
|
|
69
|
-
}
|
|
70
|
-
function createCodeFilter(filter) {
|
|
71
|
-
if (!filter) return;
|
|
72
|
-
const { exclude, include } = normalizeFilter(filter);
|
|
73
|
-
const excludeFilter = exclude?.map(patternToCodeFilter);
|
|
74
|
-
const includeFilter = include?.map(patternToCodeFilter);
|
|
75
|
-
return createFilter(excludeFilter, includeFilter);
|
|
76
|
-
}
|
|
77
|
-
function createFilterForId(filter) {
|
|
78
|
-
const filterFunction = createIdFilter(filter);
|
|
79
|
-
return filterFunction ? (id) => !!filterFunction(id) : void 0;
|
|
80
|
-
}
|
|
81
|
-
function createFilterForTransform(idFilter, codeFilter) {
|
|
82
|
-
if (!idFilter && !codeFilter) return;
|
|
83
|
-
const idFilterFunction = createIdFilter(idFilter);
|
|
84
|
-
const codeFilterFunction = createCodeFilter(codeFilter);
|
|
85
|
-
return (id, code) => {
|
|
86
|
-
let fallback = true;
|
|
87
|
-
if (idFilterFunction) fallback &&= idFilterFunction(id);
|
|
88
|
-
if (!fallback) return false;
|
|
89
|
-
if (codeFilterFunction) fallback &&= codeFilterFunction(code);
|
|
90
|
-
return fallback;
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
function normalizeObjectHook(name, hook) {
|
|
94
|
-
let handler;
|
|
95
|
-
let filter;
|
|
96
|
-
if (typeof hook === "function") handler = hook;
|
|
97
|
-
else {
|
|
98
|
-
handler = hook.handler;
|
|
99
|
-
const hookFilter = hook.filter;
|
|
100
|
-
if (name === "resolveId" || name === "load") filter = createFilterForId(hookFilter?.id);
|
|
101
|
-
else filter = createFilterForTransform(hookFilter?.id, hookFilter?.code);
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
handler,
|
|
105
|
-
filter: filter || (() => true)
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
exports.i = toArray;
|
|
110
|
-
exports.r = normalizeObjectHook;
|
|
111
|
-
//# sourceMappingURL=parse-CRORloGP.cjs.map
|
package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/parse-CRORloGP.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { resolve } from 'node:path';
|
|
2
|
-
import picomatch from 'picomatch';
|
|
3
|
-
|
|
4
|
-
//#region src/utils/general.ts
|
|
5
|
-
function toArray(array) {
|
|
6
|
-
array = array || [];
|
|
7
|
-
if (Array.isArray(array)) return array;
|
|
8
|
-
return [array];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/utils/filter.ts
|
|
13
|
-
const BACKSLASH_REGEX = /\\/g;
|
|
14
|
-
function normalize$1(path$1) {
|
|
15
|
-
return path$1.replace(BACKSLASH_REGEX, "/");
|
|
16
|
-
}
|
|
17
|
-
const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Z]:)?[/\\|])/i;
|
|
18
|
-
function isAbsolute$1(path$1) {
|
|
19
|
-
return ABSOLUTE_PATH_REGEX.test(path$1);
|
|
20
|
-
}
|
|
21
|
-
function getMatcherString(glob, cwd) {
|
|
22
|
-
if (glob.startsWith("**") || isAbsolute$1(glob)) return normalize$1(glob);
|
|
23
|
-
return normalize$1(resolve(cwd, glob));
|
|
24
|
-
}
|
|
25
|
-
function patternToIdFilter(pattern) {
|
|
26
|
-
if (pattern instanceof RegExp) return (id) => {
|
|
27
|
-
const normalizedId = normalize$1(id);
|
|
28
|
-
const result = pattern.test(normalizedId);
|
|
29
|
-
pattern.lastIndex = 0;
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
const matcher = picomatch(getMatcherString(pattern, process.cwd()), { dot: true });
|
|
33
|
-
return (id) => {
|
|
34
|
-
return matcher(normalize$1(id));
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function patternToCodeFilter(pattern) {
|
|
38
|
-
if (pattern instanceof RegExp) return (code) => {
|
|
39
|
-
const result = pattern.test(code);
|
|
40
|
-
pattern.lastIndex = 0;
|
|
41
|
-
return result;
|
|
42
|
-
};
|
|
43
|
-
return (code) => code.includes(pattern);
|
|
44
|
-
}
|
|
45
|
-
function createFilter(exclude, include) {
|
|
46
|
-
if (!exclude && !include) return;
|
|
47
|
-
return (input) => {
|
|
48
|
-
if (exclude?.some((filter) => filter(input))) return false;
|
|
49
|
-
if (include?.some((filter) => filter(input))) return true;
|
|
50
|
-
return !(include && include.length > 0);
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function normalizeFilter(filter) {
|
|
54
|
-
if (typeof filter === "string" || filter instanceof RegExp) return { include: [filter] };
|
|
55
|
-
if (Array.isArray(filter)) return { include: filter };
|
|
56
|
-
return {
|
|
57
|
-
exclude: filter.exclude ? toArray(filter.exclude) : void 0,
|
|
58
|
-
include: filter.include ? toArray(filter.include) : void 0
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
function createIdFilter(filter) {
|
|
62
|
-
if (!filter) return;
|
|
63
|
-
const { exclude, include } = normalizeFilter(filter);
|
|
64
|
-
const excludeFilter = exclude?.map(patternToIdFilter);
|
|
65
|
-
const includeFilter = include?.map(patternToIdFilter);
|
|
66
|
-
return createFilter(excludeFilter, includeFilter);
|
|
67
|
-
}
|
|
68
|
-
function createCodeFilter(filter) {
|
|
69
|
-
if (!filter) return;
|
|
70
|
-
const { exclude, include } = normalizeFilter(filter);
|
|
71
|
-
const excludeFilter = exclude?.map(patternToCodeFilter);
|
|
72
|
-
const includeFilter = include?.map(patternToCodeFilter);
|
|
73
|
-
return createFilter(excludeFilter, includeFilter);
|
|
74
|
-
}
|
|
75
|
-
function createFilterForId(filter) {
|
|
76
|
-
const filterFunction = createIdFilter(filter);
|
|
77
|
-
return filterFunction ? (id) => !!filterFunction(id) : void 0;
|
|
78
|
-
}
|
|
79
|
-
function createFilterForTransform(idFilter, codeFilter) {
|
|
80
|
-
if (!idFilter && !codeFilter) return;
|
|
81
|
-
const idFilterFunction = createIdFilter(idFilter);
|
|
82
|
-
const codeFilterFunction = createCodeFilter(codeFilter);
|
|
83
|
-
return (id, code) => {
|
|
84
|
-
let fallback = true;
|
|
85
|
-
if (idFilterFunction) fallback &&= idFilterFunction(id);
|
|
86
|
-
if (!fallback) return false;
|
|
87
|
-
if (codeFilterFunction) fallback &&= codeFilterFunction(code);
|
|
88
|
-
return fallback;
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
function normalizeObjectHook(name, hook) {
|
|
92
|
-
let handler;
|
|
93
|
-
let filter;
|
|
94
|
-
if (typeof hook === "function") handler = hook;
|
|
95
|
-
else {
|
|
96
|
-
handler = hook.handler;
|
|
97
|
-
const hookFilter = hook.filter;
|
|
98
|
-
if (name === "resolveId" || name === "load") filter = createFilterForId(hookFilter?.id);
|
|
99
|
-
else filter = createFilterForTransform(hookFilter?.id, hookFilter?.code);
|
|
100
|
-
}
|
|
101
|
-
return {
|
|
102
|
-
handler,
|
|
103
|
-
filter: filter || (() => true)
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export { toArray as i, normalizeObjectHook as r };
|
|
108
|
-
//# sourceMappingURL=parse-CRORloGP.js.map
|
package/dist/src/index.cjs
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var parseTypeDefinition = require('@stryke/convert/parse-type-definition');
|
|
6
|
-
var toArray = require('@stryke/convert/to-array');
|
|
7
|
-
var join = require('@stryke/path/join');
|
|
8
|
-
var titleCase = require('@stryke/string-format/title-case');
|
|
9
|
-
var isSetString = require('@stryke/type-checks/is-set-string');
|
|
10
|
-
var defu = require('defu');
|
|
11
|
-
var tsdown$1 = require('powerlines/lib/build/tsdown');
|
|
12
|
-
var unplugin = require('powerlines/lib/unplugin');
|
|
13
|
-
var format = require('powerlines/lib/utilities/format');
|
|
14
|
-
var tsdown = require('tsdown');
|
|
15
|
-
var index = require('../node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/index.cjs');
|
|
16
|
-
|
|
17
|
-
function __assignType(fn, args) {
|
|
18
|
-
fn.__type = args;
|
|
19
|
-
return fn;
|
|
20
|
-
}
|
|
21
|
-
function createPlugin(context) {
|
|
22
|
-
return index.createRolldownPlugin(unplugin.createUnplugin(context))({});
|
|
23
|
-
}
|
|
24
|
-
createPlugin.__type = ['context', 'createPlugin', 'P"2!"/"'];
|
|
25
|
-
/**
|
|
26
|
-
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
27
|
-
*/
|
|
28
|
-
const plugin = __assignType((options = {}) => {
|
|
29
|
-
return {
|
|
30
|
-
name: "plugin",
|
|
31
|
-
config: __assignType(function config() {
|
|
32
|
-
this.debug("Providing default configuration for the Powerlines plugin.");
|
|
33
|
-
return {
|
|
34
|
-
type: "library",
|
|
35
|
-
output: {
|
|
36
|
-
format: ["cjs", "esm"],
|
|
37
|
-
dts: false
|
|
38
|
-
},
|
|
39
|
-
build: {
|
|
40
|
-
variant: "tsdown",
|
|
41
|
-
platform: "node",
|
|
42
|
-
nodeProtocol: true,
|
|
43
|
-
minify: false,
|
|
44
|
-
exports: true,
|
|
45
|
-
unbundle: true,
|
|
46
|
-
external: ["powerlines", /^powerlines\/.*$/, /^@powerlines\//]
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
}, ['config', 'P"/!']),
|
|
50
|
-
configResolved: __assignType(async function configResolved() {
|
|
51
|
-
if (!this.config.entry ||
|
|
52
|
-
(Array.isArray(this.config.entry) && this.config.entry.length === 0)) {
|
|
53
|
-
let entry = "src/index.tsx";
|
|
54
|
-
if (!this.fs.existsSync(join.joinPaths(this.config.projectRoot, entry))) {
|
|
55
|
-
entry = "src/index.ts";
|
|
56
|
-
}
|
|
57
|
-
this.config.entry = entry;
|
|
58
|
-
}
|
|
59
|
-
}, ['configResolved', 'P"/!']),
|
|
60
|
-
types: __assignType(async function types(code) {
|
|
61
|
-
if (!options.types?.userConfig || !this.packageJson?.name) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
let typeDef;
|
|
65
|
-
if (isSetString.isSetString(options.types.userConfig) &&
|
|
66
|
-
!options.types.userConfig.includes("#")) {
|
|
67
|
-
typeDef = {
|
|
68
|
-
file: this.packageJson.name,
|
|
69
|
-
name: options.types.userConfig
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
typeDef = parseTypeDefinition.parseTypeDefinition(options.types.userConfig);
|
|
74
|
-
if (!typeDef) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (!toArray.toArray(this.config.entry).includes(typeDef.file)) {
|
|
78
|
-
this.warn(`The specified user configuration file "${typeDef.file}" is not included in the build entry points.`);
|
|
79
|
-
}
|
|
80
|
-
typeDef.file = `${this.packageJson.name}/${typeDef.file.replace(/^\.\//, "")}`;
|
|
81
|
-
}
|
|
82
|
-
return `${code || ""}
|
|
83
|
-
|
|
84
|
-
// Extend \`UserConfig\` with the ${titleCase.titleCase(this.config.name)} plugin's type definition
|
|
85
|
-
declare module "powerlines" {
|
|
86
|
-
export interface UserConfig extends import("${typeDef.file}").${typeDef.name || "default"}
|
|
87
|
-
}
|
|
88
|
-
`.trim();
|
|
89
|
-
}, ['code', 'types', 'P&2!"/"']),
|
|
90
|
-
async build() {
|
|
91
|
-
await tsdown.build(defu.defu({
|
|
92
|
-
config: false,
|
|
93
|
-
plugins: [(createPlugin.Ω = [['PluginPluginContext', '"w!']], createPlugin(this))]
|
|
94
|
-
}, tsdown$1.extractTsdownConfig(this)));
|
|
95
|
-
const packageJsonPath = join.joinPaths(this.workspaceConfig.workspaceRoot, this.config.projectRoot, "package.json");
|
|
96
|
-
const packageJsonFile = await this.fs.read(packageJsonPath);
|
|
97
|
-
if (isSetString.isSetString(packageJsonFile)) {
|
|
98
|
-
await this.fs.write(packageJsonPath, await format.format(this, packageJsonPath, packageJsonFile));
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
}, ['PluginPluginOptions', 'options', () => ({}), '', 'P"w!2">#!/$']);
|
|
103
|
-
|
|
104
|
-
exports.default = plugin;
|
|
105
|
-
exports.plugin = plugin;
|
|
106
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "powerlines/types/plugin";
|
|
2
|
-
import type { PluginPluginContext, PluginPluginOptions } from "./types/plugin";
|
|
3
|
-
/**
|
|
4
|
-
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
5
|
-
*/
|
|
6
|
-
export declare const plugin: <TContext extends PluginPluginContext = PluginPluginContext>(options?: PluginPluginOptions) => Plugin<TContext>;
|
|
7
|
-
export default plugin;
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { parseTypeDefinition } from '@stryke/convert/parse-type-definition';
|
|
2
|
-
import { toArray } from '@stryke/convert/to-array';
|
|
3
|
-
import { joinPaths } from '@stryke/path/join';
|
|
4
|
-
import { titleCase } from '@stryke/string-format/title-case';
|
|
5
|
-
import { isSetString } from '@stryke/type-checks/is-set-string';
|
|
6
|
-
import { defu } from 'defu';
|
|
7
|
-
import { extractTsdownConfig } from 'powerlines/lib/build/tsdown';
|
|
8
|
-
import { createUnplugin } from 'powerlines/lib/unplugin';
|
|
9
|
-
import { format } from 'powerlines/lib/utilities/format';
|
|
10
|
-
import { build } from 'tsdown';
|
|
11
|
-
import { createRolldownPlugin } from '../node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/index.js';
|
|
12
|
-
|
|
13
|
-
function __assignType(fn, args) {
|
|
14
|
-
fn.__type = args;
|
|
15
|
-
return fn;
|
|
16
|
-
}
|
|
17
|
-
function createPlugin(context) {
|
|
18
|
-
return createRolldownPlugin(createUnplugin(context))({});
|
|
19
|
-
}
|
|
20
|
-
createPlugin.__type = ['context', 'createPlugin', 'P"2!"/"'];
|
|
21
|
-
/**
|
|
22
|
-
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
23
|
-
*/
|
|
24
|
-
const plugin = __assignType((options = {}) => {
|
|
25
|
-
return {
|
|
26
|
-
name: "plugin",
|
|
27
|
-
config: __assignType(function config() {
|
|
28
|
-
this.debug("Providing default configuration for the Powerlines plugin.");
|
|
29
|
-
return {
|
|
30
|
-
type: "library",
|
|
31
|
-
output: {
|
|
32
|
-
format: ["cjs", "esm"],
|
|
33
|
-
dts: false
|
|
34
|
-
},
|
|
35
|
-
build: {
|
|
36
|
-
variant: "tsdown",
|
|
37
|
-
platform: "node",
|
|
38
|
-
nodeProtocol: true,
|
|
39
|
-
minify: false,
|
|
40
|
-
exports: true,
|
|
41
|
-
unbundle: true,
|
|
42
|
-
external: ["powerlines", /^powerlines\/.*$/, /^@powerlines\//]
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
}, ['config', 'P"/!']),
|
|
46
|
-
configResolved: __assignType(async function configResolved() {
|
|
47
|
-
if (!this.config.entry ||
|
|
48
|
-
(Array.isArray(this.config.entry) && this.config.entry.length === 0)) {
|
|
49
|
-
let entry = "src/index.tsx";
|
|
50
|
-
if (!this.fs.existsSync(joinPaths(this.config.projectRoot, entry))) {
|
|
51
|
-
entry = "src/index.ts";
|
|
52
|
-
}
|
|
53
|
-
this.config.entry = entry;
|
|
54
|
-
}
|
|
55
|
-
}, ['configResolved', 'P"/!']),
|
|
56
|
-
types: __assignType(async function types(code) {
|
|
57
|
-
if (!options.types?.userConfig || !this.packageJson?.name) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
let typeDef;
|
|
61
|
-
if (isSetString(options.types.userConfig) &&
|
|
62
|
-
!options.types.userConfig.includes("#")) {
|
|
63
|
-
typeDef = {
|
|
64
|
-
file: this.packageJson.name,
|
|
65
|
-
name: options.types.userConfig
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
typeDef = parseTypeDefinition(options.types.userConfig);
|
|
70
|
-
if (!typeDef) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
if (!toArray(this.config.entry).includes(typeDef.file)) {
|
|
74
|
-
this.warn(`The specified user configuration file "${typeDef.file}" is not included in the build entry points.`);
|
|
75
|
-
}
|
|
76
|
-
typeDef.file = `${this.packageJson.name}/${typeDef.file.replace(/^\.\//, "")}`;
|
|
77
|
-
}
|
|
78
|
-
return `${code || ""}
|
|
79
|
-
|
|
80
|
-
// Extend \`UserConfig\` with the ${titleCase(this.config.name)} plugin's type definition
|
|
81
|
-
declare module "powerlines" {
|
|
82
|
-
export interface UserConfig extends import("${typeDef.file}").${typeDef.name || "default"}
|
|
83
|
-
}
|
|
84
|
-
`.trim();
|
|
85
|
-
}, ['code', 'types', 'P&2!"/"']),
|
|
86
|
-
async build() {
|
|
87
|
-
await build(defu({
|
|
88
|
-
config: false,
|
|
89
|
-
plugins: [(createPlugin.Ω = [['PluginPluginContext', '"w!']], createPlugin(this))]
|
|
90
|
-
}, extractTsdownConfig(this)));
|
|
91
|
-
const packageJsonPath = joinPaths(this.workspaceConfig.workspaceRoot, this.config.projectRoot, "package.json");
|
|
92
|
-
const packageJsonFile = await this.fs.read(packageJsonPath);
|
|
93
|
-
if (isSetString(packageJsonFile)) {
|
|
94
|
-
await this.fs.write(packageJsonPath, await format(this, packageJsonPath, packageJsonFile));
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
}, ['PluginPluginOptions', 'options', () => ({}), '', 'P"w!2">#!/$']);
|
|
99
|
-
|
|
100
|
-
export { plugin as default, plugin };
|
|
101
|
-
//# sourceMappingURL=index.js.map
|
package/dist/src/types/index.cjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var src_types_plugin = require('./plugin.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.__ΩPluginPluginContext = src_types_plugin.__ΩPluginPluginContext;
|
|
8
|
-
exports.__ΩPluginPluginOptions = src_types_plugin.__ΩPluginPluginOptions;
|
|
9
|
-
exports.__ΩPluginPluginResolvedConfig = src_types_plugin.__ΩPluginPluginResolvedConfig;
|
|
10
|
-
exports.__ΩPluginPluginTypesOptions = src_types_plugin.__ΩPluginPluginTypesOptions;
|
|
11
|
-
exports.__ΩPluginPluginUserConfig = src_types_plugin.__ΩPluginPluginUserConfig;
|
|
12
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/src/types/index.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/* -------------------------------------------------------------------
|
|
4
|
-
|
|
5
|
-
⚡ Storm Software - Powerlines
|
|
6
|
-
|
|
7
|
-
This code was released as part of the Powerlines project. Powerlines
|
|
8
|
-
is maintained by Storm Software under the Apache-2.0 license, and is
|
|
9
|
-
free for commercial and private use. For more information, please visit
|
|
10
|
-
our licensing page at https://stormsoftware.com/licenses/projects/powerlines.
|
|
11
|
-
|
|
12
|
-
Website: https://stormsoftware.com
|
|
13
|
-
Repository: https://github.com/storm-software/powerlines
|
|
14
|
-
Documentation: https://docs.stormsoftware.com/projects/powerlines
|
|
15
|
-
Contact: https://stormsoftware.com/contact
|
|
16
|
-
|
|
17
|
-
SPDX-License-Identifier: Apache-2.0
|
|
18
|
-
|
|
19
|
-
------------------------------------------------------------------- */
|
|
20
|
-
const __ΩPluginPluginTypesOptions = ['options', 'userConfig', 'PluginPluginTypesOptions', 'P!4!8!4"8Mw#y'];
|
|
21
|
-
const __ΩPluginPluginOptions = [() => __ΩPluginPluginTypesOptions, 'types', 'PluginPluginOptions', 'Pn!4"8Mw#y'];
|
|
22
|
-
const __ΩPluginPluginUserConfig = [() => __ΩPluginPluginOptions, 'plugin', 'PluginPluginUserConfig', 'P!Pn!4"MKw#y'];
|
|
23
|
-
const __ΩPluginPluginResolvedConfig = [() => __ΩPluginPluginOptions, 'plugin', 'PluginPluginResolvedConfig', 'P!Pn!4"MKw#y'];
|
|
24
|
-
const __ΩPluginPluginContext = [() => __ΩPluginPluginResolvedConfig, 'TResolvedConfig', 'PluginPluginContext', 'n!c"!w#y'];
|
|
25
|
-
|
|
26
|
-
exports.__ΩPluginPluginContext = __ΩPluginPluginContext;
|
|
27
|
-
exports.__ΩPluginPluginOptions = __ΩPluginPluginOptions;
|
|
28
|
-
exports.__ΩPluginPluginResolvedConfig = __ΩPluginPluginResolvedConfig;
|
|
29
|
-
exports.__ΩPluginPluginTypesOptions = __ΩPluginPluginTypesOptions;
|
|
30
|
-
exports.__ΩPluginPluginUserConfig = __ΩPluginPluginUserConfig;
|
|
31
|
-
//# sourceMappingURL=plugin.cjs.map
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
2
|
-
import type { TsdownBuildConfig, TsdownResolvedBuildConfig } from "powerlines/types/build";
|
|
3
|
-
import type { UserConfig } from "powerlines/types/config";
|
|
4
|
-
import type { PluginContext } from "powerlines/types/context";
|
|
5
|
-
import type { ResolvedConfig } from "powerlines/types/resolved";
|
|
6
|
-
export interface PluginPluginTypesOptions {
|
|
7
|
-
/**
|
|
8
|
-
* The type definition for the plugin's options.
|
|
9
|
-
*/
|
|
10
|
-
options?: TypeDefinitionParameter;
|
|
11
|
-
/**
|
|
12
|
-
* The type definition for the plugin's user config.
|
|
13
|
-
*/
|
|
14
|
-
userConfig?: TypeDefinitionParameter;
|
|
15
|
-
}
|
|
16
|
-
export interface PluginPluginOptions {
|
|
17
|
-
/**
|
|
18
|
-
* The type definitions for the Plugin plugin.
|
|
19
|
-
*/
|
|
20
|
-
types?: PluginPluginTypesOptions;
|
|
21
|
-
}
|
|
22
|
-
export type PluginPluginUserConfig = UserConfig<TsdownBuildConfig, TsdownResolvedBuildConfig, "tsdown"> & {
|
|
23
|
-
plugin: PluginPluginOptions;
|
|
24
|
-
};
|
|
25
|
-
export type PluginPluginResolvedConfig = ResolvedConfig<PluginPluginUserConfig> & {
|
|
26
|
-
plugin: PluginPluginOptions;
|
|
27
|
-
};
|
|
28
|
-
export type PluginPluginContext<TResolvedConfig extends PluginPluginResolvedConfig = PluginPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
29
|
-
export declare type __ΩPluginPluginTypesOptions = any[];
|
|
30
|
-
export declare type __ΩPluginPluginOptions = any[];
|
|
31
|
-
export declare type __ΩPluginPluginUserConfig = any[];
|
|
32
|
-
export declare type __ΩPluginPluginResolvedConfig = any[];
|
|
33
|
-
export declare type __ΩPluginPluginContext = any[];
|
|
34
|
-
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/src/types/plugin.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/* -------------------------------------------------------------------
|
|
2
|
-
|
|
3
|
-
⚡ Storm Software - Powerlines
|
|
4
|
-
|
|
5
|
-
This code was released as part of the Powerlines project. Powerlines
|
|
6
|
-
is maintained by Storm Software under the Apache-2.0 license, and is
|
|
7
|
-
free for commercial and private use. For more information, please visit
|
|
8
|
-
our licensing page at https://stormsoftware.com/licenses/projects/powerlines.
|
|
9
|
-
|
|
10
|
-
Website: https://stormsoftware.com
|
|
11
|
-
Repository: https://github.com/storm-software/powerlines
|
|
12
|
-
Documentation: https://docs.stormsoftware.com/projects/powerlines
|
|
13
|
-
Contact: https://stormsoftware.com/contact
|
|
14
|
-
|
|
15
|
-
SPDX-License-Identifier: Apache-2.0
|
|
16
|
-
|
|
17
|
-
------------------------------------------------------------------- */
|
|
18
|
-
const __ΩPluginPluginTypesOptions = ['options', 'userConfig', 'PluginPluginTypesOptions', 'P!4!8!4"8Mw#y'];
|
|
19
|
-
const __ΩPluginPluginOptions = [() => __ΩPluginPluginTypesOptions, 'types', 'PluginPluginOptions', 'Pn!4"8Mw#y'];
|
|
20
|
-
const __ΩPluginPluginUserConfig = [() => __ΩPluginPluginOptions, 'plugin', 'PluginPluginUserConfig', 'P!Pn!4"MKw#y'];
|
|
21
|
-
const __ΩPluginPluginResolvedConfig = [() => __ΩPluginPluginOptions, 'plugin', 'PluginPluginResolvedConfig', 'P!Pn!4"MKw#y'];
|
|
22
|
-
const __ΩPluginPluginContext = [() => __ΩPluginPluginResolvedConfig, 'TResolvedConfig', 'PluginPluginContext', 'n!c"!w#y'];
|
|
23
|
-
|
|
24
|
-
export { __ΩPluginPluginContext, __ΩPluginPluginOptions, __ΩPluginPluginResolvedConfig, __ΩPluginPluginTypesOptions, __ΩPluginPluginUserConfig };
|
|
25
|
-
//# sourceMappingURL=plugin.js.map
|