@powerlines/plugin-graphql 0.1.224 → 0.1.226

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.
Files changed (36) hide show
  1. package/dist/index.cjs +5 -5
  2. package/dist/index.d.cts +2 -1
  3. package/dist/index.d.mts +1 -1
  4. package/dist/index.mjs +2 -2
  5. package/dist/types/plugin.d.cts +3 -3
  6. package/dist/types/plugin.d.mts +3 -3
  7. package/package.json +4 -4
  8. package/dist/powerlines/src/internal/helpers/hooks.d.cts +0 -47
  9. package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -49
  10. package/dist/powerlines/src/plugin-utils/get-config-path.cjs +0 -49
  11. package/dist/powerlines/src/plugin-utils/get-config-path.mjs +0 -48
  12. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -36
  13. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -35
  14. package/dist/powerlines/src/types/api.d.cts +0 -104
  15. package/dist/powerlines/src/types/api.d.mts +0 -104
  16. package/dist/powerlines/src/types/babel.d.mts +0 -2
  17. package/dist/powerlines/src/types/build.d.cts +0 -185
  18. package/dist/powerlines/src/types/build.d.mts +0 -185
  19. package/dist/powerlines/src/types/commands.d.cts +0 -8
  20. package/dist/powerlines/src/types/commands.d.mts +0 -9
  21. package/dist/powerlines/src/types/config.d.cts +0 -424
  22. package/dist/powerlines/src/types/config.d.mts +0 -424
  23. package/dist/powerlines/src/types/context.d.cts +0 -514
  24. package/dist/powerlines/src/types/context.d.mts +0 -514
  25. package/dist/powerlines/src/types/fs.d.cts +0 -486
  26. package/dist/powerlines/src/types/fs.d.mts +0 -486
  27. package/dist/powerlines/src/types/hooks.d.cts +0 -32
  28. package/dist/powerlines/src/types/hooks.d.mts +0 -32
  29. package/dist/powerlines/src/types/plugin.d.cts +0 -205
  30. package/dist/powerlines/src/types/plugin.d.mts +0 -205
  31. package/dist/powerlines/src/types/resolved.d.cts +0 -93
  32. package/dist/powerlines/src/types/resolved.d.mts +0 -93
  33. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  34. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
  35. package/dist/powerlines/src/types/unplugin.d.cts +0 -22
  36. package/dist/powerlines/src/types/unplugin.d.mts +0 -23
package/dist/index.cjs CHANGED
@@ -1,7 +1,5 @@
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
- const require_paths = require('./powerlines/src/plugin-utils/paths.cjs');
5
3
  let __graphql_codegen_cli = require("@graphql-codegen/cli");
6
4
  let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
7
5
  let __stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
@@ -10,6 +8,8 @@ let __stryke_path_join_paths = require("@stryke/path/join-paths");
10
8
  let __stryke_path_replace = require("@stryke/path/replace");
11
9
  let defu = require("defu");
12
10
  defu = require_rolldown_runtime.__toESM(defu);
11
+ let powerlines_plugin_utils_get_config_path = require("powerlines/plugin-utils/get-config-path");
12
+ let powerlines_plugin_utils_paths = require("powerlines/plugin-utils/paths");
13
13
 
14
14
  //#region src/index.ts
