@powerlines/plugin-i18next 0.1.20 → 0.1.22

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 (48) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  2. package/dist/helpers/config-utils.cjs +31 -0
  3. package/dist/helpers/config-utils.mjs +30 -0
  4. package/dist/index.cjs +4 -60
  5. package/dist/index.d.cts +3 -3
  6. package/dist/index.d.mts +4 -3
  7. package/dist/index.mjs +1 -31
  8. package/dist/powerlines/src/types/build.d.cts +145 -0
  9. package/dist/powerlines/src/types/build.d.mts +145 -0
  10. package/dist/powerlines/src/types/commands.d.cts +8 -0
  11. package/dist/powerlines/src/types/commands.d.mts +8 -0
  12. package/dist/powerlines/src/types/config.d.cts +376 -0
  13. package/dist/powerlines/src/types/config.d.mts +376 -0
  14. package/dist/powerlines/src/types/context.d.cts +403 -0
  15. package/dist/powerlines/src/types/context.d.mts +403 -0
  16. package/dist/powerlines/src/types/fs.d.cts +486 -0
  17. package/dist/powerlines/src/types/fs.d.mts +486 -0
  18. package/dist/powerlines/src/types/plugin.d.cts +231 -0
  19. package/dist/powerlines/src/types/plugin.d.mts +231 -0
  20. package/dist/powerlines/src/types/resolved.d.cts +81 -0
  21. package/dist/powerlines/src/types/resolved.d.mts +81 -0
  22. package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
  23. package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
  24. package/dist/types/i18n.cjs +0 -1
  25. package/dist/types/i18n.d.cts +21 -1
  26. package/dist/types/i18n.d.mts +21 -1
  27. package/dist/types/i18n.mjs +0 -2
  28. package/dist/types/index.cjs +0 -3
  29. package/dist/types/index.d.cts +2 -3
  30. package/dist/types/index.d.mts +2 -3
  31. package/dist/types/index.mjs +0 -4
  32. package/dist/types/plugin.cjs +0 -1
  33. package/dist/types/plugin.d.cts +24 -1
  34. package/dist/types/plugin.d.mts +24 -1
  35. package/dist/types/plugin.mjs +0 -2
  36. package/package.json +6 -6
  37. package/dist/i18n-C5zfq1YM.d.mts +0 -22
  38. package/dist/i18n-CUSH-jI_.mjs +0 -1
  39. package/dist/i18n-ComTDYPk.d.cts +0 -22
  40. package/dist/i18n-Ctazdbgs.cjs +0 -0
  41. package/dist/index-CA4VvAY_.d.mts +0 -1
  42. package/dist/index-CmCelmEL.d.cts +0 -1
  43. package/dist/plugin-B-8QVe28.cjs +0 -0
  44. package/dist/plugin-B7p8VtjC.mjs +0 -1
  45. package/dist/plugin-Bgs_50_L.d.mts +0 -1775
  46. package/dist/plugin-Cp8UI0nI.d.cts +0 -1775
  47. package/dist/types-BReKsBV6.mjs +0 -1
  48. package/dist/types-CBTc19th.cjs +0 -0
