powerlines 0.42.11 → 0.42.12

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.
@@ -49,6 +49,7 @@ let _storm_software_config_tools_types = require("@storm-software/config-tools/t
49
49
  let _stryke_env_get_env_paths = require("@stryke/env/get-env-paths");
50
50
  let _stryke_hash = require("@stryke/hash");
51
51
  let _stryke_hash_node = require("@stryke/hash/node");
52
+ let _stryke_helpers_deep_clone = require("@stryke/helpers/deep-clone");
52
53
  let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
53
54
  let _stryke_http_fetch = require("@stryke/http/fetch");
54
55
  let _stryke_path_join = require("@stryke/path/join");
@@ -76,7 +77,7 @@ let unplugin = require("unplugin");
76
77
 
77
78
  //#region package.json
78
79
  var name = "powerlines";
79
- var version = "0.42.10";
80
+ var version = "0.42.11";
80
81
 
81
82
  //#endregion
82
83
  //#region src/_internal/helpers/generate-types.ts
@@ -2013,6 +2014,19 @@ var PowerlinesContext = class PowerlinesContext {
2013
2014
  }).filter(Boolean);
2014
2015
  }
2015
2016
  /**
2017
+ * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
2018
+ *
2019
+ * @remarks
2020
+ * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.
2021
+ *
2022
+ * @returns A promise that resolves to the cloned context.
2023
+ */
2024
+ async clone() {
2025
+ const clone = await PowerlinesContext.from(this.workspaceConfig.workspaceRoot, this.config);
2026
+ await clone.withUserConfig(this.config);
2027
+ return this.copyTo(clone);
2028
+ }
2029
+ /**
2016
2030
  * A function to perform HTTP fetch requests
2017
2031
  *
2018
2032
  * @remarks
@@ -2468,6 +2482,25 @@ var PowerlinesContext = class PowerlinesContext {
2468
2482
  */
2469
2483
  logger;
2470
2484
  /**
2485
+ * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
2486
+ *
2487
+ * @remarks
2488
+ * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.
2489
+ *
2490
+ * @returns The cloned context.
2491
+ */
2492
+ copyTo(context) {
2493
+ context.dependencies = (0, _stryke_helpers_deep_clone.deepClone)(this.dependencies);
2494
+ context.devDependencies = (0, _stryke_helpers_deep_clone.deepClone)(this.devDependencies);
2495
+ context.meta = (0, _stryke_helpers_deep_clone.deepClone)(this.meta);
2496
+ context.persistedMeta = this.persistedMeta ? (0, _stryke_helpers_deep_clone.deepClone)(this.persistedMeta) : void 0;
2497
+ context.packageJson = (0, _stryke_helpers_deep_clone.deepClone)(this.packageJson);
2498
+ context.projectJson = this.projectJson ? (0, _stryke_helpers_deep_clone.deepClone)(this.projectJson) : void 0;
2499
+ context.tsconfig = (0, _stryke_helpers_deep_clone.deepClone)(this.tsconfig);
2500
+ context.$$internal = this.$$internal;
2501
+ return context;
2502
+ }
2503
+ /**
2471
2504
  * Initialize the context with the provided configuration options
2472
2505
  *
2473
2506
  * @param config - The partial user configuration to use for initialization.
@@ -2818,6 +2851,19 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
2818
2851
  get hooks() {
2819
2852
  return this.#hooks;
2820
2853
  }
2854
+ /**
2855
+ * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
2856
+ *
2857
+ * @remarks
2858
+ * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.
2859
+ *
2860
+ * @returns A promise that resolves to the cloned context.
2861
+ */
2862
+ async clone() {
2863
+ const clone = await PowerlinesEnvironmentContext.fromConfig(this.workspaceConfig, this.config);
2864
+ await clone.withUserConfig(this.config);
2865
+ return this.copyTo(clone);
2866
+ }
2821
2867
  async addPlugin(plugin) {
2822
2868
  let resolvedPlugin = plugin;
2823
2869
  if ((0, _stryke_type_checks_is_function.isFunction)(plugin.applyToEnvironment)) {
@@ -2960,6 +3006,18 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
2960
3006
  super(workspaceConfig);
2961
3007
  this.resolvedConfig = config;
2962
3008
  }
3009
+ /**
3010
+ * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
3011
+ *
3012
+ * @remarks
3013
+ * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.
3014
+ *
3015
+ * @returns The cloned context.
3016
+ */
3017
+ copyTo(context) {
3018
+ context.plugins = this.plugins;
3019
+ return this.copyTo(context);
3020
+ }
2963
3021
  };
2964
3022
 
2965
3023
  //#endregion
@@ -3018,6 +3076,19 @@ var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext
3018
3076
  super(workspaceConfig);
3019
3077
  }
