@powerlines/plugin-nitro 0.1.124 → 0.1.125
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 +2 -2
- package/dist/index.d.cts +2 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types/plugin.d.cts +3 -3
- package/dist/types/plugin.d.mts +3 -3
- package/package.json +3 -3
- package/dist/powerlines/src/internal/helpers/hooks.d.cts +0 -47
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -47
- package/dist/powerlines/src/plugin-utils/get-config-path.cjs +0 -49
- package/dist/powerlines/src/plugin-utils/get-config-path.mjs +0 -48
- package/dist/powerlines/src/types/api.d.cts +0 -104
- package/dist/powerlines/src/types/api.d.mts +0 -104
- package/dist/powerlines/src/types/build.d.cts +0 -185
- package/dist/powerlines/src/types/build.d.mts +0 -185
- package/dist/powerlines/src/types/commands.d.cts +0 -8
- package/dist/powerlines/src/types/commands.d.mts +0 -8
- package/dist/powerlines/src/types/config.d.cts +0 -424
- package/dist/powerlines/src/types/config.d.mts +0 -424
- package/dist/powerlines/src/types/context.d.cts +0 -514
- package/dist/powerlines/src/types/context.d.mts +0 -514
- package/dist/powerlines/src/types/fs.d.cts +0 -486
- package/dist/powerlines/src/types/fs.d.mts +0 -486
- package/dist/powerlines/src/types/hooks.d.cts +0 -32
- package/dist/powerlines/src/types/hooks.d.mts +0 -32
- package/dist/powerlines/src/types/plugin.d.cts +0 -205
- package/dist/powerlines/src/types/plugin.d.mts +0 -205
- package/dist/powerlines/src/types/resolved.d.cts +0 -93
- package/dist/powerlines/src/types/resolved.d.mts +0 -93
- package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
- package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
- package/dist/powerlines/src/types/unplugin.d.cts +0 -22
- package/dist/powerlines/src/types/unplugin.d.mts +0 -22
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
-
const require_get_config_path = require('./powerlines/src/plugin-utils/get-config-path.cjs');
|
|
4
3
|
let __stryke_path_append = require("@stryke/path/append");
|
|
5
4
|
let defu = require("defu");
|
|
6
5
|
defu = require_rolldown_runtime.__toESM(defu);
|
|
7
6
|
let nitro_builder = require("nitro/builder");
|
|
7
|
+
let powerlines_plugin_utils_get_config_path = require("powerlines/plugin-utils/get-config-path");
|
|
8
8
|
|
|
9
9
|
//#region src/index.ts
|
|
10
10
|
/**
|
|
@@ -17,7 +17,7 @@ const plugin = (options = {}) => {
|
|
|
17
17
|
async config() {
|
|
18
18
|
this.debug("Providing default configuration for the Powerlines `nitro` plugin.");
|
|
19
19
|
let configFile = options.configFile;
|
|
20
|
-
if (!configFile) configFile =
|
|
20
|
+
if (!configFile) configFile = (0, powerlines_plugin_utils_get_config_path.getConfigPath)(this, "nitro");
|
|
21
21
|
return { nitro: {
|
|
22
22
|
configFile: configFile ? (0, __stryke_path_append.appendPath)(configFile, this.workspaceConfig.workspaceRoot) : void 0,
|
|
23
23
|
...options
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Plugin } from "./powerlines/src/types/plugin.cjs";
|
|
2
1
|
import { NitroContext, NitroPluginContext, NitroPluginOptions, NitroPluginResolvedConfig, NitroPluginUserConfig, __ΩNitroContext, __ΩNitroPluginContext, __ΩNitroPluginOptions, __ΩNitroPluginResolvedConfig, __ΩNitroPluginUserConfig } from "./types/plugin.cjs";
|
|
2
|
+
import "./types/index.cjs";
|
|
3
|
+
import { Plugin } from "powerlines/types/plugin";
|
|
3
4
|
|
|
4
5
|
//#region src/index.d.ts
|
|
5
6
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Plugin } from "./powerlines/src/types/plugin.mjs";
|
|
2
1
|
import { NitroContext, NitroPluginContext, NitroPluginOptions, NitroPluginResolvedConfig, NitroPluginUserConfig, __ΩNitroContext, __ΩNitroPluginContext, __ΩNitroPluginOptions, __ΩNitroPluginResolvedConfig, __ΩNitroPluginUserConfig } from "./types/plugin.mjs";
|
|
3
2
|
import "./types/index.mjs";
|
|
3
|
+
import { Plugin } from "powerlines/types/plugin";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
6
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getConfigPath } from "./powerlines/src/plugin-utils/get-config-path.mjs";
|
|
2
1
|
import { appendPath } from "@stryke/path/append";
|
|
3
2
|
import defu from "defu";
|
|
4
3
|
import { createNitro } from "nitro/builder";
|
|
4
|
+
import { getConfigPath } from "powerlines/plugin-utils/get-config-path";
|
|
5
5
|
|
|
6
6
|
//#region src/index.ts
|
|
7
7
|
/**
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { UserConfig } from "../powerlines/src/types/config.cjs";
|
|
2
|
-
import { ResolvedConfig } from "../powerlines/src/types/resolved.cjs";
|
|
3
|
-
import { PluginContext } from "../powerlines/src/types/context.cjs";
|
|
4
1
|
import { createDevServer } from "nitro/builder";
|
|
5
2
|
import { Nitro, NitroConfig } from "nitro/types";
|
|
6
3
|
import { NitroPluginConfig, ServiceConfig } from "nitro/vite";
|
|
4
|
+
import { UserConfig } from "powerlines/types/config";
|
|
5
|
+
import { PluginContext } from "powerlines/types/context";
|
|
6
|
+
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
7
7
|
|
|
8
8
|
//#region src/types/plugin.d.ts
|
|
9
9
|
interface NitroPluginOptions extends Omit<NitroConfig, "root" | "compatibilityDate" | "logLevel" | "sourcemap" | "minify"> {
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { UserConfig } from "../powerlines/src/types/config.mjs";
|
|
2
|
-
import { ResolvedConfig } from "../powerlines/src/types/resolved.mjs";
|
|
3
|
-
import { PluginContext } from "../powerlines/src/types/context.mjs";
|
|
4
1
|
import { createDevServer } from "nitro/builder";
|
|
5
2
|
import { Nitro, NitroConfig } from "nitro/types";
|
|
6
3
|
import { NitroPluginConfig, ServiceConfig } from "nitro/vite";
|
|
4
|
+
import { UserConfig } from "powerlines/types/config";
|
|
5
|
+
import { PluginContext } from "powerlines/types/context";
|
|
6
|
+
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
7
7
|
|
|
8
8
|
//#region src/types/plugin.d.ts
|
|
9
9
|
interface NitroPluginOptions extends Omit<NitroConfig, "root" | "compatibilityDate" | "logLevel" | "sourcemap" | "minify"> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-nitro",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.125",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for creating a server application that runs on Nitro.",
|
|
6
6
|
"repository": {
|
|
@@ -63,12 +63,12 @@
|
|
|
63
63
|
"powerlines": "^0.38.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
66
|
+
"@powerlines/plugin-plugin": "^0.12.184",
|
|
67
67
|
"@types/node": "^24.10.9"
|
|
68
68
|
},
|
|
69
69
|
"publishConfig": { "access": "public" },
|
|
70
70
|
"main": "./dist/index.cjs",
|
|
71
71
|
"module": "./dist/index.mjs",
|
|
72
72
|
"types": "./dist/index.d.cts",
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "8a8bee34b0195608f4e45380ea3bcf33b9da18d7"
|
|
74
74
|
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { SelectHooksOptions } from "../../types/context.cjs";
|
|
2
|
-
import { MaybePromise } from "@stryke/types/base";
|
|
3
|
-
|
|
4
|
-
//#region ../powerlines/src/internal/helpers/hooks.d.ts
|
|
5
|
-
type CallHookOptions = SelectHooksOptions & (({
|
|
6
|
-
/**
|
|
7
|
-
* Whether to call the hooks sequentially or in parallel.
|
|
8
|
-
*
|
|
9
|
-
* @defaultValue true
|
|
10
|
-
*/
|
|
11
|
-
sequential?: true;
|
|
12
|
-
} & ({
|
|
13
|
-
/**
|
|
14
|
-
* How to handle multiple return values from hooks.
|
|
15
|
-
* - "merge": Merge all non-undefined return values (if they are objects).
|
|
16
|
-
* - "first": Return the first non-undefined value.
|
|
17
|
-
*
|
|
18
|
-
* @remarks
|
|
19
|
-
* Merging only works if the return values are objects.
|
|
20
|
-
*
|
|
21
|
-
* @defaultValue "merge"
|
|
22
|
-
*/
|
|
23
|
-
result: "first";
|
|
24
|
-
} | {
|
|
25
|
-
/**
|
|
26
|
-
* How to handle multiple return values from hooks.
|
|
27
|
-
* - "merge": Merge all non-undefined return values (if they are objects).
|
|
28
|
-
* - "first": Return the first non-undefined value.
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
* Merging only works if the return values are objects.
|
|
32
|
-
*
|
|
33
|
-
* @defaultValue "merge"
|
|
34
|
-
*/
|
|
35
|
-
result?: "merge" | "last";
|
|
36
|
-
/**
|
|
37
|
-
* An indicator specifying if the results of the previous hook should be provided as the **first** parameter of the next hook function, or a function to process the result of the previous hook function and pass the returned value as the next hook's **first** parameter
|
|
38
|
-
*/
|
|
39
|
-
asNextParam?: false | ((previousResult: any) => MaybePromise<any>);
|
|
40
|
-
})) | {
|
|
41
|
-
/**
|
|
42
|
-
* Whether to call the hooks sequentially or in parallel.
|
|
43
|
-
*/
|
|
44
|
-
sequential: false;
|
|
45
|
-
});
|
|
46
|
-
//#endregion
|
|
47
|
-
export { CallHookOptions };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { SelectHooksOptions } from "../../types/context.mjs";
|
|
2
|
-
import { MaybePromise } from "@stryke/types/base";
|
|
3
|
-
|
|
4
|
-
//#region ../powerlines/src/internal/helpers/hooks.d.ts
|
|
5
|
-
type CallHookOptions = SelectHooksOptions & (({
|
|
6
|
-
/**
|
|
7
|
-
* Whether to call the hooks sequentially or in parallel.
|
|
8
|
-
*
|
|
9
|
-
* @defaultValue true
|
|
10
|
-
*/
|
|
11
|
-
sequential?: true;
|
|
12
|
-
} & ({
|
|
13
|
-
/**
|
|
14
|
-
* How to handle multiple return values from hooks.
|
|
15
|
-
* - "merge": Merge all non-undefined return values (if they are objects).
|
|
16
|
-
* - "first": Return the first non-undefined value.
|
|
17
|
-
*
|
|
18
|
-
* @remarks
|
|
19
|
-
* Merging only works if the return values are objects.
|
|
20
|
-
*
|
|
21
|
-
* @defaultValue "merge"
|
|
22
|
-
*/
|
|
23
|
-
result: "first";
|
|
24
|
-
} | {
|
|
25
|
-
/**
|
|
26
|
-
* How to handle multiple return values from hooks.
|
|
27
|
-
* - "merge": Merge all non-undefined return values (if they are objects).
|
|
28
|
-
* - "first": Return the first non-undefined value.
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
* Merging only works if the return values are objects.
|
|
32
|
-
*
|
|
33
|
-
* @defaultValue "merge"
|
|
34
|
-
*/
|
|
35
|
-
result?: "merge" | "last";
|
|
36
|
-
/**
|
|
37
|
-
* An indicator specifying if the results of the previous hook should be provided as the **first** parameter of the next hook function, or a function to process the result of the previous hook function and pass the returned value as the next hook's **first** parameter
|
|
38
|
-
*/
|
|
39
|
-
asNextParam?: false | ((previousResult: any) => MaybePromise<any>);
|
|
40
|
-
})) | {
|
|
41
|
-
/**
|
|
42
|
-
* Whether to call the hooks sequentially or in parallel.
|
|
43
|
-
*/
|
|
44
|
-
sequential: false;
|
|
45
|
-
});
|
|
46
|
-
//#endregion
|
|
47
|
-
export { CallHookOptions };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let __stryke_path_join = require("@stryke/path/join");
|
|
3
|
-
let node_fs = require("node:fs");
|
|
4
|
-
|
|
5
|
-
//#region ../powerlines/src/plugin-utils/get-config-path.ts
|
|
6
|
-
/**
|
|
7
|
-
* Get the configuration file path for a given name.
|
|
8
|
-
*
|
|
9
|
-
* @param context - The Powerlines context.
|
|
10
|
-
* @param name - The name of the configuration file (without extension).
|
|
11
|
-
* @returns The absolute path to the configuration file, or undefined if not found.
|
|
12
|
-
*/
|
|
13
|
-
function getConfigPath(context, name) {
|
|
14
|
-
if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yml`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yml`);
|
|
15
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yaml`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yaml`);
|
|
16
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.json`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.json`);
|
|
17
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.jsonc`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.jsonc`);
|
|
18
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.ts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.ts`);
|
|
19
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cts`);
|
|
20
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mts`);
|
|
21
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.js`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.js`);
|
|
22
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cjs`);
|
|
23
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mjs`);
|
|
24
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.ts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.ts`);
|
|
25
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cts`);
|
|
26
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mts`);
|
|
27
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.js`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.js`);
|
|
28
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cjs`);
|
|
29
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mjs`);
|
|
30
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.yml`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.yml`);
|
|
31
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.yaml`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.yaml`);
|
|
32
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.json`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.json`);
|
|
33
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.jsonc`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.jsonc`);
|
|
34
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.ts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.ts`);
|
|
35
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.cts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.cts`);
|
|
36
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.mts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.mts`);
|
|
37
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.js`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.js`);
|
|
38
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.cjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.cjs`);
|
|
39
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.mjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.mjs`);
|
|
40
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.ts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.ts`);
|
|
41
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.cts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.cts`);
|
|
42
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.mts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.mts`);
|
|
43
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.js`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.js`);
|
|
44
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.cjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.cjs`);
|
|
45
|
-
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.mjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.mjs`);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
//#endregion
|
|
49
|
-
exports.getConfigPath = getConfigPath;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { joinPaths } from "@stryke/path/join";
|
|
2
|
-
import { existsSync } from "node:fs";
|
|
3
|
-
|
|
4
|
-
//#region ../powerlines/src/plugin-utils/get-config-path.ts
|
|
5
|
-
/**
|
|
6
|
-
* Get the configuration file path for a given name.
|
|
7
|
-
*
|
|
8
|
-
* @param context - The Powerlines context.
|
|
9
|
-
* @param name - The name of the configuration file (without extension).
|
|
10
|
-
* @returns The absolute path to the configuration file, or undefined if not found.
|
|
11
|
-
*/
|
|
12
|
-
function getConfigPath(context, name) {
|
|
13
|
-
if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yml`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yml`);
|
|
14
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yaml`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yaml`);
|
|
15
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.json`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.json`);
|
|
16
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.jsonc`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.jsonc`);
|
|
17
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.ts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.ts`);
|
|
18
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cts`);
|
|
19
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mts`);
|
|
20
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.js`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.js`);
|
|
21
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cjs`);
|
|
22
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mjs`);
|
|
23
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.ts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.ts`);
|
|
24
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cts`);
|
|
25
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mts`);
|
|
26
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.js`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.js`);
|
|
27
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cjs`);
|
|
28
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mjs`);
|
|
29
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.yml`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.yml`);
|
|
30
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.yaml`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.yaml`);
|
|
31
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.json`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.json`);
|
|
32
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.jsonc`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.jsonc`);
|
|
33
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.ts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.ts`);
|
|
34
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.cts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.cts`);
|
|
35
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.mts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.mts`);
|
|
36
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.js`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.js`);
|
|
37
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.cjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.cjs`);
|
|
38
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.mjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.mjs`);
|
|
39
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.ts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.ts`);
|
|
40
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.cts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.cts`);
|
|
41
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.mts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.mts`);
|
|
42
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.js`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.js`);
|
|
43
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.cjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.cjs`);
|
|
44
|
-
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.mjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.mjs`);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
//#endregion
|
|
48
|
-
export { getConfigPath };
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, LintInlineConfig, NewInlineConfig, PrepareInlineConfig } from "./config.cjs";
|
|
2
|
-
import { InferHookParameters, InferHookReturnType } from "./hooks.cjs";
|
|
3
|
-
import { ResolvedConfig } from "./resolved.cjs";
|
|
4
|
-
import { APIContext, EnvironmentContext, PluginContext } from "./context.cjs";
|
|
5
|
-
import { CallHookOptions } from "../internal/helpers/hooks.cjs";
|
|
6
|
-
|
|
7
|
-
//#region ../powerlines/src/types/api.d.ts
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Powerlines API Interface
|
|
11
|
-
*/
|
|
12
|
-
interface API<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
|
|
13
|
-
/**
|
|
14
|
-
* The Powerlines shared API context
|
|
15
|
-
*/
|
|
16
|
-
context: APIContext<TResolvedConfig>;
|
|
17
|
-
/**
|
|
18
|
-
* Prepare the Powerlines API
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* This method will prepare the Powerlines API for use, initializing any necessary resources.
|
|
22
|
-
*
|
|
23
|
-
* @param inlineConfig - The inline configuration for the prepare command
|
|
24
|
-
*/
|
|
25
|
-
prepare: (inlineConfig: PrepareInlineConfig | NewInlineConfig | CleanInlineConfig | BuildInlineConfig | LintInlineConfig | DocsInlineConfig | DeployInlineConfig) => Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Create a new Powerlines project
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* This method will create a new Powerlines project in the current directory.
|
|
31
|
-
*
|
|
32
|
-
* @param inlineConfig - The inline configuration for the new command
|
|
33
|
-
* @returns A promise that resolves when the project has been created
|
|
34
|
-
*/
|
|
35
|
-
new: (inlineConfig: NewInlineConfig) => Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Clean any previously prepared artifacts
|
|
38
|
-
*
|
|
39
|
-
* @remarks
|
|
40
|
-
* This method will remove the previous Powerlines artifacts from the project.
|
|
41
|
-
*
|
|
42
|
-
* @param inlineConfig - The inline configuration for the clean command
|
|
43
|
-
* @returns A promise that resolves when the clean command has completed
|
|
44
|
-
*/
|
|
45
|
-
clean: (inlineConfig: CleanInlineConfig | PrepareInlineConfig) => Promise<void>;
|
|
46
|
-
/**
|
|
47
|
-
* Lint the project source code
|
|
48
|
-
*
|
|
49
|
-
* @param inlineConfig - The inline configuration for the lint command
|
|
50
|
-
* @returns A promise that resolves when the lint command has completed
|
|
51
|
-
*/
|
|
52
|
-
lint: (inlineConfig: LintInlineConfig) => Promise<void>;
|
|
53
|
-
/**
|
|
54
|
-
* Build the project
|
|
55
|
-
*
|
|
56
|
-
* @remarks
|
|
57
|
-
* This method will build the Powerlines project, generating the necessary artifacts.
|
|
58
|
-
*
|
|
59
|
-
* @param inlineConfig - The inline configuration for the build command
|
|
60
|
-
* @returns A promise that resolves when the build command has completed
|
|
61
|
-
*/
|
|
62
|
-
build: (inlineConfig: BuildInlineConfig) => Promise<void>;
|
|
63
|
-
/**
|
|
64
|
-
* Prepare the documentation for the project
|
|
65
|
-
*
|
|
66
|
-
* @param inlineConfig - The inline configuration for the docs command
|
|
67
|
-
* @returns A promise that resolves when the documentation generation has completed
|
|
68
|
-
*/
|
|
69
|
-
docs: (inlineConfig: DocsInlineConfig) => Promise<void>;
|
|
70
|
-
/**
|
|
71
|
-
* Deploy the project source code
|
|
72
|
-
*
|
|
73
|
-
* @remarks
|
|
74
|
-
* This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.
|
|
75
|
-
*
|
|
76
|
-
* @param inlineConfig - The inline configuration for the deploy command
|
|
77
|
-
*/
|
|
78
|
-
deploy: (inlineConfig: DeployInlineConfig) => Promise<void>;
|
|
79
|
-
/**
|
|
80
|
-
* Finalization process
|
|
81
|
-
*
|
|
82
|
-
* @remarks
|
|
83
|
-
* This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.
|
|
84
|
-
*
|
|
85
|
-
* @returns A promise that resolves when the finalization process has completed
|
|
86
|
-
*/
|
|
87
|
-
finalize: () => Promise<void>;
|
|
88
|
-
/**
|
|
89
|
-
* Invokes the configured plugin hooks
|
|
90
|
-
*
|
|
91
|
-
* @remarks
|
|
92
|
-
* By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
|
|
93
|
-
*
|
|
94
|
-
* @param hook - The hook to call
|
|
95
|
-
* @param options - The options to provide to the hook
|
|
96
|
-
* @param args - The arguments to pass to the hook
|
|
97
|
-
* @returns The result of the hook call
|
|
98
|
-
*/
|
|
99
|
-
callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
|
|
100
|
-
environment?: string | EnvironmentContext<TResolvedConfig>;
|
|
101
|
-
}, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
|
|
102
|
-
}
|
|
103
|
-
//#endregion
|
|
104
|
-
export { API };
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, LintInlineConfig, NewInlineConfig, PrepareInlineConfig } from "./config.mjs";
|
|
2
|
-
import { InferHookParameters, InferHookReturnType } from "./hooks.mjs";
|
|
3
|
-
import { ResolvedConfig } from "./resolved.mjs";
|
|
4
|
-
import { APIContext, EnvironmentContext, PluginContext } from "./context.mjs";
|
|
5
|
-
import { CallHookOptions } from "../internal/helpers/hooks.mjs";
|
|
6
|
-
|
|
7
|
-
//#region ../powerlines/src/types/api.d.ts
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Powerlines API Interface
|
|
11
|
-
*/
|
|
12
|
-
interface API<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
|
|
13
|
-
/**
|
|
14
|
-
* The Powerlines shared API context
|
|
15
|
-
*/
|
|
16
|
-
context: APIContext<TResolvedConfig>;
|
|
17
|
-
/**
|
|
18
|
-
* Prepare the Powerlines API
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* This method will prepare the Powerlines API for use, initializing any necessary resources.
|
|
22
|
-
*
|
|
23
|
-
* @param inlineConfig - The inline configuration for the prepare command
|
|
24
|
-
*/
|
|
25
|
-
prepare: (inlineConfig: PrepareInlineConfig | NewInlineConfig | CleanInlineConfig | BuildInlineConfig | LintInlineConfig | DocsInlineConfig | DeployInlineConfig) => Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Create a new Powerlines project
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* This method will create a new Powerlines project in the current directory.
|
|
31
|
-
*
|
|
32
|
-
* @param inlineConfig - The inline configuration for the new command
|
|
33
|
-
* @returns A promise that resolves when the project has been created
|
|
34
|
-
*/
|
|
35
|
-
new: (inlineConfig: NewInlineConfig) => Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Clean any previously prepared artifacts
|
|
38
|
-
*
|
|
39
|
-
* @remarks
|
|
40
|
-
* This method will remove the previous Powerlines artifacts from the project.
|
|
41
|
-
*
|
|
42
|
-
* @param inlineConfig - The inline configuration for the clean command
|
|
43
|
-
* @returns A promise that resolves when the clean command has completed
|
|
44
|
-
*/
|
|
45
|
-
clean: (inlineConfig: CleanInlineConfig | PrepareInlineConfig) => Promise<void>;
|
|
46
|
-
/**
|
|
47
|
-
* Lint the project source code
|
|
48
|
-
*
|
|
49
|
-
* @param inlineConfig - The inline configuration for the lint command
|
|
50
|
-
* @returns A promise that resolves when the lint command has completed
|
|
51
|
-
*/
|
|
52
|
-
lint: (inlineConfig: LintInlineConfig) => Promise<void>;
|
|
53
|
-
/**
|
|
54
|
-
* Build the project
|
|
55
|
-
*
|
|
56
|
-
* @remarks
|
|
57
|
-
* This method will build the Powerlines project, generating the necessary artifacts.
|
|
58
|
-
*
|
|
59
|
-
* @param inlineConfig - The inline configuration for the build command
|
|
60
|
-
* @returns A promise that resolves when the build command has completed
|
|
61
|
-
*/
|
|
62
|
-
build: (inlineConfig: BuildInlineConfig) => Promise<void>;
|
|
63
|
-
/**
|
|
64
|
-
* Prepare the documentation for the project
|
|
65
|
-
*
|
|
66
|
-
* @param inlineConfig - The inline configuration for the docs command
|
|
67
|
-
* @returns A promise that resolves when the documentation generation has completed
|
|
68
|
-
*/
|
|
69
|
-
docs: (inlineConfig: DocsInlineConfig) => Promise<void>;
|
|
70
|
-
/**
|
|
71
|
-
* Deploy the project source code
|
|
72
|
-
*
|
|
73
|
-
* @remarks
|
|
74
|
-
* This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.
|
|
75
|
-
*
|
|
76
|
-
* @param inlineConfig - The inline configuration for the deploy command
|
|
77
|
-
*/
|
|
78
|
-
deploy: (inlineConfig: DeployInlineConfig) => Promise<void>;
|
|
79
|
-
/**
|
|
80
|
-
* Finalization process
|
|
81
|
-
*
|
|
82
|
-
* @remarks
|
|
83
|
-
* This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.
|
|
84
|
-
*
|
|
85
|
-
* @returns A promise that resolves when the finalization process has completed
|
|
86
|
-
*/
|
|
87
|
-
finalize: () => Promise<void>;
|
|
88
|
-
/**
|
|
89
|
-
* Invokes the configured plugin hooks
|
|
90
|
-
*
|
|
91
|
-
* @remarks
|
|
92
|
-
* By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
|
|
93
|
-
*
|
|
94
|
-
* @param hook - The hook to call
|
|
95
|
-
* @param options - The options to provide to the hook
|
|
96
|
-
* @param args - The arguments to pass to the hook
|
|
97
|
-
* @returns The result of the hook call
|
|
98
|
-
*/
|
|
99
|
-
callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
|
|
100
|
-
environment?: string | EnvironmentContext<TResolvedConfig>;
|
|
101
|
-
}, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
|
|
102
|
-
}
|
|
103
|
-
//#endregion
|
|
104
|
-
export { API };
|