@powerlines/plugin-unbuild 0.5.303 → 0.5.305

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 (40) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  2. package/dist/core/src/lib/utilities/source-file.cjs +22 -0
  3. package/dist/core/src/types/_internal.d.cts +85 -0
  4. package/dist/core/src/types/_internal.d.cts.map +1 -0
  5. package/dist/core/src/types/api.d.cts +103 -0
  6. package/dist/core/src/types/api.d.cts.map +1 -0
  7. package/dist/core/src/types/commands.d.cts +9 -0
  8. package/dist/core/src/types/commands.d.cts.map +1 -0
  9. package/dist/core/src/types/config.d.cts +551 -0
  10. package/dist/core/src/types/config.d.cts.map +1 -0
  11. package/dist/core/src/types/context.d.cts +511 -0
  12. package/dist/core/src/types/context.d.cts.map +1 -0
  13. package/dist/core/src/types/fs.d.cts +487 -0
  14. package/dist/core/src/types/fs.d.cts.map +1 -0
  15. package/dist/core/src/types/hooks.d.cts +99 -0
  16. package/dist/core/src/types/hooks.d.cts.map +1 -0
  17. package/dist/core/src/types/plugin.d.cts +204 -0
  18. package/dist/core/src/types/plugin.d.cts.map +1 -0
  19. package/dist/core/src/types/tsconfig.d.cts +70 -0
  20. package/dist/core/src/types/tsconfig.d.cts.map +1 -0
  21. package/dist/core/src/types/unplugin.d.cts +24 -0
  22. package/dist/core/src/types/unplugin.d.cts.map +1 -0
  23. package/dist/helpers/index.cjs +5 -0
  24. package/dist/helpers/index.d.cts +2 -0
  25. package/dist/helpers/resolve-options.cjs +126 -0
  26. package/dist/helpers/resolve-options.d.cts +17 -0
  27. package/dist/helpers/resolve-options.d.cts.map +1 -0
  28. package/dist/index.cjs +31 -0
  29. package/dist/index.d.cts +13 -0
  30. package/dist/index.d.cts.map +1 -0
  31. package/dist/plugin-rollup/src/helpers/resolve-options.cjs +122 -0
  32. package/dist/types/build.cjs +0 -0
  33. package/dist/types/build.d.cts +8 -0
  34. package/dist/types/build.d.cts.map +1 -0
  35. package/dist/types/index.cjs +0 -0
  36. package/dist/types/index.d.cts +3 -0
  37. package/dist/types/plugin.cjs +0 -0
  38. package/dist/types/plugin.d.cts +20 -0
  39. package/dist/types/plugin.d.cts.map +1 -0
  40. package/package.json +26 -11
