powerlines 0.47.3 → 0.47.7
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/astro.cjs +7 -24
- package/dist/astro.d.cts +1 -25
- package/dist/astro.d.mts +1 -25
- package/dist/astro.mjs +2 -24
- package/dist/esbuild.cjs +6 -54
- package/dist/esbuild.d.cts +1 -25
- package/dist/esbuild.d.mts +1 -25
- package/dist/esbuild.mjs +2 -42
- package/dist/farm.cjs +7 -26
- package/dist/farm.d.cts +1 -68
- package/dist/farm.d.mts +1 -68
- package/dist/farm.mjs +2 -25
- package/dist/index.cjs +8 -35
- package/dist/index.d.cts +7 -13
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +7 -13
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +8 -25
- package/dist/index.mjs.map +1 -1
- package/dist/next.cjs +7 -35
- package/dist/next.d.cts +1 -25
- package/dist/next.d.mts +1 -25
- package/dist/next.mjs +2 -35
- package/dist/nuxt.cjs +7 -44
- package/dist/nuxt.d.cts +1 -29
- package/dist/nuxt.d.mts +1 -29
- package/dist/nuxt.mjs +2 -43
- package/dist/package.cjs +1 -8
- package/dist/package.mjs +2 -3
- package/dist/rolldown.cjs +6 -46
- package/dist/rolldown.d.cts +1 -24
- package/dist/rolldown.d.mts +1 -24
- package/dist/rolldown.mjs +2 -34
- package/dist/rollup.cjs +6 -37
- package/dist/rollup.d.cts +1 -25
- package/dist/rollup.d.mts +1 -25
- package/dist/rollup.mjs +2 -25
- package/dist/rspack.cjs +6 -37
- package/dist/rspack.d.cts +1 -25
- package/dist/rspack.d.mts +1 -25
- package/dist/rspack.mjs +2 -25
- package/dist/storage.cjs +3 -3
- package/dist/storage.d.cts +1 -1
- package/dist/storage.d.mts +1 -1
- package/dist/storage.mjs +1 -1
- package/dist/tsdown.cjs +6 -94
- package/dist/tsdown.d.cts +1 -31
- package/dist/tsdown.d.mts +1 -31
- package/dist/tsdown.mjs +2 -82
- package/dist/tsup.cjs +6 -70
- package/dist/tsup.d.cts +1 -31
- package/dist/tsup.d.mts +1 -31
- package/dist/tsup.mjs +2 -58
- package/dist/types.d.cts +2 -7
- package/dist/types.d.mts +2 -7
- package/dist/unloader.cjs +7 -23
- package/dist/unloader.d.cts +1 -65
- package/dist/unloader.d.mts +1 -65
- package/dist/unloader.mjs +2 -22
- package/dist/unplugin.cjs +3 -99
- package/dist/unplugin.d.cts +1 -17
- package/dist/unplugin.d.mts +1 -17
- package/dist/unplugin.mjs +2 -97
- package/dist/utils.cjs +3 -19
- package/dist/utils.d.cts +1 -3
- package/dist/utils.d.mts +1 -3
- package/dist/utils.mjs +1 -5
- package/dist/vite.cjs +6 -78
- package/dist/vite.d.cts +1 -25
- package/dist/vite.d.mts +1 -25
- package/dist/vite.mjs +2 -65
- package/dist/webpack.cjs +6 -36
- package/dist/webpack.d.cts +1 -24
- package/dist/webpack.d.mts +1 -24
- package/dist/webpack.mjs +2 -24
- package/package.json +50 -351
- package/dist/_virtual/_rolldown/runtime.cjs +0 -29
- package/dist/api.cjs +0 -10
- package/dist/api.d.cts +0 -2
- package/dist/api.d.mts +0 -2
- package/dist/api.mjs +0 -3
- package/dist/astro.d.cts.map +0 -1
- package/dist/astro.d.mts.map +0 -1
- package/dist/astro.mjs.map +0 -1
- package/dist/context.cjs +0 -9
- package/dist/context.d.cts +0 -1
- package/dist/context.d.mts +0 -1
- package/dist/context.mjs +0 -3
- package/dist/engine.cjs +0 -30
- package/dist/engine.d.cts +0 -24
- package/dist/engine.d.cts.map +0 -1
- package/dist/engine.d.mts +0 -24
- package/dist/engine.d.mts.map +0 -1
- package/dist/engine.mjs +0 -29
- package/dist/engine.mjs.map +0 -1
- package/dist/esbuild.d.cts.map +0 -1
- package/dist/esbuild.d.mts.map +0 -1
- package/dist/esbuild.mjs.map +0 -1
- package/dist/farm.d.cts.map +0 -1
- package/dist/farm.d.mts.map +0 -1
- package/dist/farm.mjs.map +0 -1
- package/dist/next.d.cts.map +0 -1
- package/dist/next.d.mts.map +0 -1
- package/dist/next.mjs.map +0 -1
- package/dist/nuxt.d.cts.map +0 -1
- package/dist/nuxt.d.mts.map +0 -1
- package/dist/nuxt.mjs.map +0 -1
- package/dist/rolldown.d.cts.map +0 -1
- package/dist/rolldown.d.mts.map +0 -1
- package/dist/rolldown.mjs.map +0 -1
- package/dist/rollup.d.cts.map +0 -1
- package/dist/rollup.d.mts.map +0 -1
- package/dist/rollup.mjs.map +0 -1
- package/dist/rspack.d.cts.map +0 -1
- package/dist/rspack.d.mts.map +0 -1
- package/dist/rspack.mjs.map +0 -1
- package/dist/schemas.cjs +0 -9
- package/dist/schemas.d.cts +0 -1
- package/dist/schemas.d.mts +0 -1
- package/dist/schemas.mjs +0 -3
- package/dist/tsdown.d.cts.map +0 -1
- package/dist/tsdown.d.mts.map +0 -1
- package/dist/tsdown.mjs.map +0 -1
- package/dist/tsup.d.cts.map +0 -1
- package/dist/tsup.d.mts.map +0 -1
- package/dist/tsup.mjs.map +0 -1
- package/dist/types.d.cts.map +0 -1
- package/dist/types.d.mts.map +0 -1
- package/dist/typescript.cjs +0 -9
- package/dist/typescript.d.cts +0 -1
- package/dist/typescript.d.mts +0 -1
- package/dist/typescript.mjs +0 -3
- package/dist/unbuild.cjs +0 -17
- package/dist/unbuild.d.cts +0 -2
- package/dist/unbuild.d.mts +0 -2
- package/dist/unbuild.mjs +0 -3
- package/dist/unloader.d.cts.map +0 -1
- package/dist/unloader.d.mts.map +0 -1
- package/dist/unloader.mjs.map +0 -1
- package/dist/unplugin.d.cts.map +0 -1
- package/dist/unplugin.d.mts.map +0 -1
- package/dist/unplugin.mjs.map +0 -1
- package/dist/vite.d.cts.map +0 -1
- package/dist/vite.d.mts.map +0 -1
- package/dist/vite.mjs.map +0 -1
- package/dist/webpack.d.cts.map +0 -1
- package/dist/webpack.d.mts.map +0 -1
- package/dist/webpack.mjs.map +0 -1
- package/schemas/fs.capnp +0 -42
package/dist/unloader.d.cts
CHANGED
|
@@ -1,65 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as _$_powerlines_plugin_esbuild0 from "@powerlines/plugin-esbuild";
|
|
3
|
-
import * as _$_stryke_types_configuration0 from "@stryke/types/configuration";
|
|
4
|
-
import * as _$compatx from "compatx";
|
|
5
|
-
import * as _$_powerlines_plugin_webpack0 from "@powerlines/plugin-webpack";
|
|
6
|
-
import * as _$_powerlines_plugin_vite0 from "@powerlines/plugin-vite";
|
|
7
|
-
import * as _$_powerlines_plugin_rollup0 from "@powerlines/plugin-rollup";
|
|
8
|
-
import * as _$_powerlines_plugin_rolldown0 from "@powerlines/plugin-rolldown";
|
|
9
|
-
import * as _$_powerlines_plugin_tsdown0 from "@powerlines/plugin-tsdown";
|
|
10
|
-
import * as _$_powerlines_plugin_tsup0 from "@powerlines/plugin-tsup";
|
|
11
|
-
import * as _$_powerlines_plugin_unbuild0 from "@powerlines/plugin-unbuild";
|
|
12
|
-
import * as _$unloader from "unloader";
|
|
13
|
-
|
|
14
|
-
//#region src/unloader.d.ts
|
|
15
|
-
/**
|
|
16
|
-
* An Unloader plugin that will invoke the Powerlines API hooks during processing.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* // unloader.config.js
|
|
21
|
-
* import powerlines from "powerlines/unloader";
|
|
22
|
-
*
|
|
23
|
-
* export default defineConfig({
|
|
24
|
-
* plugins: [powerlines({ name: "example-app", ... })],
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
declare const unplugin: (options: _$_powerlines_core0.InitialPluginConfig<{
|
|
30
|
-
readonly name?: string | undefined;
|
|
31
|
-
readonly title?: string | undefined;
|
|
32
|
-
readonly description?: string | undefined;
|
|
33
|
-
readonly organization?: string | undefined;
|
|
34
|
-
readonly logLevel?: _$_powerlines_core0.LogLevelUserConfig | undefined;
|
|
35
|
-
readonly customLogger?: _$_powerlines_core0.CustomLogger | undefined;
|
|
36
|
-
readonly projectType?: _$_powerlines_core0.ProjectType | undefined;
|
|
37
|
-
readonly autoInstall?: boolean | undefined;
|
|
38
|
-
readonly skipCache?: boolean | undefined;
|
|
39
|
-
readonly plugins?: _$_powerlines_core0.PluginConfig<any>[] | undefined;
|
|
40
|
-
readonly environments?: Record<string, _$_powerlines_core0.EnvironmentConfig> | undefined;
|
|
41
|
-
readonly singleBuild?: boolean | undefined;
|
|
42
|
-
readonly root?: string | undefined;
|
|
43
|
-
readonly mode?: _$_powerlines_core0.Mode | undefined;
|
|
44
|
-
readonly framework?: string | undefined;
|
|
45
|
-
readonly input: _$_stryke_types_configuration0.TypeDefinitionParameter | _$_stryke_types_configuration0.TypeDefinitionParameter[] | Record<string, _$_stryke_types_configuration0.TypeDefinitionParameter | _$_stryke_types_configuration0.TypeDefinitionParameter[]>;
|
|
46
|
-
readonly output?: _$_powerlines_core0.OutputConfig | undefined;
|
|
47
|
-
readonly compatibilityDate?: _$compatx.CompatibilityDateSpec | undefined;
|
|
48
|
-
readonly resolve?: _$_powerlines_core0.ResolveConfig | undefined;
|
|
49
|
-
readonly platform?: "node" | "browser" | "neutral" | undefined;
|
|
50
|
-
readonly define?: Record<string, any> | undefined;
|
|
51
|
-
readonly inject?: Record<string, string | string[]> | undefined;
|
|
52
|
-
readonly tsconfig?: string | undefined;
|
|
53
|
-
readonly tsconfigRaw?: _$_powerlines_core0.TSConfig | undefined;
|
|
54
|
-
readonly webpack?: _$_powerlines_plugin_webpack0.WebpackPluginOptions | undefined;
|
|
55
|
-
readonly vite?: _$_powerlines_plugin_vite0.VitePluginOptions | undefined;
|
|
56
|
-
readonly rollup?: _$_powerlines_plugin_rollup0.RollupPluginOptions | undefined;
|
|
57
|
-
readonly esbuild?: _$_powerlines_plugin_esbuild0.EsbuildPluginOptions | undefined;
|
|
58
|
-
readonly rolldown?: _$_powerlines_plugin_rolldown0.RolldownPluginOptions | undefined;
|
|
59
|
-
readonly tsdown?: _$_powerlines_plugin_tsdown0.TsdownPluginOptions | undefined;
|
|
60
|
-
readonly tsup?: _$_powerlines_plugin_tsup0.TsupPluginOptions | undefined;
|
|
61
|
-
readonly unbuild?: _$_powerlines_plugin_unbuild0.UnbuildPluginOptions | undefined;
|
|
62
|
-
}>) => _$unloader.Plugin | _$unloader.Plugin[];
|
|
63
|
-
//#endregion
|
|
64
|
-
export { unplugin as unloader, unplugin };
|
|
65
|
-
//# sourceMappingURL=unloader.d.cts.map
|
|
1
|
+
export * from "@powerlines/unplugin/unloader";
|
package/dist/unloader.d.mts
CHANGED
|
@@ -1,65 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as _$_powerlines_plugin_esbuild0 from "@powerlines/plugin-esbuild";
|
|
3
|
-
import * as _$_powerlines_plugin_webpack0 from "@powerlines/plugin-webpack";
|
|
4
|
-
import * as _$_powerlines_plugin_rolldown0 from "@powerlines/plugin-rolldown";
|
|
5
|
-
import * as _$_powerlines_plugin_rollup0 from "@powerlines/plugin-rollup";
|
|
6
|
-
import * as _$_powerlines_plugin_tsdown0 from "@powerlines/plugin-tsdown";
|
|
7
|
-
import * as _$_powerlines_plugin_tsup0 from "@powerlines/plugin-tsup";
|
|
8
|
-
import * as _$_powerlines_plugin_unbuild0 from "@powerlines/plugin-unbuild";
|
|
9
|
-
import * as _$_powerlines_core0 from "@powerlines/core";
|
|
10
|
-
import * as _$_stryke_types_configuration0 from "@stryke/types/configuration";
|
|
11
|
-
import * as _$compatx from "compatx";
|
|
12
|
-
import * as _$unloader from "unloader";
|
|
13
|
-
|
|
14
|
-
//#region src/unloader.d.ts
|
|
15
|
-
/**
|
|
16
|
-
* An Unloader plugin that will invoke the Powerlines API hooks during processing.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* // unloader.config.js
|
|
21
|
-
* import powerlines from "powerlines/unloader";
|
|
22
|
-
*
|
|
23
|
-
* export default defineConfig({
|
|
24
|
-
* plugins: [powerlines({ name: "example-app", ... })],
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
declare const unplugin: (options: _$_powerlines_core0.InitialPluginConfig<{
|
|
30
|
-
readonly name?: string | undefined;
|
|
31
|
-
readonly title?: string | undefined;
|
|
32
|
-
readonly description?: string | undefined;
|
|
33
|
-
readonly organization?: string | undefined;
|
|
34
|
-
readonly logLevel?: _$_powerlines_core0.LogLevelUserConfig | undefined;
|
|
35
|
-
readonly customLogger?: _$_powerlines_core0.CustomLogger | undefined;
|
|
36
|
-
readonly projectType?: _$_powerlines_core0.ProjectType | undefined;
|
|
37
|
-
readonly autoInstall?: boolean | undefined;
|
|
38
|
-
readonly skipCache?: boolean | undefined;
|
|
39
|
-
readonly plugins?: _$_powerlines_core0.PluginConfig<any>[] | undefined;
|
|
40
|
-
readonly environments?: Record<string, _$_powerlines_core0.EnvironmentConfig> | undefined;
|
|
41
|
-
readonly singleBuild?: boolean | undefined;
|
|
42
|
-
readonly root?: string | undefined;
|
|
43
|
-
readonly mode?: _$_powerlines_core0.Mode | undefined;
|
|
44
|
-
readonly framework?: string | undefined;
|
|
45
|
-
readonly input: _$_stryke_types_configuration0.TypeDefinitionParameter | _$_stryke_types_configuration0.TypeDefinitionParameter[] | Record<string, _$_stryke_types_configuration0.TypeDefinitionParameter | _$_stryke_types_configuration0.TypeDefinitionParameter[]>;
|
|
46
|
-
readonly output?: _$_powerlines_core0.OutputConfig | undefined;
|
|
47
|
-
readonly compatibilityDate?: _$compatx.CompatibilityDateSpec | undefined;
|
|
48
|
-
readonly resolve?: _$_powerlines_core0.ResolveConfig | undefined;
|
|
49
|
-
readonly platform?: "node" | "browser" | "neutral" | undefined;
|
|
50
|
-
readonly define?: Record<string, any> | undefined;
|
|
51
|
-
readonly inject?: Record<string, string | string[]> | undefined;
|
|
52
|
-
readonly tsconfig?: string | undefined;
|
|
53
|
-
readonly tsconfigRaw?: _$_powerlines_core0.TSConfig | undefined;
|
|
54
|
-
readonly webpack?: _$_powerlines_plugin_webpack0.WebpackPluginOptions | undefined;
|
|
55
|
-
readonly vite?: _$_powerlines_plugin_vite0.VitePluginOptions | undefined;
|
|
56
|
-
readonly rollup?: _$_powerlines_plugin_rollup0.RollupPluginOptions | undefined;
|
|
57
|
-
readonly esbuild?: _$_powerlines_plugin_esbuild0.EsbuildPluginOptions | undefined;
|
|
58
|
-
readonly rolldown?: _$_powerlines_plugin_rolldown0.RolldownPluginOptions | undefined;
|
|
59
|
-
readonly tsdown?: _$_powerlines_plugin_tsdown0.TsdownPluginOptions | undefined;
|
|
60
|
-
readonly tsup?: _$_powerlines_plugin_tsup0.TsupPluginOptions | undefined;
|
|
61
|
-
readonly unbuild?: _$_powerlines_plugin_unbuild0.UnbuildPluginOptions | undefined;
|
|
62
|
-
}>) => _$unloader.Plugin | _$unloader.Plugin[];
|
|
63
|
-
//#endregion
|
|
64
|
-
export { unplugin as unloader, unplugin };
|
|
65
|
-
//# sourceMappingURL=unloader.d.mts.map
|
|
1
|
+
export * from "@powerlines/unplugin/unloader";
|
package/dist/unloader.mjs
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import { createUnloaderPlugin } from "unplugin";
|
|
1
|
+
export * from "@powerlines/unplugin/unloader"
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* An Unloader plugin that will invoke the Powerlines API hooks during processing.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* // unloader.config.js
|
|
11
|
-
* import powerlines from "powerlines/unloader";
|
|
12
|
-
*
|
|
13
|
-
* export default defineConfig({
|
|
14
|
-
* plugins: [powerlines({ name: "example-app", ... })],
|
|
15
|
-
* });
|
|
16
|
-
*
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
const unplugin = createUnloaderPlugin(createUnpluginFactory("unloader"));
|
|
20
|
-
|
|
21
|
-
//#endregion
|
|
22
|
-
export { unplugin as unloader, unplugin };
|
|
23
|
-
//# sourceMappingURL=unloader.mjs.map
|
|
3
|
+
export { };
|
package/dist/unplugin.cjs
CHANGED
|
@@ -1,105 +1,9 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
require('./api.cjs');
|
|
4
|
-
let unplugin = require("unplugin");
|
|
5
|
-
let _powerlines_core_lib_utilities_source_file = require("@powerlines/core/lib/utilities/source-file");
|
|
6
|
-
let _powerlines_core_plugin_utils_logging = require("@powerlines/core/plugin-utils/logging");
|
|
7
|
-
let _stryke_fs_get_workspace_root = require("@stryke/fs/get-workspace-root");
|
|
8
|
-
let _powerlines_engine_api = require("@powerlines/engine/api");
|
|
9
1
|
|
|
10
|
-
//#region src/unplugin.ts
|
|
11
|
-
/**
|
|
12
|
-
* Creates a Powerlines unplugin factory that generates a plugin instance.
|
|
13
|
-
*
|
|
14
|
-
* @param variant - The build variant for which to create the unplugin.
|
|
15
|
-
* @param decorate - An optional function to decorate the unplugin options.
|
|
16
|
-
* @returns The unplugin factory that generates a plugin instance.
|
|
17
|
-
*/
|
|
18
|
-
function createUnpluginFactory(variant, decorate) {
|
|
19
|
-
return (options, meta) => {
|
|
20
|
-
let logger = (0, _powerlines_core_plugin_utils_logging.createLogger)(options.name || "powerlines", {});
|
|
21
|
-
logger.debug("Initializing Unplugin");
|
|
22
|
-
try {
|
|
23
|
-
const initialConfig = {
|
|
24
|
-
...options,
|
|
25
|
-
variant,
|
|
26
|
-
unplugin: meta
|
|
27
|
-
};
|
|
28
|
-
let api;
|
|
29
|
-
async function buildStart() {
|
|
30
|
-
api = await _powerlines_engine_api.PowerlinesAPI.from({
|
|
31
|
-
...options,
|
|
32
|
-
cwd: (0, _stryke_fs_get_workspace_root.getWorkspaceRoot)(process.cwd()),
|
|
33
|
-
root: initialConfig.root,
|
|
34
|
-
mode: initialConfig.mode
|
|
35
|
-
}, initialConfig);
|
|
36
|
-
logger = api.context.logger;
|
|
37
|
-
logger.debug("Powerlines build plugin starting...");
|
|
38
|
-
(0, unplugin.setParseImpl)(api.context.parse.bind(api.context));
|
|
39
|
-
logger.debug("Preparing build artifacts for the Powerlines project...");
|
|
40
|
-
await api.prepare({ command: "build" });
|
|
41
|
-
}
|
|
42
|
-
async function resolveId(id, importer, options = { isEntry: false }) {
|
|
43
|
-
return api.context.resolve(id, importer, options);
|
|
44
|
-
}
|
|
45
|
-
async function load(id) {
|
|
46
|
-
const environment = await api.context.getEnvironment();
|
|
47
|
-
let result = await api.callHook("load", {
|
|
48
|
-
environment,
|
|
49
|
-
order: "pre"
|
|
50
|
-
}, id);
|
|
51
|
-
if (result) return result;
|
|
52
|
-
result = await api.callHook("load", {
|
|
53
|
-
environment,
|
|
54
|
-
order: "normal"
|
|
55
|
-
}, id);
|
|
56
|
-
if (result) return result;
|
|
57
|
-
result = await environment.load(id);
|
|
58
|
-
if (result) return result;
|
|
59
|
-
return api.callHook("load", {
|
|
60
|
-
environment,
|
|
61
|
-
order: "post"
|
|
62
|
-
}, id);
|
|
63
|
-
}
|
|
64
|
-
async function transform(code, id) {
|
|
65
|
-
return api.callHook("transform", {
|
|
66
|
-
environment: await api.context.getEnvironment(),
|
|
67
|
-
result: "merge",
|
|
68
|
-
asNextParam: (previousResult) => (0, _powerlines_core_lib_utilities_source_file.getString)(previousResult)
|
|
69
|
-
}, (0, _powerlines_core_lib_utilities_source_file.getString)(code), id);
|
|
70
|
-
}
|
|
71
|
-
async function writeBundle() {
|
|
72
|
-
logger.debug("Finalizing Powerlines project output...");
|
|
73
|
-
await api.callHook("writeBundle", { environment: await api.context.getEnvironment() });
|
|
74
|
-
}
|
|
75
|
-
const unpluginOptions = {
|
|
76
|
-
name: "powerlines",
|
|
77
|
-
api,
|
|
78
|
-
resolveId,
|
|
79
|
-
load,
|
|
80
|
-
transform,
|
|
81
|
-
buildStart,
|
|
82
|
-
writeBundle
|
|
83
|
-
};
|
|
84
|
-
const result = decorate ? decorate(api, unpluginOptions) : unpluginOptions;
|
|
85
|
-
logger.debug("Unplugin initialized successfully.");
|
|
86
|
-
return {
|
|
87
|
-
api,
|
|
88
|
-
...result
|
|
89
|
-
};
|
|
90
|
-
} catch (error) {
|
|
91
|
-
logger.error(error?.message);
|
|
92
|
-
throw error;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
2
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
var _powerlines_core_lib_unplugin = require("@powerlines/core/lib/unplugin");
|
|
100
|
-
Object.keys(_powerlines_core_lib_unplugin).forEach(function (k) {
|
|
3
|
+
var _powerlines_unplugin_unplugin = require("@powerlines/unplugin/unplugin");
|
|
4
|
+
Object.keys(_powerlines_unplugin_unplugin).forEach(function (k) {
|
|
101
5
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
102
6
|
enumerable: true,
|
|
103
|
-
get: function () { return
|
|
7
|
+
get: function () { return _powerlines_unplugin_unplugin[k]; }
|
|
104
8
|
});
|
|
105
9
|
});
|
package/dist/unplugin.d.cts
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { PluginContext, UnpluginBuilderVariant, UnpluginFactory, UnpluginOptions } from "@powerlines/core";
|
|
3
|
-
import { UnpluginOptions as UnpluginOptions$1 } from "unplugin";
|
|
4
|
-
export * from "@powerlines/core/lib/unplugin";
|
|
5
|
-
|
|
6
|
-
//#region src/unplugin.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* Creates a Powerlines unplugin factory that generates a plugin instance.
|
|
9
|
-
*
|
|
10
|
-
* @param variant - The build variant for which to create the unplugin.
|
|
11
|
-
* @param decorate - An optional function to decorate the unplugin options.
|
|
12
|
-
* @returns The unplugin factory that generates a plugin instance.
|
|
13
|
-
*/
|
|
14
|
-
declare function createUnpluginFactory<TContext extends PluginContext, TUnpluginBuilderVariant extends UnpluginBuilderVariant = UnpluginBuilderVariant>(variant: TUnpluginBuilderVariant, decorate?: (api: PowerlinesAPI<TContext["config"]>, plugin: UnpluginOptions<TContext>) => UnpluginOptions$1): UnpluginFactory<TContext>;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { createUnpluginFactory };
|
|
17
|
-
//# sourceMappingURL=unplugin.d.cts.map
|
|
1
|
+
export * from "@powerlines/unplugin/unplugin";
|
package/dist/unplugin.d.mts
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { UnpluginOptions } from "unplugin";
|
|
3
|
-
import { PluginContext, UnpluginBuilderVariant, UnpluginFactory, UnpluginOptions as UnpluginOptions$1 } from "@powerlines/core";
|
|
4
|
-
export * from "@powerlines/core/lib/unplugin";
|
|
5
|
-
|
|
6
|
-
//#region src/unplugin.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* Creates a Powerlines unplugin factory that generates a plugin instance.
|
|
9
|
-
*
|
|
10
|
-
* @param variant - The build variant for which to create the unplugin.
|
|
11
|
-
* @param decorate - An optional function to decorate the unplugin options.
|
|
12
|
-
* @returns The unplugin factory that generates a plugin instance.
|
|
13
|
-
*/
|
|
14
|
-
declare function createUnpluginFactory<TContext extends PluginContext, TUnpluginBuilderVariant extends UnpluginBuilderVariant = UnpluginBuilderVariant>(variant: TUnpluginBuilderVariant, decorate?: (api: PowerlinesAPI<TContext["config"]>, plugin: UnpluginOptions$1<TContext>) => UnpluginOptions): UnpluginFactory<TContext>;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { createUnpluginFactory };
|
|
17
|
-
//# sourceMappingURL=unplugin.d.mts.map
|
|
1
|
+
export * from "@powerlines/unplugin/unplugin";
|
package/dist/unplugin.mjs
CHANGED
|
@@ -1,98 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import { setParseImpl } from "unplugin";
|
|
3
|
-
import { getString } from "@powerlines/core/lib/utilities/source-file";
|
|
4
|
-
import { createLogger } from "@powerlines/core/plugin-utils/logging";
|
|
5
|
-
import { getWorkspaceRoot } from "@stryke/fs/get-workspace-root";
|
|
1
|
+
export * from "@powerlines/unplugin/unplugin"
|
|
6
2
|
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
//#region src/unplugin.ts
|
|
10
|
-
/**
|
|
11
|
-
* Creates a Powerlines unplugin factory that generates a plugin instance.
|
|
12
|
-
*
|
|
13
|
-
* @param variant - The build variant for which to create the unplugin.
|
|
14
|
-
* @param decorate - An optional function to decorate the unplugin options.
|
|
15
|
-
* @returns The unplugin factory that generates a plugin instance.
|
|
16
|
-
*/
|
|
17
|
-
function createUnpluginFactory(variant, decorate) {
|
|
18
|
-
return (options, meta) => {
|
|
19
|
-
let logger = createLogger(options.name || "powerlines", {});
|
|
20
|
-
logger.debug("Initializing Unplugin");
|
|
21
|
-
try {
|
|
22
|
-
const initialConfig = {
|
|
23
|
-
...options,
|
|
24
|
-
variant,
|
|
25
|
-
unplugin: meta
|
|
26
|
-
};
|
|
27
|
-
let api;
|
|
28
|
-
async function buildStart() {
|
|
29
|
-
api = await PowerlinesAPI.from({
|
|
30
|
-
...options,
|
|
31
|
-
cwd: getWorkspaceRoot(process.cwd()),
|
|
32
|
-
root: initialConfig.root,
|
|
33
|
-
mode: initialConfig.mode
|
|
34
|
-
}, initialConfig);
|
|
35
|
-
logger = api.context.logger;
|
|
36
|
-
logger.debug("Powerlines build plugin starting...");
|
|
37
|
-
setParseImpl(api.context.parse.bind(api.context));
|
|
38
|
-
logger.debug("Preparing build artifacts for the Powerlines project...");
|
|
39
|
-
await api.prepare({ command: "build" });
|
|
40
|
-
}
|
|
41
|
-
async function resolveId(id, importer, options = { isEntry: false }) {
|
|
42
|
-
return api.context.resolve(id, importer, options);
|
|
43
|
-
}
|
|
44
|
-
async function load(id) {
|
|
45
|
-
const environment = await api.context.getEnvironment();
|
|
46
|
-
let result = await api.callHook("load", {
|
|
47
|
-
environment,
|
|
48
|
-
order: "pre"
|
|
49
|
-
}, id);
|
|
50
|
-
if (result) return result;
|
|
51
|
-
result = await api.callHook("load", {
|
|
52
|
-
environment,
|
|
53
|
-
order: "normal"
|
|
54
|
-
}, id);
|
|
55
|
-
if (result) return result;
|
|
56
|
-
result = await environment.load(id);
|
|
57
|
-
if (result) return result;
|
|
58
|
-
return api.callHook("load", {
|
|
59
|
-
environment,
|
|
60
|
-
order: "post"
|
|
61
|
-
}, id);
|
|
62
|
-
}
|
|
63
|
-
async function transform(code, id) {
|
|
64
|
-
return api.callHook("transform", {
|
|
65
|
-
environment: await api.context.getEnvironment(),
|
|
66
|
-
result: "merge",
|
|
67
|
-
asNextParam: (previousResult) => getString(previousResult)
|
|
68
|
-
}, getString(code), id);
|
|
69
|
-
}
|
|
70
|
-
async function writeBundle() {
|
|
71
|
-
logger.debug("Finalizing Powerlines project output...");
|
|
72
|
-
await api.callHook("writeBundle", { environment: await api.context.getEnvironment() });
|
|
73
|
-
}
|
|
74
|
-
const unpluginOptions = {
|
|
75
|
-
name: "powerlines",
|
|
76
|
-
api,
|
|
77
|
-
resolveId,
|
|
78
|
-
load,
|
|
79
|
-
transform,
|
|
80
|
-
buildStart,
|
|
81
|
-
writeBundle
|
|
82
|
-
};
|
|
83
|
-
const result = decorate ? decorate(api, unpluginOptions) : unpluginOptions;
|
|
84
|
-
logger.debug("Unplugin initialized successfully.");
|
|
85
|
-
return {
|
|
86
|
-
api,
|
|
87
|
-
...result
|
|
88
|
-
};
|
|
89
|
-
} catch (error) {
|
|
90
|
-
logger.error(error?.message);
|
|
91
|
-
throw error;
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
//#endregion
|
|
97
|
-
export { createUnpluginFactory };
|
|
98
|
-
//# sourceMappingURL=unplugin.mjs.map
|
|
3
|
+
export { };
|
package/dist/utils.cjs
CHANGED
|
@@ -1,25 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
Object.keys(
|
|
3
|
+
var _powerlines_core_lib = require("@powerlines/core/lib");
|
|
4
|
+
Object.keys(_powerlines_core_lib).forEach(function (k) {
|
|
5
5
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: function () { return
|
|
8
|
-
});
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
var _powerlines_core_lib_utilities = require("@powerlines/core/lib/utilities");
|
|
12
|
-
Object.keys(_powerlines_core_lib_utilities).forEach(function (k) {
|
|
13
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () { return _powerlines_core_lib_utilities[k]; }
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
var _powerlines_core_plugin_utils_logging = require("@powerlines/core/plugin-utils/logging");
|
|
20
|
-
Object.keys(_powerlines_core_plugin_utils_logging).forEach(function (k) {
|
|
21
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () { return _powerlines_core_plugin_utils_logging[k]; }
|
|
7
|
+
get: function () { return _powerlines_core_lib[k]; }
|
|
24
8
|
});
|
|
25
9
|
});
|
package/dist/utils.d.cts
CHANGED
package/dist/utils.d.mts
CHANGED
package/dist/utils.mjs
CHANGED
package/dist/vite.cjs
CHANGED
|
@@ -1,81 +1,9 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_unplugin = require('./unplugin.cjs');
|
|
4
|
-
let _powerlines_plugin_vite_helpers_resolve_options = require("@powerlines/plugin-vite/helpers/resolve-options");
|
|
5
|
-
let _stryke_env_environment_checks = require("@stryke/env/environment-checks");
|
|
6
|
-
let defu = require("defu");
|
|
7
|
-
defu = require_runtime.__toESM(defu, 1);
|
|
8
|
-
let unplugin = require("unplugin");
|
|
9
|
-
let _powerlines_plugin_vite = require("@powerlines/plugin-vite");
|
|
10
|
-
_powerlines_plugin_vite = require_runtime.__toESM(_powerlines_plugin_vite, 1);
|
|
11
1
|
|
|
12
|
-
//#region src/vite.ts
|
|
13
|
-
/**
|
|
14
|
-
* A Vite plugin that will invoke the Powerlines API hooks during the build process.
|
|
15
|
-
*
|
|
16
|
-
* @see https://vitejs.dev/guide/api-plugin.html#plugin-api
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* // vite.config.ts
|
|
21
|
-
* import powerlines from "powerlines/vite";
|
|
22
|
-
*
|
|
23
|
-
* export default defineConfig({
|
|
24
|
-
* plugins: [powerlines({ name: "example-app", ... })],
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
const unplugin$1 = (0, unplugin.createVitePlugin)(require_unplugin.createUnpluginFactory("vite", (api, plugin) => {
|
|
30
|
-
return {
|
|
31
|
-
...plugin,
|
|
32
|
-
vite: {
|
|
33
|
-
sharedDuringBuild: true,
|
|
34
|
-
async hotUpdate(options) {
|
|
35
|
-
const environment = await api.context.getEnvironment();
|
|
36
|
-
return api.callHook("vite:hotUpdate", { environment }, options);
|
|
37
|
-
},
|
|
38
|
-
async config(config, env) {
|
|
39
|
-
api.context.config.mode = (0, _stryke_env_environment_checks.isDevelopmentMode)(env.mode) ? "development" : (0, _stryke_env_environment_checks.isTestMode)(env.mode) ? "test" : "production";
|
|
40
|
-
const environment = await api.context.getEnvironment();
|
|
41
|
-
const result = await api.callHook("vite:config", { environment }, config, env);
|
|
42
|
-
return (0, defu.default)((0, _powerlines_plugin_vite_helpers_resolve_options.resolveOptions)(api.context), result?.build ?? {}, config);
|
|
43
|
-
},
|
|
44
|
-
async configResolved(_config) {
|
|
45
|
-
const environment = await api.context.getEnvironment();
|
|
46
|
-
await api.callHook("configResolved", { environment });
|
|
47
|
-
},
|
|
48
|
-
async configureServer(server) {
|
|
49
|
-
const environment = await api.context.getEnvironment();
|
|
50
|
-
return api.callHook("vite:configureServer", { environment }, server);
|
|
51
|
-
},
|
|
52
|
-
async configurePreviewServer(server) {
|
|
53
|
-
const environment = await api.context.getEnvironment();
|
|
54
|
-
return api.callHook("vite:configurePreviewServer", { environment }, server);
|
|
55
|
-
},
|
|
56
|
-
async transformIndexHtml(html, ctx) {
|
|
57
|
-
const environment = await api.context.getEnvironment();
|
|
58
|
-
return api.callHook("vite:transformIndexHtml", { environment }, html, ctx);
|
|
59
|
-
},
|
|
60
|
-
async handleHotUpdate(ctx) {
|
|
61
|
-
const environment = await api.context.getEnvironment();
|
|
62
|
-
return api.callHook("vite:handleHotUpdate", { environment }, ctx);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
}));
|
|
67
2
|
|
|
68
|
-
|
|
69
|
-
Object.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return
|
|
73
|
-
}
|
|
3
|
+
var _powerlines_unplugin_vite = require("@powerlines/unplugin/vite");
|
|
4
|
+
Object.keys(_powerlines_unplugin_vite).forEach(function (k) {
|
|
5
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function () { return _powerlines_unplugin_vite[k]; }
|
|
8
|
+
});
|
|
74
9
|
});
|
|
75
|
-
exports.unplugin = unplugin$1;
|
|
76
|
-
Object.defineProperty(exports, 'vite', {
|
|
77
|
-
enumerable: true,
|
|
78
|
-
get: function () {
|
|
79
|
-
return _powerlines_plugin_vite.default;
|
|
80
|
-
}
|
|
81
|
-
});
|
package/dist/vite.d.cts
CHANGED
|
@@ -1,25 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as _$vite from "vite";
|
|
3
|
-
import { VitePluginInitialConfig } from "@powerlines/plugin-vite/types";
|
|
4
|
-
|
|
5
|
-
//#region src/vite.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* A Vite plugin that will invoke the Powerlines API hooks during the build process.
|
|
8
|
-
*
|
|
9
|
-
* @see https://vitejs.dev/guide/api-plugin.html#plugin-api
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* // vite.config.ts
|
|
14
|
-
* import powerlines from "powerlines/vite";
|
|
15
|
-
*
|
|
16
|
-
* export default defineConfig({
|
|
17
|
-
* plugins: [powerlines({ name: "example-app", ... })],
|
|
18
|
-
* });
|
|
19
|
-
*
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
declare const unplugin: (options: VitePluginInitialConfig) => _$vite.Plugin<any> | _$vite.Plugin<any>[];
|
|
23
|
-
//#endregion
|
|
24
|
-
export { plugin, unplugin, vite };
|
|
25
|
-
//# sourceMappingURL=vite.d.cts.map
|
|
1
|
+
export * from "@powerlines/unplugin/vite";
|
package/dist/vite.d.mts
CHANGED
|
@@ -1,25 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as _$vite from "vite";
|
|
3
|
-
import { VitePluginInitialConfig } from "@powerlines/plugin-vite/types";
|
|
4
|
-
|
|
5
|
-
//#region src/vite.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* A Vite plugin that will invoke the Powerlines API hooks during the build process.
|
|
8
|
-
*
|
|
9
|
-
* @see https://vitejs.dev/guide/api-plugin.html#plugin-api
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* // vite.config.ts
|
|
14
|
-
* import powerlines from "powerlines/vite";
|
|
15
|
-
*
|
|
16
|
-
* export default defineConfig({
|
|
17
|
-
* plugins: [powerlines({ name: "example-app", ... })],
|
|
18
|
-
* });
|
|
19
|
-
*
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
declare const unplugin: (options: VitePluginInitialConfig) => _$vite.Plugin<any> | _$vite.Plugin<any>[];
|
|
23
|
-
//#endregion
|
|
24
|
-
export { plugin, unplugin, vite };
|
|
25
|
-
//# sourceMappingURL=vite.d.mts.map
|
|
1
|
+
export * from "@powerlines/unplugin/vite";
|