@powerlines/plugin-style-dictionary 0.3.124 → 0.3.126

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 (54) hide show
  1. package/dist/index.cjs +8 -8
  2. package/dist/index.d.cts +2 -1
  3. package/dist/index.d.mts +1 -1
  4. package/dist/index.mjs +1 -1
  5. package/dist/types/plugin.d.cts +3 -3
  6. package/dist/types/plugin.d.mts +3 -3
  7. package/package.json +4 -4
  8. package/dist/powerlines/src/internal/helpers/hooks.d.cts +0 -47
  9. package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -49
  10. package/dist/powerlines/src/lib/build/esbuild.cjs +0 -93
  11. package/dist/powerlines/src/lib/build/esbuild.mjs +0 -91
  12. package/dist/powerlines/src/lib/entry.cjs +0 -11
  13. package/dist/powerlines/src/lib/entry.mjs +0 -13
  14. package/dist/powerlines/src/lib/logger.cjs +0 -41
  15. package/dist/powerlines/src/lib/logger.mjs +0 -39
  16. package/dist/powerlines/src/lib/unplugin/helpers.cjs +0 -3
  17. package/dist/powerlines/src/lib/unplugin/helpers.mjs +0 -5
  18. package/dist/powerlines/src/lib/unplugin/module-resolution.cjs +0 -66
  19. package/dist/powerlines/src/lib/unplugin/module-resolution.mjs +0 -65
  20. package/dist/powerlines/src/lib/unplugin/plugin.cjs +0 -46
  21. package/dist/powerlines/src/lib/unplugin/plugin.mjs +0 -45
  22. package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -42
  23. package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -40
  24. package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -50
  25. package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -49
  26. package/dist/powerlines/src/lib/utilities/source-file.cjs +0 -5
  27. package/dist/powerlines/src/lib/utilities/source-file.mjs +0 -6
  28. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
  29. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -3
  30. package/dist/powerlines/src/types/api.d.cts +0 -104
  31. package/dist/powerlines/src/types/api.d.mts +0 -104
  32. package/dist/powerlines/src/types/babel.d.mts +0 -2
  33. package/dist/powerlines/src/types/build.cjs +0 -21
  34. package/dist/powerlines/src/types/build.d.cts +0 -185
  35. package/dist/powerlines/src/types/build.d.mts +0 -185
  36. package/dist/powerlines/src/types/build.mjs +0 -21
  37. package/dist/powerlines/src/types/commands.d.cts +0 -8
  38. package/dist/powerlines/src/types/commands.d.mts +0 -9
  39. package/dist/powerlines/src/types/config.d.cts +0 -424
  40. package/dist/powerlines/src/types/config.d.mts +0 -424
  41. package/dist/powerlines/src/types/context.d.cts +0 -514
  42. package/dist/powerlines/src/types/context.d.mts +0 -514
  43. package/dist/powerlines/src/types/fs.d.cts +0 -486
  44. package/dist/powerlines/src/types/fs.d.mts +0 -486
  45. package/dist/powerlines/src/types/hooks.d.cts +0 -32
  46. package/dist/powerlines/src/types/hooks.d.mts +0 -32
  47. package/dist/powerlines/src/types/plugin.d.cts +0 -205
  48. package/dist/powerlines/src/types/plugin.d.mts +0 -205
  49. package/dist/powerlines/src/types/resolved.d.cts +0 -93
  50. package/dist/powerlines/src/types/resolved.d.mts +0 -93
  51. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  52. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
  53. package/dist/powerlines/src/types/unplugin.d.cts +0 -22
  54. package/dist/powerlines/src/types/unplugin.d.mts +0 -23