@@ -0,0 +1,29 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ exports.__toESM = __toESM;
@@ -0,0 +1,31 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ let __stryke_path_correct_path = require("@stryke/path/correct-path");
3
+
4
+ //#region src/helpers/config-utils.ts
5
+ /**
6
+ * Resolve an output template (string or function) into an actual path string.
7
+ *
8
+ * @remarks
9
+ * - If `outputTemplate` is a function, call it with (language, namespace)
10
+ * - If it's a string, replace placeholders:
11
+ * - \{\{language\}\} or \{\{lng\}\} -\> language
12
+ * - \{\{namespace\}\} -\> namespace (or removed if namespace is undefined)
13
+ * - Normalizes duplicate slashes and returns a platform-correct path.
14
+ */
15
+ function getOutputPath(outputTemplate, language, namespace) {
16
+ if (!outputTemplate) return (0, __stryke_path_correct_path.correctPath)(`locales/${language}/${namespace ?? "translation"}.json`);
17
+ if (typeof outputTemplate === "function") try {
18
+ return (0, __stryke_path_correct_path.correctPath)(String(outputTemplate(language, namespace)).replace(/\/{2,}/g, "/"));
19
+ } catch {
20
+ return (0, __stryke_path_correct_path.correctPath)(`locales/${language}/${namespace ?? "translation"}.json`);
21
+ }
22
+ let out = String(outputTemplate);
23
+ out = out.replace(/\{\{language\}\}|\{\{lng\}\}/g, language);
24
+ if (namespace !== void 0 && namespace !== null) out = out.replace(/\{\{namespace\}\}/g, namespace);
25
+ else out = out.replace(/\/?\{\{namespace\}\}/g, "");
26
+ out = out.replace(/\/{2,}/g, "/");
27
+ return (0, __stryke_path_correct_path.correctPath)(out);
28
+ }
29
+
30
+ //#endregion
31
+ exports.getOutputPath = getOutputPath;
@@ -0,0 +1,30 @@
1
+ import { correctPath } from "@stryke/path/correct-path";
2
+
3
+ //#region src/helpers/config-utils.ts
4
+ /**
5
+ * Resolve an output template (string or function) into an actual path string.
6
+ *
7
+ * @remarks
8
+ * - If `outputTemplate` is a function, call it with (language, namespace)
9
+ * - If it's a string, replace placeholders:
10
+ * - \{\{language\}\} or \{\{lng\}\} -\> language
11
+ * - \{\{namespace\}\} -\> namespace (or removed if namespace is undefined)
12
+ * - Normalizes duplicate slashes and returns a platform-correct path.
13
+ */
14
+ function getOutputPath(outputTemplate, language, namespace) {
15
+ if (!outputTemplate) return correctPath(`locales/${language}/${namespace ?? "translation"}.json`);
16
+ if (typeof outputTemplate === "function") try {
17
+ return correctPath(String(outputTemplate(language, namespace)).replace(/\/{2,}/g, "/"));
18
+ } catch {
19
+ return correctPath(`locales/${language}/${namespace ?? "translation"}.json`);
20
+ }
21
+ let out = String(outputTemplate);
22
+ out = out.replace(/\{\{language\}\}|\{\{lng\}\}/g, language);
23
+ if (namespace !== void 0 && namespace !== null) out = out.replace(/\{\{namespace\}\}/g, namespace);
24
+ else out = out.replace(/\/?\{\{namespace\}\}/g, "");
25
+ out = out.replace(/\/{2,}/g, "/");
26
+ return correctPath(out);
27
+ }
28
+
29
+ //#endregion
30
+ export { getOutputPath };
package/dist/index.cjs CHANGED
@@ -1,34 +1,6 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- //#region rolldown:runtime
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
- key = keys[i];
13
- if (!__hasOwnProp.call(to, key) && key !== except) {
14
- __defProp(to, key, {
15
- get: ((k) => from[k]).bind(null, key),
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- }
19
- }
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
- value: mod,
25
- enumerable: true
26
- }) : target, mod));
27
-
28
- //#endregion
29
- require('./i18n-Ctazdbgs.cjs');
30
- require('./plugin-B-8QVe28.cjs');
31
- require('./types-CBTc19th.cjs');
2
+ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
+ const require_config_utils = require('./helpers/config-utils.cjs');
32
4
  let __stryke_fs_list_files = require("@stryke/fs/list-files");
33
5
  let __stryke_path_append = require("@stryke/path/append");
34
6
  let __stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
@@ -37,38 +9,10 @@ let __stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
37
9
  let __stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
38
10
  let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
39
11
  let defu = require("defu");
40
- defu = __toESM(defu);
12
+ defu = require_rolldown_runtime.__toESM(defu);
41
13
  let i18next_cli = require("i18next-cli");
