@mtndev/cli 0.0.1
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/cjs/__chunks/4SFWHCB3.cjs +133 -0
- package/cjs/__chunks/B2KFW7T7.cjs +1 -0
- package/cjs/__chunks/EMMC33QA.cjs +401 -0
- package/cjs/__chunks/FEZT3HUT.cjs +52 -0
- package/cjs/__chunks/INFOPAHN.cjs +117 -0
- package/cjs/__chunks/J36P6UNE.cjs +75 -0
- package/cjs/__chunks/LQMP4ZKY.cjs +22 -0
- package/cjs/__chunks/NIMXXHJQ.cjs +92 -0
- package/cjs/__chunks/WNJ3ZYLI.cjs +1 -0
- package/cjs/__chunks/YCCIX4ZQ.cjs +100 -0
- package/cjs/commands/doppler/handler.cjs +9 -0
- package/cjs/commands/doppler/handler.d.ts +5 -0
- package/cjs/commands/doppler/index.cjs +41 -0
- package/cjs/commands/doppler/index.d.ts +3 -0
- package/cjs/commands/doppler/schema.cjs +8 -0
- package/cjs/commands/doppler/schema.d.ts +50 -0
- package/cjs/commands/doppler/utils/exec.cjs +12 -0
- package/cjs/commands/doppler/utils/exec.d.ts +52 -0
- package/cjs/commands/doppler/utils.cjs +30 -0
- package/cjs/commands/doppler/utils.d.ts +69 -0
- package/cjs/commands/icons/handler.cjs +8 -0
- package/cjs/commands/icons/handler.d.ts +5 -0
- package/cjs/commands/icons/index.cjs +31 -0
- package/cjs/commands/icons/index.d.ts +3 -0
- package/cjs/commands/icons/schema.cjs +16 -0
- package/cjs/commands/icons/schema.d.ts +86 -0
- package/cjs/commands/icons/utils.cjs +13 -0
- package/cjs/commands/icons/utils.d.ts +52 -0
- package/cjs/commands/index.cjs +84 -0
- package/cjs/commands/index.d.ts +2 -0
- package/cjs/commands/schema.cjs +8 -0
- package/cjs/commands/schema.d.ts +26 -0
- package/cjs/index.cjs +5 -0
- package/cjs/index.d.ts +2 -0
- package/esm/__chunks/46HGXFME.js +0 -0
- package/esm/__chunks/6G4PXXKF.js +75 -0
- package/esm/__chunks/FL7AILGH.js +133 -0
- package/esm/__chunks/HJSXC6HP.js +117 -0
- package/esm/__chunks/O262GK4B.js +401 -0
- package/esm/__chunks/OXGTO4KT.js +22 -0
- package/esm/__chunks/QSRTFPAA.js +100 -0
- package/esm/__chunks/SJXQJ7RS.js +92 -0
- package/esm/__chunks/SNCKIAOR.js +0 -0
- package/esm/__chunks/XPAQNFHZ.js +52 -0
- package/esm/commands/doppler/handler.d.ts +5 -0
- package/esm/commands/doppler/handler.js +9 -0
- package/esm/commands/doppler/index.d.ts +3 -0
- package/esm/commands/doppler/index.js +41 -0
- package/esm/commands/doppler/schema.d.ts +50 -0
- package/esm/commands/doppler/schema.js +8 -0
- package/esm/commands/doppler/utils/exec.d.ts +52 -0
- package/esm/commands/doppler/utils/exec.js +12 -0
- package/esm/commands/doppler/utils.d.ts +69 -0
- package/esm/commands/doppler/utils.js +30 -0
- package/esm/commands/icons/handler.d.ts +5 -0
- package/esm/commands/icons/handler.js +8 -0
- package/esm/commands/icons/index.d.ts +3 -0
- package/esm/commands/icons/index.js +31 -0
- package/esm/commands/icons/schema.d.ts +86 -0
- package/esm/commands/icons/schema.js +16 -0
- package/esm/commands/icons/utils.d.ts +52 -0
- package/esm/commands/icons/utils.js +13 -0
- package/esm/commands/index.d.ts +2 -0
- package/esm/commands/index.js +84 -0
- package/esm/commands/schema.d.ts +26 -0
- package/esm/commands/schema.js +8 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.js +5 -0
- package/package.json +59 -0
- package/utils/input/package.json +8 -0
- package/utils/package/package.json +8 -0
- package/utils/validation/package.json +8 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// src/commands/doppler/utils/exec.js
|
|
2
|
+
import { execSync } from "child_process";
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
function exec(command, options = {}) {
|
|
5
|
+
const {
|
|
6
|
+
stdoutParser = "string",
|
|
7
|
+
throwOnError = true,
|
|
8
|
+
verbosity = "default",
|
|
9
|
+
stdio: userStdio,
|
|
10
|
+
...execSyncOptions
|
|
11
|
+
} = options;
|
|
12
|
+
try {
|
|
13
|
+
if (verbosity === "verbose") {
|
|
14
|
+
console.log(chalk.gray(` Executing: ${command}`));
|
|
15
|
+
}
|
|
16
|
+
let stdio;
|
|
17
|
+
if (userStdio) {
|
|
18
|
+
stdio = userStdio;
|
|
19
|
+
} else if (verbosity === "verbose") {
|
|
20
|
+
stdio = "inherit";
|
|
21
|
+
} else if (verbosity === "silent") {
|
|
22
|
+
stdio = "pipe";
|
|
23
|
+
} else {
|
|
24
|
+
stdio = ["pipe", "pipe", "pipe"];
|
|
25
|
+
}
|
|
26
|
+
const result = (
|
|
27
|
+
/** @type {string} */
|
|
28
|
+
execSync(command, {
|
|
29
|
+
encoding: "utf-8",
|
|
30
|
+
stdio,
|
|
31
|
+
...execSyncOptions
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
if (stdio === "inherit") {
|
|
35
|
+
return stdoutParser === "string" ? "" : void 0;
|
|
36
|
+
}
|
|
37
|
+
if (!result || typeof result === "string" && !result.trim()) {
|
|
38
|
+
return stdoutParser === "string" ? "" : void 0;
|
|
39
|
+
}
|
|
40
|
+
switch (stdoutParser) {
|
|
41
|
+
case "json": {
|
|
42
|
+
try {
|
|
43
|
+
return JSON.parse(result);
|
|
44
|
+
} catch (parseError) {
|
|
45
|
+
if (throwOnError) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`Failed to parse JSON output: ${parseError.message}`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
return void 0;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
case "number": {
|
|
54
|
+
const num = parseFloat(result.trim());
|
|
55
|
+
if (isNaN(num)) {
|
|
56
|
+
if (throwOnError) {
|
|
57
|
+
throw new Error(`Failed to parse number from output: ${result}`);
|
|
58
|
+
}
|
|
59
|
+
return void 0;
|
|
60
|
+
}
|
|
61
|
+
return num;
|
|
62
|
+
}
|
|
63
|
+
case "string":
|
|
64
|
+
default:
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
} catch (error) {
|
|
68
|
+
if (!throwOnError) {
|
|
69
|
+
return void 0;
|
|
70
|
+
}
|
|
71
|
+
if (error.stderr) {
|
|
72
|
+
throw new Error(error.stderr.toString());
|
|
73
|
+
}
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function execString(command, options = {}) {
|
|
78
|
+
return exec(command, { ...options, stdoutParser: "string" });
|
|
79
|
+
}
|
|
80
|
+
function execJson(command, options = {}) {
|
|
81
|
+
return exec(command, { ...options, stdoutParser: "json" });
|
|
82
|
+
}
|
|
83
|
+
function execNumber(command, options = {}) {
|
|
84
|
+
return exec(command, { ...options, stdoutParser: "number" });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
exec,
|
|
89
|
+
execString,
|
|
90
|
+
execJson,
|
|
91
|
+
execNumber
|
|
92
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// src/commands/doppler/schema.js
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var dopplerCommandOptionsSchema = z.object({
|
|
4
|
+
action: z.enum(["download", "upload"], {
|
|
5
|
+
errorMap: () => ({
|
|
6
|
+
message: "Action must be either 'download' or 'upload'"
|
|
7
|
+
})
|
|
8
|
+
}).describe("Action to perform: download or upload configurations"),
|
|
9
|
+
environment: z.string().optional().default("dev").describe(
|
|
10
|
+
'Environment configuration to process (e.g., dev, stg, prd, or "all" for all configs)'
|
|
11
|
+
),
|
|
12
|
+
verbose: z.boolean().optional().default(false).describe("Enable verbose logging for detailed error information"),
|
|
13
|
+
help: z.boolean().optional().default(false).describe("Display help for command")
|
|
14
|
+
});
|
|
15
|
+
var dopplerCommandMetadata = {
|
|
16
|
+
name: "doppler",
|
|
17
|
+
description: `Manage Doppler configurations
|
|
18
|
+
|
|
19
|
+
Subcommands:
|
|
20
|
+
download Download configurations from Doppler to local .env files
|
|
21
|
+
upload Upload local .env files to Doppler (with confirmation prompt)
|
|
22
|
+
|
|
23
|
+
Examples:
|
|
24
|
+
$ @mtndev/cli doppler download # Download dev config to .env.dev
|
|
25
|
+
$ @mtndev/cli doppler download -e all # Download all configs
|
|
26
|
+
$ @mtndev/cli doppler download -e stg # Download staging config
|
|
27
|
+
$ @mtndev/cli doppler upload # Upload .env.dev to Doppler
|
|
28
|
+
$ @mtndev/cli doppler upload -e prd # Upload production config`,
|
|
29
|
+
options: {
|
|
30
|
+
environment: {
|
|
31
|
+
description: dopplerCommandOptionsSchema.shape.environment.description,
|
|
32
|
+
default: "dev",
|
|
33
|
+
alias: "e"
|
|
34
|
+
},
|
|
35
|
+
// Global options are included here for help display
|
|
36
|
+
verbose: {
|
|
37
|
+
description: dopplerCommandOptionsSchema.shape.verbose.description,
|
|
38
|
+
default: false,
|
|
39
|
+
alias: "v"
|
|
40
|
+
},
|
|
41
|
+
help: {
|
|
42
|
+
description: dopplerCommandOptionsSchema.shape.help.description,
|
|
43
|
+
default: false,
|
|
44
|
+
alias: "h"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export {
|
|
50
|
+
dopplerCommandOptionsSchema,
|
|
51
|
+
dopplerCommandMetadata
|
|
52
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import "../../__chunks/46HGXFME.js";
|
|
2
|
+
import {
|
|
3
|
+
dopplerCommand
|
|
4
|
+
} from "../../__chunks/QSRTFPAA.js";
|
|
5
|
+
import {
|
|
6
|
+
checkDependencies,
|
|
7
|
+
createDiff,
|
|
8
|
+
downloadConfigs,
|
|
9
|
+
execDoppler,
|
|
10
|
+
getConfigs,
|
|
11
|
+
normalizeEscapeSequences,
|
|
12
|
+
promptConfirmation,
|
|
13
|
+
uploadConfigs
|
|
14
|
+
} from "../../__chunks/O262GK4B.js";
|
|
15
|
+
import {
|
|
16
|
+
exec,
|
|
17
|
+
execJson,
|
|
18
|
+
execNumber,
|
|
19
|
+
execString
|
|
20
|
+
} from "../../__chunks/SJXQJ7RS.js";
|
|
21
|
+
import {
|
|
22
|
+
dopplerCommandMetadata,
|
|
23
|
+
dopplerCommandOptionsSchema
|
|
24
|
+
} from "../../__chunks/XPAQNFHZ.js";
|
|
25
|
+
export {
|
|
26
|
+
checkDependencies,
|
|
27
|
+
createDiff,
|
|
28
|
+
dopplerCommand,
|
|
29
|
+
dopplerCommandMetadata,
|
|
30
|
+
dopplerCommandOptionsSchema,
|
|
31
|
+
downloadConfigs,
|
|
32
|
+
exec,
|
|
33
|
+
execDoppler,
|
|
34
|
+
execJson,
|
|
35
|
+
execNumber,
|
|
36
|
+
execString,
|
|
37
|
+
getConfigs,
|
|
38
|
+
normalizeEscapeSequences,
|
|
39
|
+
promptConfirmation,
|
|
40
|
+
uploadConfigs
|
|
41
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for doppler command-specific options
|
|
3
|
+
* Global options (verbose, help) are inherited from globalOptionsSchema
|
|
4
|
+
*/
|
|
5
|
+
export const dopplerCommandOptionsSchema: z.ZodObject<{
|
|
6
|
+
action: z.ZodEnum<["download", "upload"]>;
|
|
7
|
+
environment: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
8
|
+
verbose: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
9
|
+
help: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
action: "download" | "upload";
|
|
12
|
+
environment: string;
|
|
13
|
+
verbose: boolean;
|
|
14
|
+
help: boolean;
|
|
15
|
+
}, {
|
|
16
|
+
action: "download" | "upload";
|
|
17
|
+
environment?: string | undefined;
|
|
18
|
+
verbose?: boolean | undefined;
|
|
19
|
+
help?: boolean | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export namespace dopplerCommandMetadata {
|
|
22
|
+
let name: string;
|
|
23
|
+
let description: string;
|
|
24
|
+
namespace options {
|
|
25
|
+
namespace environment {
|
|
26
|
+
let description_1: string | undefined;
|
|
27
|
+
export { description_1 as description };
|
|
28
|
+
let _default: string;
|
|
29
|
+
export { _default as default };
|
|
30
|
+
export let alias: string;
|
|
31
|
+
}
|
|
32
|
+
namespace verbose {
|
|
33
|
+
let description_2: string | undefined;
|
|
34
|
+
export { description_2 as description };
|
|
35
|
+
let _default_1: boolean;
|
|
36
|
+
export { _default_1 as default };
|
|
37
|
+
let alias_1: string;
|
|
38
|
+
export { alias_1 as alias };
|
|
39
|
+
}
|
|
40
|
+
namespace help {
|
|
41
|
+
let description_3: string | undefined;
|
|
42
|
+
export { description_3 as description };
|
|
43
|
+
let _default_2: boolean;
|
|
44
|
+
export { _default_2 as default };
|
|
45
|
+
let alias_2: string;
|
|
46
|
+
export { alias_2 as alias };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
import { z } from "zod";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {'silent' | 'verbose' | 'default'} VerbosityLevel
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {Object} ExecOptions
|
|
6
|
+
* @property {'string' | 'number' | 'json'} [stdoutParser='string'] - How to parse stdout
|
|
7
|
+
* @property {boolean} [throwOnError=true] - Whether to throw on error
|
|
8
|
+
* @property {VerbosityLevel} [verbosity='default'] - Output verbosity level
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Execute a command and parse the output
|
|
12
|
+
* @param {string} command - Command to execute
|
|
13
|
+
* @param {import('child_process').ExecSyncOptions & ExecOptions} [options={}] - Execution options (inherits all execSync options + custom options)
|
|
14
|
+
* @returns {string | number | any} - Parsed output based on stdoutParser
|
|
15
|
+
*/
|
|
16
|
+
export function exec(command: string, options?: import("child_process").ExecSyncOptions & ExecOptions): string | number | any;
|
|
17
|
+
/**
|
|
18
|
+
* Execute a command with string output
|
|
19
|
+
* @param {string} command - Command to execute
|
|
20
|
+
* @param {import('child_process').ExecSyncOptions & ExecOptions} [options] - Execution options
|
|
21
|
+
* @returns {string}
|
|
22
|
+
*/
|
|
23
|
+
export function execString(command: string, options?: import("child_process").ExecSyncOptions & ExecOptions): string;
|
|
24
|
+
/**
|
|
25
|
+
* Execute a command with JSON output
|
|
26
|
+
* @param {string} command - Command to execute
|
|
27
|
+
* @param {import('child_process').ExecSyncOptions & ExecOptions} [options] - Execution options
|
|
28
|
+
* @returns {any}
|
|
29
|
+
*/
|
|
30
|
+
export function execJson(command: string, options?: import("child_process").ExecSyncOptions & ExecOptions): any;
|
|
31
|
+
/**
|
|
32
|
+
* Execute a command with number output
|
|
33
|
+
* @param {string} command - Command to execute
|
|
34
|
+
* @param {import('child_process').ExecSyncOptions & ExecOptions} [options] - Execution options
|
|
35
|
+
* @returns {number}
|
|
36
|
+
*/
|
|
37
|
+
export function execNumber(command: string, options?: import("child_process").ExecSyncOptions & ExecOptions): number;
|
|
38
|
+
export type VerbosityLevel = "silent" | "verbose" | "default";
|
|
39
|
+
export type ExecOptions = {
|
|
40
|
+
/**
|
|
41
|
+
* - How to parse stdout
|
|
42
|
+
*/
|
|
43
|
+
stdoutParser?: "string" | "number" | "json" | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* - Whether to throw on error
|
|
46
|
+
*/
|
|
47
|
+
throwOnError?: boolean | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* - Output verbosity level
|
|
50
|
+
*/
|
|
51
|
+
verbosity?: VerbosityLevel | undefined;
|
|
52
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execute a doppler command and return the result
|
|
3
|
+
* @param {string[]} args - Command arguments
|
|
4
|
+
* @param {'string' | 'json'} parser - How to parse the output
|
|
5
|
+
* @param {boolean} silent - Suppress output
|
|
6
|
+
* @param {boolean} verbose - Show verbose output
|
|
7
|
+
* @returns {string | any}
|
|
8
|
+
*/
|
|
9
|
+
export function execDoppler(args: string[], parser?: "string" | "json", silent?: boolean, verbose?: boolean): string | any;
|
|
10
|
+
/**
|
|
11
|
+
* Check if doppler CLI is installed and configured
|
|
12
|
+
* @param {boolean} verbose - Show verbose output
|
|
13
|
+
*/
|
|
14
|
+
export function checkDependencies(verbose?: boolean): void;
|
|
15
|
+
/**
|
|
16
|
+
* Get list of configurations based on environment parameter
|
|
17
|
+
* @param {string} environment - Environment name ('all', 'dev', 'stg', 'prd', etc.)
|
|
18
|
+
* @param {boolean} verbose - Show verbose output
|
|
19
|
+
* @returns {string[]}
|
|
20
|
+
*/
|
|
21
|
+
export function getConfigs(environment: string, verbose?: boolean): string[];
|
|
22
|
+
/**
|
|
23
|
+
* Normalize escape sequences in file content
|
|
24
|
+
* @param {string} content - File content
|
|
25
|
+
* @returns {string}
|
|
26
|
+
*/
|
|
27
|
+
export function normalizeEscapeSequences(content: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Create a unified diff between two strings
|
|
30
|
+
* @param {string} oldContent - Original content
|
|
31
|
+
* @param {string} newContent - New content
|
|
32
|
+
* @returns {string[]}
|
|
33
|
+
*/
|
|
34
|
+
export function createDiff(oldContent: string, newContent: string): string[];
|
|
35
|
+
/**
|
|
36
|
+
* Prompt user for confirmation
|
|
37
|
+
* @param {string} message - Prompt message
|
|
38
|
+
* @returns {Promise<boolean>}
|
|
39
|
+
*/
|
|
40
|
+
export function promptConfirmation(message: string): Promise<boolean>;
|
|
41
|
+
/**
|
|
42
|
+
* Download configurations from Doppler
|
|
43
|
+
* @param {{
|
|
44
|
+
* verbose: boolean;
|
|
45
|
+
* environment: string;
|
|
46
|
+
* }} options - Options for downloading configurations
|
|
47
|
+
*/
|
|
48
|
+
export function downloadConfigs(options: {
|
|
49
|
+
verbose: boolean;
|
|
50
|
+
environment: string;
|
|
51
|
+
}): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Upload configurations to Doppler
|
|
54
|
+
* @param {{
|
|
55
|
+
* environment: string;
|
|
56
|
+
* verbose: boolean;
|
|
57
|
+
* }} options - Options for uploading configurations
|
|
58
|
+
*/
|
|
59
|
+
export function uploadConfigs(options: {
|
|
60
|
+
environment: string;
|
|
61
|
+
verbose: boolean;
|
|
62
|
+
}): Promise<void>;
|
|
63
|
+
export type VerbosityLevel = import("./utils/exec.js").VerbosityLevel;
|
|
64
|
+
export type ExecOptions = import("./utils/exec.js").ExecOptions;
|
|
65
|
+
import { exec } from "./utils/exec.js";
|
|
66
|
+
import { execString } from "./utils/exec.js";
|
|
67
|
+
import { execJson } from "./utils/exec.js";
|
|
68
|
+
import { execNumber } from "./utils/exec.js";
|
|
69
|
+
export { exec, execString, execJson, execNumber };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkDependencies,
|
|
3
|
+
createDiff,
|
|
4
|
+
downloadConfigs,
|
|
5
|
+
execDoppler,
|
|
6
|
+
getConfigs,
|
|
7
|
+
normalizeEscapeSequences,
|
|
8
|
+
promptConfirmation,
|
|
9
|
+
uploadConfigs
|
|
10
|
+
} from "../../__chunks/O262GK4B.js";
|
|
11
|
+
import {
|
|
12
|
+
exec,
|
|
13
|
+
execJson,
|
|
14
|
+
execNumber,
|
|
15
|
+
execString
|
|
16
|
+
} from "../../__chunks/SJXQJ7RS.js";
|
|
17
|
+
export {
|
|
18
|
+
checkDependencies,
|
|
19
|
+
createDiff,
|
|
20
|
+
downloadConfigs,
|
|
21
|
+
exec,
|
|
22
|
+
execDoppler,
|
|
23
|
+
execJson,
|
|
24
|
+
execNumber,
|
|
25
|
+
execString,
|
|
26
|
+
getConfigs,
|
|
27
|
+
normalizeEscapeSequences,
|
|
28
|
+
promptConfirmation,
|
|
29
|
+
uploadConfigs
|
|
30
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import "../../__chunks/SNCKIAOR.js";
|
|
2
|
+
import {
|
|
3
|
+
iconsCommand
|
|
4
|
+
} from "../../__chunks/HJSXC6HP.js";
|
|
5
|
+
import {
|
|
6
|
+
checkDependencies,
|
|
7
|
+
generateAllIcons,
|
|
8
|
+
generateIcon,
|
|
9
|
+
validateBaseIcons
|
|
10
|
+
} from "../../__chunks/FL7AILGH.js";
|
|
11
|
+
import {
|
|
12
|
+
CHANNELS,
|
|
13
|
+
CHANNEL_TEXT_MAP,
|
|
14
|
+
ICON_SIZE_MAP,
|
|
15
|
+
ICON_TYPES,
|
|
16
|
+
iconsCommandMetadata,
|
|
17
|
+
iconsCommandOptionsSchema
|
|
18
|
+
} from "../../__chunks/6G4PXXKF.js";
|
|
19
|
+
export {
|
|
20
|
+
CHANNELS,
|
|
21
|
+
CHANNEL_TEXT_MAP,
|
|
22
|
+
ICON_SIZE_MAP,
|
|
23
|
+
ICON_TYPES,
|
|
24
|
+
checkDependencies,
|
|
25
|
+
generateAllIcons,
|
|
26
|
+
generateIcon,
|
|
27
|
+
iconsCommand,
|
|
28
|
+
iconsCommandMetadata,
|
|
29
|
+
iconsCommandOptionsSchema,
|
|
30
|
+
validateBaseIcons
|
|
31
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Available channels for icon generation
|
|
3
|
+
*/
|
|
4
|
+
export const CHANNELS: string[];
|
|
5
|
+
/**
|
|
6
|
+
* Available icon types
|
|
7
|
+
*/
|
|
8
|
+
export const ICON_TYPES: string[];
|
|
9
|
+
export namespace CHANNEL_TEXT_MAP {
|
|
10
|
+
let dev: string;
|
|
11
|
+
let local: string;
|
|
12
|
+
let staging: string;
|
|
13
|
+
let test: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Icon type to point size mapping
|
|
17
|
+
*/
|
|
18
|
+
export const ICON_SIZE_MAP: {
|
|
19
|
+
"adaptive-icon": number;
|
|
20
|
+
icon: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Zod schema for icons command options
|
|
24
|
+
*/
|
|
25
|
+
export const iconsCommandOptionsSchema: z.ZodObject<{
|
|
26
|
+
input: z.ZodString;
|
|
27
|
+
channels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["dev", "local", "staging", "test"]>, "many">>>;
|
|
28
|
+
iconTypes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["icon", "adaptive-icon"]>, "many">>>;
|
|
29
|
+
verbose: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
30
|
+
help: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
verbose: boolean;
|
|
33
|
+
help: boolean;
|
|
34
|
+
input: string;
|
|
35
|
+
channels: ("dev" | "staging" | "test" | "local")[];
|
|
36
|
+
iconTypes: ("icon" | "adaptive-icon")[];
|
|
37
|
+
}, {
|
|
38
|
+
input: string;
|
|
39
|
+
verbose?: boolean | undefined;
|
|
40
|
+
help?: boolean | undefined;
|
|
41
|
+
channels?: ("dev" | "staging" | "test" | "local")[] | undefined;
|
|
42
|
+
iconTypes?: ("icon" | "adaptive-icon")[] | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
export namespace iconsCommandMetadata {
|
|
45
|
+
let name: string;
|
|
46
|
+
let description: string;
|
|
47
|
+
namespace options {
|
|
48
|
+
namespace input {
|
|
49
|
+
let description_1: string | undefined;
|
|
50
|
+
export { description_1 as description };
|
|
51
|
+
export let required: boolean;
|
|
52
|
+
}
|
|
53
|
+
namespace channels {
|
|
54
|
+
let description_2: string | undefined;
|
|
55
|
+
export { description_2 as description };
|
|
56
|
+
let _default: string;
|
|
57
|
+
export { _default as default };
|
|
58
|
+
export let alias: string;
|
|
59
|
+
}
|
|
60
|
+
namespace iconTypes {
|
|
61
|
+
let description_3: string | undefined;
|
|
62
|
+
export { description_3 as description };
|
|
63
|
+
let _default_1: string;
|
|
64
|
+
export { _default_1 as default };
|
|
65
|
+
let alias_1: string;
|
|
66
|
+
export { alias_1 as alias };
|
|
67
|
+
}
|
|
68
|
+
namespace verbose {
|
|
69
|
+
let description_4: string | undefined;
|
|
70
|
+
export { description_4 as description };
|
|
71
|
+
let _default_2: boolean;
|
|
72
|
+
export { _default_2 as default };
|
|
73
|
+
let alias_2: string;
|
|
74
|
+
export { alias_2 as alias };
|
|
75
|
+
}
|
|
76
|
+
namespace help {
|
|
77
|
+
let description_5: string | undefined;
|
|
78
|
+
export { description_5 as description };
|
|
79
|
+
let _default_3: boolean;
|
|
80
|
+
export { _default_3 as default };
|
|
81
|
+
let alias_3: string;
|
|
82
|
+
export { alias_3 as alias };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
import { z } from "zod";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CHANNELS,
|
|
3
|
+
CHANNEL_TEXT_MAP,
|
|
4
|
+
ICON_SIZE_MAP,
|
|
5
|
+
ICON_TYPES,
|
|
6
|
+
iconsCommandMetadata,
|
|
7
|
+
iconsCommandOptionsSchema
|
|
8
|
+
} from "../../__chunks/6G4PXXKF.js";
|
|
9
|
+
export {
|
|
10
|
+
CHANNELS,
|
|
11
|
+
CHANNEL_TEXT_MAP,
|
|
12
|
+
ICON_SIZE_MAP,
|
|
13
|
+
ICON_TYPES,
|
|
14
|
+
iconsCommandMetadata,
|
|
15
|
+
iconsCommandOptionsSchema
|
|
16
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if ImageMagick is installed
|
|
3
|
+
* @param {boolean} verbose - Show verbose output
|
|
4
|
+
* @throws {Error} If ImageMagick is not installed
|
|
5
|
+
*/
|
|
6
|
+
export function checkDependencies(verbose?: boolean): void;
|
|
7
|
+
/**
|
|
8
|
+
* Validate that required base icons exist
|
|
9
|
+
* @param {string} baseDir - Base directory containing icons
|
|
10
|
+
* @param {string[]} iconTypes - Icon types to validate
|
|
11
|
+
* @param {boolean} verbose - Show verbose output
|
|
12
|
+
* @throws {Error} If required icons are missing
|
|
13
|
+
*/
|
|
14
|
+
export function validateBaseIcons(baseDir: string, iconTypes: string[], verbose?: boolean): void;
|
|
15
|
+
/**
|
|
16
|
+
* Generate a single icon with channel overlay
|
|
17
|
+
* @param {{
|
|
18
|
+
* baseDir: string;
|
|
19
|
+
* channel: string;
|
|
20
|
+
* iconType: string;
|
|
21
|
+
* verbose: boolean;
|
|
22
|
+
* }} options - Generation options
|
|
23
|
+
* @returns {string} Path to generated icon
|
|
24
|
+
*/
|
|
25
|
+
export function generateIcon(options: {
|
|
26
|
+
baseDir: string;
|
|
27
|
+
channel: string;
|
|
28
|
+
iconType: string;
|
|
29
|
+
verbose: boolean;
|
|
30
|
+
}): string;
|
|
31
|
+
/**
|
|
32
|
+
* Generate all icons for specified channels and types
|
|
33
|
+
* @param {{
|
|
34
|
+
* baseDir: string;
|
|
35
|
+
* channels: string[];
|
|
36
|
+
* iconTypes: string[];
|
|
37
|
+
* verbose: boolean;
|
|
38
|
+
* }} options - Generation options
|
|
39
|
+
* @returns {{ success: string[]; failed: { icon: string; error: string }[] }}
|
|
40
|
+
*/
|
|
41
|
+
export function generateAllIcons(options: {
|
|
42
|
+
baseDir: string;
|
|
43
|
+
channels: string[];
|
|
44
|
+
iconTypes: string[];
|
|
45
|
+
verbose: boolean;
|
|
46
|
+
}): {
|
|
47
|
+
success: string[];
|
|
48
|
+
failed: {
|
|
49
|
+
icon: string;
|
|
50
|
+
error: string;
|
|
51
|
+
}[];
|
|
52
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkDependencies,
|
|
3
|
+
generateAllIcons,
|
|
4
|
+
generateIcon,
|
|
5
|
+
validateBaseIcons
|
|
6
|
+
} from "../../__chunks/FL7AILGH.js";
|
|
7
|
+
import "../../__chunks/6G4PXXKF.js";
|
|
8
|
+
export {
|
|
9
|
+
checkDependencies,
|
|
10
|
+
generateAllIcons,
|
|
11
|
+
generateIcon,
|
|
12
|
+
validateBaseIcons
|
|
13
|
+
};
|