@powerlines/unplugin 0.0.80 → 0.0.82
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/_virtual/_rolldown/runtime.cjs +45 -0
- package/dist/{chunk-BUUfjzRC.mjs → _virtual/_rolldown/runtime.mjs} +1 -1
- package/dist/esbuild.cjs +3 -2
- package/dist/esbuild.d.cts +2 -2
- package/dist/esbuild.d.cts.map +1 -1
- package/dist/esbuild.d.mts +1 -1
- package/dist/esbuild.d.mts.map +1 -1
- package/dist/farm.cjs +1 -1
- package/dist/farm.d.cts +2 -2
- package/dist/farm.d.cts.map +1 -1
- package/dist/farm.d.mts +1 -1
- package/dist/farm.d.mts.map +1 -1
- package/dist/index.cjs +5 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/nuxt.cjs +42 -3
- package/dist/nuxt.mjs +43 -3
- package/dist/nuxt.mjs.map +1 -0
- package/dist/package.cjs +18 -0
- package/dist/package.mjs +7 -0
- package/dist/package.mjs.map +1 -0
- package/dist/rolldown.cjs +6 -5
- package/dist/rolldown.d.cts +2 -2
- package/dist/rolldown.d.cts.map +1 -1
- package/dist/rolldown.d.mts +1 -1
- package/dist/rolldown.d.mts.map +1 -1
- package/dist/rollup.cjs +7 -6
- package/dist/rollup.d.cts +2 -2
- package/dist/rollup.d.cts.map +1 -1
- package/dist/rollup.d.mts +1 -1
- package/dist/rollup.d.mts.map +1 -1
- package/dist/rspack.cjs +3 -2
- package/dist/rspack.d.cts +2 -2
- package/dist/rspack.d.cts.map +1 -1
- package/dist/rspack.d.mts +1 -1
- package/dist/rspack.d.mts.map +1 -1
- package/dist/tsdown.cjs +2 -2
- package/dist/tsup.cjs +2 -2
- package/dist/types.d.cts +11 -2
- package/dist/types.d.cts.map +1 -0
- package/dist/unloader.cjs +1 -1
- package/dist/unloader.d.cts +2 -2
- package/dist/unloader.d.cts.map +1 -1
- package/dist/unloader.d.mts +1 -1
- package/dist/unloader.d.mts.map +1 -1
- package/dist/unplugin.cjs +232 -2
- package/dist/unplugin.d.cts +1 -1
- package/dist/unplugin.d.cts.map +1 -1
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.cjs +3 -2
- package/dist/vite.d.cts +2 -2
- package/dist/vite.d.cts.map +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.mts.map +1 -1
- package/dist/webpack.cjs +3 -2
- package/dist/webpack.d.cts +2 -2
- package/dist/webpack.d.cts.map +1 -1
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.d.mts.map +1 -1
- package/package.json +5 -5
- package/dist/nuxt-DnPulowA.mjs +0 -48
- package/dist/nuxt-DnPulowA.mjs.map +0 -1
- package/dist/nuxt-p97pkRJZ.cjs +0 -52
- package/dist/types-CEaXoKbk.d.cts +0 -13
- package/dist/types-CEaXoKbk.d.cts.map +0 -1
- package/dist/unplugin-WjPT9ECw.cjs +0 -296
package/dist/unloader.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UnpluginExecutionOptions, UnpluginFactory } from "./types.cjs";
|
|
2
2
|
import { UnpluginFactoryDecorator, UnpluginFactoryOptions } from "./unplugin.cjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
@@ -23,7 +23,7 @@ import { ExecutionContext } from "@powerlines/core";
|
|
|
23
23
|
* @param decorate - A function to decorate the plugin options with additional properties or hooks. This can be used to add custom behavior to the plugin instance, such as additional hooks or configuration options. The function receives the generated plugin options and should return an object containing any additional properties or hooks to be merged into the final plugin options.
|
|
24
24
|
* @returns A function that generates a Unloader plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Unloader build.
|
|
25
25
|
*/
|
|
26
|
-
declare function createUnloaderFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig
|
|
26
|
+
declare function createUnloaderFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig, any>>;
|
|
27
27
|
/**
|
|
28
28
|
* An Unloader plugin that will invoke the Powerlines API hooks during processing.
|
|
29
29
|
*
|
package/dist/unloader.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unloader.d.cts","names":[],"sources":["../src/unloader.ts"],"mappings":";;;;;;;;AA8CA;;;;;;;;;;;;;;;;;iBAAgB,qBAAA,kBAAuC,gBAAA,EACrD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA
|
|
1
|
+
{"version":3,"file":"unloader.d.cts","names":[],"sources":["../src/unloader.ts"],"mappings":";;;;;;;;AA8CA;;;;;;;;;;;;;;;;;iBAAgB,qBAAA,kBAAuC,gBAAA,EACrD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;AAAA;AAqBnE;;;;;;;cAAa,MAAA,GAAM,OAAA,GAAgD,wBAAhD,oCAAA,MAAA,sBAAA,MAAA"}
|
package/dist/unloader.d.mts
CHANGED
|
@@ -23,7 +23,7 @@ import { ExecutionContext } from "@powerlines/core";
|
|
|
23
23
|
* @param decorate - A function to decorate the plugin options with additional properties or hooks. This can be used to add custom behavior to the plugin instance, such as additional hooks or configuration options. The function receives the generated plugin options and should return an object containing any additional properties or hooks to be merged into the final plugin options.
|
|
24
24
|
* @returns A function that generates a Unloader plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Unloader build.
|
|
25
25
|
*/
|
|
26
|
-
declare function createUnloaderFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig
|
|
26
|
+
declare function createUnloaderFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig, any>>;
|
|
27
27
|
/**
|
|
28
28
|
* An Unloader plugin that will invoke the Powerlines API hooks during processing.
|
|
29
29
|
*
|
package/dist/unloader.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unloader.d.mts","names":[],"sources":["../src/unloader.ts"],"mappings":";;;;;;;;AA8CA;;;;;;;;;;;;;;;;;iBAAgB,qBAAA,kBAAuC,gBAAA,EACrD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA
|
|
1
|
+
{"version":3,"file":"unloader.d.mts","names":[],"sources":["../src/unloader.ts"],"mappings":";;;;;;;;AA8CA;;;;;;;;;;;;;;;;;iBAAgB,qBAAA,kBAAuC,gBAAA,EACrD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;AAAA;AAqBnE;;;;;;;cAAa,MAAA,GAAM,OAAA,GAAgD,wBAAhD,oCAAA,MAAA,sBAAA,MAAA"}
|
package/dist/unplugin.cjs
CHANGED
|
@@ -1,7 +1,237 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _stryke_path_replace = require("@stryke/path/replace");
|
|
4
|
+
let _powerlines_core = require("@powerlines/core");
|
|
5
|
+
let _powerlines_core_constants = require("@powerlines/core/constants");
|
|
6
|
+
let _powerlines_core_context_execution_context = require("@powerlines/core/context/execution-context");
|
|
7
|
+
let _powerlines_core_lib_context_helpers = require("@powerlines/core/lib/context-helpers");
|
|
8
|
+
let _powerlines_core_lib_environment = require("@powerlines/core/lib/environment");
|
|
9
|
+
let _powerlines_core_lib_utilities_source_file = require("@powerlines/core/lib/utilities/source-file");
|
|
10
|
+
let _powerlines_core_plugin_utils = require("@powerlines/core/plugin-utils");
|
|
11
|
+
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
12
|
+
let _stryke_fs_get_workspace_root = require("@stryke/fs/get-workspace-root");
|
|
13
|
+
let _stryke_fs_helpers = require("@stryke/fs/helpers");
|
|
14
|
+
let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
15
|
+
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
16
|
+
let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
|
|
17
|
+
let _stryke_type_checks_is_object = require("@stryke/type-checks/is-object");
|
|
18
|
+
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
19
|
+
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
3
20
|
|
|
4
|
-
|
|
21
|
+
//#region src/unplugin.ts
|
|
22
|
+
/**
|
|
23
|
+
* Creates a Powerlines unplugin factory that generates a plugin instance.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* The factory will handle loading the Powerlines configuration, resolving the plugin configuration, and executing the appropriate hooks during the build process. It also allows for optional customization of logging and framework identification through the provided options.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { createUnpluginFactory } from "@powerlines/unplugin";
|
|
31
|
+
*
|
|
32
|
+
* const factory = createUnpluginFactory({
|
|
33
|
+
* variant: "vite",
|
|
34
|
+
* framework: "my-framework",
|
|
35
|
+
* orgId: "my-org",
|
|
36
|
+
* customLogger: myCustomLogger
|
|
37
|
+
* });
|
|
38
|
+
*
|
|
39
|
+
* const plugin = createVitePlugin(factory);
|
|
40
|
+
* export default plugin;
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @param options - The options for the unplugin factory, including the build variant and an optional custom logger.
|
|
44
|
+
* @param decorate - An optional function to decorate the unplugin options.
|
|
45
|
+
* @returns The unplugin factory that generates a plugin instance.
|
|
46
|
+
*/
|
|
47
|
+
function createUnpluginFactory(options, decorate = (options) => options) {
|
|
48
|
+
if (!(0, _powerlines_core.isUnpluginBuilderVariant)(options.variant)) throw new Error(`Invalid unplugin builder variant: ${String(options.variant)}. Expected one of: ${_powerlines_core_constants.UNPLUGIN_BUILDER_VARIANTS.join(", ")}.`);
|
|
49
|
+
const cwd = (0, _stryke_fs_get_workspace_root.getWorkspaceRoot)(process.cwd());
|
|
50
|
+
const virtualModulePrefix = options.virtualModulePrefix ?? "\\0";
|
|
51
|
+
return (params = {}) => {
|
|
52
|
+
let context;
|
|
53
|
+
try {
|
|
54
|
+
const framework = (params.framework?.name ?? options.framework?.name) || "powerlines";
|
|
55
|
+
const orgId = (params.framework?.orgId ?? options.framework?.orgId) || "storm-software";
|
|
56
|
+
const root = (0, _powerlines_core.resolveRoot)(cwd, params.root, params.configFile);
|
|
57
|
+
async function buildStart() {
|
|
58
|
+
const config = await (0, _powerlines_core.loadParsedConfig)(cwd, root, framework, orgId, {
|
|
59
|
+
...params,
|
|
60
|
+
command: "build"
|
|
61
|
+
});
|
|
62
|
+
if (!config) throw new Error("Failed to load configuration");
|
|
63
|
+
const configs = (0, _stryke_convert_to_array.toArray)(config.config);
|
|
64
|
+
if (params.configIndex !== void 0 && params.configIndex >= configs.length) throw new Error(`Invalid execution index: ${params.configIndex}. The configuration file contains ${configs.length} execution(s).`);
|
|
65
|
+
const _options = {
|
|
66
|
+
cwd,
|
|
67
|
+
root,
|
|
68
|
+
...params,
|
|
69
|
+
command: "build",
|
|
70
|
+
configFile: config.configFile,
|
|
71
|
+
executionId: (0, _powerlines_core_plugin_utils.formatExecutionId)(config.config.name || root, "build", 0),
|
|
72
|
+
configIndex: 0
|
|
73
|
+
};
|
|
74
|
+
context = await _powerlines_core_context_execution_context.PowerlinesExecutionContext.from({
|
|
75
|
+
...options,
|
|
76
|
+
..._options,
|
|
77
|
+
configFile: config.configFile
|
|
78
|
+
}, _options);
|
|
79
|
+
context.logger.info(`Starting ${(0, _stryke_string_format_title_case.titleCase)(framework)} ${(0, _stryke_string_format_title_case.titleCase)(options.variant)} plugin execution`);
|
|
80
|
+
context.logger.debug({
|
|
81
|
+
meta: { category: "config" },
|
|
82
|
+
message: `Invoking ${(0, _stryke_string_format_title_case.titleCase)(framework)} ${(0, _stryke_string_format_title_case.titleCase)(options.variant)} plugin with the following execution parameters: \n --- Execution Options --- \n${(0, _powerlines_core_plugin_utils.formatConfig)(params)}`
|
|
83
|
+
});
|
|
84
|
+
await (0, _powerlines_core_lib_context_helpers.resolvePluginConfig)(context);
|
|
85
|
+
const timer = context.timer("Preparation");
|
|
86
|
+
await (0, _powerlines_core_lib_environment.executeEnvironments)(context, async (env) => {
|
|
87
|
+
env.debug(`Initializing the processing options for the Powerlines project.`);
|
|
88
|
+
await context.callHook("configResolved", {
|
|
89
|
+
environment: env,
|
|
90
|
+
order: "pre"
|
|
91
|
+
});
|
|
92
|
+
await (0, _powerlines_core.initializeTsconfig)(env);
|
|
93
|
+
await context.callHook("configResolved", {
|
|
94
|
+
environment: env,
|
|
95
|
+
order: "normal"
|
|
96
|
+
});
|
|
97
|
+
if (env.entry.length > 0) {
|
|
98
|
+
const entriesLength = (0, _stryke_type_checks_is_object.isObject)(env.config.input) ? Object.keys(env.config.input).length : (0, _stryke_convert_to_array.toArray)(env.config.input).length;
|
|
99
|
+
env.debug(`The configuration provided ${entriesLength} entry point${entriesLength !== 1 ? "s" : ""}, Powerlines has found ${env.entry.length} entry file${env.entry.length !== 1 ? "s" : ""} for the ${env.config.title} project${env.entry.length > 0 && env.entry.length < 10 ? `: \n${env.entry.map((entry) => `- ${(0, _stryke_path_replace.replacePath)(entry.file, context.config.root)}${entry.output ? ` -> ${(0, _stryke_path_replace.replacePath)(entry.output, context.config.root)}` : ""}`).join(" \n")}` : ""}`);
|
|
100
|
+
} else env.warn(`No entry files were found for the ${env.config.title} project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`);
|
|
101
|
+
await (0, _powerlines_core.resolveTsconfig)(env);
|
|
102
|
+
await (0, _powerlines_core.installDependencies)(env);
|
|
103
|
+
await context.callHook("configResolved", {
|
|
104
|
+
environment: env,
|
|
105
|
+
order: "post"
|
|
106
|
+
});
|
|
107
|
+
env.trace({
|
|
108
|
+
meta: { category: "config" },
|
|
109
|
+
message: `Powerlines configuration after configResolved hook: \n${(0, _powerlines_core_plugin_utils.formatConfig)(env.config)}`
|
|
110
|
+
});
|
|
111
|
+
if (!env.fs.existsSync(env.cachePath)) await (0, _stryke_fs_helpers.createDirectory)(env.cachePath);
|
|
112
|
+
if (!env.fs.existsSync(env.dataPath)) await (0, _stryke_fs_helpers.createDirectory)(env.dataPath);
|
|
113
|
+
await context.callHook("prepare", {
|
|
114
|
+
environment: env,
|
|
115
|
+
order: "pre"
|
|
116
|
+
});
|
|
117
|
+
await context.callHook("prepare", {
|
|
118
|
+
environment: env,
|
|
119
|
+
order: "normal"
|
|
120
|
+
});
|
|
121
|
+
await context.callHook("prepare", {
|
|
122
|
+
environment: env,
|
|
123
|
+
order: "post"
|
|
124
|
+
});
|
|
125
|
+
if (env.config.output.types !== false) await (0, _powerlines_core.handleTypes)(context, env);
|
|
126
|
+
context.debug("Formatting files generated during the prepare step.");
|
|
127
|
+
await Promise.all([(0, _powerlines_core.formatFolder)(env, env.builtinsPath), (0, _powerlines_core.formatFolder)(env, env.entryPath)]);
|
|
128
|
+
await (0, _powerlines_core.writeMetaFile)(env);
|
|
129
|
+
env.persistedMeta = env.meta;
|
|
130
|
+
});
|
|
131
|
+
timer();
|
|
132
|
+
}
|
|
133
|
+
async function resolveId(id, importer, opts = { isEntry: false }) {
|
|
134
|
+
const normalizedId = (0, _powerlines_core_plugin_utils.removeVirtualPrefix)(id);
|
|
135
|
+
const normalizedImporter = importer ? (0, _powerlines_core_plugin_utils.removeVirtualPrefix)(importer) : void 0;
|
|
136
|
+
let result = await context.callHook("resolveId", {
|
|
137
|
+
sequential: true,
|
|
138
|
+
result: "first",
|
|
139
|
+
order: "pre"
|
|
140
|
+
}, normalizedId, normalizedImporter, opts);
|
|
141
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(result)) return result;
|
|
142
|
+
else if ((0, _stryke_type_checks_is_set_object.isSetObject)(result)) return {
|
|
143
|
+
...result,
|
|
144
|
+
id: result.virtual && virtualModulePrefix !== false ? (0, _powerlines_core_plugin_utils.addVirtualPrefix)(result.id) : result.id
|
|
145
|
+
};
|
|
146
|
+
result = await context.callHook("resolveId", {
|
|
147
|
+
sequential: true,
|
|
148
|
+
result: "first",
|
|
149
|
+
order: "normal"
|
|
150
|
+
}, normalizedId, normalizedImporter, opts);
|
|
151
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(result)) return result;
|
|
152
|
+
else if ((0, _stryke_type_checks_is_set_object.isSetObject)(result)) return {
|
|
153
|
+
...result,
|
|
154
|
+
id: result.virtual && virtualModulePrefix !== false ? (0, _powerlines_core_plugin_utils.addVirtualPrefix)(result.id) : result.id
|
|
155
|
+
};
|
|
156
|
+
result = await context.resolve(normalizedId, normalizedImporter, {
|
|
157
|
+
isFile: true,
|
|
158
|
+
...opts
|
|
159
|
+
});
|
|
160
|
+
if ((0, _stryke_type_checks_is_set_object.isSetObject)(result)) return {
|
|
161
|
+
...result,
|
|
162
|
+
id: result.virtual && virtualModulePrefix !== false ? (0, _powerlines_core_plugin_utils.addVirtualPrefix)(result.id) : result.id
|
|
163
|
+
};
|
|
164
|
+
result = await context.callHook("resolveId", {
|
|
165
|
+
sequential: true,
|
|
166
|
+
result: "first",
|
|
167
|
+
order: "post"
|
|
168
|
+
}, normalizedId, normalizedImporter, opts);
|
|
169
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(result)) return result;
|
|
170
|
+
else if ((0, _stryke_type_checks_is_set_object.isSetObject)(result)) return {
|
|
171
|
+
...result,
|
|
172
|
+
id: result.virtual && virtualModulePrefix !== false ? (0, _powerlines_core_plugin_utils.addVirtualPrefix)(result.id) : result.id
|
|
173
|
+
};
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
const load = {
|
|
177
|
+
filter: virtualModulePrefix !== false ? { id: _powerlines_core_plugin_utils.VIRTUAL_MODULE_PREFIX_REGEX } : void 0,
|
|
178
|
+
async handler(id) {
|
|
179
|
+
const normalizedId = (0, _powerlines_core_plugin_utils.removeVirtualPrefix)(id);
|
|
180
|
+
let result = await context.callHook("load", {
|
|
181
|
+
sequential: true,
|
|
182
|
+
result: "first",
|
|
183
|
+
order: "pre"
|
|
184
|
+
}, normalizedId);
|
|
185
|
+
if (result) return result;
|
|
186
|
+
result = await context.callHook("load", {
|
|
187
|
+
sequential: true,
|
|
188
|
+
result: "first",
|
|
189
|
+
order: "normal"
|
|
190
|
+
}, normalizedId);
|
|
191
|
+
if (result) return result;
|
|
192
|
+
result = await context.load(normalizedId);
|
|
193
|
+
if (result) return result;
|
|
194
|
+
return context.callHook("load", {
|
|
195
|
+
sequential: true,
|
|
196
|
+
result: "first",
|
|
197
|
+
order: "post"
|
|
198
|
+
}, normalizedId);
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
async function transform(code, id) {
|
|
202
|
+
return context.callHook("transform", {
|
|
203
|
+
environment: await context.getEnvironment(),
|
|
204
|
+
result: "merge",
|
|
205
|
+
asNextParam: (previousResult) => (0, _powerlines_core_lib_utilities_source_file.getString)(previousResult)
|
|
206
|
+
}, (0, _powerlines_core_lib_utilities_source_file.getString)(code), id);
|
|
207
|
+
}
|
|
208
|
+
async function writeBundle() {
|
|
209
|
+
context.logger.debug("Finalizing Powerlines project output...");
|
|
210
|
+
await context.callHook("writeBundle", { environment: await context.getEnvironment() });
|
|
211
|
+
}
|
|
212
|
+
context.logger.debug("Unplugin initialized successfully.");
|
|
213
|
+
const result = {
|
|
214
|
+
name: `${(0, _stryke_string_format_kebab_case.kebabCase)(framework)}:${(0, _stryke_string_format_kebab_case.kebabCase)(options.variant)}-plugin`,
|
|
215
|
+
context,
|
|
216
|
+
resolveId,
|
|
217
|
+
load,
|
|
218
|
+
transform,
|
|
219
|
+
buildStart,
|
|
220
|
+
writeBundle
|
|
221
|
+
};
|
|
222
|
+
return {
|
|
223
|
+
...result,
|
|
224
|
+
...decorate(result)
|
|
225
|
+
};
|
|
226
|
+
} catch (error) {
|
|
227
|
+
if ((0, _stryke_type_checks_is_function.isFunction)(context?.logger?.error)) context.logger.error(error?.message);
|
|
228
|
+
throw error;
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
//#endregion
|
|
234
|
+
exports.createUnpluginFactory = createUnpluginFactory;
|
|
5
235
|
var _powerlines_core_lib_unplugin = require("@powerlines/core/lib/unplugin");
|
|
6
236
|
Object.keys(_powerlines_core_lib_unplugin).forEach(function (k) {
|
|
7
237
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
package/dist/unplugin.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UnpluginFactory } from "./types.cjs";
|
|
2
2
|
import { CustomLogger, ExecutionContext, Options, UnpluginBuilderVariant, UnpluginOptions } from "@powerlines/core";
|
|
3
3
|
export * from "@powerlines/core/lib/unplugin";
|
|
4
4
|
|
package/dist/unplugin.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.d.cts","names":[],"sources":["../src/unplugin.ts"],"mappings":";;;;;;;;UAuEiB,sBAAA,SAA+B,OAAA;
|
|
1
|
+
{"version":3,"file":"unplugin.d.cts","names":[],"sources":["../src/unplugin.ts"],"mappings":";;;;;;;;UAuEiB,sBAAA,SAA+B,OAAA;EAA/B;;;;;;EAOf,OAAA,EAAS,sBAAA;EAP4C;;;;;EAcrD,mBAAA;EAQe;;AAAY;AAG7B;;;EAHE,YAAA,GAAe,YAAA;AAAA;AAAA,KAGL,wBAAA,kBAA0C,gBAAA,KACpD,OAAA,EAAS,eAAA,CAAgB,QAAA,MACtB,OAAA,CAAQ,eAAA,CAAgB,QAAA;;;;;;;;;;;;;;;AAAQ;AA2BrC;;;;;;;;;;iBAAgB,qBAAA,kBACG,gBAAA,GAAmB,gBAAA,EAEpC,OAAA,EAAS,sBAAA,EACT,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAClC,eAAA,CAAgB,QAAA"}
|
package/dist/unplugin.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __exportAll, __reExport } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { replacePath } from "@stryke/path/replace";
|
|
3
3
|
import { formatFolder, handleTypes, initializeTsconfig, installDependencies, isUnpluginBuilderVariant, loadParsedConfig, resolveRoot, resolveTsconfig, writeMetaFile } from "@powerlines/core";
|
|
4
4
|
import { UNPLUGIN_BUILDER_VARIANTS } from "@powerlines/core/constants";
|
package/dist/vite.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
-
const
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_unplugin = require('./unplugin.cjs');
|
|
3
4
|
const require_esbuild = require('./esbuild.cjs');
|
|
4
5
|
const require_rolldown = require('./rolldown.cjs');
|
|
5
6
|
let _stryke_env_environment_checks = require("@stryke/env/environment-checks");
|
|
@@ -7,7 +8,7 @@ let _stryke_path_append = require("@stryke/path/append");
|
|
|
7
8
|
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
8
9
|
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
9
10
|
let defu = require("defu");
|
|
10
|
-
defu =
|
|
11
|
+
defu = require_runtime.__toESM(defu, 1);
|
|
11
12
|
let unplugin = require("unplugin");
|
|
12
13
|
|
|
13
14
|
//#region src/vite.ts
|
package/dist/vite.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UnpluginExecutionOptions, UnpluginFactory } from "./types.cjs";
|
|
2
2
|
import { UnpluginFactoryDecorator, UnpluginFactoryOptions } from "./unplugin.cjs";
|
|
3
3
|
import { ExecutionContext, UnresolvedContext } from "@powerlines/core";
|
|
4
4
|
import { UserConfig as UserConfig$1 } from "vite";
|
|
@@ -34,7 +34,7 @@ declare function resolveOptions<TContext extends UnresolvedContext>(context: TCo
|
|
|
34
34
|
* @param decorate - A function to decorate the plugin options with additional properties or hooks. This can be used to add custom behavior to the plugin instance, such as additional hooks or configuration options. The function receives the generated plugin options and should return an object containing any additional properties or hooks to be merged into the final plugin options.
|
|
35
35
|
* @returns A function that generates a Vite plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Vite build.
|
|
36
36
|
*/
|
|
37
|
-
declare function createViteFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig
|
|
37
|
+
declare function createViteFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig, any>>;
|
|
38
38
|
/**
|
|
39
39
|
* A Vite plugin that will invoke the Powerlines API hooks during the build process.
|
|
40
40
|
*
|
package/dist/vite.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.cts","names":[],"sources":["../src/vite.ts"],"mappings":";;;;;;cAsCa,eAAA,EAAiB,OAAO,CAAC,YAAA;;;AAAtC;;;;iBAiBgB,cAAA,kBAAgC,iBAAA,EAC9C,OAAA,EAAS,QAAA,GACR,YAAA;AAFH;;;;;;;;;;;;;;AAEa;AAuFb;;;;;;;AAzFA,iBAyFgB,iBAAA,kBAAmC,gBAAA,EACjD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA
|
|
1
|
+
{"version":3,"file":"vite.d.cts","names":[],"sources":["../src/vite.ts"],"mappings":";;;;;;cAsCa,eAAA,EAAiB,OAAO,CAAC,YAAA;;;AAAtC;;;;iBAiBgB,cAAA,kBAAgC,iBAAA,EAC9C,OAAA,EAAS,QAAA,GACR,YAAA;AAFH;;;;;;;;;;;;;;AAEa;AAuFb;;;;;;;AAzFA,iBAyFgB,iBAAA,kBAAmC,gBAAA,EACjD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;;;;;;cAqGtD,MAAA,GAAM,OAAA,GAAwC,wBAAxC,gCAAA,MAAA,uBAAA,MAAA"}
|
package/dist/vite.d.mts
CHANGED
|
@@ -34,7 +34,7 @@ declare function resolveOptions<TContext extends UnresolvedContext>(context: TCo
|
|
|
34
34
|
* @param decorate - A function to decorate the plugin options with additional properties or hooks. This can be used to add custom behavior to the plugin instance, such as additional hooks or configuration options. The function receives the generated plugin options and should return an object containing any additional properties or hooks to be merged into the final plugin options.
|
|
35
35
|
* @returns A function that generates a Vite plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Vite build.
|
|
36
36
|
*/
|
|
37
|
-
declare function createViteFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig
|
|
37
|
+
declare function createViteFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig, any>>;
|
|
38
38
|
/**
|
|
39
39
|
* A Vite plugin that will invoke the Powerlines API hooks during the build process.
|
|
40
40
|
*
|
package/dist/vite.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.mts","names":[],"sources":["../src/vite.ts"],"mappings":";;;;;;cAsCa,eAAA,EAAiB,OAAO,CAAC,YAAA;;;AAAtC;;;;iBAiBgB,cAAA,kBAAgC,iBAAA,EAC9C,OAAA,EAAS,QAAA,GACR,YAAA;AAFH;;;;;;;;;;;;;;AAEa;AAuFb;;;;;;;AAzFA,iBAyFgB,iBAAA,kBAAmC,gBAAA,EACjD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA
|
|
1
|
+
{"version":3,"file":"vite.d.mts","names":[],"sources":["../src/vite.ts"],"mappings":";;;;;;cAsCa,eAAA,EAAiB,OAAO,CAAC,YAAA;;;AAAtC;;;;iBAiBgB,cAAA,kBAAgC,iBAAA,EAC9C,OAAA,EAAS,QAAA,GACR,YAAA;AAFH;;;;;;;;;;;;;;AAEa;AAuFb;;;;;;;AAzFA,iBAyFgB,iBAAA,kBAAmC,gBAAA,EACjD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;;;;;;cAqGtD,MAAA,GAAM,OAAA,GAAwC,wBAAxC,gCAAA,MAAA,uBAAA,MAAA"}
|
package/dist/webpack.cjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
-
const
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_unplugin = require('./unplugin.cjs');
|
|
3
4
|
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
4
5
|
let defu = require("defu");
|
|
5
|
-
defu =
|
|
6
|
+
defu = require_runtime.__toESM(defu, 1);
|
|
6
7
|
let unplugin = require("unplugin");
|
|
7
8
|
|
|
8
9
|
//#region src/webpack.ts
|
package/dist/webpack.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UnpluginExecutionOptions, UnpluginFactory } from "./types.cjs";
|
|
2
2
|
import { UnpluginFactoryDecorator, UnpluginFactoryOptions } from "./unplugin.cjs";
|
|
3
3
|
import { Context, ExecutionContext } from "@powerlines/core";
|
|
4
4
|
import { DeepPartial } from "@stryke/types/base";
|
|
@@ -34,7 +34,7 @@ declare function resolveOptions(context: Context): DeepPartial<WebpackOptionsNor
|
|
|
34
34
|
* @param decorate - A function to decorate the plugin options with additional properties or hooks. This can be used to add custom behavior to the plugin instance, such as additional hooks or configuration options. The function receives the generated plugin options and should return an object containing any additional properties or hooks to be merged into the final plugin options.
|
|
35
35
|
* @returns A function that generates a Webpack plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Webpack build.
|
|
36
36
|
*/
|
|
37
|
-
declare function createWebpackFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig
|
|
37
|
+
declare function createWebpackFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig, any>>;
|
|
38
38
|
/**
|
|
39
39
|
* An Webpack plugin that will invoke the Powerlines API hooks during the build process.
|
|
40
40
|
*
|
package/dist/webpack.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.d.cts","names":[],"sources":["../src/webpack.ts"],"mappings":";;;;;;;;;;AAqCA;;;iBAAgB,cAAA,CACd,OAAA,EAAS,OAAA,GACR,WAAA,CAAY,wBAAA;;;;;;;;;;AAAwB;AAiEvC;;;;;;;;;;;;iBAAgB,oBAAA,kBAAsC,gBAAA,EACpD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA
|
|
1
|
+
{"version":3,"file":"webpack.d.cts","names":[],"sources":["../src/webpack.ts"],"mappings":";;;;;;;;;;AAqCA;;;iBAAgB,cAAA,CACd,OAAA,EAAS,OAAA,GACR,WAAA,CAAY,wBAAA;;;;;;;;;;AAAwB;AAiEvC;;;;;;;;;;;;iBAAgB,oBAAA,kBAAsC,gBAAA,EACpD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;AAAA;AAgCnE;;;cAAa,MAAA,GAAM,OAAA,GAA8C,wBAA9C,mCAAA,qBAAA"}
|
package/dist/webpack.d.mts
CHANGED
|
@@ -34,7 +34,7 @@ declare function resolveOptions(context: Context): DeepPartial<WebpackOptionsNor
|
|
|
34
34
|
* @param decorate - A function to decorate the plugin options with additional properties or hooks. This can be used to add custom behavior to the plugin instance, such as additional hooks or configuration options. The function receives the generated plugin options and should return an object containing any additional properties or hooks to be merged into the final plugin options.
|
|
35
35
|
* @returns A function that generates a Webpack plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Webpack build.
|
|
36
36
|
*/
|
|
37
|
-
declare function createWebpackFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig
|
|
37
|
+
declare function createWebpackFactory<TContext extends ExecutionContext>(options?: Omit<UnpluginFactoryOptions, "variant">, decorate?: UnpluginFactoryDecorator<TContext>): UnpluginFactory<ExecutionContext<import("@powerlines/core").ResolvedConfig, any>>;
|
|
38
38
|
/**
|
|
39
39
|
* An Webpack plugin that will invoke the Powerlines API hooks during the build process.
|
|
40
40
|
*
|
package/dist/webpack.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.d.mts","names":[],"sources":["../src/webpack.ts"],"mappings":";;;;;;;;;;AAqCA;;;iBAAgB,cAAA,CACd,OAAA,EAAS,OAAA,GACR,WAAA,CAAY,wBAAA;;;;;;;;;;AAAwB;AAiEvC;;;;;;;;;;;;iBAAgB,oBAAA,kBAAsC,gBAAA,EACpD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA
|
|
1
|
+
{"version":3,"file":"webpack.d.mts","names":[],"sources":["../src/webpack.ts"],"mappings":";;;;;;;;;;AAqCA;;;iBAAgB,cAAA,CACd,OAAA,EAAS,OAAA,GACR,WAAA,CAAY,wBAAA;;;;;;;;;;AAAwB;AAiEvC;;;;;;;;;;;;iBAAgB,oBAAA,kBAAsC,gBAAA,EACpD,OAAA,GAAS,IAAA,CAAK,sBAAA,cACd,QAAA,GAAU,wBAAA,CAAyB,QAAA,IAA8B,eAAA,CAAA,gBAAA,4BAAA,cAAA;;;;;;;;;;;;AAAA;AAgCnE;;;cAAa,MAAA,GAAM,OAAA,GAA8C,wBAA9C,mCAAA,qBAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/unplugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.82",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"keywords": [
|
|
@@ -105,20 +105,20 @@
|
|
|
105
105
|
"typings": "dist/index.d.mts",
|
|
106
106
|
"files": ["dist"],
|
|
107
107
|
"dependencies": {
|
|
108
|
-
"@powerlines/core": "^0.48.
|
|
108
|
+
"@powerlines/core": "^0.48.34",
|
|
109
109
|
"@rollup/plugin-alias": "^6.0.0",
|
|
110
110
|
"@rollup/plugin-inject": "^5.0.5",
|
|
111
111
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
112
112
|
"@rollup/plugin-replace": "^6.0.3",
|
|
113
113
|
"@stryke/convert": "^0.7.13",
|
|
114
|
-
"@stryke/fs": "^0.33.
|
|
114
|
+
"@stryke/fs": "^0.33.83",
|
|
115
115
|
"@stryke/helpers": "^0.10.22",
|
|
116
116
|
"@stryke/json": "^0.15.6",
|
|
117
117
|
"@stryke/path": "^0.29.9",
|
|
118
118
|
"@stryke/string-format": "^0.17.24",
|
|
119
119
|
"@stryke/type-checks": "^0.6.15",
|
|
120
120
|
"@stryke/types": "^0.12.10",
|
|
121
|
-
"@stryke/unique-id": "^0.3.
|
|
121
|
+
"@stryke/unique-id": "^0.3.94",
|
|
122
122
|
"defu": "^6.1.7",
|
|
123
123
|
"glob": "^13.0.6",
|
|
124
124
|
"jiti": "^2.7.0",
|
|
@@ -167,5 +167,5 @@
|
|
|
167
167
|
"webpack": { "optional": true }
|
|
168
168
|
},
|
|
169
169
|
"publishConfig": { "access": "public" },
|
|
170
|
-
"gitHead": "
|
|
170
|
+
"gitHead": "64a604fd5da7312baeeb58dfcef0fd3ace15174e"
|
|
171
171
|
}
|
package/dist/nuxt-DnPulowA.mjs
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import plugin$1 from "./vite.mjs";
|
|
2
|
-
import plugin$2 from "./webpack.mjs";
|
|
3
|
-
import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
|
|
4
|
-
|
|
5
|
-
//#region package.json
|
|
6
|
-
var name = "@powerlines/unplugin";
|
|
7
|
-
var version = "0.0.79";
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/nuxt.ts
|
|
11
|
-
/**
|
|
12
|
-
* A Nuxt plugin that will invoke the Powerlines API hooks during the build process.
|
|
13
|
-
*
|
|
14
|
-
* @see https://nuxt.com/docs/guide/directory-structure/modules
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```ts
|
|
18
|
-
* // nuxt.config.ts
|
|
19
|
-
* import { defineNuxtConfig } from "@nuxt/kit";
|
|
20
|
-
*
|
|
21
|
-
* export default defineNuxtConfig({
|
|
22
|
-
* modules: [
|
|
23
|
-
* [
|
|
24
|
-
* "@powerlines/unplugin/nuxt",
|
|
25
|
-
* { name: "example-app", ... }
|
|
26
|
-
* ],
|
|
27
|
-
* ],
|
|
28
|
-
* });
|
|
29
|
-
*
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
const plugin = defineNuxtModule({
|
|
33
|
-
meta: {
|
|
34
|
-
name,
|
|
35
|
-
version,
|
|
36
|
-
configKey: "powerlines",
|
|
37
|
-
compatibility: { builder: { vite: "^8.0.0" } }
|
|
38
|
-
},
|
|
39
|
-
defaults: {},
|
|
40
|
-
setup(options) {
|
|
41
|
-
addVitePlugin(() => plugin$1(options));
|
|
42
|
-
addWebpackPlugin(() => plugin$2(options));
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
//#endregion
|
|
47
|
-
export { plugin as t };
|
|
48
|
-
//# sourceMappingURL=nuxt-DnPulowA.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nuxt-DnPulowA.mjs","names":["vite","webpack"],"sources":["../package.json","../src/nuxt.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 { addVitePlugin, addWebpackPlugin, defineNuxtModule } from \"@nuxt/kit\";\nimport type { UserConfig } from \"@powerlines/core\";\nimport { name, version } from \"../package.json\";\nimport vite from \"./vite\";\nimport webpack from \"./webpack\";\n\n/**\n * A Nuxt plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://nuxt.com/docs/guide/directory-structure/modules\n *\n * @example\n * ```ts\n * // nuxt.config.ts\n * import { defineNuxtConfig } from \"@nuxt/kit\";\n *\n * export default defineNuxtConfig({\n * modules: [\n * [\n * \"@powerlines/unplugin/nuxt\",\n * { name: \"example-app\", ... }\n * ],\n * ],\n * });\n *\n * ```\n */\nconst plugin = defineNuxtModule<UserConfig>({\n meta: {\n name,\n version,\n configKey: \"powerlines\",\n compatibility: {\n builder: {\n vite: \"^8.0.0\"\n }\n }\n },\n defaults: {},\n setup(options) {\n addVitePlugin(() => vite(options));\n addWebpackPlugin(() => webpack(options));\n }\n});\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC6CA,MAAM,SAAS,iBAA6B;CAC1C,MAAM;EACJ;EACA;EACA,WAAW;EACX,eAAe,EACb,SAAS,EACP,MAAM,SACR,EACF;CACF;CACA,UAAU,CAAC;CACX,MAAM,SAAS;EACb,oBAAoBA,SAAK,OAAO,CAAC;EACjC,uBAAuBC,SAAQ,OAAO,CAAC;CACzC;AACF,CAAC"}
|
package/dist/nuxt-p97pkRJZ.cjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
const require_vite = require('./vite.cjs');
|
|
2
|
-
const require_webpack = require('./webpack.cjs');
|
|
3
|
-
let _nuxt_kit = require("@nuxt/kit");
|
|
4
|
-
|
|
5
|
-
//#region package.json
|
|
6
|
-
var name = "@powerlines/unplugin";
|
|
7
|
-
var version = "0.0.79";
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/nuxt.ts
|
|
11
|
-
/**
|
|
12
|
-
* A Nuxt plugin that will invoke the Powerlines API hooks during the build process.
|
|
13
|
-
*
|
|
14
|
-
* @see https://nuxt.com/docs/guide/directory-structure/modules
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```ts
|
|
18
|
-
* // nuxt.config.ts
|
|
19
|
-
* import { defineNuxtConfig } from "@nuxt/kit";
|
|
20
|
-
*
|
|
21
|
-
* export default defineNuxtConfig({
|
|
22
|
-
* modules: [
|
|
23
|
-
* [
|
|
24
|
-
* "@powerlines/unplugin/nuxt",
|
|
25
|
-
* { name: "example-app", ... }
|
|
26
|
-
* ],
|
|
27
|
-
* ],
|
|
28
|
-
* });
|
|
29
|
-
*
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
const plugin = (0, _nuxt_kit.defineNuxtModule)({
|
|
33
|
-
meta: {
|
|
34
|
-
name,
|
|
35
|
-
version,
|
|
36
|
-
configKey: "powerlines",
|
|
37
|
-
compatibility: { builder: { vite: "^8.0.0" } }
|
|
38
|
-
},
|
|
39
|
-
defaults: {},
|
|
40
|
-
setup(options) {
|
|
41
|
-
(0, _nuxt_kit.addVitePlugin)(() => require_vite.default(options));
|
|
42
|
-
(0, _nuxt_kit.addWebpackPlugin)(() => require_webpack.default(options));
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
//#endregion
|
|
47
|
-
Object.defineProperty(exports, 'plugin', {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
get: function () {
|
|
50
|
-
return plugin;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BuildInlineConfig, ExecutionContext, ExecutionOptions, UnpluginOptions } from "@powerlines/core";
|
|
2
|
-
import { PartialKeys } from "@stryke/types/base";
|
|
3
|
-
import { UnpluginContextMeta } from "unplugin";
|
|
4
|
-
|
|
5
|
-
//#region \0rolldown/runtime.js
|
|
6
|
-
//#endregion
|
|
7
|
-
//#region src/types.d.ts
|
|
8
|
-
type UnpluginExecutionOptionsBase = Omit<PartialKeys<ExecutionOptions, "cwd" | "configFile" | "framework" | "root" | "configIndex">, "executionId">;
|
|
9
|
-
type UnpluginExecutionOptions = Omit<BuildInlineConfig, "command"> & UnpluginExecutionOptionsBase;
|
|
10
|
-
type UnpluginFactory<TContext extends ExecutionContext> = (options: UnpluginExecutionOptions | undefined, meta: UnpluginContextMeta) => UnpluginOptions<TContext>;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { __reExport as a, __exportAll as i, UnpluginExecutionOptionsBase as n, UnpluginFactory as r, UnpluginExecutionOptions as t };
|
|
13
|
-
//# sourceMappingURL=types-CEaXoKbk.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-CEaXoKbk.d.cts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;KA6BY,4BAAA,GAA+B,IAAA,CACzC,WAAA,CACE,gBAAA;AAAA,KAMQ,wBAAA,GAA2B,IAAA,CAAK,iBAAA,eAC1C,4BAAA;AAAA,KAEU,eAAA,kBAAiC,gBAAA,KAC3C,OAAA,EAAS,wBAAA,cACT,IAAA,EAAM,mBAAA,KACH,eAAA,CAAgB,QAAA"}
|