@powerlines/plugin-marked 0.1.197 → 0.1.199

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 (29) hide show
  1. package/dist/index.d.cts +2 -1
  2. package/dist/index.d.mts +1 -1
  3. package/dist/types/plugin.d.cts +3 -3
  4. package/dist/types/plugin.d.mts +3 -3
  5. package/package.json +60 -13
  6. package/dist/powerlines/src/internal/helpers/hooks.d.cts +0 -47
  7. package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -47
  8. package/dist/powerlines/src/types/api.d.cts +0 -104
  9. package/dist/powerlines/src/types/api.d.mts +0 -104
  10. package/dist/powerlines/src/types/build.d.cts +0 -185
  11. package/dist/powerlines/src/types/build.d.mts +0 -185
  12. package/dist/powerlines/src/types/commands.d.cts +0 -8
  13. package/dist/powerlines/src/types/commands.d.mts +0 -8
  14. package/dist/powerlines/src/types/config.d.cts +0 -424
  15. package/dist/powerlines/src/types/config.d.mts +0 -424
  16. package/dist/powerlines/src/types/context.d.cts +0 -514
  17. package/dist/powerlines/src/types/context.d.mts +0 -514
  18. package/dist/powerlines/src/types/fs.d.cts +0 -486
  19. package/dist/powerlines/src/types/fs.d.mts +0 -486
  20. package/dist/powerlines/src/types/hooks.d.cts +0 -32
  21. package/dist/powerlines/src/types/hooks.d.mts +0 -32
  22. package/dist/powerlines/src/types/plugin.d.cts +0 -205
  23. package/dist/powerlines/src/types/plugin.d.mts +0 -205
  24. package/dist/powerlines/src/types/resolved.d.cts +0 -93
  25. package/dist/powerlines/src/types/resolved.d.mts +0 -93
  26. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  27. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
  28. package/dist/powerlines/src/types/unplugin.d.cts +0 -22
  29. package/dist/powerlines/src/types/unplugin.d.mts +0 -22
package/dist/index.d.cts CHANGED
@@ -1,5 +1,6 @@
1
- import { Plugin } from "./powerlines/src/types/plugin.cjs";
2
1
  import { MarkedPluginContext, MarkedPluginOptions, MarkedPluginResolvedConfig, MarkedPluginUserConfig } from "./types/plugin.cjs";
2
+ import "./types/index.cjs";
3
+ import { Plugin } from "powerlines/types/plugin";
3
4
 
4
5
  //#region src/index.d.ts
5
6
 
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { Plugin } from "./powerlines/src/types/plugin.mjs";
2
1
  import { MarkedPluginContext, MarkedPluginOptions, MarkedPluginResolvedConfig, MarkedPluginUserConfig } from "./types/plugin.mjs";
3
2
  import "./types/index.mjs";
3
+ import { Plugin } from "powerlines/types/plugin";
4
4
 
5
5
  //#region src/index.d.ts
6
6
 
@@ -1,7 +1,7 @@
1
- import { UserConfig } from "../powerlines/src/types/config.cjs";
2
- import { ResolvedConfig } from "../powerlines/src/types/resolved.cjs";
3
- import { PluginContext } from "../powerlines/src/types/context.cjs";
4
1
  import { MarkedExtension, MarkedOptions, marked } from "marked";
2
+ import { UserConfig } from "powerlines/types/config";
3
+ import { PluginContext } from "powerlines/types/context";
4
+ import { ResolvedConfig } from "powerlines/types/resolved";
5
5
 
6
6
  //#region src/types/plugin.d.ts
7
7
  type MarkedPluginOptions = MarkedOptions & MarkedExtension;
@@ -1,7 +1,7 @@
1
- import { UserConfig } from "../powerlines/src/types/config.mjs";
2
- import { ResolvedConfig } from "../powerlines/src/types/resolved.mjs";
3
- import { PluginContext } from "../powerlines/src/types/context.mjs";
4
1
  import { MarkedExtension, MarkedOptions, marked } from "marked";