42
14
  let i18next_resources_for_ts = require("i18next-resources-for-ts");
43
- let __stryke_path_correct_path = require("@stryke/path/correct-path");
44
15
 
45
- //#region src/helpers/config-utils.ts
46
- /**
47
- * Resolve an output template (string or function) into an actual path string.
48
- *
49
- * @remarks
50
- * - If `outputTemplate` is a function, call it with (language, namespace)
51
- * - If it's a string, replace placeholders:
52
- * - \{\{language\}\} or \{\{lng\}\} -\> language
53
- * - \{\{namespace\}\} -\> namespace (or removed if namespace is undefined)
54
- * - Normalizes duplicate slashes and returns a platform-correct path.
55
- */
56
- function getOutputPath(outputTemplate, language, namespace) {
57
- if (!outputTemplate) return (0, __stryke_path_correct_path.correctPath)(`locales/${language}/${namespace ?? "translation"}.json`);
58
- if (typeof outputTemplate === "function") try {
59
- return (0, __stryke_path_correct_path.correctPath)(String(outputTemplate(language, namespace)).replace(/\/{2,}/g, "/"));
60
- } catch {
61
- return (0, __stryke_path_correct_path.correctPath)(`locales/${language}/${namespace ?? "translation"}.json`);
62
- }
63
- let out = String(outputTemplate);
64
- out = out.replace(/\{\{language\}\}|\{\{lng\}\}/g, language);
65
- if (namespace !== void 0 && namespace !== null) out = out.replace(/\{\{namespace\}\}/g, namespace);
66
- else out = out.replace(/\/?\{\{namespace\}\}/g, "");
67
- out = out.replace(/\/{2,}/g, "/");
68
- return (0, __stryke_path_correct_path.correctPath)(out);
69
- }
70
-
71
- //#endregion
72
16
  //#region src/index.ts