@@ -1,65 +0,0 @@
1
- //#region ../powerlines/src/lib/unplugin/module-resolution.ts
2
- /**
3
- * Creates the module resolution hook functions for a Powerlines unplugin plugin instance.
4
- *
5
- * @remarks
6
- * This includes the `resolveId` and `load` hooks.
7
- *
8
- * @see https://rollupjs.org/plugin-development/#resolveid
9
- * @see https://rollupjs.org/plugin-development/#load
10
- *
11
- * @param context - The plugin context.
12
- * @returns The module resolution hooks (`resolveId` and `load`).
13
- */
14
- function createUnpluginModuleResolutionFunctions(context) {
15
- const ctx = context;
16
- async function resolveId(id, importer, opts = { isEntry: false }) {
17
- let result = await ctx.$$internal.callHook("resolveId", {
18
- sequential: true,
19
- result: "first",
20
- order: "pre"
21
- }, id, importer, opts);
22
- if (result) return result;
23
- result = await ctx.$$internal.callHook("resolveId", {
24
- sequential: true,
25
- result: "first",
26
- order: "normal"
27
- }, id, importer, opts);
28
- if (result) return result;
29
- result = await ctx.resolve(id, importer, opts);
30
- if (result) return result;
31
- return ctx.$$internal.callHook("resolveId", {
32
- sequential: true,
33
- result: "first",
34
- order: "post"
35
- }, id, importer, opts);
36
- }
37
- async function load(id) {
38
- let result = await ctx.$$internal.callHook("load", {
39
- sequential: true,
40
- result: "first",
41
- order: "pre"
42
- }, id);
43
- if (result) return result;
44
- result = await ctx.$$internal.callHook("load", {
45
- sequential: true,
46
- result: "first",
47
- order: "normal"
48
- }, id);
49
- if (result) return result;
50
- result = await ctx.load(id);
51
- if (result) return result;
52
- return ctx.$$internal.callHook("load", {
53
- sequential: true,
54
- result: "first",
55
- order: "post"
56
- }, id);
57
- }
58
- return {
59
- resolveId,
60
- load
61
- };
62
- }
63
-
64
- //#endregion
65
- export { createUnpluginModuleResolutionFunctions };
@@ -1,46 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
- const require_logger = require('../logger.cjs');
3
- require('../utilities/source-file.cjs');
4
- require('./helpers.cjs');
5
- const require_module_resolution = require('./module-resolution.cjs');
6
- let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
7
- let unplugin = require("unplugin");
8
- let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
9
- let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
10
-
11
- //#region ../powerlines/src/lib/unplugin/plugin.ts
12
- /**
13
- * Creates a Powerlines unplugin instance.
14
- *
15
- * @param context - The plugin context.
16
- * @returns The unplugin instance.
17
- */
18
- function createUnpluginResolver(context, name = "unplugin") {
19
- const ctx = context;
20
- (0, unplugin.setParseImpl)(ctx.parse);
21
- return () => {
22
- const log = require_logger.extendLog(ctx.log, name);
23
- log(__storm_software_config_tools_types.LogLevelLabel.DEBUG, `Initializing ${name.toLowerCase() === "unplugin" ? "Unplugin" : `${(0, __stryke_string_format_title_case.titleCase)(name)} - Unplugin`} plugin`);
24
- try {
25
- const { resolveId, load } = require_module_resolution.createUnpluginModuleResolutionFunctions(context);
26
- return {
27
- name: name.toLowerCase() === "unplugin" ? "powerlines" : `powerlines:${(0, __stryke_string_format_kebab_case.kebabCase)(name)}`,
28
- api: ctx.$$internal.api,
29
- resolveId: {
30
- filter: { id: { include: [/.*/] } },
31
- handler: resolveId
32
- },
33
- load: {
34
- filter: { id: { include: [/.*/] } },
35
- handler: load
36
- }
37
- };
38
- } catch (error) {
39
- log(__storm_software_config_tools_types.LogLevelLabel.FATAL, error?.message);
40
- throw error;
41
- }
42
- };
43
- }
44
-
45
- //#endregion
46
- exports.createUnpluginResolver = createUnpluginResolver;
@@ -1,45 +0,0 @@
1
- import { extendLog } from "../logger.mjs";
2
- import "../utilities/source-file.mjs";
3
- import "./helpers.mjs";
4
- import { createUnpluginModuleResolutionFunctions } from "./module-resolution.mjs";
5
- import { LogLevelLabel } from "@storm-software/config-tools/types";
6
- import { setParseImpl } from "unplugin";
7
- import { kebabCase } from "@stryke/string-format/kebab-case";
8
- import { titleCase } from "@stryke/string-format/title-case";
9
-
10
- //#region ../powerlines/src/lib/unplugin/plugin.ts
11
- /**
12
- * Creates a Powerlines unplugin instance.
13
- *
14
- * @param context - The plugin context.
15
- * @returns The unplugin instance.
16
- */
17
- function createUnpluginResolver(context, name = "unplugin") {
18
- const ctx = context;
19
- setParseImpl(ctx.parse);
20
- return () => {
21
- const log = extendLog(ctx.log, name);
22
- log(LogLevelLabel.DEBUG, `Initializing ${name.toLowerCase() === "unplugin" ? "Unplugin" : `${titleCase(name)} - Unplugin`} plugin`);
23
- try {
24
- const { resolveId, load } = createUnpluginModuleResolutionFunctions(context);
25
- return {
26
- name: name.toLowerCase() === "unplugin" ? "powerlines" : `powerlines:${kebabCase(name)}`,
27
- api: ctx.$$internal.api,
28
- resolveId: {
29
- filter: { id: { include: [/.*/] } },
30
- handler: resolveId
31
- },
32
- load: {
33
- filter: { id: { include: [/.*/] } },
34
- handler: load
35
- }
36
- };
37
- } catch (error) {
38
- log(LogLevelLabel.FATAL, error?.message);
39
- throw error;
40
- }
41
- };
42
- }
43
-
44
- //#endregion
45
- export { createUnpluginResolver };
@@ -1,42 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
- const require_esbuild = require('../build/esbuild.cjs');
3
- const require_plugin = require('../unplugin/plugin.cjs');
4
- let defu = require("defu");
5
- defu = require_rolldown_runtime.__toESM(defu);
6
- let __stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
7
- let esbuild = require("esbuild");
8
- let unplugin = require("unplugin");
9
-
10
- //#region ../powerlines/src/lib/utilities/bundle.ts
11
- /**
12
- * Bundle a type definition to a module.
13
- *
14
- * @param context - The context object containing the environment paths.
15
- * @param file - The file path to bundle.
16
- * @param overrides - Optional overrides for the ESBuild configuration.
17
- * @returns A promise that resolves to the bundled module.
18
- */
19
- async function bundle(context, file, overrides = {}) {
20
- const path = await context.fs.resolve(file);
21
- if (!path || !context.fs.existsSync(path)) throw new Error(`Module not found: "${file}". Please check the path and try again.`);
22
- const result = await (0, esbuild.build)((0, defu.default)({
23
- ...require_esbuild.extractESBuildConfig(context),
24
- entryPoints: [path],
25
- write: false,
26
- sourcemap: false,
27
- splitting: false,
28
- treeShaking: false,
29
- bundle: true,
30
- packages: "bundle",
31
- platform: "node",
32
- logLevel: "silent",
33
- ...overrides
34
- }, { plugins: [(0, unplugin.createEsbuildPlugin)(require_plugin.createUnpluginResolver(context, `${(0, __stryke_path_file_path_fns.findFileName)(file)} Bundler`))({})] }));
35
- if (result.errors.length > 0) throw new Error(`Failed to bundle ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
36
- if (result.warnings.length > 0) context.warn(`Warnings while bundling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
37
- if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) throw new Error(`No output files generated for ${file}. Please check the configuration and try again.`);
38
- return result.outputFiles.filter(Boolean)[0];
39
- }
40
-
41
- //#endregion
42
- exports.bundle = bundle;
@@ -1,40 +0,0 @@
1
- import { extractESBuildConfig } from "../build/esbuild.mjs";
2
- import { createUnpluginResolver } from "../unplugin/plugin.mjs";
3
- import defu from "defu";
4
- import { findFileName } from "@stryke/path/file-path-fns";
5
- import { build } from "esbuild";
6
- import { createEsbuildPlugin } from "unplugin";
7
-
8
- //#region ../powerlines/src/lib/utilities/bundle.ts
9
- /**
10
- * Bundle a type definition to a module.
11
- *
12
- * @param context - The context object containing the environment paths.
13
- * @param file - The file path to bundle.
14
- * @param overrides - Optional overrides for the ESBuild configuration.
15
- * @returns A promise that resolves to the bundled module.
16
- */
17
- async function bundle(context, file, overrides = {}) {
18
- const path = await context.fs.resolve(file);
19
- if (!path || !context.fs.existsSync(path)) throw new Error(`Module not found: "${file}". Please check the path and try again.`);
20
- const result = await build(defu({
21
- ...extractESBuildConfig(context),
22
- entryPoints: [path],
23
- write: false,
24
- sourcemap: false,
25
- splitting: false,
26
- treeShaking: false,
27
- bundle: true,
28
- packages: "bundle",
29
- platform: "node",
30
- logLevel: "silent",
31
- ...overrides
32
- }, { plugins: [createEsbuildPlugin(createUnpluginResolver(context, `${findFileName(file)} Bundler`))({})] }));
33
- if (result.errors.length > 0) throw new Error(`Failed to bundle ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
34
- if (result.warnings.length > 0) context.warn(`Warnings while bundling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
35
- if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) throw new Error(`No output files generated for ${file}. Please check the configuration and try again.`);
36
- return result.outputFiles.filter(Boolean)[0];
37
- }
38
-
39
- //#endregion
40
- export { bundle };
@@ -1,50 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
- const require_bundle = require('./bundle.cjs');
3
- let __stryke_convert_parse_type_definition = require("@stryke/convert/parse-type-definition");
4
- let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
5
-
6
- //#region ../powerlines/src/lib/utilities/resolve.ts
7
- /**
8
- * Compiles a type definition to a module.
9
- *
10
- * @param context - The context object containing the environment paths.
11
- * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
12
- * @param overrides - Optional overrides for the ESBuild configuration.
13
- * @returns A promise that resolves to the compiled module.
14
- */
15
- async function resolve(context, type, overrides = {}) {
16
- let typeDefinition;
17
- if ((0, __stryke_type_checks_is_set_string.isSetString)(type)) typeDefinition = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(type);
18
- else typeDefinition = type;
19
- const result = await require_bundle.bundle(context, typeDefinition.file, overrides);
20
- let resolved;
21
- try {
22
- resolved = await context.resolver.evalModule(result.text, {
23
- filename: result.path,
24
- forceTranspile: true
25
- });
26
- } catch (error) {
27
- if ((0, __stryke_type_checks_is_set_string.isSetString)(error.message) && (/* @__PURE__ */ new RegExp(`Cannot find module '${context.config.framework || "powerlines"}:.*'`)).test(error.message)) {
28
- const moduleName = error.message.match(/* @__PURE__ */ new RegExp(`Cannot find module '(${context.config.framework || "powerlines"}:.*)'`))?.[1];
29
- throw new Error(`The module "${moduleName}" could not be resolved while evaluating "${typeDefinition.file}". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
30
-
31
- Bundle output for module:
32
- ${result.text}` : ""}`);
33
- }
34
- throw new Error(`Failed to evaluate the bundled module for "${typeDefinition.file}". Error: ${error.message}${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
35
-
36
- Bundle output for module:
37
- ${result.text}` : ""}`);
38
- }
39
- let exportName = typeDefinition.name;
40
- if (!exportName) exportName = "default";
41
- const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];
42
- if (resolvedExport === void 0) throw new Error(`The export "${exportName}" could not be resolved in the "${typeDefinition.file}" module. ${Object.keys(resolved).length === 0 ? `After bundling, no exports were found in the module. Please ensure that the "${typeDefinition.file}" module has a "${exportName}" export with the desired value.` : `After bundling, the available exports were: ${Object.keys(resolved).join(", ")}. Please ensure that the export exists and is correctly named.`}${context.config.logLevel === "debug" ? `
43
-
44
- Bundle output for module:
45
- ${result.text}` : ""}`);
46
- return resolvedExport;
47
- }
48
-
49
- //#endregion
50
- exports.resolve = resolve;
@@ -1,49 +0,0 @@
1
- import { bundle } from "./bundle.mjs";
2
- import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
3
- import { isSetString } from "@stryke/type-checks/is-set-string";
4
-
5
- //#region ../powerlines/src/lib/utilities/resolve.ts
6
- /**
7
- * Compiles a type definition to a module.
8
- *
9
- * @param context - The context object containing the environment paths.
10
- * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
11
- * @param overrides - Optional overrides for the ESBuild configuration.
12
- * @returns A promise that resolves to the compiled module.
13
- */
14
- async function resolve(context, type, overrides = {}) {
15
- let typeDefinition;
16
- if (isSetString(type)) typeDefinition = parseTypeDefinition(type);
17
- else typeDefinition = type;
18
- const result = await bundle(context, typeDefinition.file, overrides);
19
- let resolved;
20
- try {
21
- resolved = await context.resolver.evalModule(result.text, {
22
- filename: result.path,
23
- forceTranspile: true
24
- });
25
- } catch (error) {
26
- if (isSetString(error.message) && (/* @__PURE__ */ new RegExp(`Cannot find module '${context.config.framework || "powerlines"}:.*'`)).test(error.message)) {
27
- const moduleName = error.message.match(/* @__PURE__ */ new RegExp(`Cannot find module '(${context.config.framework || "powerlines"}:.*)'`))?.[1];
28
- throw new Error(`The module "${moduleName}" could not be resolved while evaluating "${typeDefinition.file}". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
29
-
30
- Bundle output for module:
31
- ${result.text}` : ""}`);
32
- }
33
- throw new Error(`Failed to evaluate the bundled module for "${typeDefinition.file}". Error: ${error.message}${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
34
-
35
- Bundle output for module:
36
- ${result.text}` : ""}`);
37
- }
38
- let exportName = typeDefinition.name;
39
- if (!exportName) exportName = "default";
40
- const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];
41
- if (resolvedExport === void 0) throw new Error(`The export "${exportName}" could not be resolved in the "${typeDefinition.file}" module. ${Object.keys(resolved).length === 0 ? `After bundling, no exports were found in the module. Please ensure that the "${typeDefinition.file}" module has a "${exportName}" export with the desired value.` : `After bundling, the available exports were: ${Object.keys(resolved).join(", ")}. Please ensure that the export exists and is correctly named.`}${context.config.logLevel === "debug" ? `
42
-
43
- Bundle output for module:
44
- ${result.text}` : ""}`);
45
- return resolvedExport;
46
- }
47
-
48
- //#endregion
49
- export { resolve };
@@ -1,5 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
- require("@stryke/type-checks/is-string");
3
- require("@stryke/fs/read-file");
4
- require("@stryke/type-checks/is-set-object");
5
- require("magic-string");
@@ -1,6 +0,0 @@
1
- import "@stryke/type-checks/is-string";
2
- import "@stryke/fs/read-file";
3
- import "@stryke/type-checks/is-set-object";
4
- import "magic-string";
5
-
6
- export { };
@@ -1 +0,0 @@
1
- require("@stryke/path/replace");
@@ -1,3 +0,0 @@
1
- import "@stryke/path/replace";
2
-
3
- export { };
@@ -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,2 +0,0 @@
1
- import "./config.mjs";
2
- import "./context.mjs";
@@ -1,21 +0,0 @@
1
-
2
- //#region ../powerlines/src/types/build.ts
3
- const UNPLUGIN_BUILDER_VARIANTS = [
4
- "rollup",
5
- "webpack",
6
- "rspack",
7
- "vite",
8
- "esbuild",
9
- "farm",
10
- "unloader",
11
- "rolldown",
12
- "bun"
13
- ];
14
- const BUILDER_VARIANTS = [
15
- ...UNPLUGIN_BUILDER_VARIANTS,
16
- "tsup",
17
- "tsdown",
18
- "unbuild"
19
- ];
20
-
21
- //#endregion