powerlines 0.31.6 → 0.32.1

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 CHANGED
@@ -18,12 +18,18 @@ var chunkOENQ5VVB_cjs = require('./chunk-OENQ5VVB.cjs');
18
18
  var chunkVFXZVCGG_cjs = require('./chunk-VFXZVCGG.cjs');
19
19
  var chunkZ6ARQDHR_cjs = require('./chunk-Z6ARQDHR.cjs');
20
20
  var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
21
+ var getWorkspaceRoot = require('@stryke/fs/get-workspace-root');
21
22
 
22
- // src/index.ts
23
23
  function defineConfig(config) {
24
24
  return config;
25
25
  }
26
26
  chunkPK6SKIKE_cjs.__name(defineConfig, "defineConfig");
27
+ async function createPowerlines(options = {}) {
28
+ options.root ??= process.cwd();
29
+ const workspaceRoot = getWorkspaceRoot.getWorkspaceRoot(options.root);
30
+ return chunkOENQ5VVB_cjs.PowerlinesAPI.from(workspaceRoot, options);
31
+ }
32
+ chunkPK6SKIKE_cjs.__name(createPowerlines, "createPowerlines");
27
33
  var index_default = chunkOENQ5VVB_cjs.PowerlinesAPI;
28
34
 
29
35
  Object.defineProperty(exports, "LogLevel", {
@@ -74,6 +80,7 @@ Object.defineProperty(exports, "SUPPORTED_COMMANDS", {
74
80
  enumerable: true,
75
81
  get: function () { return chunkZ6ARQDHR_cjs.SUPPORTED_COMMANDS; }
76
82
  });
83
+ exports.createPowerlines = createPowerlines;
77
84
  exports.default = index_default;
78
85
  exports.defineConfig = defineConfig;
79
86
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -168,15 +168,6 @@ declare class FileSystem extends $.Struct {
168
168
  toString(): string;
169
169
  }
170
170
 
171
- /**
172
- * The powerlines library used by Storm Software for building NodeJS applications.
173
- *
174
- * @remarks
175
- * A build toolkit and runtime used by Storm Software in TypeScript applications
176
- *
177
- * @packageDocumentation
178
- */
179
-
180
171
  /**
181
172
  * A type helper to make it easier to use `powerlines.config.ts` files.
182
173
  *
@@ -184,5 +175,12 @@ declare class FileSystem extends $.Struct {
184
175
  * The function accepts a direct {@link AnyUserConfig} object and returns it typed as a {@link UserConfig} object.
185
176
  */
186
177
  declare function defineConfig(config: AnyUserConfig): UserConfig;
178
+ /**
179
+ * Creates a new {@link PowerlinesAPI} instance.
180
+ *
181
+ * @param options - The user configuration options.
182
+ * @returns A promise that resolves to a {@link PowerlinesAPI} instance.
183
+ */
184
+ declare function createPowerlines(options?: Partial<UserConfig>): Promise<PowerlinesAPI>;
187
185
 
188
- export { AnyUserConfig, FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, PowerlinesAPI, UserConfig, _capnpFileId, PowerlinesAPI as default, defineConfig };
186
+ export { AnyUserConfig, FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, PowerlinesAPI, UserConfig, _capnpFileId, createPowerlines, PowerlinesAPI as default, defineConfig };
package/dist/index.d.ts CHANGED
@@ -168,15 +168,6 @@ declare class FileSystem extends $.Struct {
168
168
  toString(): string;
169
169
  }
170
170
 
171
- /**
172
- * The powerlines library used by Storm Software for building NodeJS applications.
173
- *
174
- * @remarks
175
- * A build toolkit and runtime used by Storm Software in TypeScript applications
176
- *
177
- * @packageDocumentation
178
- */
179
-
180
171
  /**
181
172
  * A type helper to make it easier to use `powerlines.config.ts` files.
182
173
  *
@@ -184,5 +175,12 @@ declare class FileSystem extends $.Struct {
184
175
  * The function accepts a direct {@link AnyUserConfig} object and returns it typed as a {@link UserConfig} object.
185
176
  */
186
177
  declare function defineConfig(config: AnyUserConfig): UserConfig;
178
+ /**
179
+ * Creates a new {@link PowerlinesAPI} instance.
180
+ *
181
+ * @param options - The user configuration options.
182
+ * @returns A promise that resolves to a {@link PowerlinesAPI} instance.
183
+ */
184
+ declare function createPowerlines(options?: Partial<UserConfig>): Promise<PowerlinesAPI>;
187
185
 
188
- export { AnyUserConfig, FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, PowerlinesAPI, UserConfig, _capnpFileId, PowerlinesAPI as default, defineConfig };
186
+ export { AnyUserConfig, FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, PowerlinesAPI, UserConfig, _capnpFileId, createPowerlines, PowerlinesAPI as default, defineConfig };
package/dist/index.js CHANGED
@@ -15,14 +15,20 @@ export { FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSyste
15
15
  export { PLUGIN_NON_HOOK_FIELDS } from './chunk-JGSCIWFQ.js';
16
16
  export { SUPPORTED_COMMANDS } from './chunk-2MYPFASJ.js';
17
17
  import { __name } from './chunk-7QVYU63E.js';
18
+ import { getWorkspaceRoot } from '@stryke/fs/get-workspace-root';
18
19
 
19
- // src/index.ts
20
20
  function defineConfig(config) {
21
21
  return config;
22
22
  }
23
23
  __name(defineConfig, "defineConfig");
24
+ async function createPowerlines(options = {}) {
25
+ options.root ??= process.cwd();
26
+ const workspaceRoot = getWorkspaceRoot(options.root);
27
+ return PowerlinesAPI.from(workspaceRoot, options);
28
+ }
29
+ __name(createPowerlines, "createPowerlines");
24
30
  var index_default = PowerlinesAPI;
25
31
 
26
- export { index_default as default, defineConfig };
32
+ export { createPowerlines, index_default as default, defineConfig };
27
33
  //# sourceMappingURL=index.js.map
28
34
  //# sourceMappingURL=index.js.map
package/dist/nuxt.cjs CHANGED
@@ -14,7 +14,7 @@ var kit = require('@nuxt/kit');
14
14
 
15
15
  // package.json
16
16
  var name = "powerlines";
17
- var version = "0.31.5";
17
+ var version = "0.32.0";
18
18
 
19
19
  // src/nuxt.ts
20
20
  var nuxt = kit.defineNuxtModule({
package/dist/nuxt.js CHANGED
@@ -10,7 +10,7 @@ import { defineNuxtModule, addVitePlugin, addWebpackPlugin } from '@nuxt/kit';
10
10
 
11
11
  // package.json
12
12
  var name = "powerlines";
13
- var version = "0.31.5";
13
+ var version = "0.32.0";
14
14
 
15
15
  // src/nuxt.ts
16
16
  var nuxt = defineNuxtModule({
@@ -0,0 +1,23 @@
1
+ import { extend } from './chunk-36OM2X4L.js';
2
+ import { __name } from './chunk-7QVYU63E.js';
3
+ import { toArray } from '@stryke/convert/to-array';
4
+
5
+ function enforceBuild(plugin, variant) {
6
+ return extend(plugin, {
7
+ config: Array.isArray(variant) ? void 0 : {
8
+ build: {
9
+ variant
10
+ }
11
+ },
12
+ configResolved() {
13
+ if (!toArray(variant).includes(this.config.build.variant)) {
14
+ throw new Error(`The plugin requires ${Array.isArray(variant) ? `the build variants ${variant.map((v) => `"${v}"`).slice(0, -1).join(", ")}, or ${variant.map((v) => `"${v}"`).slice(-1).join("")}` : `the build variant "${variant}"`}, but received "${this.config.build.variant}". Please ensure the \`build.variant\` is set correctly in your configuration.`);
15
+ }
16
+ }
17
+ });
18
+ }
19
+ __name(enforceBuild, "enforceBuild");
20
+
21
+ export { enforceBuild };
22
+ //# sourceMappingURL=chunk-DQDBFO67.js.map
23
+ //# sourceMappingURL=chunk-DQDBFO67.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/plugin-utils/enforce.ts"],"names":["enforceBuild","plugin","variant","extend","config","Array","isArray","undefined","build","configResolved","toArray","includes","Error","map","v","slice","join"],"mappings":";;;;AAgCO,SAASA,YAAAA,CAIdC,QACAC,OAAAA,EAAwC;AAExC,EAAA,OAAOC,OAAOF,MAAAA,EAAQ;AACpBG,IAAAA,MAAAA,EAAQC,KAAAA,CAAMC,OAAAA,CAAQJ,OAAAA,CAAAA,GAClBK,MAAAA,GACA;MACEC,KAAAA,EAAO;AACLN,QAAAA;AACF;AACF,KAAA;IACJO,cAAAA,GAAAA;AACE,MAAA,IACE,CAACC,QAAuBR,OAAAA,CAAAA,CAASS,SAAS,IAAA,CAAKP,MAAAA,CAAOI,KAAAA,CAAMN,OAAO,CAAA,EACnE;AACA,QAAA,MAAM,IAAIU,MACR,CAAA,oBAAA,EACEP,KAAAA,CAAMC,QAAQJ,OAAAA,CAAAA,GACV,sBAAsBA,OAAAA,CACnBW,GAAAA,CAAIC,CAAAA,CAAAA,KAAK,CAAA,CAAA,EAAIA,CAAAA,CAAAA,CAAAA,CAAI,CAAA,CACjBC,MAAM,CAAA,EAAG,EAAC,CAAA,CACVC,IAAAA,CAAK,IAAA,CAAA,QAAad,OAAAA,CAClBW,GAAAA,CAAIC,CAAAA,CAAAA,KAAK,CAAA,CAAA,EAAIA,CAAAA,CAAAA,CAAAA,CAAI,CAAA,CACjBC,KAAAA,CAAM,EAAC,CAAA,CACPC,IAAAA,CAAK,EAAA,CAAA,CAAA,CAAA,GACR,sBAAsBd,OAAAA,CAAAA,CAAAA,CAAU,mBAEpC,IAAA,CAAKE,MAAAA,CAAOI,KAAAA,CAAMN,OAAO,CAAA,8EAAA,CACqD,CAAA;AAEpF,MAAA;AACF,IAAA;GACF,CAAA;AACF;AArCgBF,MAAAA,CAAAA,YAAAA,EAAAA,cAAAA,CAAAA","file":"chunk-DQDBFO67.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { BuildVariant } from \"../types/build\";\nimport { PluginFactory } from \"../types/config\";\nimport { PluginContext } from \"../types/context\";\nimport { Plugin } from \"../types/plugin\";\nimport { extend } from \"./extend\";\n\n/**\n * Enforces a specific build variant for a plugin.\n *\n * @param plugin - The plugin or plugin factory to enforce the build variant on.\n * @param variant - The build variant to enforce.\n * @returns A new plugin or plugin factory that enforces the specified build variant.\n */\nexport function enforceBuild<\n TContext extends PluginContext = PluginContext,\n TBuildVariant extends BuildVariant = BuildVariant\n>(\n plugin: Plugin<TContext> | PluginFactory<TContext>,\n variant: TBuildVariant | TBuildVariant[]\n) {\n return extend(plugin, {\n config: Array.isArray(variant)\n ? undefined\n : {\n build: {\n variant\n }\n },\n configResolved(this: TContext) {\n if (\n !toArray<TBuildVariant>(variant).includes(this.config.build.variant)\n ) {\n throw new Error(\n `The plugin requires ${\n Array.isArray(variant)\n ? `the build variants ${variant\n .map(v => `\"${v}\"`)\n .slice(0, -1)\n .join(\", \")}, or ${variant\n .map(v => `\"${v}\"`)\n .slice(-1)\n .join(\"\")}`\n : `the build variant \"${variant}\"`\n }, but received \"${\n this.config.build.variant\n }\". Please ensure the \\`build.variant\\` is set correctly in your configuration.`\n );\n }\n }\n });\n}\n"]}
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ var chunkID47RJFS_cjs = require('./chunk-ID47RJFS.cjs');
4
+ var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
5
+ var toArray = require('@stryke/convert/to-array');
6
+
7
+ function enforceBuild(plugin, variant) {
8
+ return chunkID47RJFS_cjs.extend(plugin, {
9
+ config: Array.isArray(variant) ? void 0 : {
10
+ build: {
11
+ variant
12
+ }
13
+ },
14
+ configResolved() {
15
+ if (!toArray.toArray(variant).includes(this.config.build.variant)) {
16
+ throw new Error(`The plugin requires ${Array.isArray(variant) ? `the build variants ${variant.map((v) => `"${v}"`).slice(0, -1).join(", ")}, or ${variant.map((v) => `"${v}"`).slice(-1).join("")}` : `the build variant "${variant}"`}, but received "${this.config.build.variant}". Please ensure the \`build.variant\` is set correctly in your configuration.`);
17
+ }
18
+ }
19
+ });
20
+ }
21
+ chunkPK6SKIKE_cjs.__name(enforceBuild, "enforceBuild");
22
+
23
+ exports.enforceBuild = enforceBuild;
24
+ //# sourceMappingURL=chunk-EWPAHNGW.cjs.map
25
+ //# sourceMappingURL=chunk-EWPAHNGW.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/plugin-utils/enforce.ts"],"names":["enforceBuild","plugin","variant","extend","config","Array","isArray","undefined","build","configResolved","toArray","includes","Error","map","v","slice","join"],"mappings":";;;;;;AAgCO,SAASA,YAAAA,CAIdC,QACAC,OAAAA,EAAwC;AAExC,EAAA,OAAOC,yBAAOF,MAAAA,EAAQ;AACpBG,IAAAA,MAAAA,EAAQC,KAAAA,CAAMC,OAAAA,CAAQJ,OAAAA,CAAAA,GAClBK,MAAAA,GACA;MACEC,KAAAA,EAAO;AACLN,QAAAA;AACF;AACF,KAAA;IACJO,cAAAA,GAAAA;AACE,MAAA,IACE,CAACC,gBAAuBR,OAAAA,CAAAA,CAASS,SAAS,IAAA,CAAKP,MAAAA,CAAOI,KAAAA,CAAMN,OAAO,CAAA,EACnE;AACA,QAAA,MAAM,IAAIU,MACR,CAAA,oBAAA,EACEP,KAAAA,CAAMC,QAAQJ,OAAAA,CAAAA,GACV,sBAAsBA,OAAAA,CACnBW,GAAAA,CAAIC,CAAAA,CAAAA,KAAK,CAAA,CAAA,EAAIA,CAAAA,CAAAA,CAAAA,CAAI,CAAA,CACjBC,MAAM,CAAA,EAAG,EAAC,CAAA,CACVC,IAAAA,CAAK,IAAA,CAAA,QAAad,OAAAA,CAClBW,GAAAA,CAAIC,CAAAA,CAAAA,KAAK,CAAA,CAAA,EAAIA,CAAAA,CAAAA,CAAAA,CAAI,CAAA,CACjBC,KAAAA,CAAM,EAAC,CAAA,CACPC,IAAAA,CAAK,EAAA,CAAA,CAAA,CAAA,GACR,sBAAsBd,OAAAA,CAAAA,CAAAA,CAAU,mBAEpC,IAAA,CAAKE,MAAAA,CAAOI,KAAAA,CAAMN,OAAO,CAAA,8EAAA,CACqD,CAAA;AAEpF,MAAA;AACF,IAAA;GACF,CAAA;AACF;AArCgBF,wBAAAA,CAAAA,YAAAA,EAAAA,cAAAA,CAAAA","file":"chunk-EWPAHNGW.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { BuildVariant } from \"../types/build\";\nimport { PluginFactory } from \"../types/config\";\nimport { PluginContext } from \"../types/context\";\nimport { Plugin } from \"../types/plugin\";\nimport { extend } from \"./extend\";\n\n/**\n * Enforces a specific build variant for a plugin.\n *\n * @param plugin - The plugin or plugin factory to enforce the build variant on.\n * @param variant - The build variant to enforce.\n * @returns A new plugin or plugin factory that enforces the specified build variant.\n */\nexport function enforceBuild<\n TContext extends PluginContext = PluginContext,\n TBuildVariant extends BuildVariant = BuildVariant\n>(\n plugin: Plugin<TContext> | PluginFactory<TContext>,\n variant: TBuildVariant | TBuildVariant[]\n) {\n return extend(plugin, {\n config: Array.isArray(variant)\n ? undefined\n : {\n build: {\n variant\n }\n },\n configResolved(this: TContext) {\n if (\n !toArray<TBuildVariant>(variant).includes(this.config.build.variant)\n ) {\n throw new Error(\n `The plugin requires ${\n Array.isArray(variant)\n ? `the build variants ${variant\n .map(v => `\"${v}\"`)\n .slice(0, -1)\n .join(\", \")}, or ${variant\n .map(v => `\"${v}\"`)\n .slice(-1)\n .join(\"\")}`\n : `the build variant \"${variant}\"`\n }, but received \"${\n this.config.build.variant\n }\". Please ensure the \\`build.variant\\` is set correctly in your configuration.`\n );\n }\n }\n });\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkB2V5OVYF_cjs = require('./chunk-B2V5OVYF.cjs');
3
+ var chunkEWPAHNGW_cjs = require('./chunk-EWPAHNGW.cjs');
4
4
  require('./chunk-ID47RJFS.cjs');
5
5
  require('./chunk-UXLKUCEY.cjs');
6
6
  require('./chunk-VJGI676W.cjs');
@@ -8,9 +8,9 @@ require('./chunk-PK6SKIKE.cjs');
8
8
 
9
9
 
10
10
 
11
- Object.defineProperty(exports, "enforceVariant", {
11
+ Object.defineProperty(exports, "enforceBuild", {
12
12
  enumerable: true,
13
- get: function () { return chunkB2V5OVYF_cjs.enforceVariant; }
13
+ get: function () { return chunkEWPAHNGW_cjs.enforceBuild; }
14
14
  });
15
15
  //# sourceMappingURL=enforce.cjs.map
16
16
  //# sourceMappingURL=enforce.cjs.map
@@ -28,6 +28,6 @@ import '@stryke/types/array';
28
28
  * @param variant - The build variant to enforce.
29
29
  * @returns A new plugin or plugin factory that enforces the specified build variant.
30
30
  */
31
- declare function enforceVariant<TContext extends PluginContext = PluginContext, TBuildVariant extends BuildVariant = BuildVariant>(plugin: Plugin<TContext> | PluginFactory<TContext>, variant: TBuildVariant): Plugin<TContext>;
31
+ declare function enforceBuild<TContext extends PluginContext = PluginContext, TBuildVariant extends BuildVariant = BuildVariant>(plugin: Plugin<TContext> | PluginFactory<TContext>, variant: TBuildVariant | TBuildVariant[]): Plugin<TContext>;
32
32
 
33
- export { enforceVariant };
33
+ export { enforceBuild };
@@ -28,6 +28,6 @@ import '@stryke/types/array';
28
28
  * @param variant - The build variant to enforce.
29
29
  * @returns A new plugin or plugin factory that enforces the specified build variant.
30
30
  */
31
- declare function enforceVariant<TContext extends PluginContext = PluginContext, TBuildVariant extends BuildVariant = BuildVariant>(plugin: Plugin<TContext> | PluginFactory<TContext>, variant: TBuildVariant): Plugin<TContext>;
31
+ declare function enforceBuild<TContext extends PluginContext = PluginContext, TBuildVariant extends BuildVariant = BuildVariant>(plugin: Plugin<TContext> | PluginFactory<TContext>, variant: TBuildVariant | TBuildVariant[]): Plugin<TContext>;
32
32
 
33
- export { enforceVariant };
33
+ export { enforceBuild };
@@ -1,4 +1,4 @@
1
- export { enforceVariant } from './chunk-7YN6UEMJ.js';
1
+ export { enforceBuild } from './chunk-DQDBFO67.js';
2
2
  import './chunk-36OM2X4L.js';
3
3
  import './chunk-QQ63YK2G.js';
4
4
  import './chunk-X4BI25Z5.js';
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkDUIPLC7F_cjs = require('./chunk-DUIPLC7F.cjs');
4
- var chunkB2V5OVYF_cjs = require('./chunk-B2V5OVYF.cjs');
4
+ var chunkEWPAHNGW_cjs = require('./chunk-EWPAHNGW.cjs');
5
5
  var chunkID47RJFS_cjs = require('./chunk-ID47RJFS.cjs');
6
6
  var chunkGH7PPING_cjs = require('./chunk-GH7PPING.cjs');
7
7
  var chunkUXLKUCEY_cjs = require('./chunk-UXLKUCEY.cjs');
@@ -19,9 +19,9 @@ Object.defineProperty(exports, "getWorkspaceName", {
19
19
  enumerable: true,
20
20
  get: function () { return chunkDUIPLC7F_cjs.getWorkspaceName; }
21
21
  });
22
- Object.defineProperty(exports, "enforceVariant", {
22
+ Object.defineProperty(exports, "enforceBuild", {
23
23
  enumerable: true,
24
- get: function () { return chunkB2V5OVYF_cjs.enforceVariant; }
24
+ get: function () { return chunkEWPAHNGW_cjs.enforceBuild; }
25
25
  });
26
26
  Object.defineProperty(exports, "extend", {
27
27
  enumerable: true,
@@ -1,5 +1,5 @@
1
1
  export { getOrganizationName, getWorkspaceName } from './context-helpers.cjs';
2
- export { enforceVariant } from './enforce.cjs';
2
+ export { enforceBuild } from './enforce.cjs';
3
3
  export { extend } from './extend.cjs';
4
4
  export { getConfigPath } from './get-config-path.cjs';
5
5
  export { addPluginHook, checkDedupe, extractPluginHook, getHookHandler, isHookExternal, isHookInternal, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookFunction, isPluginHookObject } from './helpers.cjs';
@@ -1,5 +1,5 @@
1
1
  export { getOrganizationName, getWorkspaceName } from './context-helpers.js';
2
- export { enforceVariant } from './enforce.js';
2
+ export { enforceBuild } from './enforce.js';
3
3
  export { extend } from './extend.js';
4
4
  export { getConfigPath } from './get-config-path.js';
5
5
  export { addPluginHook, checkDedupe, extractPluginHook, getHookHandler, isHookExternal, isHookInternal, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookFunction, isPluginHookObject } from './helpers.js';
@@ -1,5 +1,5 @@
1
1
  export { getOrganizationName, getWorkspaceName } from './chunk-G32M72GJ.js';
2
- export { enforceVariant } from './chunk-7YN6UEMJ.js';
2
+ export { enforceBuild } from './chunk-DQDBFO67.js';
3
3
  export { extend } from './chunk-36OM2X4L.js';
4
4
  export { getConfigPath } from './chunk-H7GJUBNY.js';
5
5
  export { merge } from './chunk-QQ63YK2G.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powerlines",
3
- "version": "0.31.6",
3
+ "version": "0.32.1",
4
4
  "type": "module",
5
5
  "description": "The \"any framework\" framework that simplifies modern dev tool usage, generates virtual (or actual) code modules, and improves DX across the board.",
6
6
  "repository": {
@@ -570,29 +570,29 @@
570
570
  "@rollup/plugin-inject": "^5.0.5",
571
571
  "@rollup/plugin-node-resolve": "^16.0.3",
572
572
  "@rollup/plugin-replace": "^6.0.3",
573
- "@storm-software/build-tools": "^0.158.65",
574
- "@storm-software/config": "^1.134.65",
575
- "@storm-software/config-tools": "^1.188.65",
576
- "@storm-software/esbuild": "^0.53.65",
577
- "@storm-software/tsup": "^0.2.63",
578
- "@storm-software/unbuild": "^0.57.65",
579
- "@stryke/capnp": "^0.12.45",
580
- "@stryke/convert": "^0.6.24",
581
- "@stryke/env": "^0.20.37",
582
- "@stryke/fs": "^0.33.20",
583
- "@stryke/hash": "^0.12.26",
584
- "@stryke/helpers": "^0.9.26",
585
- "@stryke/http": "^0.12.14",
586
- "@stryke/json": "^0.9.27",
587
- "@stryke/path": "^0.22.11",
588
- "@stryke/string-format": "^0.12.24",
589
- "@stryke/type-checks": "^0.5.9",
590
- "@stryke/unique-id": "^0.3.31",
591
- "@typescript-eslint/utils": "^8.49.0",
592
- "babel-dead-code-elimination": "^1.0.10",
573
+ "@storm-software/build-tools": "^0.158.70",
574
+ "@storm-software/config": "^1.134.70",
575
+ "@storm-software/config-tools": "^1.188.70",
576
+ "@storm-software/esbuild": "^0.53.70",
577
+ "@storm-software/tsup": "^0.2.68",
578
+ "@storm-software/unbuild": "^0.57.70",
579
+ "@stryke/capnp": "^0.12.47",
580
+ "@stryke/convert": "^0.6.26",
581
+ "@stryke/env": "^0.20.39",
582
+ "@stryke/fs": "^0.33.22",
583
+ "@stryke/hash": "^0.12.28",
584
+ "@stryke/helpers": "^0.9.28",
585
+ "@stryke/http": "^0.12.16",
586
+ "@stryke/json": "^0.9.29",
587
+ "@stryke/path": "^0.22.13",
588
+ "@stryke/string-format": "^0.12.26",
589
+ "@stryke/type-checks": "^0.5.11",
590
+ "@stryke/unique-id": "^0.3.33",
591
+ "@typescript-eslint/utils": "^8.50.0",
592
+ "babel-dead-code-elimination": "^1.0.11",
593
593
  "babel-plugin-parameter-decorator": "^1.0.16",
594
594
  "bundle-require": "^5.1.0",
595
- "c12": "^3.3.2",
595
+ "c12": "^3.3.3",
596
596
  "chalk": "5.6.2",
597
597
  "defu": "^6.1.4",
598
598
  "diff-match-patch": "^1.0.5",
@@ -613,8 +613,8 @@
613
613
  },
614
614
  "devDependencies": {
615
615
  "@microsoft/tsdoc": "^0.15.1",
616
- "@storm-software/testing-tools": "^1.119.64",
617
- "@stryke/types": "^0.10.23",
616
+ "@storm-software/testing-tools": "^1.119.69",
617
+ "@stryke/types": "^0.10.25",
618
618
  "@types/babel__core": "^7.20.5",
619
619
  "@types/babel__helper-module-imports": "^7.18.3",
620
620
  "@types/babel__helper-plugin-utils": "^7.10.3",
@@ -631,5 +631,5 @@
631
631
  "undici-types": "^7.16.0"
632
632
  },
633
633
  "publishConfig": { "access": "public" },
634
- "gitHead": "a7da8c6e6ecb00c6bd05fa6b6525ec369d58b0c4"
634
+ "gitHead": "c3c651a6535cbd8c4b65707d25f5592937524e2e"
635
635
  }
@@ -1,23 +0,0 @@
1
- import { extend } from './chunk-36OM2X4L.js';
2
- import { __name } from './chunk-7QVYU63E.js';
3
-
4
- // src/plugin-utils/enforce.ts
5
- function enforceVariant(plugin, variant) {
6
- return extend(plugin, {
7
- config: {
8
- build: {
9
- variant
10
- }
11
- },
12
- configResolved() {
13
- if (this.config.build.variant !== variant) {
14
- throw new Error(`A plugin requires the build variant "${variant}", but received "${this.config.build.variant}". Please ensure the \`build.variant\` is set correctly in your configuration.`);
15
- }
16
- }
17
- });
18
- }
19
- __name(enforceVariant, "enforceVariant");
20
-
21
- export { enforceVariant };
22
- //# sourceMappingURL=chunk-7YN6UEMJ.js.map
23
- //# sourceMappingURL=chunk-7YN6UEMJ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/plugin-utils/enforce.ts"],"names":["enforceVariant","plugin","variant","extend","config","build","configResolved","Error"],"mappings":";;;;AA+BO,SAASA,cAAAA,CAGdC,QAAoDC,OAAAA,EAAsB;AAC1E,EAAA,OAAOC,OAAOF,MAAAA,EAAQ;IACpBG,MAAAA,EAAQ;MACNC,KAAAA,EAAO;AACLH,QAAAA;AACF;AACF,KAAA;IACAI,cAAAA,GAAAA;AACE,MAAA,IAAI,IAAA,CAAKF,MAAAA,CAAOC,KAAAA,CAAMH,OAAAA,KAAYA,OAAAA,EAAS;AACzC,QAAA,MAAM,IAAIK,MACR,CAAA,qCAAA,EAAwCL,OAAAA,oBACtC,IAAA,CAAKE,MAAAA,CAAOC,KAAAA,CAAMH,OAAO,CAAA,8EAAA,CACqD,CAAA;AAEpF,MAAA;AACF,IAAA;GACF,CAAA;AACF;AApBgBF,MAAAA,CAAAA,cAAAA,EAAAA,gBAAAA,CAAAA","file":"chunk-7YN6UEMJ.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { BuildVariant } from \"../types/build\";\nimport { PluginFactory } from \"../types/config\";\nimport { PluginContext } from \"../types/context\";\nimport { Plugin } from \"../types/plugin\";\nimport { extend } from \"./extend\";\n\n/**\n * Enforces a specific build variant for a plugin.\n *\n * @param plugin - The plugin or plugin factory to enforce the build variant on.\n * @param variant - The build variant to enforce.\n * @returns A new plugin or plugin factory that enforces the specified build variant.\n */\nexport function enforceVariant<\n TContext extends PluginContext = PluginContext,\n TBuildVariant extends BuildVariant = BuildVariant\n>(plugin: Plugin<TContext> | PluginFactory<TContext>, variant: TBuildVariant) {\n return extend(plugin, {\n config: {\n build: {\n variant\n }\n },\n configResolved(this: TContext) {\n if (this.config.build.variant !== variant) {\n throw new Error(\n `A plugin requires the build variant \"${variant}\", but received \"${\n this.config.build.variant\n }\". Please ensure the \\`build.variant\\` is set correctly in your configuration.`\n );\n }\n }\n });\n}\n"]}
@@ -1,25 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkID47RJFS_cjs = require('./chunk-ID47RJFS.cjs');
4
- var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
5
-
6
- // src/plugin-utils/enforce.ts
7
- function enforceVariant(plugin, variant) {
8
- return chunkID47RJFS_cjs.extend(plugin, {
9
- config: {
10
- build: {
11
- variant
12
- }
13
- },
14
- configResolved() {
15
- if (this.config.build.variant !== variant) {
16
- throw new Error(`A plugin requires the build variant "${variant}", but received "${this.config.build.variant}". Please ensure the \`build.variant\` is set correctly in your configuration.`);
17
- }
18
- }
19
- });
20
- }
21
- chunkPK6SKIKE_cjs.__name(enforceVariant, "enforceVariant");
22
-
23
- exports.enforceVariant = enforceVariant;
24
- //# sourceMappingURL=chunk-B2V5OVYF.cjs.map
25
- //# sourceMappingURL=chunk-B2V5OVYF.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/plugin-utils/enforce.ts"],"names":["enforceVariant","plugin","variant","extend","config","build","configResolved","Error"],"mappings":";;;;;;AA+BO,SAASA,cAAAA,CAGdC,QAAoDC,OAAAA,EAAsB;AAC1E,EAAA,OAAOC,yBAAOF,MAAAA,EAAQ;IACpBG,MAAAA,EAAQ;MACNC,KAAAA,EAAO;AACLH,QAAAA;AACF;AACF,KAAA;IACAI,cAAAA,GAAAA;AACE,MAAA,IAAI,IAAA,CAAKF,MAAAA,CAAOC,KAAAA,CAAMH,OAAAA,KAAYA,OAAAA,EAAS;AACzC,QAAA,MAAM,IAAIK,MACR,CAAA,qCAAA,EAAwCL,OAAAA,oBACtC,IAAA,CAAKE,MAAAA,CAAOC,KAAAA,CAAMH,OAAO,CAAA,8EAAA,CACqD,CAAA;AAEpF,MAAA;AACF,IAAA;GACF,CAAA;AACF;AApBgBF,wBAAAA,CAAAA,cAAAA,EAAAA,gBAAAA,CAAAA","file":"chunk-B2V5OVYF.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { BuildVariant } from \"../types/build\";\nimport { PluginFactory } from \"../types/config\";\nimport { PluginContext } from \"../types/context\";\nimport { Plugin } from \"../types/plugin\";\nimport { extend } from \"./extend\";\n\n/**\n * Enforces a specific build variant for a plugin.\n *\n * @param plugin - The plugin or plugin factory to enforce the build variant on.\n * @param variant - The build variant to enforce.\n * @returns A new plugin or plugin factory that enforces the specified build variant.\n */\nexport function enforceVariant<\n TContext extends PluginContext = PluginContext,\n TBuildVariant extends BuildVariant = BuildVariant\n>(plugin: Plugin<TContext> | PluginFactory<TContext>, variant: TBuildVariant) {\n return extend(plugin, {\n config: {\n build: {\n variant\n }\n },\n configResolved(this: TContext) {\n if (this.config.build.variant !== variant) {\n throw new Error(\n `A plugin requires the build variant \"${variant}\", but received \"${\n this.config.build.variant\n }\". Please ensure the \\`build.variant\\` is set correctly in your configuration.`\n );\n }\n }\n });\n}\n"]}