73
17
  /**
74
18
  * i18next Plugin
@@ -131,7 +75,7 @@ const plugin = (options = {}) => {
131
75
  },
132
76
  async types(code) {
133
77
  const resources = [];
134
- for (const file of await (0, __stryke_fs_list_files.listFiles)(getOutputPath(this.config.i18next.extract.output, this.config.i18next.extract.primaryLanguage, "*"))) {
78
+ for (const file of await (0, __stryke_fs_list_files.listFiles)(require_config_utils.getOutputPath(this.config.i18next.extract.output, this.config.i18next.extract.primaryLanguage, "*"))) {
135
79
  const namespace = (0, __stryke_path_file_path_fns.findFileName)(file, { withExtension: false });
136
80
  const parsedContent = await this.resolver.import(file);
137
81
  if (this.config.i18next.extract.mergeNamespaces && (0, __stryke_type_checks_is_set_object.isSetObject)(parsedContent)) {
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { a as Plugin, i as I18NextPluginUserConfig, n as I18NextPluginOptions, r as I18NextPluginResolvedConfig, t as I18NextPluginContext } from "./plugin-Cp8UI0nI.cjs";
2
- import { n as ResourceContent, t as Resource } from "./i18n-ComTDYPk.cjs";
3
- import "./index-CmCelmEL.cjs";
1
+ import { Plugin } from "./powerlines/src/types/plugin.cjs";
2
+ import { I18NextPluginContext, I18NextPluginOptions, I18NextPluginResolvedConfig, I18NextPluginUserConfig } from "./types/plugin.cjs";
3
+ import { Resource, ResourceContent } from "./types/i18n.cjs";
4
4
 
5
5
  //#region src/index.d.ts
6
6
 
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
- import { a as Plugin, i as I18NextPluginUserConfig, n as I18NextPluginOptions, r as I18NextPluginResolvedConfig, t as I18NextPluginContext } from "./plugin-Bgs_50_L.mjs";
2
- import { n as ResourceContent, t as Resource } from "./i18n-C5zfq1YM.mjs";
3
- import "./index-CA4VvAY_.mjs";
1
+ import { Plugin } from "./powerlines/src/types/plugin.mjs";
2
+ import { I18NextPluginContext, I18NextPluginOptions, I18NextPluginResolvedConfig, I18NextPluginUserConfig } from "./types/plugin.mjs";
3
+ import { Resource, ResourceContent } from "./types/i18n.mjs";
4
+ import "./types/index.mjs";
4
5
 
5
6
  //#region src/index.d.ts
6
7
 
package/dist/index.mjs CHANGED
@@ -1,6 +1,4 @@
1
- import "./i18n-CUSH-jI_.mjs";
2
- import "./plugin-B7p8VtjC.mjs";
3
- import "./types-BReKsBV6.mjs";
1
+ import { getOutputPath } from "./helpers/config-utils.mjs";
4
2
  import { listFiles } from "@stryke/fs/list-files";
5
3
  import { appendPath } from "@stryke/path/append";
6
4
  import { findFileName } from "@stryke/path/file-path-fns";
@@ -11,35 +9,7 @@ import { isString } from "@stryke/type-checks/is-string";
11
9
  import defu from "defu";
12
10
  import { runExtractor } from "i18next-cli";
13
11
  import { mergeResourcesAsInterface } from "i18next-resources-for-ts";
14
- import { correctPath } from "@stryke/path/correct-path";
15
12
 
16
- //#region src/helpers/config-utils.ts
17
- /**
18
- * Resolve an output template (string or function) into an actual path string.
19
- *
20
- * @remarks
21
- * - If `outputTemplate` is a function, call it with (language, namespace)
22
- * - If it's a string, replace placeholders:
23
- * - \{\{language\}\} or \{\{lng\}\} -\> language
24
- * - \{\{namespace\}\} -\> namespace (or removed if namespace is undefined)
25
- * - Normalizes duplicate slashes and returns a platform-correct path.
26
- */
27
- function getOutputPath(outputTemplate, language, namespace) {
28
- if (!outputTemplate) return correctPath(`locales/${language}/${namespace ?? "translation"}.json`);
29
- if (typeof outputTemplate === "function") try {
30
- return correctPath(String(outputTemplate(language, namespace)).replace(/\/{2,}/g, "/"));
31
- } catch {
32
- return correctPath(`locales/${language}/${namespace ?? "translation"}.json`);
33
- }
34
- let out = String(outputTemplate);
35
- out = out.replace(/\{\{language\}\}|\{\{lng\}\}/g, language);
36
- if (namespace !== void 0 && namespace !== null) out = out.replace(/\{\{namespace\}\}/g, namespace);
37
- else out = out.replace(/\/?\{\{namespace\}\}/g, "");
38
- out = out.replace(/\/{2,}/g, "/");
39
- return correctPath(out);
40
- }
41
-
42
- //#endregion
43
13
  //#region src/index.ts
