@powerlines/plugin-babel 0.12.299 → 0.12.300
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.
- package/dist/core/src/lib/logger.mjs +40 -0
- package/dist/core/src/lib/logger.mjs.map +1 -0
- package/dist/core/src/types/api.d.mts +103 -0
- package/dist/core/src/types/api.d.mts.map +1 -0
- package/dist/core/src/types/commands.d.mts +10 -0
- package/dist/core/src/types/commands.d.mts.map +1 -0
- package/dist/core/src/types/config.d.mts +551 -0
- package/dist/core/src/types/config.d.mts.map +1 -0
- package/dist/core/src/types/context.d.mts +511 -0
- package/dist/core/src/types/context.d.mts.map +1 -0
- package/dist/core/src/types/fs.d.mts +487 -0
- package/dist/core/src/types/fs.d.mts.map +1 -0
- package/dist/core/src/types/hooks.d.mts +99 -0
- package/dist/core/src/types/hooks.d.mts.map +1 -0
- package/dist/core/src/types/index.d.mts +9 -0
- package/dist/core/src/types/plugin.d.mts +204 -0
- package/dist/core/src/types/plugin.d.mts.map +1 -0
- package/dist/core/src/types/tsconfig.d.mts +70 -0
- package/dist/core/src/types/tsconfig.d.mts.map +1 -0
- package/dist/core/src/types/unplugin.d.mts +25 -0
- package/dist/core/src/types/unplugin.d.mts.map +1 -0
- package/dist/helpers/create-plugin.d.mts +3 -2
- package/dist/helpers/create-plugin.d.mts.map +1 -1
- package/dist/helpers/create-plugin.mjs +1 -1
- package/dist/helpers/create-plugin.mjs.map +1 -1
- package/dist/helpers/filters.d.mts +4 -3
- package/dist/helpers/filters.d.mts.map +1 -1
- package/dist/helpers/filters.mjs.map +1 -1
- package/dist/helpers/module-helpers.d.mts +1 -1
- package/dist/helpers/module-helpers.mjs.map +1 -1
- package/dist/helpers/options.d.mts +3 -2
- package/dist/helpers/options.d.mts.map +1 -1
- package/dist/helpers/options.mjs.map +1 -1
- package/dist/index.d.mts +5 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/types/config.d.mts +88 -0
- package/dist/types/config.d.mts.map +1 -0
- package/dist/types/config.mjs +1 -0
- package/dist/types/index.d.mts +2 -1
- package/dist/types/plugin.d.mts +8 -7
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +36 -153
- package/dist/_virtual/rolldown_runtime.cjs +0 -29
- package/dist/helpers/ast-utils.cjs +0 -35
- package/dist/helpers/ast-utils.d.cts +0 -20
- package/dist/helpers/ast-utils.d.cts.map +0 -1
- package/dist/helpers/create-plugin.cjs +0 -41
- package/dist/helpers/create-plugin.d.cts +0 -16
- package/dist/helpers/create-plugin.d.cts.map +0 -1
- package/dist/helpers/filters.cjs +0 -59
- package/dist/helpers/filters.d.cts +0 -43
- package/dist/helpers/filters.d.cts.map +0 -1
- package/dist/helpers/index.cjs +0 -22
- package/dist/helpers/index.d.cts +0 -6
- package/dist/helpers/module-helpers.cjs +0 -103
- package/dist/helpers/module-helpers.d.cts +0 -50
- package/dist/helpers/module-helpers.d.cts.map +0 -1
- package/dist/helpers/options.cjs +0 -49
- package/dist/helpers/options.d.cts +0 -19
- package/dist/helpers/options.d.cts.map +0 -1
- package/dist/index.cjs +0 -104
- package/dist/index.d.cts +0 -21
- package/dist/index.d.cts.map +0 -1
- package/dist/types/index.cjs +0 -0
- package/dist/types/index.d.cts +0 -2
- package/dist/types/plugin.cjs +0 -0
- package/dist/types/plugin.d.cts +0 -20
- package/dist/types/plugin.d.cts.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import "@storm-software/config-tools/logger";
|
|
3
|
+
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
4
|
+
import "@storm-software/config-tools/utilities/colors";
|
|
5
|
+
import "@stryke/helpers/noop";
|
|
6
|
+
import "@stryke/string-format/kebab-case";
|
|
7
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
8
|
+
|
|
9
|
+
//#region ../core/src/lib/logger.ts
|
|
10
|
+
const BADGE_COLORS = [
|
|
11
|
+
"#00A0DD",
|
|
12
|
+
"#6FCE4E",
|
|
13
|
+
"#FBBF24",
|
|
14
|
+
"#F43F5E",
|
|
15
|
+
"#3B82F6",
|
|
16
|
+
"#A855F7",
|
|
17
|
+
"#469592",
|
|
18
|
+
"#288EDF",
|
|
19
|
+
"#D8B4FE",
|
|
20
|
+
"#10B981",
|
|
21
|
+
"#EF4444",
|
|
22
|
+
"#F0EC56",
|
|
23
|
+
"#F472B6",
|
|
24
|
+
"#22D3EE",
|
|
25
|
+
"#EAB308",
|
|
26
|
+
"#84CC16",
|
|
27
|
+
"#F87171",
|
|
28
|
+
"#0EA5E9",
|
|
29
|
+
"#D946EF",
|
|
30
|
+
"#FACC15",
|
|
31
|
+
"#34D399",
|
|
32
|
+
"#8B5CF6"
|
|
33
|
+
];
|
|
34
|
+
const extendLog = (logFn, name) => {
|
|
35
|
+
return (type, ...args) => logFn(type, ` ${chalk.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${titleCase(name)} `)} ${args.join(" ")} `);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { extendLog };
|
|
40
|
+
//# sourceMappingURL=logger.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.mjs","names":[],"sources":["../../../../../core/src/lib/logger.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { getLogFn, getLogLevel } from \"@storm-software/config-tools/logger\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { getColor } from \"@storm-software/config-tools/utilities/colors\";\nimport { noop } from \"@stryke/helpers/noop\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport chalk from \"chalk\";\nimport type { LogFn, WorkspaceConfig } from \"../types\";\n\nexport interface CreateLogOptions {\n name?: string;\n logLevel?: LogLevelLabel | null;\n customLogger?: LogFn;\n colors?: WorkspaceConfig[\"colors\"];\n}\n\n/**\n * Create a logging function with a specific name and options.\n *\n * @param name - The name of the logging function.\n * @param options - The options to configure the logging function.\n * @returns A logging function.\n */\nexport const createLog = (\n name: string | null,\n options: CreateLogOptions = {}\n): LogFn => {\n const logLevel =\n options.logLevel === null\n ? LogLevelLabel.SILENT\n : options.logLevel || LogLevelLabel.INFO;\n if (logLevel === LogLevelLabel.SILENT) {\n return noop;\n }\n\n if (options.customLogger) {\n return options.customLogger;\n }\n\n return (type: LogLevelLabel, ...args: string[]) =>\n getLogFn(getLogLevel(type), {\n ...options,\n logLevel\n })(\n `${chalk.bold.hex(\n getColor(\"brand\", options as Parameters<typeof getColor>[1])\n )(\n `${name ? kebabCase(name) : \"\"}${options.name ? `${name ? chalk.gray(\" > \") : \"\"}${kebabCase(options.name)}` : \"\"}${chalk.gray(\" > \")}`\n )}${args.join(\" \")} `.trim()\n );\n};\n\nconst BADGE_COLORS = [\n \"#00A0DD\",\n \"#6FCE4E\",\n \"#FBBF24\",\n \"#F43F5E\",\n \"#3B82F6\",\n \"#A855F7\",\n \"#469592\",\n \"#288EDF\",\n \"#D8B4FE\",\n \"#10B981\",\n \"#EF4444\",\n \"#F0EC56\",\n \"#F472B6\",\n \"#22D3EE\",\n \"#EAB308\",\n \"#84CC16\",\n \"#F87171\",\n \"#0EA5E9\",\n \"#D946EF\",\n \"#FACC15\",\n \"#34D399\",\n \"#8B5CF6\"\n] as const;\n\nexport const extendLog = (logFn: LogFn, name: string): LogFn => {\n return (type: LogLevelLabel, ...args: string[]) =>\n logFn(\n type,\n ` ${chalk.inverse.hex(\n BADGE_COLORS[\n name\n .split(\"\")\n .map(char => char.charCodeAt(0))\n .reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length\n ] || BADGE_COLORS[0]\n )(` ${titleCase(name)} `)} ${args.join(\" \")} `\n );\n};\n"],"mappings":";;;;;;;;;AAsEA,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,aAAa,OAAc,SAAwB;AAC9D,SAAQ,MAAqB,GAAG,SAC9B,MACE,MACA,IAAI,MAAM,QAAQ,IAChB,aACE,KACG,MAAM,GAAG,CACT,KAAI,SAAQ,KAAK,WAAW,EAAE,CAAC,CAC/B,QAAQ,KAAK,aAAa,MAAM,UAAU,EAAE,GAAG,aAAa,WAC5D,aAAa,GACnB,CAAC,IAAI,UAAU,KAAK,CAAC,GAAG,CAAC,IAAI,KAAK,KAAK,IAAI,CAAC,GAC9C"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { CallHookOptions, InferHookParameters, InferHookReturnType } from "./hooks.mjs";
|
|
2
|
+
import { APIContext, EnvironmentContext, PluginContext } from "./context.mjs";
|
|
3
|
+
import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, LintInlineConfig, NewInlineConfig, PrepareInlineConfig, ResolvedConfig } from "./config.mjs";
|
|
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.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.mts","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,10 @@
|
|
|
1
|
+
import "./context.mjs";
|
|
2
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
3
|
+
import { ArrayValues } from "@stryke/types/array";
|
|
4
|
+
|
|
5
|
+
//#region ../core/src/types/commands.d.ts
|
|
6
|
+
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
|
|
7
|
+
type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { CommandType, SUPPORTED_COMMANDS };
|
|
10
|
+
//# sourceMappingURL=commands.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.mts","names":[],"sources":["../../../../../core/src/types/commands.ts"],"sourcesContent":[],"mappings":";;;;;cAsBa;KAYD,WAAA,GAAc,mBAAmB"}
|