2
+ import { UserConfig } from "powerlines/types/config";
3
+ import { PluginContext } from "powerlines/types/context";
4
+ import { ResolvedConfig } from "powerlines/types/resolved";
5
5
 
6
6
  //#region src/types/plugin.d.ts
7
7
  type MarkedPluginOptions = MarkedOptions & MarkedExtension;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-marked",
3
- "version": "0.1.197",
3
+ "version": "0.1.199",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to use the Marked markdown compiler to generate HTML.",
6
6
  "repository": {
@@ -41,33 +41,80 @@
41
41
  "main": "./dist/index.cjs",
42
42
  "module": "./dist/index.mjs",
43
43
  "exports": {
44
- ".": { "require": "./dist/index.cjs", "import": "./dist/index.mjs" },
44
+ ".": {
45
+ "require": {
46
+ "types": "./dist/index.d.cts",
47
+ "default": "./dist/index.cjs"
48
+ },
49
+ "import": {
50
+ "types": "./dist/index.d.mts",
51
+ "default": "./dist/index.mjs"
52
+ },
53
+ "default": {
54
+ "types": "./dist/index.d.mts",
55
+ "default": "./dist/index.mjs"
56
+ }
57
+ },
58
+ "./package.json": "./package.json",
45
59
  "./types": {
46
- "require": "./dist/types/index.cjs",
47
- "import": "./dist/types/index.mjs"
60
+ "require": {
61
+ "types": "./dist/types/index.d.cts",
62
+ "default": "./dist/types/index.cjs"
63
+ },
64
+ "import": {
65
+ "types": "./dist/types/index.d.mts",
66
+ "default": "./dist/types/index.mjs"
67
+ },
68
+ "default": {
69
+ "types": "./dist/types/index.d.mts",
70
+ "default": "./dist/types/index.mjs"
71
+ }
48
72
  },
49
- "./types/plugin": {
50
- "require": "./dist/types/plugin.cjs",
51
- "import": "./dist/types/plugin.mjs"
73
+ "./types/*": {
74
+ "require": {
75
+ "types": "./dist/types/*.d.cts",
76
+ "default": "./dist/types/*.cjs"
77
+ },
78
+ "import": {
79
+ "types": "./dist/types/*.d.mts",
80
+ "default": "./dist/types/*.mjs"
81
+ },
82
+ "default": {
83
+ "types": "./dist/types/*.d.mts",
84
+ "default": "./dist/types/*.mjs"
85
+ }
52
86
  },
53
- "./package.json": "./package.json"
87
+ "./types/plugin": {
88
+ "require": {
89
+ "types": "./dist/types/plugin.d.cts",
90
+ "default": "./dist/types/plugin.cjs"
91
+ },
92
+ "import": {
93
+ "types": "./dist/types/plugin.d.mts",
94
+ "default": "./dist/types/plugin.mjs"
95
+ },
96
+ "default": {
97
+ "types": "./dist/types/plugin.d.mts",
98
+ "default": "./dist/types/plugin.mjs"
99
+ }
100
+ }
54
101
  },
55
102
  "typings": "dist/index.d.mts",
56
103
  "files": ["dist/**/*"],
57
104
  "keywords": ["marked", "powerlines", "storm-software", "powerlines-plugin"],
58
105
  "dependencies": {
59
- "@stryke/fs": "^0.33.38",
60
- "@stryke/path": "^0.26.2",
106
+ "@stryke/fs": "^0.33.39",
107
+ "@stryke/path": "^0.26.3",
61
108
  "@stryke/types": "^0.10.36",
62
109
  "defu": "^6.1.4",
63
- "powerlines": "^0.38.0"
110
+ "powerlines": "^0.38.1"
64
111
  },
65
112
  "devDependencies": {
66
- "@powerlines/plugin-plugin": "^0.12.183",
113
+ "@powerlines/plugin-plugin": "^0.12.185",
67
114
  "@types/node": "^24.10.9",
68
115
  "marked": "^17.0.1"
69
116
  },
70
117
  "publishConfig": { "access": "public" },
71
118
  "types": "./dist/index.d.cts",
72
- "gitHead": "2b025c75ca3472c6d322f6576f47ed70184abb1f"
119
+ "gitHead": "2a4d9ef63cc29e4551fa9f680ea63874c7f48d2d"
73
120
  }
@@ -1,47 +0,0 @@
1
- import { SelectHooksOptions } from "../../types/context.cjs";
2
- import { MaybePromise } from "@stryke/types/base";
3
-
4
- //#region ../powerlines/src/internal/helpers/hooks.d.ts
5
- type CallHookOptions = SelectHooksOptions & (({
6
- /**
7
- * Whether to call the hooks sequentially or in parallel.
8
- *
9
- * @defaultValue true
10
- */
11
- sequential?: true;
12
- } & ({
13
- /**
14
- * How to handle multiple return values from hooks.
15
- * - "merge": Merge all non-undefined return values (if they are objects).
16
- * - "first": Return the first non-undefined value.
17
- *
18
- * @remarks
19
- * Merging only works if the return values are objects.
20
- *
21
- * @defaultValue "merge"
22
- */
23
- result: "first";
24
- } | {
25
- /**
26
- * How to handle multiple return values from hooks.
27
- * - "merge": Merge all non-undefined return values (if they are objects).
28
- * - "first": Return the first non-undefined value.
29
- *
30
- * @remarks
31
- * Merging only works if the return values are objects.
32
- *
33
- * @defaultValue "merge"
34
- */
35
- result?: "merge" | "last";
36
- /**
37
- * An indicator specifying if the results of the previous hook should be provided as the **first** parameter of the next hook function, or a function to process the result of the previous hook function and pass the returned value as the next hook's **first** parameter
38
- */
39
- asNextParam?: false | ((previousResult: any) => MaybePromise<any>);
40
- })) | {
41
- /**
42
- * Whether to call the hooks sequentially or in parallel.
43
- */
44
- sequential: false;
45
- });
46
- //#endregion
47
- export { CallHookOptions };
@@ -1,47 +0,0 @@
1
- import { SelectHooksOptions } from "../../types/context.mjs";
2
- import { MaybePromise } from "@stryke/types/base";
3
-
4
- //#region ../powerlines/src/internal/helpers/hooks.d.ts
5
- type CallHookOptions = SelectHooksOptions & (({
6
- /**
7
- * Whether to call the hooks sequentially or in parallel.
8
- *
9
- * @defaultValue true
10
- */
11
- sequential?: true;
12
- } & ({
13
- /**
14
- * How to handle multiple return values from hooks.
15
- * - "merge": Merge all non-undefined return values (if they are objects).
16
- * - "first": Return the first non-undefined value.
17
- *
18
- * @remarks
19
- * Merging only works if the return values are objects.
20
- *
21
- * @defaultValue "merge"
22
- */
23
- result: "first";
24
- } | {
25
- /**
26
- * How to handle multiple return values from hooks.
27
- * - "merge": Merge all non-undefined return values (if they are objects).
28
- * - "first": Return the first non-undefined value.
29
- *
30
- * @remarks
31
- * Merging only works if the return values are objects.
32
- *
33
- * @defaultValue "merge"
34
- */
35
- result?: "merge" | "last";
36
- /**
37
- * An indicator specifying if the results of the previous hook should be provided as the **first** parameter of the next hook function, or a function to process the result of the previous hook function and pass the returned value as the next hook's **first** parameter
38
- */
39
- asNextParam?: false | ((previousResult: any) => MaybePromise<any>);
40
- })) | {
41
- /**
42
- * Whether to call the hooks sequentially or in parallel.
43
- */
44
- sequential: false;
45
- });
46
- //#endregion
47
- export { CallHookOptions };
@@ -1,104 +0,0 @@
1
- import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, LintInlineConfig, NewInlineConfig, PrepareInlineConfig } from "./config.cjs";
2
- import { InferHookParameters, InferHookReturnType } from "./hooks.cjs";
3
- import { ResolvedConfig } from "./resolved.cjs";
4
- import { APIContext, EnvironmentContext, PluginContext } from "./context.cjs";
5
- import { CallHookOptions } from "../internal/helpers/hooks.cjs";
6
-
7
- //#region ../powerlines/src/types/api.d.ts
8
-
9
- /**
10
- * Powerlines API Interface
11
- */
12
- interface API<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
13
- /**
14
- * The Powerlines shared API context
15
- */
16
- context: APIContext<TResolvedConfig>;
17
- /**
18
- * Prepare the Powerlines API
19
- *
20
- * @remarks
21
- * This method will prepare the Powerlines API for use, initializing any necessary resources.
22
- *
23
- * @param inlineConfig - The inline configuration for the prepare command
24
- */
25
- prepare: (inlineConfig: PrepareInlineConfig | NewInlineConfig | CleanInlineConfig | BuildInlineConfig | LintInlineConfig | DocsInlineConfig | DeployInlineConfig) => Promise<void>;
26
- /**
27
- * Create a new Powerlines project
28
- *
29
- * @remarks
30
- * This method will create a new Powerlines project in the current directory.
31
- *
32
- * @param inlineConfig - The inline configuration for the new command
33
- * @returns A promise that resolves when the project has been created
34
- */
35
- new: (inlineConfig: NewInlineConfig) => Promise<void>;
36
- /**
37
- * Clean any previously prepared artifacts
38
- *
39
- * @remarks
40
- * This method will remove the previous Powerlines artifacts from the project.
41
- *
42
- * @param inlineConfig - The inline configuration for the clean command
43
- * @returns A promise that resolves when the clean command has completed
44
- */
45
- clean: (inlineConfig: CleanInlineConfig | PrepareInlineConfig) => Promise<void>;
46
- /**
47
- * Lint the project source code
48
- *
49
- * @param inlineConfig - The inline configuration for the lint command
50
- * @returns A promise that resolves when the lint command has completed
51
- */
52
- lint: (inlineConfig: LintInlineConfig) => Promise<void>;
53
- /**
54
- * Build the project
55
- *
56
- * @remarks
57
- * This method will build the Powerlines project, generating the necessary artifacts.
58
- *
59
- * @param inlineConfig - The inline configuration for the build command
60
- * @returns A promise that resolves when the build command has completed
61
- */
62
- build: (inlineConfig: BuildInlineConfig) => Promise<void>;
63
- /**
64
- * Prepare the documentation for the project
65
- *
66
- * @param inlineConfig - The inline configuration for the docs command
67
- * @returns A promise that resolves when the documentation generation has completed
68
- */
69
- docs: (inlineConfig: DocsInlineConfig) => Promise<void>;
70
- /**
71
- * Deploy the project source code
72
- *
73
- * @remarks
74
- * This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.
75
- *
76
- * @param inlineConfig - The inline configuration for the deploy command
77
- */
78
- deploy: (inlineConfig: DeployInlineConfig) => Promise<void>;
79
- /**
80
- * Finalization process
81
- *
82
- * @remarks
83
- * This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.
84
- *
85
- * @returns A promise that resolves when the finalization process has completed
86
- */
87
- finalize: () => Promise<void>;
88
- /**
89
- * Invokes the configured plugin hooks
90
- *
91
- * @remarks
92
- * By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
93
- *
94
- * @param hook - The hook to call
95
- * @param options - The options to provide to the hook
96
- * @param args - The arguments to pass to the hook
97
- * @returns The result of the hook call
98
- */
99
- callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
100
- environment?: string | EnvironmentContext<TResolvedConfig>;
101
- }, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
102
- }
103
- //#endregion
104
- export { API };
@@ -1,104 +0,0 @@
1
- import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, LintInlineConfig, NewInlineConfig, PrepareInlineConfig } from "./config.mjs";
2
- import { InferHookParameters, InferHookReturnType } from "./hooks.mjs";
3
- import { ResolvedConfig } from "./resolved.mjs";
4
- import { APIContext, EnvironmentContext, PluginContext } from "./context.mjs";
5
- import { CallHookOptions } from "../internal/helpers/hooks.mjs";
6
-
7
- //#region ../powerlines/src/types/api.d.ts
8
-
9
- /**
10
- * Powerlines API Interface
11
- */
12
- interface API<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
13
- /**
14
- * The Powerlines shared API context
15
- */
16
- context: APIContext<TResolvedConfig>;
17
- /**
18
- * Prepare the Powerlines API
19
- *
20
- * @remarks
21
- * This method will prepare the Powerlines API for use, initializing any necessary resources.
22
- *
23
- * @param inlineConfig - The inline configuration for the prepare command
24
- */
25
- prepare: (inlineConfig: PrepareInlineConfig | NewInlineConfig | CleanInlineConfig | BuildInlineConfig | LintInlineConfig | DocsInlineConfig | DeployInlineConfig) => Promise<void>;
26
- /**
27
- * Create a new Powerlines project
28
- *
29
- * @remarks
30
- * This method will create a new Powerlines project in the current directory.
31
- *
32
- * @param inlineConfig - The inline configuration for the new command
33
- * @returns A promise that resolves when the project has been created
34
- */
35
- new: (inlineConfig: NewInlineConfig) => Promise<void>;
36
- /**
37
- * Clean any previously prepared artifacts
38
- *
39
- * @remarks
40
- * This method will remove the previous Powerlines artifacts from the project.
41
- *
42
- * @param inlineConfig - The inline configuration for the clean command
43
- * @returns A promise that resolves when the clean command has completed
44
- */
45
- clean: (inlineConfig: CleanInlineConfig | PrepareInlineConfig) => Promise<void>;
46
- /**
47
- * Lint the project source code
48
- *
49
- * @param inlineConfig - The inline configuration for the lint command
50
- * @returns A promise that resolves when the lint command has completed
51
- */
52
- lint: (inlineConfig: LintInlineConfig) => Promise<void>;
53
- /**
54
- * Build the project
55
- *
56
- * @remarks
57
- * This method will build the Powerlines project, generating the necessary artifacts.
58
- *
59
- * @param inlineConfig - The inline configuration for the build command
60
- * @returns A promise that resolves when the build command has completed
61
- */
62
- build: (inlineConfig: BuildInlineConfig) => Promise<void>;
63
- /**
64
- * Prepare the documentation for the project
65
- *
66
- * @param inlineConfig - The inline configuration for the docs command
67
- * @returns A promise that resolves when the documentation generation has completed
68
- */
69
- docs: (inlineConfig: DocsInlineConfig) => Promise<void>;
70
- /**
71
- * Deploy the project source code
72
- *
73
- * @remarks
74
- * This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.
75
- *
76
- * @param inlineConfig - The inline configuration for the deploy command
77
- */
78
- deploy: (inlineConfig: DeployInlineConfig) => Promise<void>;
79
- /**
80
- * Finalization process
81
- *
82
- * @remarks
83
- * This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.
84
- *
85
- * @returns A promise that resolves when the finalization process has completed
86
- */
87
- finalize: () => Promise<void>;
88
- /**
89
- * Invokes the configured plugin hooks
90
- *
91
- * @remarks
92
- * By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
93
- *
94
- * @param hook - The hook to call
95
- * @param options - The options to provide to the hook
96
- * @param args - The arguments to pass to the hook
97
- * @returns The result of the hook call
98
- */
99
- callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
100
- environment?: string | EnvironmentContext<TResolvedConfig>;
101
- }, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
102
- }
103
- //#endregion
104
- export { API };
@@ -1,185 +0,0 @@
1
- import { OutputOptions, RollupOptions } from "rollup";
2
- import { UserConfig } from "@farmfe/core";
3
- import { Configuration } from "@rspack/core";
4
- import { BuildOptions } from "@storm-software/tsup/types";
5
- import { UnbuildOptions } from "@storm-software/unbuild/types";
6
- import { BuildOptions as BuildOptions$1 } from "esbuild";
7
- import { RolldownOptions } from "rolldown";
8
- import { UserConfig as UserConfig$1 } from "tsdown";
9
- import { DepOptimizationOptions, UserConfig as UserConfig$2 } from "vite";
10
- import { Configuration as Configuration$1 } from "webpack";
11
-
12
- //#region ../powerlines/src/types/build.d.ts
13
- type UnpluginBuilderVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown" | "bun";
14
- type BuilderVariant = UnpluginBuilderVariant | "tsup" | "tsdown" | "unbuild";
15
- type InferUnpluginVariant<TBuildVariant extends BuilderVariant> = TBuildVariant extends "tsup" ? "esbuild" : TBuildVariant extends "tsdown" ? "rolldown" : TBuildVariant extends "unbuild" ? "rollup" : TBuildVariant;
16
- interface BuildConfig {
17
- /**
18
- * The platform to build the project for
19
- *
20
- * @defaultValue "neutral"
21
- */
22
- platform?: "node" | "browser" | "neutral";
23
- /**
24
- * Array of strings indicating the polyfills to include for the build.
25
- *
26
- * @remarks
27
- * 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).
28
- *
29
- * @example
30
- * ```ts
31
- * {
32
- * polyfill: ['{projectRoot}/custom-polyfill.ts']
33
- * }
34
- * ```
35
- */
36
- polyfill?: string[];
37
- /**
38
- * 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.
39
- *
40
- * @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
41
- */
42
- mainFields?: string[];
43
- /**
44
- * Array of strings indicating what conditions should be used for module resolution.
45
- */
46
- conditions?: string[];
47
- /**
48
- * Array of strings indicating what file extensions should be used for module resolution.
49
- *
50
- * @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
51
- */
52
- extensions?: string[];
53
- /**
54
- * Array of strings indicating what modules should be deduplicated to a single version in the build.
55
- *
56
- * @remarks
57
- * 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.
58
- */
59
- dedupe?: string[];
60
- /**
61
- * Array of strings or regular expressions that indicate what modules are builtin for the environment.
62
- */
63
- builtins?: (string | RegExp)[];
64
- /**
65
- * Define global variable replacements.
66
- *
67
- * @remarks
68
- * 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.
69
- *
70
- * @example
71
- * ```ts
72
- * {
73
- * define: {
74
- * __VERSION__: '"1.0.0"',
75
- * __DEV__: 'process.env.NODE_ENV !== "production"'
76
- * }
77
- * }
78
- * ```
79
- *
80
- * @see https://esbuild.github.io/api/#define
81
- * @see https://vitejs.dev/config/build-options.html#define
82
- * @see https://github.com/rollup/plugins/tree/master/packages/replace
83
- */
84
- define?: Record<string, any>;
85
- /**
86
- * Global variables that will have import statements injected where necessary
87
- *
88
- * @remarks
89
- * 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.
90
- *
91
- * @example
92
- * ```ts
93
- * {
94
- * inject: {
95
- * process: 'process/browser',
96
- * Buffer: ['buffer', 'Buffer'],
97
- * }
98
- * }
99
- * ```
100
- *
101
- * @see https://github.com/rollup/plugins/tree/master/packages/inject
102
- */
103
- inject?: Record<string, string | string[]>;
104
- /**
105
- * The alias mappings to use for module resolution during the build process.
106
- *
107
- * @remarks
108
- * This option allows you to define custom path aliases for modules, which can be useful for simplifying imports and managing dependencies.
109
- *
110
- * @example
111
- * ```ts
112
- * {
113
- * alias: {
114
- * "@utils": "./src/utils",
115
- * "@components": "./src/components"
116
- * }
117
- * }
118
- * ```
119
- *
120
- * @see https://github.com/rollup/plugins/tree/master/packages/alias
121
- */
122
- alias?: Record<string, string> | Array<{
123
- find: string | RegExp;
124
- replacement: string;
125
- }>;
126
- /**
127
- * A list of modules that should not be bundled, even if they are external dependencies.
128
- *
129
- * @remarks
130
- * 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.
131
- */
132
- external?: (string | RegExp)[];
133
- /**
134
- * A list of modules that should always be bundled, even if they are external dependencies.
135
- */
136
- noExternal?: (string | RegExp)[];
137
- /**
138
- * Should the Powerlines CLI processes skip bundling the `node_modules` directory?
139
- */
140
- skipNodeModulesBundle?: boolean;
141
- /**
142
- * 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.
143
- *
144
- * @defaultValue false
145
- */
146
- keepProcessEnv?: boolean;
147
- /**
148
- * An optional set of override options to apply to the selected build variant.
149
- *
150
- * @remarks
151
- * 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.
152
- */
153
- override?: Record<string, any>;
154
- }
155
- type BuildResolvedConfig = Omit<BuildConfig, "override">;
156
- type ESBuildBuildConfig = Omit<BuildOptions$1, "entryPoints" | "sourceRoot" | "platform" | "outdir" | "env" | "assets" | "external" | "inject" | "tsconfig" | "tsconfigRaw" | "logLevel"> & BuildConfig;
157
- type ESBuildResolvedBuildConfig = Omit<BuildOptions$1, "inject"> & BuildResolvedConfig;
158
- type ViteBuildConfig = Omit<UserConfig$2, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output"> & BuildConfig & {
159
- /**
160
- * Optimize deps config
161
- */
162
- optimizeDeps?: Omit<DepOptimizationOptions, "extensions">;
163
- };
164
- type ViteResolvedBuildConfig = UserConfig$2 & BuildResolvedConfig;
165
- type WebpackBuildConfig = Omit<Configuration$1, "name" | "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw"> & BuildConfig;
166
- type WebpackResolvedBuildConfig = Configuration$1 & BuildResolvedConfig;
167
- type RspackBuildConfig = Omit<Configuration, "name" | "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw"> & BuildConfig;
168
- type RspackResolvedBuildConfig = Configuration & BuildResolvedConfig;
169
- type RollupBuildOutputConfig = Omit<OutputOptions, "dir" | "format">;
170
- type RollupBuildConfig = Omit<RollupOptions, "entry" | "external" | "input" | "output" | "logLevel"> & {
171
- output: RollupBuildOutputConfig | RollupBuildOutputConfig[];
172
- } & BuildConfig;
173
- type RollupResolvedBuildConfig = RollupOptions & BuildResolvedConfig;
174
- type RolldownBuildConfig = Omit<RolldownOptions, "input" | "external" | "tsconfig" | "logLevel" | "output"> & BuildConfig;
175
- type RolldownResolvedBuildConfig = RolldownOptions & BuildResolvedConfig;
176
- type TsupBuildConfig = Partial<Omit<BuildOptions, "userOptions" | "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "clean" | "env" | "entry" | "entryPoints" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
177
- type TsupResolvedBuildConfig = BuildOptions & BuildResolvedConfig;
178
- type TsdownBuildConfig = Partial<Omit<UserConfig$1, "name" | "outDir" | "clean" | "cwd" | "tsconfig" | "publicDir" | "copy" | "alias" | "format" | "platform" | "env" | "define" | "entry" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
179
- type TsdownResolvedBuildConfig = UserConfig$1 & BuildResolvedConfig;
180
- type UnbuildBuildConfig = Partial<Omit<UnbuildOptions, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">> & BuildConfig;
181
- type UnbuildResolvedBuildConfig = UnbuildOptions & BuildResolvedConfig;
182
- type FarmBuildConfig = Partial<Omit<UserConfig, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">> & BuildConfig;
183
- type FarmResolvedBuildConfig = UserConfig & BuildResolvedConfig;
184
- //#endregion
185
- export { BuildConfig, BuildResolvedConfig, BuilderVariant, ESBuildBuildConfig, ESBuildResolvedBuildConfig, FarmBuildConfig, FarmResolvedBuildConfig, InferUnpluginVariant, RolldownBuildConfig, RolldownResolvedBuildConfig, RollupBuildConfig, RollupResolvedBuildConfig, RspackBuildConfig, RspackResolvedBuildConfig, TsdownBuildConfig, TsdownResolvedBuildConfig, TsupBuildConfig, TsupResolvedBuildConfig, UnbuildBuildConfig, UnbuildResolvedBuildConfig, UnpluginBuilderVariant, ViteBuildConfig, ViteResolvedBuildConfig, WebpackBuildConfig, WebpackResolvedBuildConfig };