15
15
  /**
@@ -24,9 +24,9 @@ const plugin = (options = {}) => {
24
24
  config() {
25
25
  let configFile = options.configFile;
26
26
  if (!configFile) {
27
- configFile = require_get_config_path.getConfigPath(this, "codegen");
27
+ configFile = (0, powerlines_plugin_utils_get_config_path.getConfigPath)(this, "codegen");
28
28
  if (!configFile) {
29
- configFile = require_get_config_path.getConfigPath(this, "graphql-codegen");
29
+ configFile = (0, powerlines_plugin_utils_get_config_path.getConfigPath)(this, "graphql-codegen");
30
30
  if (!configFile) throw new Error(`No GraphQL Codegen configuration file found. Please specify a valid config file path in the Biome plugin's \`configFile\` options.`);
31
31
  }
32
32
  }
@@ -40,7 +40,7 @@ const plugin = (options = {}) => {
40
40
  },
41
41
  async configResolved() {
42
42
  this.dependencies.graphql = "latest";
43
- this.config.graphql.outputPath = require_paths.replacePathTokens(this, this.config.graphql.outputPath);
43
+ this.config.graphql.outputPath = (0, powerlines_plugin_utils_paths.replacePathTokens)(this, this.config.graphql.outputPath);
44
44
  this.graphql ??= {};
45
45
  this.graphql.codegen = await (0, __graphql_codegen_cli.loadContext)(this.config.graphql.configFile);
46
46
  (0, __graphql_codegen_cli.updateContextWithCliFlags)(this.graphql.codegen, {
package/dist/index.d.cts CHANGED
@@ -1,5 +1,6 @@
1
- import { Plugin } from "./powerlines/src/types/plugin.cjs";
2
1
  import { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig, __ΩGraphQLPluginContext, __ΩGraphQLPluginOptions, __ΩGraphQLPluginResolvedConfig, __ΩGraphQLPluginUserConfig } 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 { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig, __ΩGraphQLPluginContext, __ΩGraphQLPluginOptions, __ΩGraphQLPluginResolvedConfig, __ΩGraphQLPluginUserConfig } 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,5 +1,3 @@
1
- import { getConfigPath } from "./powerlines/src/plugin-utils/get-config-path.mjs";
2
- import { replacePathTokens } from "./powerlines/src/plugin-utils/paths.mjs";
3
1
  import { generate, loadContext, updateContextWithCliFlags } from "@graphql-codegen/cli";
4
2
  import { LogLevelLabel } from "@storm-software/config-tools/types";
5
3
  import { findFileName } from "@stryke/path/file-path-fns";
@@ -7,6 +5,8 @@ import { isParentPath } from "@stryke/path/is-parent-path";
7
5
  import { joinPaths } from "@stryke/path/join-paths";
8
6
  import { replacePath } from "@stryke/path/replace";
9
7
  import defu from "defu";
8
+ import { getConfigPath } from "powerlines/plugin-utils/get-config-path";
9
+ import { replacePathTokens } from "powerlines/plugin-utils/paths";
10
10
 
11
11
  //#region src/index.ts
12
12
  /**
@@ -1,7 +1,7 @@
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 { CodegenContext, YamlCliFlags } from "@graphql-codegen/cli";
2
+ import { UserConfig } from "powerlines/types/config";
3
+ import { PluginContext } from "powerlines/types/context";
4
+ import { ResolvedConfig } from "powerlines/types/resolved";
5
5
 
6
6
  //#region src/types/plugin.d.ts
7
7
  type GraphQLPluginOptions = Partial<Omit<YamlCliFlags, "config" | "watch">> & {
@@ -1,7 +1,7 @@
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 { CodegenContext, YamlCliFlags } from "@graphql-codegen/cli";
2
+ import { UserConfig } from "powerlines/types/config";
3
+ import { PluginContext } from "powerlines/types/context";
4
+ import { ResolvedConfig } from "powerlines/types/resolved";
5
5
 
6
6
  //#region src/types/plugin.d.ts
7
7
  type GraphQLPluginOptions = Partial<Omit<YamlCliFlags, "config" | "watch">> & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-graphql",
3
- "version": "0.1.224",
3
+ "version": "0.1.226",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code from GraphQL schemas.",
6
6
  "repository": {
@@ -123,13 +123,13 @@
123
123
  "@stryke/types": "^0.10.34",
124
124
  "defu": "^6.1.4",
125
125
  "jiti": "^2.6.1",
126
- "powerlines": "^0.37.95"
126
+ "powerlines": "^0.37.96"
127
127
  },
128
128
  "devDependencies": {
129
129
  "@graphql-codegen/plugin-helpers": "^6.1.0",
130
- "@powerlines/plugin-plugin": "^0.12.174",
130
+ "@powerlines/plugin-plugin": "^0.12.176",
131
131
  "@types/node": "^24.10.9"
132
132
  },
133
133
  "publishConfig": { "access": "public" },
134
- "gitHead": "2852dab8ff7cad2d1aa4a44d7fd2479d62f65d47"
134
+ "gitHead": "fff363cfd44dc9985f5fee1062f6527049bd67e5"
135
135
  }
@@ -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,49 +0,0 @@
1
- import "../../types/hooks.mjs";
2
- import "../../types/resolved.mjs";
3
- import { SelectHooksOptions } from "../../types/context.mjs";
4
- import { MaybePromise } from "@stryke/types/base";
5
-
6
- //#region ../powerlines/src/internal/helpers/hooks.d.ts
7
- type CallHookOptions = SelectHooksOptions & (({
8
- /**
9
- * Whether to call the hooks sequentially or in parallel.
10
- *
11
- * @defaultValue true
12
- */
13
- sequential?: true;
14
- } & ({
15
- /**
16
- * How to handle multiple return values from hooks.
17
- * - "merge": Merge all non-undefined return values (if they are objects).
18
- * - "first": Return the first non-undefined value.
19
- *
20
- * @remarks
21
- * Merging only works if the return values are objects.
22
- *
23
- * @defaultValue "merge"
24
- */
25
- result: "first";
26
- } | {
27
- /**
28
- * How to handle multiple return values from hooks.
29
- * - "merge": Merge all non-undefined return values (if they are objects).
30
- * - "first": Return the first non-undefined value.
31
- *
32
- * @remarks
33
- * Merging only works if the return values are objects.
34
- *
35
- * @defaultValue "merge"
36
- */
37
- result?: "merge" | "last";
38
- /**
39
- * 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
40
- */
41
- asNextParam?: false | ((previousResult: any) => MaybePromise<any>);
42
- })) | {
43
- /**
44
- * Whether to call the hooks sequentially or in parallel.
45
- */
46
- sequential: false;
47
- });
48
- //#endregion
49
- 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,36 +0,0 @@
1
- const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
- let __stryke_path_replace = require("@stryke/path/replace");
3
-
4
- //#region ../powerlines/src/plugin-utils/paths.ts
5
- /**
6
- * Replaces tokens in the given path string with their corresponding values from the context.
7
- *
8
- * @remarks
9
- * The following tokens are supported:
10
- * - `{workspaceRoot}` - The root directory of the workspace.
11
- * - `{root}` - The root directory of the project (same as `{projectRoot}`).
12
- * - `{projectRoot}` - The root directory of the project (same as `{root}`).
13
- * - `{sourceRoot}` - The source root directory of the project (usually `./src`).
14
- * - `{powerlinesPath}` - The directory where Powerlines is installed.
15
- * - `{cachePath}` - The environment's directory for cached files.
16
- * - `{dataPath}` - The environment's directory for data files.
17
- * - `{logPath}` - The environment's directory for log files.
18
- * - `{tempPath}` - The environment's directory for temporary files.
19
- * - `{configPath}` - The environment's directory for configuration files.
20
- * - `{outputPath}` - The configured output directory for the project.
21
- * - `{buildPath}` - The configured distribution directory for the project.
22
- * - `{artifactsPath}` - The configured directory for build artifacts.
23
- * - `{builtinPath}` - The configured directory for generated built-in plugins.
24
- * - `{entryPath}` - The configured directory for generated entry files.
25
- *
26
- * @param context - The context containing the values for the path tokens.
27
- * @param path - The path string with tokens to replace.
28
- * @returns The path string with tokens replaced by their corresponding values from the context.
29
- */
30
- function replacePathTokens(context, path) {
31
- if (!path) return path;
32
- return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.projectRoot).replaceAll("{projectRoot}", context.config.projectRoot).replaceAll("{sourceRoot}", context.config.sourceRoot).replaceAll("{powerlinesPath}", context.powerlinesPath).replaceAll("{cachePath}", context.cachePath).replaceAll("{dataPath}", context.dataPath).replaceAll("{logPath}", context.envPaths.log).replaceAll("{tempPath}", context.envPaths.temp).replaceAll("{configPath}", context.envPaths.config).replaceAll("{outputPath}", context.config.output.outputPath).replaceAll("{buildPath}", context.config.output.buildPath).replaceAll("{artifactsPath}", (0, __stryke_path_replace.replacePath)(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", (0, __stryke_path_replace.replacePath)(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", (0, __stryke_path_replace.replacePath)(context.entryPath, context.workspaceConfig.workspaceRoot));
33
- }
34
-
35
- //#endregion
36
- exports.replacePathTokens = replacePathTokens;
@@ -1,35 +0,0 @@
1
- import { replacePath } from "@stryke/path/replace";
2
-
3
- //#region ../powerlines/src/plugin-utils/paths.ts
4
- /**
5
- * Replaces tokens in the given path string with their corresponding values from the context.
6
- *
7
- * @remarks
8
- * The following tokens are supported:
9
- * - `{workspaceRoot}` - The root directory of the workspace.
10
- * - `{root}` - The root directory of the project (same as `{projectRoot}`).
11
- * - `{projectRoot}` - The root directory of the project (same as `{root}`).
12
- * - `{sourceRoot}` - The source root directory of the project (usually `./src`).
13
- * - `{powerlinesPath}` - The directory where Powerlines is installed.
14
- * - `{cachePath}` - The environment's directory for cached files.
15
- * - `{dataPath}` - The environment's directory for data files.
16
- * - `{logPath}` - The environment's directory for log files.
17
- * - `{tempPath}` - The environment's directory for temporary files.
18
- * - `{configPath}` - The environment's directory for configuration files.
19
- * - `{outputPath}` - The configured output directory for the project.
20
- * - `{buildPath}` - The configured distribution directory for the project.
21
- * - `{artifactsPath}` - The configured directory for build artifacts.
22
- * - `{builtinPath}` - The configured directory for generated built-in plugins.
23
- * - `{entryPath}` - The configured directory for generated entry files.
24
- *
25
- * @param context - The context containing the values for the path tokens.
26
- * @param path - The path string with tokens to replace.
27
- * @returns The path string with tokens replaced by their corresponding values from the context.
28
- */
29
- function replacePathTokens(context, path) {
30
- if (!path) return path;
31
- return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.projectRoot).replaceAll("{projectRoot}", context.config.projectRoot).replaceAll("{sourceRoot}", context.config.sourceRoot).replaceAll("{powerlinesPath}", context.powerlinesPath).replaceAll("{cachePath}", context.cachePath).replaceAll("{dataPath}", context.dataPath).replaceAll("{logPath}", context.envPaths.log).replaceAll("{tempPath}", context.envPaths.temp).replaceAll("{configPath}", context.envPaths.config).replaceAll("{outputPath}", context.config.output.outputPath).replaceAll("{buildPath}", context.config.output.buildPath).replaceAll("{artifactsPath}", replacePath(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", replacePath(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", replacePath(context.entryPath, context.workspaceConfig.workspaceRoot));
32
- }
33
-
34
- //#endregion
35
- export { replacePathTokens };
@@ -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 };
@@ -1,2 +0,0 @@
1
- import "./config.mjs";
2
- import "./context.mjs";