3020
3078
  /**
3079
+ * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
3080
+ *
3081
+ * @remarks
3082
+ * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.
3083
+ *
3084
+ * @returns A promise that resolves to the cloned context.
3085
+ */
3086
+ async clone() {
3087
+ const clone = await PowerlinesAPIContext.from(this.workspaceConfig.workspaceRoot, this.config);
3088
+ await clone.withUserConfig(this.config);
3089
+ return this.copyTo(clone);
3090
+ }
3091
+ /**
3021
3092
  * Initialize the context with the provided configuration options
3022
3093
  *
3023
3094
  * @param config - The partial user configuration to use for initialization.
@@ -46,6 +46,7 @@ import { LogLevelLabel } from "@storm-software/config-tools/types";
46
46
  import { getEnvPaths } from "@stryke/env/get-env-paths";
47
47
  import { murmurhash } from "@stryke/hash";
48
48
  import { hashDirectory } from "@stryke/hash/node";
49
+ import { deepClone } from "@stryke/helpers/deep-clone";
49
50
  import { getUnique, getUniqueBy } from "@stryke/helpers/get-unique";
50
51
  import { fetchRequest } from "@stryke/http/fetch";
51
52
  import { joinPaths as joinPaths$1 } from "@stryke/path/join";
@@ -72,7 +73,7 @@ import { setParseImpl } from "unplugin";
72
73
 
73
74
  //#region package.json
74
75
  var name = "powerlines";
75
- var version = "0.42.10";
76
+ var version = "0.42.11";
76
77
 
77
78
  //#endregion
78
79
  //#region src/_internal/helpers/generate-types.ts
@@ -2009,6 +2010,19 @@ var PowerlinesContext = class PowerlinesContext {
2009
2010
  }).filter(Boolean);
2010
2011
  }
2011
2012
  /**
2013
+ * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
2014
+ *
2015
+ * @remarks
2016
+ * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.
2017
+ *
2018
+ * @returns A promise that resolves to the cloned context.
2019
+ */
2020
+ async clone() {
2021
+ const clone = await PowerlinesContext.from(this.workspaceConfig.workspaceRoot, this.config);
2022
+ await clone.withUserConfig(this.config);
2023
+ return this.copyTo(clone);
2024
+ }
2025
+ /**
2012
2026
  * A function to perform HTTP fetch requests
2013
2027
  *
2014
2028
  * @remarks
@@ -2464,6 +2478,25 @@ var PowerlinesContext = class PowerlinesContext {
2464
2478
  */
2465
2479
  logger;
2466
2480
  /**
2481
+ * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
2482
+ *
2483
+ * @remarks
2484
+ * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.
2485
+ *
2486
+ * @returns The cloned context.
2487
+ */
2488
+ copyTo(context) {
2489
+ context.dependencies = deepClone(this.dependencies);
2490
+ context.devDependencies = deepClone(this.devDependencies);
2491
+ context.meta = deepClone(this.meta);
2492
+ context.persistedMeta = this.persistedMeta ? deepClone(this.persistedMeta) : void 0;
2493
+ context.packageJson = deepClone(this.packageJson);
2494
+ context.projectJson = this.projectJson ? deepClone(this.projectJson) : void 0;
2495
+ context.tsconfig = deepClone(this.tsconfig);
2496
+ context.$$internal = this.$$internal;
2497
+ return context;
2498
+ }
2499
+ /**
2467
2500
  * Initialize the context with the provided configuration options
2468
2501
  *
2469
2502
  * @param config - The partial user configuration to use for initialization.
@@ -2815,6 +2848,19 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
2815
2848
  get hooks() {
2816
2849
  return this.#hooks;
2817
2850
  }
2851
+ /**
2852
+ * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
2853
+ *
2854
+ * @remarks
2855
+ * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.
2856
+ *
2857
+ * @returns A promise that resolves to the cloned context.
2858
+ */
2859
+ async clone() {
2860
+ const clone = await PowerlinesEnvironmentContext.fromConfig(this.workspaceConfig, this.config);
2861
+ await clone.withUserConfig(this.config);
2862
+ return this.copyTo(clone);
2863
+ }
2818
2864
  async addPlugin(plugin) {
2819
2865
  let resolvedPlugin = plugin;
2820
2866
  if (isFunction(plugin.applyToEnvironment)) {
@@ -2957,6 +3003,18 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
2957
3003
  super(workspaceConfig);
2958
3004
  this.resolvedConfig = config;
2959
3005
  }
3006
+ /**
3007
+ * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
3008
+ *
3009
+ * @remarks
3010
+ * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.
3011
+ *
3012
+ * @returns The cloned context.
3013
+ */
3014
+ copyTo(context) {
3015
+ context.plugins = this.plugins;
3016
+ return this.copyTo(context);
3017
+ }
2960
3018
  };
2961
3019
 
2962
3020
  //#endregion
@@ -3015,6 +3073,19 @@ var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext
3015
3073
  super(workspaceConfig);
3016
3074
  }
3017
3075
  /**
3076
+ * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
3077
+ *
3078
+ * @remarks
3079
+ * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.
3080
+ *
3081
+ * @returns A promise that resolves to the cloned context.
3082
+ */
3083
+ async clone() {
3084
+ const clone = await PowerlinesAPIContext.from(this.workspaceConfig.workspaceRoot, this.config);
3085
+ await clone.withUserConfig(this.config);
3086
+ return this.copyTo(clone);
3087
+ }
3088
+ /**
3018
3089
  * Initialize the context with the provided configuration options
3019
3090
  *
3020
3091
  * @param config - The partial user configuration to use for initialization.
@@ -3730,4 +3801,4 @@ ${formatTypes(types)}
3730
3801
 
3731
3802
  //#endregion
3732
3803
  export { createUnpluginFactory as a, FileMetadata as c, FileSystem as d, _capnpFileId as f, createPluginContext as i, FileMetadata_KeyValuePair as l, version as m, PowerlinesAPIContext as n, PowerlinesContext as o, name as p, PowerlinesEnvironmentContext as r, FileId as s, PowerlinesAPI as t, FileStorage as u };
3733
- //# sourceMappingURL=api-DNNDv-om.mjs.map
3804
+ //# sourceMappingURL=api-CtTfDRzb.mjs.map