powerlines 0.19.5 → 0.20.0
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/api.cjs +2 -2
- package/dist/api.d.cts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.js +1 -1
- package/dist/astro.cjs +8 -8
- package/dist/astro.d.cts +1 -1
- package/dist/astro.d.ts +1 -1
- package/dist/astro.js +5 -5
- package/dist/{chunk-JPWBN72J.js → chunk-24AZZCCW.js} +1 -1
- package/dist/{chunk-HI3LNK6Q.js → chunk-2KGMZZ36.js} +1 -1
- package/dist/{chunk-BHPTTRBA.js → chunk-2QGVOWKM.js} +16 -11
- package/dist/{chunk-AEJIVPUZ.js → chunk-4KCSCJ6E.js} +1 -1
- package/dist/{chunk-ULFJBFI7.cjs → chunk-6UVRB3IN.cjs} +3 -3
- package/dist/{chunk-RR7EC4RF.js → chunk-A2EZ3M22.js} +1 -1
- package/dist/{chunk-ZOUGUAQY.cjs → chunk-CTSV5JAF.cjs} +18 -13
- package/dist/{chunk-GFINPIIK.js → chunk-F4TS44KB.js} +3 -4
- package/dist/{chunk-I4LLZ5BI.js → chunk-FBMQTOMN.js} +1 -1
- package/dist/{chunk-PAJB5K7A.js → chunk-FYKDALJL.js} +3 -2
- package/dist/{chunk-MCDMY6GK.cjs → chunk-IHWRGHX6.cjs} +2 -2
- package/dist/{chunk-7HKTQSUG.cjs → chunk-IMMNZSFZ.cjs} +4 -3
- package/dist/{chunk-VICSRRKQ.js → chunk-JKF342AW.js} +2 -2
- package/dist/{chunk-LIXKMZW5.cjs → chunk-KL7HP7JM.cjs} +2 -2
- package/dist/{chunk-5PRY6OJM.cjs → chunk-LM6YBGC6.cjs} +2 -2
- package/dist/{chunk-KMELWYHW.cjs → chunk-MOH4CWHN.cjs} +3 -4
- package/dist/{chunk-YQZXG4X6.cjs → chunk-MZQXGWUK.cjs} +2 -2
- package/dist/{chunk-BSGWY4AP.cjs → chunk-OQNYDN5F.cjs} +2 -2
- package/dist/{chunk-X5LPEBDE.cjs → chunk-P3BP6LXC.cjs} +2 -2
- package/dist/{chunk-HEG6IAVR.js → chunk-QH3M5FBF.js} +1 -1
- package/dist/chunk-SECEPZQ3.cjs +32 -0
- package/dist/{chunk-GQM2JCO3.js → chunk-SIEHJFKB.js} +2 -2
- package/dist/{chunk-TK6CN2KT.cjs → chunk-T4AJOD6A.cjs} +4 -4
- package/dist/chunk-TY3QAXEY.js +105 -0
- package/dist/{chunk-OJSRHKHW.js → chunk-VSZXQLMI.js} +1 -1
- package/dist/{chunk-A3FMGMBV.cjs → chunk-VVFIZVYE.cjs} +2 -2
- package/dist/{chunk-Z63SQZUB.cjs → chunk-VXF37DA2.cjs} +4 -4
- package/dist/chunk-WE7PLY4H.cjs +111 -0
- package/dist/{chunk-MLAYLHZO.js → chunk-WRP6ANCC.js} +1 -1
- package/dist/chunk-XBS3AHAK.js +29 -0
- package/dist/config.d.cts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/esbuild.cjs +7 -7
- package/dist/esbuild.d.cts +1 -1
- package/dist/esbuild.d.ts +1 -1
- package/dist/esbuild.js +4 -4
- package/dist/farm.cjs +3 -3
- package/dist/farm.d.cts +1 -1
- package/dist/farm.d.ts +1 -1
- package/dist/farm.js +2 -2
- package/dist/{hooks-Bq2jUAKs.d.ts → hooks-BBZyf9CN.d.ts} +1 -1
- package/dist/{hooks-C6t50M6a.d.cts → hooks-CUxY7WKY.d.cts} +1 -1
- package/dist/index.cjs +18 -18
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +16 -16
- package/dist/lib/build/esbuild.cjs +4 -4
- package/dist/lib/build/esbuild.d.cts +3 -3
- package/dist/lib/build/esbuild.d.ts +3 -3
- package/dist/lib/build/esbuild.js +1 -1
- package/dist/lib/build/index.cjs +24 -24
- package/dist/lib/build/index.d.cts +3 -3
- package/dist/lib/build/index.d.ts +3 -3
- package/dist/lib/build/index.js +8 -8
- package/dist/lib/build/rolldown.cjs +3 -3
- package/dist/lib/build/rolldown.d.cts +1 -1
- package/dist/lib/build/rolldown.d.ts +1 -1
- package/dist/lib/build/rolldown.js +2 -2
- package/dist/lib/build/rollup.cjs +3 -3
- package/dist/lib/build/rollup.d.cts +1 -1
- package/dist/lib/build/rollup.d.ts +1 -1
- package/dist/lib/build/rollup.js +1 -1
- package/dist/lib/build/rspack.cjs +2 -2
- package/dist/lib/build/rspack.d.cts +1 -1
- package/dist/lib/build/rspack.d.ts +1 -1
- package/dist/lib/build/rspack.js +1 -1
- package/dist/lib/build/tsup.cjs +5 -5
- package/dist/lib/build/tsup.d.cts +1 -1
- package/dist/lib/build/tsup.d.ts +1 -1
- package/dist/lib/build/tsup.js +2 -2
- package/dist/lib/build/unbuild.cjs +5 -5
- package/dist/lib/build/unbuild.d.cts +2 -2
- package/dist/lib/build/unbuild.d.ts +2 -2
- package/dist/lib/build/unbuild.js +2 -2
- package/dist/lib/build/vite.cjs +4 -4
- package/dist/lib/build/vite.d.cts +1 -1
- package/dist/lib/build/vite.d.ts +1 -1
- package/dist/lib/build/vite.js +2 -2
- package/dist/lib/build/webpack.cjs +2 -2
- package/dist/lib/build/webpack.d.cts +1 -1
- package/dist/lib/build/webpack.d.ts +1 -1
- package/dist/lib/build/webpack.js +1 -1
- package/dist/lib/{chunk-7OHD3BD4.js → chunk-4QRL5CNE.js} +1 -5
- package/dist/lib/{chunk-5ASXKB2V.js → chunk-4RUHX7LV.js} +1 -1
- package/dist/lib/{chunk-KXCEN6Y4.js → chunk-5SP6QZLX.js} +1 -1
- package/dist/lib/{chunk-4AMFNBTX.cjs → chunk-ARCFV3IJ.cjs} +3 -4
- package/dist/lib/{chunk-5EXW3ZRC.cjs → chunk-CLV4J4L7.cjs} +26 -4
- package/dist/lib/{chunk-ADKYAHF5.js → chunk-DFRWBQQT.js} +33 -12
- package/dist/lib/{chunk-F7IDAYLH.cjs → chunk-FGYAS4NB.cjs} +1 -5
- package/dist/lib/{chunk-MVSXEH4P.cjs → chunk-H7V7EPB2.cjs} +6 -9
- package/dist/lib/{chunk-67IBLMW6.cjs → chunk-HIY6WOU3.cjs} +3 -3
- package/dist/lib/{chunk-ESNHFT4V.cjs → chunk-IBONIIAZ.cjs} +10 -10
- package/dist/lib/{chunk-47WZIAPZ.js → chunk-IXREPTHZ.js} +5 -8
- package/dist/lib/chunk-K4FER6YK.cjs +125 -0
- package/dist/lib/{chunk-LJ4WO7TW.cjs → chunk-MWA3DWY5.cjs} +36 -13
- package/dist/lib/{chunk-Q3ERHHXJ.js → chunk-NU4GDWLL.js} +2 -2
- package/dist/lib/{chunk-37W2ZDLA.cjs → chunk-O36FCQM6.cjs} +2 -2
- package/dist/lib/{chunk-ET5QBFGZ.cjs → chunk-O5LNKYQV.cjs} +2 -2
- package/dist/lib/{chunk-SYHVP3OW.js → chunk-OI2V6L7D.js} +24 -4
- package/dist/lib/{chunk-JB2JJXGW.js → chunk-S5F4DE65.js} +1 -1
- package/dist/lib/{chunk-DX4TFRS3.js → chunk-TTKY3DR4.js} +3 -4
- package/dist/lib/{chunk-N2EGPL2L.js → chunk-WWNNBLU7.js} +9 -9
- package/dist/lib/{chunk-AOKLB4V2.cjs → chunk-Y2BHXV33.cjs} +1 -1
- package/dist/lib/chunk-ZJNDT3GX.js +117 -0
- package/dist/lib/{config-CnPcoKqT.d.ts → config-Bag1Ft7u.d.ts} +138 -52
- package/dist/lib/{config-LK_Wl1SU.d.cts → config-DN8Ad0lv.d.cts} +138 -52
- package/dist/lib/config-file.d.cts +1 -1
- package/dist/lib/config-file.d.ts +1 -1
- package/dist/lib/create-program.d.cts +1 -1
- package/dist/lib/create-program.d.ts +1 -1
- package/dist/lib/entry.d.cts +1 -1
- package/dist/lib/entry.d.ts +1 -1
- package/dist/lib/{hooks-DX1o8l6J.d.ts → hooks-BVnPAWgt.d.ts} +1 -1
- package/dist/lib/{hooks-BD2rDhpA.d.cts → hooks-H2P-7xA4.d.cts} +1 -1
- package/dist/lib/index.cjs +7 -7
- package/dist/lib/index.d.cts +2 -2
- package/dist/lib/index.d.ts +2 -2
- package/dist/lib/index.js +4 -4
- package/dist/lib/logger.d.cts +1 -1
- package/dist/lib/logger.d.ts +1 -1
- package/dist/lib/typescript/compiler-host.d.cts +1 -1
- package/dist/lib/typescript/compiler-host.d.ts +1 -1
- package/dist/lib/typescript/import-transformer.d.cts +1 -1
- package/dist/lib/typescript/import-transformer.d.ts +1 -1
- package/dist/lib/typescript/index.d.cts +1 -1
- package/dist/lib/typescript/index.d.ts +1 -1
- package/dist/lib/typescript/program.d.cts +1 -1
- package/dist/lib/typescript/program.d.ts +1 -1
- package/dist/lib/unplugin/factory.cjs +2 -2
- package/dist/lib/unplugin/factory.d.cts +2 -2
- package/dist/lib/unplugin/factory.d.ts +2 -2
- package/dist/lib/unplugin/factory.js +1 -1
- package/dist/lib/unplugin/index.cjs +2 -2
- package/dist/lib/unplugin/index.d.cts +2 -2
- package/dist/lib/unplugin/index.d.ts +2 -2
- package/dist/lib/unplugin/index.js +1 -1
- package/dist/lib/unplugin/plugin.d.cts +1 -1
- package/dist/lib/unplugin/plugin.d.ts +1 -1
- package/dist/lib/unplugin/resolve-id.d.cts +1 -1
- package/dist/lib/unplugin/resolve-id.d.ts +1 -1
- package/dist/lib/utilities/bundle.cjs +3 -3
- package/dist/lib/utilities/bundle.d.cts +1 -1
- package/dist/lib/utilities/bundle.d.ts +1 -1
- package/dist/lib/utilities/bundle.js +2 -2
- package/dist/lib/utilities/cache.d.cts +1 -1
- package/dist/lib/utilities/cache.d.ts +1 -1
- package/dist/lib/utilities/file-header.d.cts +1 -1
- package/dist/lib/utilities/file-header.d.ts +1 -1
- package/dist/lib/utilities/index.cjs +5 -5
- package/dist/lib/utilities/index.d.cts +1 -1
- package/dist/lib/utilities/index.d.ts +1 -1
- package/dist/lib/utilities/index.js +3 -3
- package/dist/lib/utilities/meta.d.cts +1 -1
- package/dist/lib/utilities/meta.d.ts +1 -1
- package/dist/lib/utilities/resolve-path.d.cts +1 -1
- package/dist/lib/utilities/resolve-path.d.ts +1 -1
- package/dist/lib/utilities/resolve.cjs +4 -4
- package/dist/lib/utilities/resolve.d.cts +1 -1
- package/dist/lib/utilities/resolve.d.ts +1 -1
- package/dist/lib/utilities/resolve.js +3 -3
- package/dist/lib/utilities/source-file.d.cts +1 -1
- package/dist/lib/utilities/source-file.d.ts +1 -1
- package/dist/lib/utilities/source-map.d.cts +1 -1
- package/dist/lib/utilities/source-map.d.ts +1 -1
- package/dist/lib/utilities/worker.d.cts +1 -1
- package/dist/lib/utilities/worker.d.ts +1 -1
- package/dist/lib/utilities/write-file.d.cts +1 -1
- package/dist/lib/utilities/write-file.d.ts +1 -1
- package/dist/next.cjs +7 -7
- package/dist/next.js +4 -4
- package/dist/nuxt.cjs +9 -9
- package/dist/nuxt.js +6 -6
- package/dist/plugin-utils/chunk-J33TXWF6.js +12 -0
- package/dist/plugin-utils/chunk-QP6OJWFG.cjs +14 -0
- package/dist/plugin-utils/{config-48EWGWXq.d.cts → config-pwKiZvzJ.d.cts} +138 -52
- package/dist/plugin-utils/{config-48EWGWXq.d.ts → config-pwKiZvzJ.d.ts} +138 -52
- package/dist/plugin-utils/enforce.d.cts +1 -1
- package/dist/plugin-utils/enforce.d.ts +1 -1
- package/dist/plugin-utils/extend.d.cts +1 -1
- package/dist/plugin-utils/extend.d.ts +1 -1
- package/dist/plugin-utils/get-config-path.d.cts +2 -2
- package/dist/plugin-utils/get-config-path.d.ts +2 -2
- package/dist/plugin-utils/helpers.d.cts +3 -3
- package/dist/plugin-utils/helpers.d.ts +3 -3
- package/dist/plugin-utils/index.cjs +2 -2
- package/dist/plugin-utils/index.d.cts +1 -1
- package/dist/plugin-utils/index.d.ts +1 -1
- package/dist/plugin-utils/index.js +1 -1
- package/dist/plugin-utils/merge.d.cts +1 -1
- package/dist/plugin-utils/merge.d.ts +1 -1
- package/dist/plugin-utils/paths.cjs +2 -2
- package/dist/plugin-utils/paths.d.cts +3 -2
- package/dist/plugin-utils/paths.d.ts +3 -2
- package/dist/plugin-utils/paths.js +1 -1
- package/dist/{resolved-J7a2Aeuk.d.ts → resolved-Sxyrlt6g.d.ts} +68 -52
- package/dist/{resolved-B41SbjnS.d.cts → resolved-ohMN-3VJ.d.cts} +68 -52
- package/dist/rolldown.cjs +6 -6
- package/dist/rolldown.d.cts +1 -1
- package/dist/rolldown.d.ts +1 -1
- package/dist/rolldown.js +3 -3
- package/dist/rollup.cjs +6 -6
- package/dist/rollup.d.cts +1 -1
- package/dist/rollup.d.ts +1 -1
- package/dist/rollup.js +3 -3
- package/dist/rspack.cjs +6 -6
- package/dist/rspack.d.cts +1 -1
- package/dist/rspack.d.ts +1 -1
- package/dist/rspack.js +3 -3
- package/dist/tsup.cjs +8 -8
- package/dist/tsup.js +5 -5
- package/dist/types/babel.d.cts +1 -1
- package/dist/types/babel.d.ts +1 -1
- package/dist/types/build.d.cts +76 -6
- package/dist/types/build.d.ts +76 -6
- package/dist/types/commands.d.cts +1 -1
- package/dist/types/commands.d.ts +1 -1
- package/dist/types/config.d.cts +1 -1
- package/dist/types/config.d.ts +1 -1
- package/dist/types/context.d.cts +2 -2
- package/dist/types/context.d.ts +2 -2
- package/dist/types/hooks.d.cts +1 -1
- package/dist/types/hooks.d.ts +1 -1
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/internal.d.cts +2 -2
- package/dist/types/internal.d.ts +2 -2
- package/dist/types/plugin.d.cts +1 -1
- package/dist/types/plugin.d.ts +1 -1
- package/dist/types/resolved.d.cts +1 -1
- package/dist/types/resolved.d.ts +1 -1
- package/dist/types/unplugin.d.cts +1 -1
- package/dist/types/unplugin.d.ts +1 -1
- package/dist/unloader.cjs +6 -6
- package/dist/unloader.d.cts +3 -3
- package/dist/unloader.d.ts +3 -3
- package/dist/unloader.js +3 -3
- package/dist/unplugin.cjs +18 -18
- package/dist/unplugin.d.cts +4 -4
- package/dist/unplugin.d.ts +4 -4
- package/dist/unplugin.js +15 -15
- package/dist/vite.cjs +7 -7
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +4 -4
- package/dist/webpack.cjs +6 -6
- package/dist/webpack.d.cts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +3 -3
- package/package.json +7 -5
- package/dist/chunk-CWCEYGLM.js +0 -43
- package/dist/chunk-F5NKLRZD.cjs +0 -49
- package/dist/chunk-RDMLGFIT.js +0 -29
- package/dist/chunk-XDLLDHRY.cjs +0 -32
- package/dist/lib/chunk-POOHWK7C.cjs +0 -63
- package/dist/lib/chunk-VLHOYZG2.js +0 -55
- package/dist/plugin-utils/chunk-2HFS2OOG.cjs +0 -14
- package/dist/plugin-utils/chunk-CVZA2RT3.js +0 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Format } from '@storm-software/build-tools/types';
|
|
2
2
|
import { LogLevelLabel } from '@storm-software/config-tools/types';
|
|
3
3
|
import { StormWorkspaceConfig } from '@storm-software/config/types';
|
|
4
|
-
import { NonUndefined, MaybePromise, FunctionLike, DeepPartial } from '@stryke/types/base';
|
|
4
|
+
import { NonUndefined, MaybePromise, FunctionLike, DeepPartial as DeepPartial$1 } from '@stryke/types/base';
|
|
5
5
|
import { TypeDefinition, TypeDefinitionParameter } from '@stryke/types/configuration';
|
|
6
6
|
import { AssetGlob } from '@stryke/types/file';
|
|
7
7
|
import { ResolvedPreviewOptions, PreviewOptions } from 'vite';
|
|
@@ -28,6 +28,73 @@ interface BuildConfig {
|
|
|
28
28
|
* @defaultValue "neutral"
|
|
29
29
|
*/
|
|
30
30
|
platform?: "node" | "browser" | "neutral";
|
|
31
|
+
/**
|
|
32
|
+
* Array of strings indicating the order in which fields in a package.json file should be resolved to determine the entry point for a module.
|
|
33
|
+
*
|
|
34
|
+
* @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
|
|
35
|
+
*/
|
|
36
|
+
mainFields?: string[];
|
|
37
|
+
/**
|
|
38
|
+
* Array of strings indicating what conditions should be used for module resolution.
|
|
39
|
+
*/
|
|
40
|
+
conditions?: string[];
|
|
41
|
+
/**
|
|
42
|
+
* Array of strings indicating what file extensions should be used for module resolution.
|
|
43
|
+
*
|
|
44
|
+
* @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
|
|
45
|
+
*/
|
|
46
|
+
extensions?: string[];
|
|
47
|
+
/**
|
|
48
|
+
* Array of strings indicating what modules should be deduplicated to a single version in the build.
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* This option is useful for ensuring that only one version of a module is included in the bundle, which can help reduce bundle size and avoid conflicts.
|
|
52
|
+
*/
|
|
53
|
+
dedupe?: string[];
|
|
54
|
+
/**
|
|
55
|
+
* Array of strings or regular expressions that indicate what modules are builtin for the environment.
|
|
56
|
+
*/
|
|
57
|
+
builtins?: (string | RegExp)[];
|
|
58
|
+
/**
|
|
59
|
+
* Define global variable replacements.
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* This option allows you to specify global constants that will be replaced in the code during the build process. It is similar to the `define` option in esbuild and Vite, enabling you to replace specific identifiers with constant expressions at build time.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* {
|
|
67
|
+
* define: {
|
|
68
|
+
* __VERSION__: '"1.0.0"',
|
|
69
|
+
* __DEV__: 'process.env.NODE_ENV !== "production"'
|
|
70
|
+
* }
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @see https://esbuild.github.io/api/#define
|
|
75
|
+
* @see https://vitejs.dev/config/build-options.html#define
|
|
76
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/replace
|
|
77
|
+
*/
|
|
78
|
+
define?: Record<string, any>;
|
|
79
|
+
/**
|
|
80
|
+
* Global variables that will have import statements injected where necessary
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* This option allows you to specify global variables that should be automatically imported from specified modules whenever they are used in the code. This is particularly useful for polyfilling Node.js globals in a browser environment.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* {
|
|
88
|
+
* inject: {
|
|
89
|
+
* process: 'process/browser',
|
|
90
|
+
* Buffer: ['buffer', 'Buffer'],
|
|
91
|
+
* }
|
|
92
|
+
* }
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/inject
|
|
96
|
+
*/
|
|
97
|
+
inject?: Record<string, string | string[]>;
|
|
31
98
|
/**
|
|
32
99
|
* The alias mappings to use for module resolution during the build process.
|
|
33
100
|
*
|
|
@@ -43,6 +110,8 @@ interface BuildConfig {
|
|
|
43
110
|
* }
|
|
44
111
|
* }
|
|
45
112
|
* ```
|
|
113
|
+
*
|
|
114
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/alias
|
|
46
115
|
*/
|
|
47
116
|
alias?: Record<string, string>;
|
|
48
117
|
/**
|
|
@@ -61,13 +130,14 @@ interface BuildConfig {
|
|
|
61
130
|
*/
|
|
62
131
|
skipNodeModulesBundle?: boolean;
|
|
63
132
|
/**
|
|
64
|
-
*
|
|
133
|
+
* An optional set of override options to apply to the selected build variant.
|
|
65
134
|
*
|
|
66
|
-
* @
|
|
135
|
+
* @remarks
|
|
136
|
+
* This option allows you to provide configuration options with the guarantee that they will **not** be overridden and will take precedence over other build configurations.
|
|
67
137
|
*/
|
|
68
|
-
|
|
138
|
+
override?: Record<string, any>;
|
|
69
139
|
}
|
|
70
|
-
type BuildResolvedConfig = BuildConfig
|
|
140
|
+
type BuildResolvedConfig = Omit<BuildConfig, "override">;
|
|
71
141
|
|
|
72
142
|
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "release", "finalize"];
|
|
73
143
|
type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
|
|
@@ -82,7 +152,7 @@ interface ResolvedEntryTypeDefinition extends TypeDefinition {
|
|
|
82
152
|
*/
|
|
83
153
|
output?: string;
|
|
84
154
|
}
|
|
85
|
-
type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "mode" | "ssr" | "preview"
|
|
155
|
+
type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "mode" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "mode" | "ssr">> & {
|
|
86
156
|
/**
|
|
87
157
|
* The name of the environment
|
|
88
158
|
*/
|
|
@@ -99,7 +169,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
|
|
|
99
169
|
/**
|
|
100
170
|
* The resolved options for the Powerlines project configuration.
|
|
101
171
|
*/
|
|
102
|
-
type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "
|
|
172
|
+
type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "variant" | "type" | "output" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "framework">> & {
|
|
103
173
|
/**
|
|
104
174
|
* The configuration options that were provided inline to the Powerlines CLI.
|
|
105
175
|
*/
|
|
@@ -130,6 +200,13 @@ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserCon
|
|
|
130
200
|
* The output configuration options to use for the build process
|
|
131
201
|
*/
|
|
132
202
|
output: OutputResolvedConfig;
|
|
203
|
+
/**
|
|
204
|
+
* Configuration provided to build processes
|
|
205
|
+
*
|
|
206
|
+
* @remarks
|
|
207
|
+
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
|
|
208
|
+
*/
|
|
209
|
+
build: Omit<TUserConfig["build"], "override"> & Required<Pick<Required<TUserConfig["build"]>, "override">>;
|
|
133
210
|
/**
|
|
134
211
|
* The log level to use for the Powerlines processes.
|
|
135
212
|
*
|
|
@@ -160,6 +237,10 @@ interface GenerateTypesResult {
|
|
|
160
237
|
directives?: string[];
|
|
161
238
|
code: string;
|
|
162
239
|
}
|
|
240
|
+
type DeepPartial<T> = {
|
|
241
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
242
|
+
};
|
|
243
|
+
type ConfigResult<TContext extends PluginContext = PluginContext> = DeepPartial<TContext["config"]> & Record<string, any>;
|
|
163
244
|
interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext> extends Record<CommandType, (this: TContext) => MaybePromise<void>> {
|
|
164
245
|
/**
|
|
165
246
|
* A function that returns configuration options to be merged with the build context's options.
|
|
@@ -175,7 +256,7 @@ interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext
|
|
|
175
256
|
* @param config - The partial configuration object to be modified.
|
|
176
257
|
* @returns A promise that resolves to a partial configuration object.
|
|
177
258
|
*/
|
|
178
|
-
config: (this:
|
|
259
|
+
config: (this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>;
|
|
179
260
|
/**
|
|
180
261
|
* Modify environment configs before it's resolved. The hook can either mutate the passed-in environment config directly, or return a partial config object that will be deeply merged into existing config.
|
|
181
262
|
*
|
|
@@ -283,7 +364,7 @@ type PluginHooks<TContext extends PluginContext = PluginContext> = {
|
|
|
283
364
|
* @param config - The partial configuration object to be modified.
|
|
284
365
|
* @returns A promise that resolves to a partial configuration object.
|
|
285
366
|
*/
|
|
286
|
-
config: PluginHook<(this:
|
|
367
|
+
config: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>> | ConfigResult<TContext>;
|
|
287
368
|
/**
|
|
288
369
|
* A hook that is called to transform the source code.
|
|
289
370
|
*
|
|
@@ -858,7 +939,13 @@ interface InitContextOptions {
|
|
|
858
939
|
*/
|
|
859
940
|
isHighPriority: boolean;
|
|
860
941
|
}
|
|
861
|
-
|
|
942
|
+
/**
|
|
943
|
+
* The unresolved Powerlines context.
|
|
944
|
+
*
|
|
945
|
+
* @remarks
|
|
946
|
+
* This context is used before the user configuration has been fully resolved after the `config`.
|
|
947
|
+
*/
|
|
948
|
+
interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
|
|
862
949
|
/**
|
|
863
950
|
* The Storm workspace configuration
|
|
864
951
|
*/
|
|
@@ -866,7 +953,10 @@ interface Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
|
|
|
866
953
|
/**
|
|
867
954
|
* An object containing the options provided to Powerlines
|
|
868
955
|
*/
|
|
869
|
-
config: TResolvedConfig
|
|
956
|
+
config: Omit<TResolvedConfig["userConfig"], "build" | "output"> & Required<Pick<TResolvedConfig["userConfig"], "build" | "output">> & {
|
|
957
|
+
projectRoot: NonUndefined<TResolvedConfig["userConfig"]["root"]>;
|
|
958
|
+
output: TResolvedConfig["output"];
|
|
959
|
+
};
|
|
870
960
|
/**
|
|
871
961
|
* A logging function for the Powerlines engine
|
|
872
962
|
*/
|
|
@@ -1023,6 +1113,12 @@ interface Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
|
|
|
1023
1113
|
*/
|
|
1024
1114
|
extendLog: (name: string) => LogFn;
|
|
1025
1115
|
}
|
|
1116
|
+
type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = Omit<UnresolvedContext<TResolvedConfig>, "config"> & {
|
|
1117
|
+
/**
|
|
1118
|
+
* The fully resolved Powerlines configuration
|
|
1119
|
+
*/
|
|
1120
|
+
config: TResolvedConfig;
|
|
1121
|
+
};
|
|
1026
1122
|
interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig>, UnpluginContext {
|
|
1027
1123
|
/**
|
|
1028
1124
|
* The environment specific resolved configuration
|
|
@@ -1062,7 +1158,7 @@ type PluginConfigObject<TContext extends PluginContext = PluginContext, TOptions
|
|
|
1062
1158
|
* A configuration tuple for a Powerlines plugin.
|
|
1063
1159
|
*/
|
|
1064
1160
|
type PluginConfig<TContext extends PluginContext = PluginContext> = string | PluginFactory<TContext, void> | Plugin<TContext> | Promise<Plugin<TContext>> | PluginConfigTuple<TContext> | PluginConfigObject<TContext>;
|
|
1065
|
-
type PartialPlugin<in out TContext extends PluginContext = PluginContext> = DeepPartial<Plugin<TContext>>;
|
|
1161
|
+
type PartialPlugin<in out TContext extends PluginContext = PluginContext> = DeepPartial$1<Plugin<TContext>>;
|
|
1066
1162
|
type PartialPluginFactory<in out TContext extends PluginContext = PluginContext, TOptions = any> = (options: TOptions) => MaybePromise<PartialPlugin<TContext>>;
|
|
1067
1163
|
type ProjectType = "application" | "library";
|
|
1068
1164
|
interface OutputConfig {
|
|
@@ -1163,24 +1259,33 @@ interface BaseConfig {
|
|
|
1163
1259
|
* The entry point(s) for the application
|
|
1164
1260
|
*/
|
|
1165
1261
|
entry?: TypeDefinitionParameter | TypeDefinitionParameter[];
|
|
1262
|
+
/**
|
|
1263
|
+
* Configuration for the output of the build process
|
|
1264
|
+
*/
|
|
1265
|
+
output?: OutputConfig;
|
|
1166
1266
|
/**
|
|
1167
1267
|
* Configuration for linting the source code
|
|
1268
|
+
*
|
|
1269
|
+
* @remarks
|
|
1270
|
+
* If set to `false`, linting will be disabled.
|
|
1168
1271
|
*/
|
|
1169
1272
|
lint?: Record<string, any> | false;
|
|
1170
1273
|
/**
|
|
1171
1274
|
* Configuration for testing the source code
|
|
1275
|
+
*
|
|
1276
|
+
* @remarks
|
|
1277
|
+
* If set to `false`, testing will be disabled.
|
|
1172
1278
|
*/
|
|
1173
1279
|
test?: Record<string, any> | false;
|
|
1174
|
-
/**
|
|
1175
|
-
* Configuration for the output of the build process
|
|
1176
|
-
*/
|
|
1177
|
-
output?: OutputConfig;
|
|
1178
1280
|
/**
|
|
1179
1281
|
* Configuration for the transformation of the source code
|
|
1180
1282
|
*/
|
|
1181
1283
|
transform?: Record<string, any>;
|
|
1182
1284
|
/**
|
|
1183
|
-
*
|
|
1285
|
+
* Configuration provided to build processes
|
|
1286
|
+
*
|
|
1287
|
+
* @remarks
|
|
1288
|
+
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
|
|
1184
1289
|
*/
|
|
1185
1290
|
build?: BuildConfig;
|
|
1186
1291
|
/**
|
|
@@ -1210,37 +1315,6 @@ interface BaseConfig {
|
|
|
1210
1315
|
tsconfigRaw?: TSConfig;
|
|
1211
1316
|
}
|
|
1212
1317
|
interface EnvironmentConfig extends BaseConfig {
|
|
1213
|
-
/**
|
|
1214
|
-
* Array of strings indicating the order in which fields in a package.json file should be resolved to determine the entry point for a module.
|
|
1215
|
-
*
|
|
1216
|
-
* @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
|
|
1217
|
-
*/
|
|
1218
|
-
mainFields?: string[];
|
|
1219
|
-
/**
|
|
1220
|
-
* Array of strings indicating what conditions should be used for module resolution.
|
|
1221
|
-
*/
|
|
1222
|
-
conditions?: string[];
|
|
1223
|
-
/**
|
|
1224
|
-
* Array of strings indicating what conditions should be used for external modules.
|
|
1225
|
-
*/
|
|
1226
|
-
externalConditions?: string[];
|
|
1227
|
-
/**
|
|
1228
|
-
* Array of strings indicating what file extensions should be used for module resolution.
|
|
1229
|
-
*
|
|
1230
|
-
* @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
|
|
1231
|
-
*/
|
|
1232
|
-
extensions?: string[];
|
|
1233
|
-
/**
|
|
1234
|
-
* Array of strings indicating what modules should be deduplicated to a single version in the build.
|
|
1235
|
-
*
|
|
1236
|
-
* @remarks
|
|
1237
|
-
* This option is useful for ensuring that only one version of a module is included in the bundle, which can help reduce bundle size and avoid conflicts.
|
|
1238
|
-
*/
|
|
1239
|
-
dedupe?: string[];
|
|
1240
|
-
/**
|
|
1241
|
-
* Array of strings or regular expressions that indicate what modules are builtin for the environment.
|
|
1242
|
-
*/
|
|
1243
|
-
builtins?: (string | RegExp)[];
|
|
1244
1318
|
/**
|
|
1245
1319
|
* Configuration options for the preview server
|
|
1246
1320
|
*/
|
|
@@ -1313,14 +1387,26 @@ interface CommonUserConfig extends BaseConfig {
|
|
|
1313
1387
|
*/
|
|
1314
1388
|
framework?: string;
|
|
1315
1389
|
}
|
|
1316
|
-
type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> = CommonUserConfig & {
|
|
1317
|
-
|
|
1390
|
+
type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> = Omit<CommonUserConfig, "build"> & {
|
|
1391
|
+
/**
|
|
1392
|
+
* Configuration provided to build processes
|
|
1393
|
+
*
|
|
1394
|
+
* @remarks
|
|
1395
|
+
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
|
|
1396
|
+
*/
|
|
1397
|
+
build: Omit<TBuildConfig, "override"> & {
|
|
1318
1398
|
/**
|
|
1319
1399
|
* The build variant being used by the Powerlines engine.
|
|
1320
1400
|
*/
|
|
1321
1401
|
variant?: TBuildVariant;
|
|
1402
|
+
/**
|
|
1403
|
+
* An optional set of override options to apply to the selected build variant.
|
|
1404
|
+
*
|
|
1405
|
+
* @remarks
|
|
1406
|
+
* This option allows you to provide configuration options with the guarantee that they will **not** be overridden and will take precedence over other build configurations.
|
|
1407
|
+
*/
|
|
1408
|
+
override?: Partial<TBuildResolvedConfig>;
|
|
1322
1409
|
};
|
|
1323
|
-
override?: Partial<TBuildResolvedConfig>;
|
|
1324
1410
|
};
|
|
1325
1411
|
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "release" | "clean";
|
|
1326
1412
|
/**
|
|
@@ -1333,4 +1419,4 @@ type InlineConfig<TUserConfig extends UserConfig = UserConfig> = Partial<TUserCo
|
|
|
1333
1419
|
command: PowerlinesCommand;
|
|
1334
1420
|
};
|
|
1335
1421
|
|
|
1336
|
-
export type { BuildVariant as B, Context as C, ExternalPluginHookFunctions as E, GenerateTypesResult as G, PluginContext as P, ResolvedConfig as R, Plugin as a, PluginFactory as b, PartialPlugin as c, PartialPluginFactory as d, BasePluginHookFunctions as e, PluginHookFunctions as f, PluginHookObject as g, PluginConfigObject as h, PluginConfigTuple as i, PluginConfig as j, PluginHook as k,
|
|
1422
|
+
export type { BuildVariant as B, Context as C, ExternalPluginHookFunctions as E, GenerateTypesResult as G, PluginContext as P, ResolvedConfig as R, UnresolvedContext as U, Plugin as a, PluginFactory as b, PartialPlugin as c, PartialPluginFactory as d, BasePluginHookFunctions as e, PluginHookFunctions as f, PluginHookObject as g, PluginConfigObject as h, PluginConfigTuple as i, PluginConfig as j, PluginHook as k, ConfigResult as l, EnvironmentConfig as m, EnvironmentResolvedConfig as n };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Format } from '@storm-software/build-tools/types';
|
|
2
2
|
import { LogLevelLabel } from '@storm-software/config-tools/types';
|
|
3
3
|
import { StormWorkspaceConfig } from '@storm-software/config/types';
|
|
4
|
-
import { NonUndefined, MaybePromise, FunctionLike, DeepPartial } from '@stryke/types/base';
|
|
4
|
+
import { NonUndefined, MaybePromise, FunctionLike, DeepPartial as DeepPartial$1 } from '@stryke/types/base';
|
|
5
5
|
import { TypeDefinition, TypeDefinitionParameter } from '@stryke/types/configuration';
|
|
6
6
|
import { AssetGlob } from '@stryke/types/file';
|
|
7
7
|
import { ResolvedPreviewOptions, PreviewOptions } from 'vite';
|
|
@@ -28,6 +28,73 @@ interface BuildConfig {
|
|
|
28
28
|
* @defaultValue "neutral"
|
|
29
29
|
*/
|
|
30
30
|
platform?: "node" | "browser" | "neutral";
|
|
31
|
+
/**
|
|
32
|
+
* Array of strings indicating the order in which fields in a package.json file should be resolved to determine the entry point for a module.
|
|
33
|
+
*
|
|
34
|
+
* @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
|
|
35
|
+
*/
|
|
36
|
+
mainFields?: string[];
|
|
37
|
+
/**
|
|
38
|
+
* Array of strings indicating what conditions should be used for module resolution.
|
|
39
|
+
*/
|
|
40
|
+
conditions?: string[];
|
|
41
|
+
/**
|
|
42
|
+
* Array of strings indicating what file extensions should be used for module resolution.
|
|
43
|
+
*
|
|
44
|
+
* @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
|
|
45
|
+
*/
|
|
46
|
+
extensions?: string[];
|
|
47
|
+
/**
|
|
48
|
+
* Array of strings indicating what modules should be deduplicated to a single version in the build.
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* This option is useful for ensuring that only one version of a module is included in the bundle, which can help reduce bundle size and avoid conflicts.
|
|
52
|
+
*/
|
|
53
|
+
dedupe?: string[];
|
|
54
|
+
/**
|
|
55
|
+
* Array of strings or regular expressions that indicate what modules are builtin for the environment.
|
|
56
|
+
*/
|
|
57
|
+
builtins?: (string | RegExp)[];
|
|
58
|
+
/**
|
|
59
|
+
* Define global variable replacements.
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* This option allows you to specify global constants that will be replaced in the code during the build process. It is similar to the `define` option in esbuild and Vite, enabling you to replace specific identifiers with constant expressions at build time.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* {
|
|
67
|
+
* define: {
|
|
68
|
+
* __VERSION__: '"1.0.0"',
|
|
69
|
+
* __DEV__: 'process.env.NODE_ENV !== "production"'
|
|
70
|
+
* }
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @see https://esbuild.github.io/api/#define
|
|
75
|
+
* @see https://vitejs.dev/config/build-options.html#define
|
|
76
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/replace
|
|
77
|
+
*/
|
|
78
|
+
define?: Record<string, any>;
|
|
79
|
+
/**
|
|
80
|
+
* Global variables that will have import statements injected where necessary
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* This option allows you to specify global variables that should be automatically imported from specified modules whenever they are used in the code. This is particularly useful for polyfilling Node.js globals in a browser environment.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* {
|
|
88
|
+
* inject: {
|
|
89
|
+
* process: 'process/browser',
|
|
90
|
+
* Buffer: ['buffer', 'Buffer'],
|
|
91
|
+
* }
|
|
92
|
+
* }
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/inject
|
|
96
|
+
*/
|
|
97
|
+
inject?: Record<string, string | string[]>;
|
|
31
98
|
/**
|
|
32
99
|
* The alias mappings to use for module resolution during the build process.
|
|
33
100
|
*
|
|
@@ -43,6 +110,8 @@ interface BuildConfig {
|
|
|
43
110
|
* }
|
|
44
111
|
* }
|
|
45
112
|
* ```
|
|
113
|
+
*
|
|
114
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/alias
|
|
46
115
|
*/
|
|
47
116
|
alias?: Record<string, string>;
|
|
48
117
|
/**
|
|
@@ -61,13 +130,14 @@ interface BuildConfig {
|
|
|
61
130
|
*/
|
|
62
131
|
skipNodeModulesBundle?: boolean;
|
|
63
132
|
/**
|
|
64
|
-
*
|
|
133
|
+
* An optional set of override options to apply to the selected build variant.
|
|
65
134
|
*
|
|
66
|
-
* @
|
|
135
|
+
* @remarks
|
|
136
|
+
* This option allows you to provide configuration options with the guarantee that they will **not** be overridden and will take precedence over other build configurations.
|
|
67
137
|
*/
|
|
68
|
-
|
|
138
|
+
override?: Record<string, any>;
|
|
69
139
|
}
|
|
70
|
-
type BuildResolvedConfig = BuildConfig
|
|
140
|
+
type BuildResolvedConfig = Omit<BuildConfig, "override">;
|
|
71
141
|
|
|
72
142
|
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "release", "finalize"];
|
|
73
143
|
type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
|
|
@@ -82,7 +152,7 @@ interface ResolvedEntryTypeDefinition extends TypeDefinition {
|
|
|
82
152
|
*/
|
|
83
153
|
output?: string;
|
|
84
154
|
}
|
|
85
|
-
type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "mode" | "ssr" | "preview"
|
|
155
|
+
type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "mode" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "mode" | "ssr">> & {
|
|
86
156
|
/**
|
|
87
157
|
* The name of the environment
|
|
88
158
|
*/
|
|
@@ -99,7 +169,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
|
|
|
99
169
|
/**
|
|
100
170
|
* The resolved options for the Powerlines project configuration.
|
|
101
171
|
*/
|
|
102
|
-
type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "
|
|
172
|
+
type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "variant" | "type" | "output" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "framework">> & {
|
|
103
173
|
/**
|
|
104
174
|
* The configuration options that were provided inline to the Powerlines CLI.
|
|
105
175
|
*/
|
|
@@ -130,6 +200,13 @@ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserCon
|
|
|
130
200
|
* The output configuration options to use for the build process
|
|
131
201
|
*/
|
|
132
202
|
output: OutputResolvedConfig;
|
|
203
|
+
/**
|
|
204
|
+
* Configuration provided to build processes
|
|
205
|
+
*
|
|
206
|
+
* @remarks
|
|
207
|
+
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
|
|
208
|
+
*/
|
|
209
|
+
build: Omit<TUserConfig["build"], "override"> & Required<Pick<Required<TUserConfig["build"]>, "override">>;
|
|
133
210
|
/**
|
|
134
211
|
* The log level to use for the Powerlines processes.
|
|
135
212
|
*
|
|
@@ -160,6 +237,10 @@ interface GenerateTypesResult {
|
|
|
160
237
|
directives?: string[];
|
|
161
238
|
code: string;
|
|
162
239
|
}
|
|
240
|
+
type DeepPartial<T> = {
|
|
241
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
242
|
+
};
|
|
243
|
+
type ConfigResult<TContext extends PluginContext = PluginContext> = DeepPartial<TContext["config"]> & Record<string, any>;
|
|
163
244
|
interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext> extends Record<CommandType, (this: TContext) => MaybePromise<void>> {
|
|
164
245
|
/**
|
|
165
246
|
* A function that returns configuration options to be merged with the build context's options.
|
|
@@ -175,7 +256,7 @@ interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext
|
|
|
175
256
|
* @param config - The partial configuration object to be modified.
|
|
176
257
|
* @returns A promise that resolves to a partial configuration object.
|
|
177
258
|
*/
|
|
178
|
-
config: (this:
|
|
259
|
+
config: (this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>;
|
|
179
260
|
/**
|
|
180
261
|
* Modify environment configs before it's resolved. The hook can either mutate the passed-in environment config directly, or return a partial config object that will be deeply merged into existing config.
|
|
181
262
|
*
|
|
@@ -283,7 +364,7 @@ type PluginHooks<TContext extends PluginContext = PluginContext> = {
|
|
|
283
364
|
* @param config - The partial configuration object to be modified.
|
|
284
365
|
* @returns A promise that resolves to a partial configuration object.
|
|
285
366
|
*/
|
|
286
|
-
config: PluginHook<(this:
|
|
367
|
+
config: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>> | ConfigResult<TContext>;
|
|
287
368
|
/**
|
|
288
369
|
* A hook that is called to transform the source code.
|
|
289
370
|
*
|
|
@@ -858,7 +939,13 @@ interface InitContextOptions {
|
|
|
858
939
|
*/
|
|
859
940
|
isHighPriority: boolean;
|
|
860
941
|
}
|
|
861
|
-
|
|
942
|
+
/**
|
|
943
|
+
* The unresolved Powerlines context.
|
|
944
|
+
*
|
|
945
|
+
* @remarks
|
|
946
|
+
* This context is used before the user configuration has been fully resolved after the `config`.
|
|
947
|
+
*/
|
|
948
|
+
interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
|
|
862
949
|
/**
|
|
863
950
|
* The Storm workspace configuration
|
|
864
951
|
*/
|
|
@@ -866,7 +953,10 @@ interface Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
|
|
|
866
953
|
/**
|
|
867
954
|
* An object containing the options provided to Powerlines
|
|
868
955
|
*/
|
|
869
|
-
config: TResolvedConfig
|
|
956
|
+
config: Omit<TResolvedConfig["userConfig"], "build" | "output"> & Required<Pick<TResolvedConfig["userConfig"], "build" | "output">> & {
|
|
957
|
+
projectRoot: NonUndefined<TResolvedConfig["userConfig"]["root"]>;
|
|
958
|
+
output: TResolvedConfig["output"];
|
|
959
|
+
};
|
|
870
960
|
/**
|
|
871
961
|
* A logging function for the Powerlines engine
|
|
872
962
|
*/
|
|
@@ -1023,6 +1113,12 @@ interface Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
|
|
|
1023
1113
|
*/
|
|
1024
1114
|
extendLog: (name: string) => LogFn;
|
|
1025
1115
|
}
|
|
1116
|
+
type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = Omit<UnresolvedContext<TResolvedConfig>, "config"> & {
|
|
1117
|
+
/**
|
|
1118
|
+
* The fully resolved Powerlines configuration
|
|
1119
|
+
*/
|
|
1120
|
+
config: TResolvedConfig;
|
|
1121
|
+
};
|
|
1026
1122
|
interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig>, UnpluginContext {
|
|
1027
1123
|
/**
|
|
1028
1124
|
* The environment specific resolved configuration
|
|
@@ -1062,7 +1158,7 @@ type PluginConfigObject<TContext extends PluginContext = PluginContext, TOptions
|
|
|
1062
1158
|
* A configuration tuple for a Powerlines plugin.
|
|
1063
1159
|
*/
|
|
1064
1160
|
type PluginConfig<TContext extends PluginContext = PluginContext> = string | PluginFactory<TContext, void> | Plugin<TContext> | Promise<Plugin<TContext>> | PluginConfigTuple<TContext> | PluginConfigObject<TContext>;
|
|
1065
|
-
type PartialPlugin<in out TContext extends PluginContext = PluginContext> = DeepPartial<Plugin<TContext>>;
|
|
1161
|
+
type PartialPlugin<in out TContext extends PluginContext = PluginContext> = DeepPartial$1<Plugin<TContext>>;
|
|
1066
1162
|
type PartialPluginFactory<in out TContext extends PluginContext = PluginContext, TOptions = any> = (options: TOptions) => MaybePromise<PartialPlugin<TContext>>;
|
|
1067
1163
|
type ProjectType = "application" | "library";
|
|
1068
1164
|
interface OutputConfig {
|
|
@@ -1163,24 +1259,33 @@ interface BaseConfig {
|
|
|
1163
1259
|
* The entry point(s) for the application
|
|
1164
1260
|
*/
|
|
1165
1261
|
entry?: TypeDefinitionParameter | TypeDefinitionParameter[];
|
|
1262
|
+
/**
|
|
1263
|
+
* Configuration for the output of the build process
|
|
1264
|
+
*/
|
|
1265
|
+
output?: OutputConfig;
|
|
1166
1266
|
/**
|
|
1167
1267
|
* Configuration for linting the source code
|
|
1268
|
+
*
|
|
1269
|
+
* @remarks
|
|
1270
|
+
* If set to `false`, linting will be disabled.
|
|
1168
1271
|
*/
|
|
1169
1272
|
lint?: Record<string, any> | false;
|
|
1170
1273
|
/**
|
|
1171
1274
|
* Configuration for testing the source code
|
|
1275
|
+
*
|
|
1276
|
+
* @remarks
|
|
1277
|
+
* If set to `false`, testing will be disabled.
|
|
1172
1278
|
*/
|
|
1173
1279
|
test?: Record<string, any> | false;
|
|
1174
|
-
/**
|
|
1175
|
-
* Configuration for the output of the build process
|
|
1176
|
-
*/
|
|
1177
|
-
output?: OutputConfig;
|
|
1178
1280
|
/**
|
|
1179
1281
|
* Configuration for the transformation of the source code
|
|
1180
1282
|
*/
|
|
1181
1283
|
transform?: Record<string, any>;
|
|
1182
1284
|
/**
|
|
1183
|
-
*
|
|
1285
|
+
* Configuration provided to build processes
|
|
1286
|
+
*
|
|
1287
|
+
* @remarks
|
|
1288
|
+
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
|
|
1184
1289
|
*/
|
|
1185
1290
|
build?: BuildConfig;
|
|
1186
1291
|
/**
|
|
@@ -1210,37 +1315,6 @@ interface BaseConfig {
|
|
|
1210
1315
|
tsconfigRaw?: TSConfig;
|
|
1211
1316
|
}
|
|
1212
1317
|
interface EnvironmentConfig extends BaseConfig {
|
|
1213
|
-
/**
|
|
1214
|
-
* Array of strings indicating the order in which fields in a package.json file should be resolved to determine the entry point for a module.
|
|
1215
|
-
*
|
|
1216
|
-
* @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
|
|
1217
|
-
*/
|
|
1218
|
-
mainFields?: string[];
|
|
1219
|
-
/**
|
|
1220
|
-
* Array of strings indicating what conditions should be used for module resolution.
|
|
1221
|
-
*/
|
|
1222
|
-
conditions?: string[];
|
|
1223
|
-
/**
|
|
1224
|
-
* Array of strings indicating what conditions should be used for external modules.
|
|
1225
|
-
*/
|
|
1226
|
-
externalConditions?: string[];
|
|
1227
|
-
/**
|
|
1228
|
-
* Array of strings indicating what file extensions should be used for module resolution.
|
|
1229
|
-
*
|
|
1230
|
-
* @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
|
|
1231
|
-
*/
|
|
1232
|
-
extensions?: string[];
|
|
1233
|
-
/**
|
|
1234
|
-
* Array of strings indicating what modules should be deduplicated to a single version in the build.
|
|
1235
|
-
*
|
|
1236
|
-
* @remarks
|
|
1237
|
-
* This option is useful for ensuring that only one version of a module is included in the bundle, which can help reduce bundle size and avoid conflicts.
|
|
1238
|
-
*/
|
|
1239
|
-
dedupe?: string[];
|
|
1240
|
-
/**
|
|
1241
|
-
* Array of strings or regular expressions that indicate what modules are builtin for the environment.
|
|
1242
|
-
*/
|
|
1243
|
-
builtins?: (string | RegExp)[];
|
|
1244
1318
|
/**
|
|
1245
1319
|
* Configuration options for the preview server
|
|
1246
1320
|
*/
|
|
@@ -1313,14 +1387,26 @@ interface CommonUserConfig extends BaseConfig {
|
|
|
1313
1387
|
*/
|
|
1314
1388
|
framework?: string;
|
|
1315
1389
|
}
|
|
1316
|
-
type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> = CommonUserConfig & {
|
|
1317
|
-
|
|
1390
|
+
type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> = Omit<CommonUserConfig, "build"> & {
|
|
1391
|
+
/**
|
|
1392
|
+
* Configuration provided to build processes
|
|
1393
|
+
*
|
|
1394
|
+
* @remarks
|
|
1395
|
+
* This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
|
|
1396
|
+
*/
|
|
1397
|
+
build: Omit<TBuildConfig, "override"> & {
|
|
1318
1398
|
/**
|
|
1319
1399
|
* The build variant being used by the Powerlines engine.
|
|
1320
1400
|
*/
|
|
1321
1401
|
variant?: TBuildVariant;
|
|
1402
|
+
/**
|
|
1403
|
+
* An optional set of override options to apply to the selected build variant.
|
|
1404
|
+
*
|
|
1405
|
+
* @remarks
|
|
1406
|
+
* This option allows you to provide configuration options with the guarantee that they will **not** be overridden and will take precedence over other build configurations.
|
|
1407
|
+
*/
|
|
1408
|
+
override?: Partial<TBuildResolvedConfig>;
|
|
1322
1409
|
};
|
|
1323
|
-
override?: Partial<TBuildResolvedConfig>;
|
|
1324
1410
|
};
|
|
1325
1411
|
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "release" | "clean";
|
|
1326
1412
|
/**
|
|
@@ -1333,4 +1419,4 @@ type InlineConfig<TUserConfig extends UserConfig = UserConfig> = Partial<TUserCo
|
|
|
1333
1419
|
command: PowerlinesCommand;
|
|
1334
1420
|
};
|
|
1335
1421
|
|
|
1336
|
-
export type { BuildVariant as B, Context as C, ExternalPluginHookFunctions as E, GenerateTypesResult as G, PluginContext as P, ResolvedConfig as R, Plugin as a, PluginFactory as b, PartialPlugin as c, PartialPluginFactory as d, BasePluginHookFunctions as e, PluginHookFunctions as f, PluginHookObject as g, PluginConfigObject as h, PluginConfigTuple as i, PluginConfig as j, PluginHook as k,
|
|
1422
|
+
export type { BuildVariant as B, Context as C, ExternalPluginHookFunctions as E, GenerateTypesResult as G, PluginContext as P, ResolvedConfig as R, UnresolvedContext as U, Plugin as a, PluginFactory as b, PartialPlugin as c, PartialPluginFactory as d, BasePluginHookFunctions as e, PluginHookFunctions as f, PluginHookObject as g, PluginConfigObject as h, PluginConfigTuple as i, PluginConfig as j, PluginHook as k, ConfigResult as l, EnvironmentConfig as m, EnvironmentResolvedConfig as n };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PluginContext, B as BuildVariant, a as Plugin, b as PluginFactory } from './config-
|
|
1
|
+
import { P as PluginContext, B as BuildVariant, a as Plugin, b as PluginFactory } from './config-pwKiZvzJ.cjs';
|
|
2
2
|
import '@storm-software/build-tools/types';
|
|
3
3
|
import '@storm-software/config-tools/types';
|
|
4
4
|
import '@storm-software/config/types';
|