@@ -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,22 @@
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 ../core/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;
@@ -0,0 +1,85 @@
1
+ import { CallHookOptions, InferHookParameters, InferHookReturnType } from "./hooks.cjs";
2
+ import { EnvironmentContext, PluginContext } from "./context.cjs";
3
+ import { PluginConfig, ResolvedConfig } from "./config.cjs";
4
+ import { API } from "./api.cjs";
5
+
6
+ //#region ../core/src/types/_internal.d.ts
7
+
8
+ /**
9
+ * Internal fields and methods for internal contexts
10
+ *
11
+ * @internal
12
+ */
13
+ interface UNSAFE_ContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
14
+ /**
15
+ * The API instance for interacting with Powerlines
16
+ *
17
+ * @internal
18
+ */
19
+ api: API<TResolvedConfig>;
20
+ /**
21
+ * Add a Powerlines plugin used in the build process
22
+ *
23
+ * @internal
24
+ *
25
+ * @param config - The import path of the plugin to add
26
+ */
27
+ addPlugin: (config: PluginConfig<PluginContext<TResolvedConfig>>) => Promise<void>;
28
+ }
29
+ /**
30
+ * An internal representation of the environment context, used for managing hooks and environment data.
31
+ *
32
+ * @internal
33
+ */
34
+ interface UNSAFE_EnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends EnvironmentContext<TResolvedConfig> {
35
+ $$internal: UNSAFE_ContextInternal<TResolvedConfig>;
36
+ }
37
+ /**
38
+ * Internal fields and methods for the internal plugin context
39
+ *
40
+ * @internal
41
+ */
42
+ interface UNSAFE_PluginContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends UNSAFE_ContextInternal<TResolvedConfig> {
43
+ /**
44
+ * The API instance for interacting with Powerlines
45
+ *
46
+ * @internal
47
+ */
48
+ api: API<TResolvedConfig>;
49
+ /**
50
+ * The environment context associated with this plugin context
51
+ *
52
+ * @internal
53
+ */
54
+ environment: UNSAFE_EnvironmentContext<TResolvedConfig>;
55
+ /**
56
+ * Call a hook within the Powerlines system
57
+ *
58
+ * @internal
59
+ *
60
+ * @param hook - The name of the hook to call
61
+ * @param options - Options for calling the hook
62
+ * @param args - Arguments to pass to the hook
63
+ * @returns The result of the hook call
64
+ */
65
+ callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
66
+ environment?: string | EnvironmentContext<TResolvedConfig>;
67
+ }, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
68
+ /**
69
+ * A place to store internal data for the plugin context
70
+ *
71
+ * @internal
72
+ */
73
+ meta: Record<string, any>;
74
+ }
75
+ /**
76
+ * An internal representation of the plugin context, used for managing hooks and environment data.
77
+ *
78
+ * @internal
79
+ */
80
+ interface UNSAFE_PluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PluginContext<TResolvedConfig> {
81
+ $$internal: UNSAFE_PluginContextInternal<TResolvedConfig>;
82
+ }
83
+ //#endregion
84
+ export { UNSAFE_PluginContext };
85
+ //# sourceMappingURL=_internal.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_internal.d.cts","names":[],"sources":["../../../../../core/src/types/_internal.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAuCA;;;AAQW,UARM,sBAQN,CAAA,wBAPe,cAOf,GAPgC,cAOhC,CAAA,CAAA;EAAJ;;;;;EAWO,GAAA,EAXP,GAWO,CAXH,eAWG,CAAA;EA8BG;;;;;;;EAEW,SAAA,EAAA,CAAA,MAAA,EAjChB,YAiCgB,CAjCH,aAiCG,CAjCW,eAiCX,CAAA,CAAA,EAAA,GAhCrB,OAgCqB,CAAA,IAAA,CAAA;AAS5B;;;;;;AAEU,UAbO,yBAaP,CAAA,wBAZgB,cAYhB,GAZiC,cAYjC,CAAA,SAXA,kBAWA,CAXmB,eAWnB,CAAA,CAAA;EAAsB,UAAA,EAVlB,sBAUkB,CAVK,eAUL,CAAA;AAgDhC;;;;;;AAEU,UApDO,4BAoDP,CAAA,wBAnDgB,cAmDhB,GAnDiC,cAmDjC,CAAA,SAlDA,sBAkDA,CAlDuB,eAkDvB,CAAA,CAAA;EAAa;;;;;OA5ChB,IAAI;;;;;;eAOI,0BAA0B;;;;;;;;;;;wCAa/B,eACG;2BACgB,mBAAmB;cAEnC,oBAAoB,cAAc,kBAAkB,UAC1D,QACH,oBAAoB,cAAc,kBAAkB;;;;;;QAQhD;;;;;;;UAQS,6CACS,iBAAiB,wBACjC,cAAc;cACV,6BAA6B"}
@@ -0,0 +1,103 @@
1
+ import { CallHookOptions, InferHookParameters, InferHookReturnType } from "./hooks.cjs";
2
+ import { APIContext, EnvironmentContext, PluginContext } from "./context.cjs";
3
+ import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, LintInlineConfig, NewInlineConfig, PrepareInlineConfig, ResolvedConfig } from "./config.cjs";
4
+
5
+ //#region ../core/src/types/api.d.ts
6
+
7
+ /**
8
+ * Powerlines API Interface
9
+ */
10
+ interface API<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
11
+ /**
12
+ * The Powerlines shared API context
13
+ */
14
+ context: APIContext<TResolvedConfig>;
15
+ /**
16
+ * Prepare the Powerlines API
17
+ *
18
+ * @remarks
19
+ * This method will prepare the Powerlines API for use, initializing any necessary resources.
20
+ *
21
+ * @param inlineConfig - The inline configuration for the prepare command
22
+ */
23
+ prepare: (inlineConfig: PrepareInlineConfig | NewInlineConfig | CleanInlineConfig | BuildInlineConfig | LintInlineConfig | DocsInlineConfig | DeployInlineConfig) => Promise<void>;
24
+ /**
25
+ * Create a new Powerlines project
26
+ *
27
+ * @remarks
28
+ * This method will create a new Powerlines project in the current directory.
29
+ *
30
+ * @param inlineConfig - The inline configuration for the new command
31
+ * @returns A promise that resolves when the project has been created
32
+ */
33
+ new: (inlineConfig: NewInlineConfig) => Promise<void>;
34
+ /**
35
+ * Clean any previously prepared artifacts
36
+ *
37
+ * @remarks
38
+ * This method will remove the previous Powerlines artifacts from the project.
39
+ *
40
+ * @param inlineConfig - The inline configuration for the clean command
41
+ * @returns A promise that resolves when the clean command has completed
42
+ */
43
+ clean: (inlineConfig: CleanInlineConfig | PrepareInlineConfig) => Promise<void>;
44
+ /**
45
+ * Lint the project source code
46
+ *
47
+ * @param inlineConfig - The inline configuration for the lint command
48
+ * @returns A promise that resolves when the lint command has completed
49
+ */
50
+ lint: (inlineConfig: LintInlineConfig) => Promise<void>;
51
+ /**
52
+ * Build the project
53
+ *
54
+ * @remarks
55
+ * This method will build the Powerlines project, generating the necessary artifacts.
56
+ *
57
+ * @param inlineConfig - The inline configuration for the build command
58
+ * @returns A promise that resolves when the build command has completed
59
+ */
60
+ build: (inlineConfig: BuildInlineConfig) => Promise<void>;
61
+ /**
62
+ * Prepare the documentation for the project
63
+ *
64
+ * @param inlineConfig - The inline configuration for the docs command
65
+ * @returns A promise that resolves when the documentation generation has completed
66
+ */
67
+ docs: (inlineConfig: DocsInlineConfig) => Promise<void>;
68
+ /**
69
+ * Deploy the project source code
70
+ *
71
+ * @remarks
72
+ * This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.
73
+ *
74
+ * @param inlineConfig - The inline configuration for the deploy command
75
+ */
76
+ deploy: (inlineConfig: DeployInlineConfig) => Promise<void>;
77
+ /**
78
+ * Finalization process
79
+ *
80
+ * @remarks
81
+ * This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.
82
+ *
83
+ * @returns A promise that resolves when the finalization process has completed
84
+ */
85
+ finalize: () => Promise<void>;
86
+ /**
87
+ * Invokes the configured plugin hooks
88
+ *
89
+ * @remarks
90
+ * By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
91
+ *
92
+ * @param hook - The hook to call
93
+ * @param options - The options to provide to the hook
94
+ * @param args - The arguments to pass to the hook
95
+ * @returns The result of the hook call
96
+ */
97
+ callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
98
+ environment?: string | EnvironmentContext<TResolvedConfig>;
99
+ }, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
100
+ }
101
+ //#endregion
102
+ export { API };
103
+ //# sourceMappingURL=api.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.cts","names":[],"sources":["../../../../../core/src/types/api.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAsCA;AAA6C,UAA5B,GAA4B,CAAA,wBAAA,cAAA,GAAiB,cAAjB,CAAA,CAAA;EAAiB;;;EAgBtD,OAAA,EAZG,UAYH,CAZc,eAYd,CAAA;EACA;;;;;;;;EAiBkC,OAAA,EAAA,CAAA,YAAA,EAlBlC,mBAkBkC,GAjBlC,eAiBkC,GAhBlC,iBAgBkC,GAflC,iBAekC,GAdlC,gBAckC,GAblC,gBAakC,GAZlC,kBAYkC,EAAA,GAXnC,OAWmC,CAAA,IAAA,CAAA;EAYxB;;;;;;;;;EAsCO,GAAA,EAAA,CAAA,YAAA,EAlDH,eAkDG,EAAA,GAlDiB,OAkDjB,CAAA,IAAA,CAAA;EAAuB;;;;;;;;;EA4BnC,KAAA,EAAA,CAAA,YAAA,EAlEK,iBAkEL,GAlEyB,mBAkEzB,EAAA,GAjEN,OAiEM,CAAA,IAAA,CAAA;EAEyB;;;;;;uBA3Df,qBAAqB;;;;;;;;;;wBAWpB,sBAAsB;;;;;;;uBAQvB,qBAAqB;;;;;;;;;yBAUnB,uBAAuB;;;;;;;;;kBAU9B;;;;;;;;;;;;wCAcR,eACG;2BACgB,mBAAmB;cAEnC,oBAAoB,cAAc,kBAAkB,UAC1D,QACH,oBAAoB,cAAc,kBAAkB"}
@@ -0,0 +1,9 @@
1
+ import { MaybePromise } from "@stryke/types/base";
2
+ import { ArrayValues } from "@stryke/types/array";
3
+
4
+ //#region ../core/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 };
9
+ //# sourceMappingURL=commands.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.d.cts","names":[],"sources":["../../../../../core/src/types/commands.ts"],"sourcesContent":[],"mappings":";;;;cAsBa;AAAA,KAYD,WAAA,GAAc,WAFhB,CAAA,OAEmC,kBAFnC,CAAA"}