@powerlines/plugin-unbuild 0.5.130 → 0.5.132

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/index-BgAdqTbb.d.mts +1 -0
  2. package/dist/index-CEgs-Dz2.d.cts +1 -0
  3. package/dist/index.cjs +305 -4
  4. package/dist/index.d.cts +2 -2
  5. package/dist/index.d.mts +2 -3
  6. package/dist/index.mjs +270 -1
  7. package/dist/plugin-1QId2-vF.d.cts +1762 -0
  8. package/dist/plugin-BzSd-mPe.d.mts +1763 -0
  9. package/dist/plugin-C3MaN5jp.mjs +1 -0
  10. package/dist/plugin-DHXHjv16.cjs +0 -0
  11. package/dist/types/index.cjs +2 -0
  12. package/dist/types/index.d.cts +2 -1
  13. package/dist/types/index.d.mts +2 -1
  14. package/dist/types/index.mjs +3 -0
  15. package/dist/types/plugin.cjs +1 -0
  16. package/dist/types/plugin.d.cts +1 -12
  17. package/dist/types/plugin.d.mts +1 -12
  18. package/dist/types/plugin.mjs +2 -0
  19. package/dist/types-CTUnla4x.mjs +1 -0
  20. package/dist/types-DHkg7xmX.cjs +0 -0
  21. package/package.json +5 -5
  22. package/dist/_virtual/rolldown_runtime.cjs +0 -29
  23. package/dist/powerlines/src/lib/build/rollup.cjs +0 -134
  24. package/dist/powerlines/src/lib/build/rollup.mjs +0 -127
  25. package/dist/powerlines/src/lib/build/unbuild.cjs +0 -135
  26. package/dist/powerlines/src/lib/build/unbuild.mjs +0 -132
  27. package/dist/powerlines/src/lib/utilities/source-file.cjs +0 -22
  28. package/dist/powerlines/src/lib/utilities/source-file.mjs +0 -21
  29. package/dist/powerlines/src/types/babel.d.mts +0 -2
  30. package/dist/powerlines/src/types/build.d.cts +0 -149
  31. package/dist/powerlines/src/types/build.d.mts +0 -150
  32. package/dist/powerlines/src/types/commands.d.cts +0 -8
  33. package/dist/powerlines/src/types/commands.d.mts +0 -9
  34. package/dist/powerlines/src/types/config.d.cts +0 -370
  35. package/dist/powerlines/src/types/config.d.mts +0 -370
  36. package/dist/powerlines/src/types/context.d.cts +0 -403
  37. package/dist/powerlines/src/types/context.d.mts +0 -405
  38. package/dist/powerlines/src/types/fs.d.cts +0 -486
  39. package/dist/powerlines/src/types/fs.d.mts +0 -486
  40. package/dist/powerlines/src/types/hooks.d.mts +0 -2
  41. package/dist/powerlines/src/types/plugin.d.cts +0 -231
  42. package/dist/powerlines/src/types/plugin.d.mts +0 -231
  43. package/dist/powerlines/src/types/resolved.d.cts +0 -82
  44. package/dist/powerlines/src/types/resolved.d.mts +0 -83
  45. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  46. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
