@powerlines/plugin-graphql 0.1.129 → 0.1.131

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 (24) hide show
  1. package/dist/index.cjs +7 -7
  2. package/dist/index.d.mts +1 -1
  3. package/dist/index.mjs +3 -3
  4. package/dist/node_modules/.pnpm/@storm-software_config-tools@1.188.75_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.cjs +16 -0
  5. package/dist/node_modules/.pnpm/@storm-software_config-tools@1.188.75_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.mjs +15 -0
  6. package/dist/{powerlines → packages/powerlines}/src/internal/helpers/hooks.d.mts +0 -2
  7. package/dist/{powerlines → packages/powerlines}/src/types/commands.d.mts +0 -1
  8. package/dist/{powerlines → packages/powerlines}/src/types/config.d.mts +2 -2
  9. package/dist/{powerlines → packages/powerlines}/src/types/unplugin.d.mts +0 -1
  10. package/dist/types/plugin.d.mts +3 -3
  11. package/package.json +4 -5
  12. package/dist/powerlines/src/plugin-utils/get-config-path.cjs +0 -49
  13. package/dist/powerlines/src/plugin-utils/get-config-path.mjs +0 -48
  14. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -36
  15. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -35
  16. package/dist/powerlines/src/types/babel.d.mts +0 -2
  17. /package/dist/{powerlines → packages/powerlines}/src/types/api.d.mts +0 -0
  18. /package/dist/{powerlines → packages/powerlines}/src/types/build.d.mts +0 -0
  19. /package/dist/{powerlines → packages/powerlines}/src/types/context.d.mts +0 -0
  20. /package/dist/{powerlines → packages/powerlines}/src/types/fs.d.mts +0 -0
  21. /package/dist/{powerlines → packages/powerlines}/src/types/hooks.d.mts +0 -0
  22. /package/dist/{powerlines → packages/powerlines}/src/types/plugin.d.mts +0 -0
  23. /package/dist/{powerlines → packages/powerlines}/src/types/resolved.d.mts +0 -0
  24. /package/dist/{powerlines → packages/powerlines}/src/types/tsconfig.d.mts +0 -0
package/dist/index.cjs CHANGED
@@ -1,15 +1,15 @@
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');
3
+ const require_chunk_POXTJ6GF = require('./node_modules/.pnpm/@storm-software_config-tools@1.188.75_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.cjs');
5
4
  let __graphql_codegen_cli = require("@graphql-codegen/cli");
6
- 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");
8
6
  let __stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
9
7
  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,23 +24,23 @@ 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
  }
33
33
  return { graphql: (0, defu.default)(options, {
34
34
  configFile,
35
35
  silent: this.config.logLevel === null,
36
- verbose: this.config.logLevel === __storm_software_config_tools_types.LogLevelLabel.DEBUG || this.config.logLevel === __storm_software_config_tools_types.LogLevelLabel.TRACE,
36
+ verbose: this.config.logLevel === require_chunk_POXTJ6GF.LogLevelLabel.DEBUG || this.config.logLevel === require_chunk_POXTJ6GF.LogLevelLabel.TRACE,
37
37
  debug: this.config.mode === "development",
38
38
  outputPath: (0, __stryke_path_join_paths.joinPaths)("{builtinPath}", "graphql")
39
39
  }) };
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.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Plugin } from "./powerlines/src/types/plugin.mjs";
1
+ import { Plugin } from "./packages/powerlines/src/types/plugin.mjs";
2
2
  import { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig, __ΩGraphQLPluginContext, __ΩGraphQLPluginOptions, __ΩGraphQLPluginResolvedConfig, __ΩGraphQLPluginUserConfig } from "./types/plugin.mjs";
3
3
  import "./types/index.mjs";
4
4
 
package/dist/index.mjs CHANGED
@@ -1,12 +1,12 @@
1
- import { getConfigPath } from "./powerlines/src/plugin-utils/get-config-path.mjs";
2
- import { replacePathTokens } from "./powerlines/src/plugin-utils/paths.mjs";
1
+ import { LogLevelLabel } from "./node_modules/.pnpm/@storm-software_config-tools@1.188.75_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.mjs";
3
2
  import { generate, loadContext, updateContextWithCliFlags } from "@graphql-codegen/cli";
4
- import { LogLevelLabel } from "@storm-software/config-tools/types";
5
3
  import { findFileName } from "@stryke/path/file-path-fns";