44
14
  /**
45
15
  * i18next Plugin
@@ -0,0 +1,145 @@
1
+ //#region ../powerlines/src/types/build.d.ts
2
+
3
+ type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
4
+ interface BuildConfig {
5
+ /**
6
+ * The platform to build the project for
7
+ *
8
+ * @defaultValue "neutral"
9
+ */
10
+ platform?: "node" | "browser" | "neutral";
11
+ /**
12
+ * Array of strings indicating the polyfills to include for the build.
13
+ *
14
+ * @remarks
15
+ * 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).
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * {
20
+ * polyfill: ['{projectRoot}/custom-polyfill.ts']
21
+ * }
22
+ * ```
23
+ */
24
+ polyfill?: string[];
25
+ /**
26
+ * 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.
27
+ *
28
+ * @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
29
+ */
30
+ mainFields?: string[];
31
+ /**
32
+ * Array of strings indicating what conditions should be used for module resolution.
33
+ */
34
+ conditions?: string[];
35
+ /**
36
+ * Array of strings indicating what file extensions should be used for module resolution.
37
+ *
38
+ * @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
39
+ */
40
+ extensions?: string[];
41
+ /**
42
+ * Array of strings indicating what modules should be deduplicated to a single version in the build.
43
+ *
44
+ * @remarks
45
+ * 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.
46
+ */
47
+ dedupe?: string[];
48
+ /**
49
+ * Array of strings or regular expressions that indicate what modules are builtin for the environment.
50
+ */
51
+ builtins?: (string | RegExp)[];
52
+ /**
53
+ * Define global variable replacements.
54
+ *
55
+ * @remarks
56
+ * 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.
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * {
61
+ * define: {
62
+ * __VERSION__: '"1.0.0"',
63
+ * __DEV__: 'process.env.NODE_ENV !== "production"'
64
+ * }
65
+ * }
66
+ * ```
67
+ *
68
+ * @see https://esbuild.github.io/api/#define
69
+ * @see https://vitejs.dev/config/build-options.html#define
70
+ * @see https://github.com/rollup/plugins/tree/master/packages/replace
71
+ */
72
+ define?: Record<string, any>;
73
+ /**
74
+ * Global variables that will have import statements injected where necessary
75
+ *
76
+ * @remarks
77
+ * 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.
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * {
82
+ * inject: {
83
+ * process: 'process/browser',
84
+ * Buffer: ['buffer', 'Buffer'],
85
+ * }
86
+ * }
87
+ * ```
88
+ *
89
+ * @see https://github.com/rollup/plugins/tree/master/packages/inject
90
+ */
91
+ inject?: Record<string, string | string[]>;
92
+ /**
93
+ * The alias mappings to use for module resolution during the build process.
94
+ *
95
+ * @remarks
96
+ * This option allows you to define custom path aliases for modules, which can be useful for simplifying imports and managing dependencies.
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * {
101
+ * alias: {
102
+ * "@utils": "./src/utils",
103
+ * "@components": "./src/components"
104
+ * }
105
+ * }
106
+ * ```
107
+ *
108
+ * @see https://github.com/rollup/plugins/tree/master/packages/alias
109
+ */
110
+ alias?: Record<string, string> | Array<{
111
+ find: string | RegExp;
112
+ replacement: string;
113
+ }>;
114
+ /**
115
+ * A list of modules that should not be bundled, even if they are external dependencies.
116
+ *
117
+ * @remarks
118
+ * 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.
119
+ */
120
+ external?: (string | RegExp)[];
121
+ /**
122
+ * A list of modules that should always be bundled, even if they are external dependencies.
123
+ */
124
+ noExternal?: (string | RegExp)[];
125
+ /**
126
+ * Should the Powerlines CLI processes skip bundling the `node_modules` directory?
127
+ */
128
+ skipNodeModulesBundle?: boolean;
129
+ /**
130
+ * 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.
131
+ *
132
+ * @defaultValue false
133
+ */
134
+ keepProcessEnv?: boolean;
135
+ /**
136
+ * An optional set of override options to apply to the selected build variant.
137
+ *
138
+ * @remarks
139
+ * 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.
140
+ */
141
+ override?: Record<string, any>;
142
+ }
143
+ type BuildResolvedConfig = Omit<BuildConfig, "override">;
144
+ //#endregion
145
+ export { BuildConfig, BuildResolvedConfig, UnpluginBuildVariant };
@@ -0,0 +1,145 @@
1
+ //#region ../powerlines/src/types/build.d.ts
2
+
3
+ type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
4
+ interface BuildConfig {
5
+ /**
6
+ * The platform to build the project for
7
+ *
8
+ * @defaultValue "neutral"
9
+ */
10
+ platform?: "node" | "browser" | "neutral";
11
+ /**
12
+ * Array of strings indicating the polyfills to include for the build.
13
+ *
14
+ * @remarks
15
+ * 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).
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * {
20
+ * polyfill: ['{projectRoot}/custom-polyfill.ts']
21
+ * }
22
+ * ```
23
+ */
24
+ polyfill?: string[];
25
+ /**
26
+ * 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.
27
+ *
28
+ * @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
29
+ */
30
+ mainFields?: string[];
31
+ /**
32
+ * Array of strings indicating what conditions should be used for module resolution.
33
+ */
34
+ conditions?: string[];
35
+ /**
36
+ * Array of strings indicating what file extensions should be used for module resolution.
37
+ *
38
+ * @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
39
+ */
40
+ extensions?: string[];
41
+ /**
42
+ * Array of strings indicating what modules should be deduplicated to a single version in the build.
43
+ *
44
+ * @remarks
45
+ * 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.
46
+ */
47
+ dedupe?: string[];
48
+ /**
49
+ * Array of strings or regular expressions that indicate what modules are builtin for the environment.
50
+ */
51
+ builtins?: (string | RegExp)[];
52
+ /**
53
+ * Define global variable replacements.
54
+ *
55
+ * @remarks
56
+ * 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.
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * {
61
+ * define: {
62
+ * __VERSION__: '"1.0.0"',
63
+ * __DEV__: 'process.env.NODE_ENV !== "production"'
64
+ * }
65
+ * }
66
+ * ```
67
+ *
68
+ * @see https://esbuild.github.io/api/#define
69
+ * @see https://vitejs.dev/config/build-options.html#define
70
+ * @see https://github.com/rollup/plugins/tree/master/packages/replace
71
+ */
72
+ define?: Record<string, any>;
73
+ /**
74
+ * Global variables that will have import statements injected where necessary
75
+ *
76
+ * @remarks
77
+ * 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.
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * {
82
+ * inject: {
83
+ * process: 'process/browser',
84
+ * Buffer: ['buffer', 'Buffer'],
85
+ * }
86
+ * }
87
+ * ```
88
+ *
89
+ * @see https://github.com/rollup/plugins/tree/master/packages/inject
90
+ */
91
+ inject?: Record<string, string | string[]>;
92
+ /**
93
+ * The alias mappings to use for module resolution during the build process.
94
+ *
95
+ * @remarks
96
+ * This option allows you to define custom path aliases for modules, which can be useful for simplifying imports and managing dependencies.
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * {
101
+ * alias: {
102
+ * "@utils": "./src/utils",
103
+ * "@components": "./src/components"
104
+ * }
105
+ * }
106
+ * ```
107
+ *
108
+ * @see https://github.com/rollup/plugins/tree/master/packages/alias
109
+ */
110
+ alias?: Record<string, string> | Array<{
111
+ find: string | RegExp;
112
+ replacement: string;
113
+ }>;
114
+ /**
115
+ * A list of modules that should not be bundled, even if they are external dependencies.
116
+ *
117
+ * @remarks
118
+ * 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.
119
+ */
120
+ external?: (string | RegExp)[];
121
+ /**
122
+ * A list of modules that should always be bundled, even if they are external dependencies.
123
+ */
124
+ noExternal?: (string | RegExp)[];
125
+ /**
126
+ * Should the Powerlines CLI processes skip bundling the `node_modules` directory?
127
+ */
128
+ skipNodeModulesBundle?: boolean;
129
+ /**
130
+ * 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.
131
+ *
132
+ * @defaultValue false
133
+ */
134
+ keepProcessEnv?: boolean;
135
+ /**
136
+ * An optional set of override options to apply to the selected build variant.
137
+ *
138
+ * @remarks
139
+ * 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.
140
+ */
141
+ override?: Record<string, any>;
142
+ }
143
+ type BuildResolvedConfig = Omit<BuildConfig, "override">;
144
+ //#endregion
145
+ export { BuildConfig, BuildResolvedConfig, UnpluginBuildVariant };
@@ -0,0 +1,8 @@
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 };
@@ -0,0 +1,8 @@
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 };