@@ -1,22 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
- require("@stryke/fs/read-file");
3
- let __stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
4
- let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
5
- require("magic-string");
6
-
7
- //#region ../powerlines/src/lib/utilities/source-file.ts
8
- /**
9
- * Get the string from the source.
10
- *
11
- * @param code - The source string or magic string.
12
- * @returns The source string.
13
- */
14
- function getString(code) {
15
- if (!code) return "";
16
- if ((0, __stryke_type_checks_is_string.isString)(code)) return code;
17
- if ((0, __stryke_type_checks_is_set_object.isSetObject)(code) && "code" in code) return code.code;
18
- return code.toString();
19
- }
20
-
21
- //#endregion
22
- exports.getString = getString;
@@ -1,21 +0,0 @@
1
- import "@stryke/fs/read-file";
2
- import { isSetObject } from "@stryke/type-checks/is-set-object";
3
- import { isString } from "@stryke/type-checks/is-string";
4
- import "magic-string";
5
-
6
- //#region ../powerlines/src/lib/utilities/source-file.ts
7
- /**
8
- * Get the string from the source.
9
- *
10
- * @param code - The source string or magic string.
11
- * @returns The source string.
12
- */
13
- function getString(code) {
14
- if (!code) return "";
15
- if (isString(code)) return code;
16
- if (isSetObject(code) && "code" in code) return code.code;
17
- return code.toString();
18
- }
19
-
20
- //#endregion
21
- export { getString };
@@ -1,2 +0,0 @@
1
- import "./config.mjs";
2
- import "./context.mjs";
@@ -1,149 +0,0 @@
1
- import { UnbuildOptions } from "@storm-software/unbuild/types";
2
-
3
- //#region ../powerlines/src/types/build.d.ts
4
-
5
- type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
6
- interface BuildConfig {
7
- /**
8
- * The platform to build the project for
9
- *
10
- * @defaultValue "neutral"
11
- */
12
- platform?: "node" | "browser" | "neutral";
13
- /**
14
- * Array of strings indicating the polyfills to include for the build.
15
- *
16
- * @remarks
17
- * This option allows you to specify which polyfills should be included in the build process to ensure compatibility with the target environment. The paths for the polyfills can use placeholder tokens (the `replacePathTokens` helper function will be used to resolve the actual values).
18
- *
19
- * @example
20
- * ```ts
21
- * {
22
- * polyfill: ['{projectRoot}/custom-polyfill.ts']
23
- * }
24
- * ```
25
- */
26
- polyfill?: string[];
27
- /**
28
- * 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.
29
- *
30
- * @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
31
- */
32
- mainFields?: string[];
33
- /**
34
- * Array of strings indicating what conditions should be used for module resolution.
35
- */
36
- conditions?: string[];
37
- /**
38
- * Array of strings indicating what file extensions should be used for module resolution.
39
- *
40
- * @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
41
- */
42
- extensions?: string[];
43
- /**
44
- * Array of strings indicating what modules should be deduplicated to a single version in the build.
45
- *
46
- * @remarks
47
- * 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.
48
- */
49
- dedupe?: string[];
50
- /**
51
- * Array of strings or regular expressions that indicate what modules are builtin for the environment.
52
- */
53
- builtins?: (string | RegExp)[];
54
- /**
55
- * Define global variable replacements.
56
- *
57
- * @remarks
58
- * 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.
59
- *
60
- * @example
61
- * ```ts
62
- * {
63
- * define: {
64
- * __VERSION__: '"1.0.0"',
65
- * __DEV__: 'process.env.NODE_ENV !== "production"'
66
- * }
67
- * }
68
- * ```
69
- *
70
- * @see https://esbuild.github.io/api/#define
71
- * @see https://vitejs.dev/config/build-options.html#define
72
- * @see https://github.com/rollup/plugins/tree/master/packages/replace
73
- */
74
- define?: Record<string, any>;
75
- /**
76
- * Global variables that will have import statements injected where necessary
77
- *
78
- * @remarks
79
- * 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.
80
- *
81
- * @example
82
- * ```ts
83
- * {
84
- * inject: {
85
- * process: 'process/browser',
86
- * Buffer: ['buffer', 'Buffer'],
87
- * }
88
- * }
89
- * ```
90
- *
91
- * @see https://github.com/rollup/plugins/tree/master/packages/inject
92
- */
93
- inject?: Record<string, string | string[]>;
94
- /**
95
- * The alias mappings to use for module resolution during the build process.
96
- *
97
- * @remarks
98
- * This option allows you to define custom path aliases for modules, which can be useful for simplifying imports and managing dependencies.
99
- *
100
- * @example
101
- * ```ts
102
- * {
103
- * alias: {
104
- * "@utils": "./src/utils",
105
- * "@components": "./src/components"
106
- * }
107
- * }
108
- * ```
109
- *
110
- * @see https://github.com/rollup/plugins/tree/master/packages/alias
111
- */
112
- alias?: Record<string, string> | Array<{
113
- find: string | RegExp;
114
- replacement: string;
115
- }>;
116
- /**
117
- * A list of modules that should not be bundled, even if they are external dependencies.
118
- *
119
- * @remarks
120
- * This option is useful for excluding specific modules from the bundle, such as Node.js built-in modules or other libraries that should not be bundled.
121
- */
122
- external?: (string | RegExp)[];
123
- /**
124
- * A list of modules that should always be bundled, even if they are external dependencies.
125
- */
126
- noExternal?: (string | RegExp)[];
127
- /**
128
- * Should the Powerlines CLI processes skip bundling the `node_modules` directory?
129
- */
130
- skipNodeModulesBundle?: boolean;
131
- /**
132
- * If true, `process.env` referenced in code will be preserved as-is and evaluated in runtime. Otherwise, it is statically replaced as an empty object.
133
- *
134
- * @defaultValue false
135
- */
136
- keepProcessEnv?: boolean;
137
- /**
138
- * An optional set of override options to apply to the selected build variant.
139
- *
140
- * @remarks
141
- * 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.
142
- */
143
- override?: Record<string, any>;
144
- }
145
- type BuildResolvedConfig = Omit<BuildConfig, "override">;
146
- type UnbuildBuildConfig = Partial<Omit<UnbuildOptions, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">> & BuildConfig;
147
- type UnbuildResolvedBuildConfig = UnbuildOptions & BuildResolvedConfig;
148
- //#endregion
149
- export { BuildConfig, BuildResolvedConfig, UnbuildBuildConfig, UnbuildResolvedBuildConfig, UnpluginBuildVariant };
@@ -1,150 +0,0 @@
1
- import "esbuild";
2
- import { UnbuildOptions } from "@storm-software/unbuild/types";
3
-
4
- //#region ../powerlines/src/types/build.d.ts
5
-
6
- type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
7
- interface BuildConfig {
8
- /**
9
- * The platform to build the project for
10
- *
11
- * @defaultValue "neutral"
12
- */
13
- platform?: "node" | "browser" | "neutral";
14
- /**
15
- * Array of strings indicating the polyfills to include for the build.
16
- *
17
- * @remarks
18
- * This option allows you to specify which polyfills should be included in the build process to ensure compatibility with the target environment. The paths for the polyfills can use placeholder tokens (the `replacePathTokens` helper function will be used to resolve the actual values).
19
- *
20
- * @example
21
- * ```ts
22
- * {
23
- * polyfill: ['{projectRoot}/custom-polyfill.ts']
24
- * }
25
- * ```
26
- */
27
- polyfill?: string[];
28
- /**
29
- * 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.
30
- *
31
- * @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
32
- */
33
- mainFields?: string[];
34
- /**
35
- * Array of strings indicating what conditions should be used for module resolution.
36
- */
37
- conditions?: string[];
38
- /**
39
- * Array of strings indicating what file extensions should be used for module resolution.
40
- *
41
- * @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
42
- */
43
- extensions?: string[];
44
- /**
45
- * Array of strings indicating what modules should be deduplicated to a single version in the build.
46
- *
47
- * @remarks
48
- * 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.
49
- */
50
- dedupe?: string[];
51
- /**
52
- * Array of strings or regular expressions that indicate what modules are builtin for the environment.
53
- */
54
- builtins?: (string | RegExp)[];
55
- /**
56
- * Define global variable replacements.
57
- *
58
- * @remarks
59
- * 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.
60
- *
61
- * @example
62
- * ```ts
63
- * {
64
- * define: {
65
- * __VERSION__: '"1.0.0"',
66
- * __DEV__: 'process.env.NODE_ENV !== "production"'
67
- * }
68
- * }
69
- * ```
70
- *
71
- * @see https://esbuild.github.io/api/#define
72
- * @see https://vitejs.dev/config/build-options.html#define
73
- * @see https://github.com/rollup/plugins/tree/master/packages/replace
74
- */
75
- define?: Record<string, any>;
76
- /**
77
- * Global variables that will have import statements injected where necessary
78
- *
79
- * @remarks
80
- * 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.
81
- *
82
- * @example
83
- * ```ts
84
- * {
85
- * inject: {
86
- * process: 'process/browser',
87
- * Buffer: ['buffer', 'Buffer'],
88
- * }
89
- * }
90
- * ```
91
- *
92
- * @see https://github.com/rollup/plugins/tree/master/packages/inject
93
- */
94
- inject?: Record<string, string | string[]>;
95
- /**
96
- * The alias mappings to use for module resolution during the build process.
97
- *
98
- * @remarks
99
- * This option allows you to define custom path aliases for modules, which can be useful for simplifying imports and managing dependencies.
100
- *
101
- * @example
102
- * ```ts
103
- * {
104
- * alias: {
105
- * "@utils": "./src/utils",
106
- * "@components": "./src/components"
107
- * }
108
- * }
109
- * ```
110
- *
111
- * @see https://github.com/rollup/plugins/tree/master/packages/alias
112
- */
113
- alias?: Record<string, string> | Array<{
114
- find: string | RegExp;
115
- replacement: string;
116
- }>;
117
- /**
118
- * A list of modules that should not be bundled, even if they are external dependencies.
119
- *
120
- * @remarks
121
- * This option is useful for excluding specific modules from the bundle, such as Node.js built-in modules or other libraries that should not be bundled.
122
- */
123
- external?: (string | RegExp)[];
124
- /**
125
- * A list of modules that should always be bundled, even if they are external dependencies.
126
- */
127
- noExternal?: (string | RegExp)[];
128
- /**
129
- * Should the Powerlines CLI processes skip bundling the `node_modules` directory?
130
- */
131
- skipNodeModulesBundle?: boolean;
132
- /**
133
- * If true, `process.env` referenced in code will be preserved as-is and evaluated in runtime. Otherwise, it is statically replaced as an empty object.
134
- *
135
- * @defaultValue false
136
- */
137
- keepProcessEnv?: boolean;
138
- /**
139
- * An optional set of override options to apply to the selected build variant.
140
- *
141
- * @remarks
142
- * 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.
143
- */
144
- override?: Record<string, any>;
145
- }
146
- type BuildResolvedConfig = Omit<BuildConfig, "override">;
147
- type UnbuildBuildConfig = Partial<Omit<UnbuildOptions, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">> & BuildConfig;
148
- type UnbuildResolvedBuildConfig = UnbuildOptions & BuildResolvedConfig;
149
- //#endregion
150
- export { BuildConfig, BuildResolvedConfig, UnbuildBuildConfig, UnbuildResolvedBuildConfig, UnpluginBuildVariant };
@@ -1,8 +0,0 @@
1
- import { ArrayValues } from "@stryke/types/array";
2
- import { MaybePromise } from "@stryke/types/base";
3
-
4
- //#region ../powerlines/src/types/commands.d.ts
5
- declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
6
- type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
7
- //#endregion
8
- export { CommandType };
@@ -1,9 +0,0 @@
1
- import "./context.mjs";
2
- import { ArrayValues } from "@stryke/types/array";
3
- import { MaybePromise } from "@stryke/types/base";
4
-
5
- //#region ../powerlines/src/types/commands.d.ts
6
- declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
7
- type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
8
- //#endregion
9
- export { CommandType };