6
4
  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
  /**
@@ -0,0 +1,16 @@
1
+
2
+ //#region ../../node_modules/.pnpm/@storm-software+config-tools@1.188.75_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.js
3
+ var LogLevelLabel = {
4
+ SILENT: "silent",
5
+ FATAL: "fatal",
6
+ ERROR: "error",
7
+ WARN: "warn",
8
+ SUCCESS: "success",
9
+ INFO: "info",
10
+ DEBUG: "debug",
11
+ TRACE: "trace",
12
+ ALL: "all"
13
+ };
14
+
15
+ //#endregion
16
+ exports.LogLevelLabel = LogLevelLabel;
@@ -0,0 +1,15 @@
1
+ //#region ../../node_modules/.pnpm/@storm-software+config-tools@1.188.75_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.js
2
+ var LogLevelLabel = {
3
+ SILENT: "silent",
4
+ FATAL: "fatal",
5
+ ERROR: "error",
6
+ WARN: "warn",
7
+ SUCCESS: "success",
8
+ INFO: "info",
9
+ DEBUG: "debug",
10
+ TRACE: "trace",
11
+ ALL: "all"
12
+ };
13
+
14
+ //#endregion
15
+ export { LogLevelLabel };
@@ -1,5 +1,3 @@
1
- import "../../types/hooks.mjs";
2
- import "../../types/resolved.mjs";
3
1
  import { SelectHooksOptions } from "../../types/context.mjs";
4
2
  import { MaybePromise } from "@stryke/types/base";
5
3
 
@@ -1,4 +1,3 @@
1
- import "./context.mjs";
2
1
  import { ArrayValues } from "@stryke/types/array";
3
2
  import { MaybePromise } from "@stryke/types/base";
4
3
 
@@ -1,19 +1,19 @@
1
1
  import { BuildConfig, BuildResolvedConfig, ESBuildBuildConfig, ESBuildResolvedBuildConfig, FarmBuildConfig, FarmResolvedBuildConfig, RolldownBuildConfig, RolldownResolvedBuildConfig, RollupBuildConfig, RollupResolvedBuildConfig, RspackBuildConfig, RspackResolvedBuildConfig, TsdownBuildConfig, TsdownResolvedBuildConfig, TsupBuildConfig, TsupResolvedBuildConfig, UnbuildBuildConfig, UnbuildResolvedBuildConfig, ViteBuildConfig, ViteResolvedBuildConfig, WebpackBuildConfig, WebpackResolvedBuildConfig } from "./build.mjs";
2
- import "./babel.mjs";
3
2
  import { StoragePort, StoragePreset } from "./fs.mjs";
4
3
  import { TSConfig } from "./tsconfig.mjs";
5
4
  import { PluginContext } from "./context.mjs";
6
5
  import { Plugin } from "./plugin.mjs";
7
- import { LogLevelLabel } from "@storm-software/config-tools/types";
8
6
  import { MaybePromise } from "@stryke/types/base";
9
7
  import { PreviewOptions } from "vite";
10
8
  import { Format } from "@storm-software/build-tools/types";
9
+ import { LogLevelLabel } from "@storm-software/config-tools/types";
11
10
  import { StormWorkspaceConfig } from "@storm-software/config/types";
12
11
  import { TypeDefinitionParameter } from "@stryke/types/configuration";
13
12
  import { AssetGlob } from "@stryke/types/file";
14
13
  import { DateString } from "compatx";
15
14
 
16
15
  //#region ../powerlines/src/types/config.d.ts
16
+
17
17
  type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
18
18
  /**
19
19
  * The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
@@ -1,5 +1,4 @@
1
1
  import { BuilderVariant, InferUnpluginVariant, UnpluginBuilderVariant } from "./build.mjs";
2
- import "./config.mjs";
3
2
  import { InferResolvedConfig } from "./resolved.mjs";
4
3
  import { Context } from "./context.mjs";
5
4
  import { API } from "./api.mjs";
@@ -1,6 +1,6 @@
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";
1
+ import { UserConfig } from "../packages/powerlines/src/types/config.mjs";
2
+ import { ResolvedConfig } from "../packages/powerlines/src/types/resolved.mjs";
3
+ import { PluginContext } from "../packages/powerlines/src/types/context.mjs";
4
4
  import { CodegenContext, YamlCliFlags } from "@graphql-codegen/cli";
5
5
 
6
6
  //#region src/types/plugin.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-graphql",
3
- "version": "0.1.129",
3
+ "version": "0.1.131",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code from GraphQL schemas.",
6
6
  "repository": {
@@ -123,14 +123,13 @@
123
123
  "@stryke/types": "^0.10.29",
124
124
  "defu": "^6.1.4",
125
125
  "jiti": "^2.6.1",
126
- "powerlines": "^0.37.2"
126
+ "powerlines": "^0.37.4"
127
127
  },
128
128
  "devDependencies": {
129
129
  "@graphql-codegen/plugin-helpers": "^6.1.0",
130
- "@powerlines/nx": "^0.11.58",
131
- "@powerlines/plugin-plugin": "^0.12.80",
130
+ "@powerlines/plugin-plugin": "^0.12.82",
132
131
  "@types/node": "^24.10.4"
133
132
  },
134
133
  "publishConfig": { "access": "public" },
135
- "gitHead": "5a9bfc9333eca98a453682f39a04a0d642930a50"
134
+ "gitHead": "48a35579bd5535a267a420c160c273899920b2e7"
136
135
  }
@@ -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,2 +0,0 @@
1
- import "./config.mjs";
2
- import "./context.mjs";