@ben-studios/envedit 0.0.0-stage → 1.0.0
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/.gitlab-ci.yml +133 -0
- package/.idea/envedit.iml +8 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/@types/custom.d.ts +10 -0
- package/CHANGELOG.md +196 -0
- package/LICENSE +674 -0
- package/README.md +97 -2
- package/bun.lock +176 -0
- package/ci/npm.sh +4 -0
- package/cli/cmd/environment.ts +10 -0
- package/cli/cmd/environmentCmd/add.ts +115 -0
- package/cli/cmd/environmentCmd/edit.ts +74 -0
- package/cli/cmd/environmentCmd/index.ts +6 -0
- package/cli/cmd/environmentCmd/list.ts +16 -0
- package/cli/cmd/environmentCmd/remove.ts +47 -0
- package/cli/cmd/index.ts +7 -0
- package/cli/cmd/init.ts +60 -0
- package/cli/cmd/setup.ts +46 -0
- package/cli/cmd/use.ts +60 -0
- package/cli/cmd/variable.ts +10 -0
- package/cli/cmd/variableCmd/add.ts +92 -0
- package/cli/cmd/variableCmd/edit.ts +150 -0
- package/cli/cmd/variableCmd/index.ts +6 -0
- package/cli/cmd/variableCmd/list.ts +35 -0
- package/cli/cmd/variableCmd/remove.ts +39 -0
- package/cli/index.ts +28 -0
- package/coverage/.lcov.info.133d8750bda2c350.tmp +139 -0
- package/coverage/.lcov.info.64d068458fa931ef.tmp +139 -0
- package/coverage/junit.xml +37 -0
- package/coverage/lcov.info +139 -0
- package/lib/config.ts +133 -0
- package/lib/error.ts +6 -0
- package/lib/logger.ts +40 -0
- package/package.json +26 -3
- package/tsconfig.json +35 -0
package/cli/cmd/setup.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
lstatSync as lstat,
|
|
3
|
+
existsSync as exists,
|
|
4
|
+
copyFileSync as copy,
|
|
5
|
+
unlinkSync as unlink,
|
|
6
|
+
symlinkSync as symlink,
|
|
7
|
+
} from 'node:fs';
|
|
8
|
+
|
|
9
|
+
import { Configuration, EnvironmentFile } from "#lib/config";
|
|
10
|
+
import { NotFoundError } from "#lib/error";
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
command: 'setup',
|
|
14
|
+
describe: 'Setup the project for use with envedit',
|
|
15
|
+
builder: (yargs) => yargs
|
|
16
|
+
.usage('Usage: envedit setup')
|
|
17
|
+
.epilogue("Note that this command is meant to be used after the project has been setup. To make a clean start, please run the 'init' command instead."),
|
|
18
|
+
handler: async (_argv) => {
|
|
19
|
+
if (!exists('env.config.yaml')) {
|
|
20
|
+
throw new NotFoundError("Could not find configuration file. Did you run the init command?")
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const config = new Configuration();
|
|
24
|
+
|
|
25
|
+
for (const environment of config.envs.values()) {
|
|
26
|
+
const envFile = new EnvironmentFile(environment.file);
|
|
27
|
+
|
|
28
|
+
if (environment.isActive) {
|
|
29
|
+
if (exists('.env') && !lstat('.env').isSymbolicLink()) {
|
|
30
|
+
copy('.env', environment.file);
|
|
31
|
+
unlink('.env');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
symlink(environment.file, '.env', 'file');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
for (const variable of config.vars.values()) {
|
|
38
|
+
if (!envFile.vars.has(variable.name)) {
|
|
39
|
+
envFile.vars.set(variable.name, '');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
envFile.save();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
} as CommandModule;
|
package/cli/cmd/use.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
lstatSync as lstat,
|
|
3
|
+
existsSync as exists,
|
|
4
|
+
unlinkSync as unlink,
|
|
5
|
+
symlinkSync as symlink,
|
|
6
|
+
} from 'node:fs';
|
|
7
|
+
|
|
8
|
+
import { select } from "@inquirer/prompts";
|
|
9
|
+
|
|
10
|
+
import { Configuration } from "#lib/config";
|
|
11
|
+
import { NotFoundError } from "#lib/error";
|
|
12
|
+
import { Logger } from "#lib/logger";
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
command: 'use',
|
|
16
|
+
describe: 'Set the current environment to use',
|
|
17
|
+
builder: (yargs) => yargs
|
|
18
|
+
.usage('Usage: envedit use'),
|
|
19
|
+
handler: async (argv) => {
|
|
20
|
+
const logger = new Logger(argv.level);
|
|
21
|
+
const config = new Configuration();
|
|
22
|
+
|
|
23
|
+
const name = await select({
|
|
24
|
+
message: "Select the environment to use",
|
|
25
|
+
choices: Array.from(config.envs.keys()).map(env => ({
|
|
26
|
+
name: env + (config.envs.get(env)?.isActive ? " (active)" : ""),
|
|
27
|
+
value: env,
|
|
28
|
+
})),
|
|
29
|
+
default: config.active,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const selectedEnv = config.envs.get(name);
|
|
33
|
+
|
|
34
|
+
if (!selectedEnv) {
|
|
35
|
+
throw new NotFoundError(`Environment not found: ${name}`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
logger.debug(`Setting current environment to "${name}" with file: "${selectedEnv.file}"`);
|
|
39
|
+
|
|
40
|
+
if (!selectedEnv.isActive) {
|
|
41
|
+
logger.debug(`Updating active environment in configuration file to "${name}"`);
|
|
42
|
+
|
|
43
|
+
config.active = selectedEnv.name;
|
|
44
|
+
|
|
45
|
+
config.save();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
logger.debug(`Creating symlink to environment file: ${selectedEnv.file}`);
|
|
49
|
+
|
|
50
|
+
const envFilePath = selectedEnv.file;
|
|
51
|
+
|
|
52
|
+
if (exists('.env')) {
|
|
53
|
+
logger.debug(`Removing existing symlink or file: .env`);
|
|
54
|
+
|
|
55
|
+
unlink('.env');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
symlink(envFilePath, '.env', 'file');
|
|
59
|
+
}
|
|
60
|
+
} as CommandModule;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Commands from "./variableCmd";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
command: 'variable',
|
|
5
|
+
describe: 'Manage environment variables',
|
|
6
|
+
builder: (yargs) => yargs
|
|
7
|
+
.usage('Usage: envedit variable <command> [options]')
|
|
8
|
+
.command(Commands)
|
|
9
|
+
.demandCommand(),
|
|
10
|
+
} as CommandModule;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { confirm, input, password, select } from "@inquirer/prompts";
|
|
2
|
+
|
|
3
|
+
import { Configuration, EnvironmentFile, VariableType } from "#lib/config";
|
|
4
|
+
import { NotFoundError } from "#lib/error";
|
|
5
|
+
import { Logger } from "#lib/logger";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
command: 'add',
|
|
9
|
+
describe: 'Add a new environment variable',
|
|
10
|
+
builder: (yargs) => yargs,
|
|
11
|
+
handler: async (argv) => {
|
|
12
|
+
const config = new Configuration();
|
|
13
|
+
const logger = new Logger(argv.level);
|
|
14
|
+
|
|
15
|
+
const name = await input({
|
|
16
|
+
message: "Enter the variable name:",
|
|
17
|
+
validate: (input) => {
|
|
18
|
+
if (!input) {
|
|
19
|
+
return "Variable name cannot be empty";
|
|
20
|
+
}
|
|
21
|
+
if (config.vars.has(input)) {
|
|
22
|
+
return "Variable name already exists";
|
|
23
|
+
}
|
|
24
|
+
return true;
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const type = await select({
|
|
29
|
+
message: "Select the variable type:",
|
|
30
|
+
choices: [
|
|
31
|
+
{ name: "Public", value: VariableType.Public },
|
|
32
|
+
{ name: "Private", value: VariableType.Private },
|
|
33
|
+
],
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
logger.debug(`Adding new variable "${name}" with type "${type}"`);
|
|
37
|
+
|
|
38
|
+
config.vars.set(name, { name, type });
|
|
39
|
+
config.save();
|
|
40
|
+
|
|
41
|
+
const shouldGloballySet = await confirm({
|
|
42
|
+
message: "Do you want to set this variable with a global value for all environments?",
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const valuesToSet = Array.from(config.envs.values()).map(env => ({
|
|
46
|
+
envName: env.name,
|
|
47
|
+
value: '',
|
|
48
|
+
}));
|
|
49
|
+
|
|
50
|
+
if (shouldGloballySet) {
|
|
51
|
+
const request = {
|
|
52
|
+
message: `Enter the global value for ${name}:`,
|
|
53
|
+
mask: type === VariableType.Private ? "*" : undefined,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const globalValue = type === VariableType.Private
|
|
57
|
+
? await password(request)
|
|
58
|
+
: await input(request);
|
|
59
|
+
|
|
60
|
+
logger.debug(`Setting variable "${name}" with global value "${globalValue}" for all environments`);
|
|
61
|
+
|
|
62
|
+
valuesToSet.forEach((envValue) => { envValue.value = globalValue });
|
|
63
|
+
} else {
|
|
64
|
+
for (const envValue of valuesToSet) {
|
|
65
|
+
const request = {
|
|
66
|
+
message: `Enter the value for ${name} in environment ${envValue.envName}:`,
|
|
67
|
+
mask: type === VariableType.Private ? "*" : undefined,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
envValue.value = type === VariableType.Private
|
|
71
|
+
? await password(request)
|
|
72
|
+
: await input(request);
|
|
73
|
+
|
|
74
|
+
logger.debug(`Setting variable "${name}" with value "${envValue.value}" for environment "${envValue.envName}"`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
for (const envValue of valuesToSet) {
|
|
79
|
+
const env = config.envs.get(envValue.envName);
|
|
80
|
+
logger.debug(`Retrieving environment: ${envValue.envName}`);
|
|
81
|
+
|
|
82
|
+
if (!env) {
|
|
83
|
+
throw new NotFoundError(`Environment not found: ${envValue.envName}`);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const envFile = new EnvironmentFile(env.file);
|
|
87
|
+
|
|
88
|
+
envFile.vars.set(name, envValue.value);
|
|
89
|
+
envFile.save();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
} satisfies CommandModule;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { confirm, input, password, select, checkbox } from "@inquirer/prompts";
|
|
2
|
+
|
|
3
|
+
import { Configuration, EnvironmentFile, VariableType } from "#lib/config";
|
|
4
|
+
import { NotFoundError } from "#lib/error";
|
|
5
|
+
import { Logger } from "#lib/logger";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
command: 'edit',
|
|
9
|
+
describe: 'Edit an environment variable',
|
|
10
|
+
builder: (yargs) => yargs,
|
|
11
|
+
handler: async (argv) => {
|
|
12
|
+
const config = new Configuration();
|
|
13
|
+
const logger = new Logger(argv.level);
|
|
14
|
+
|
|
15
|
+
const name = await select({
|
|
16
|
+
message: "Select the variable to edit:",
|
|
17
|
+
choices: Array.from(config.vars.keys()),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const variableConfiguration = config.vars.get(name);
|
|
21
|
+
|
|
22
|
+
if (!variableConfiguration) {
|
|
23
|
+
throw new NotFoundError(`Variable not found: ${name}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const isEditingConfig = await select({
|
|
27
|
+
message: "Are you editing the variable configuration (name/type) or the variable value?",
|
|
28
|
+
choices: [
|
|
29
|
+
{ name: "Configuration", value: true },
|
|
30
|
+
{ name: "Value", value: false },
|
|
31
|
+
],
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
if (isEditingConfig) {
|
|
35
|
+
logger.debug(`Editing variable configuration for: ${name}`);
|
|
36
|
+
|
|
37
|
+
const itemsToEdit = await checkbox({
|
|
38
|
+
message: "Select the items to edit:",
|
|
39
|
+
choices: [
|
|
40
|
+
{ name: "Name", value: "name" },
|
|
41
|
+
{ name: "Type", value: "type" },
|
|
42
|
+
],
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const updatedVariable = { ...variableConfiguration };
|
|
46
|
+
|
|
47
|
+
if (itemsToEdit.includes("name")) {
|
|
48
|
+
updatedVariable.name = await input({
|
|
49
|
+
message: "Enter the new variable name:",
|
|
50
|
+
default: variableConfiguration.name,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
for (const [_, env] of config.envs) {
|
|
54
|
+
const envFile = new EnvironmentFile(env.file);
|
|
55
|
+
|
|
56
|
+
logger.debug(`Editing variable "${name}" in environment file: ${env.file}`);
|
|
57
|
+
|
|
58
|
+
if (envFile.vars.has(name)) {
|
|
59
|
+
const value = envFile.vars.get(name) || '';
|
|
60
|
+
|
|
61
|
+
envFile.vars.delete(name);
|
|
62
|
+
envFile.vars.set(updatedVariable.name, value);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
envFile.save();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
config.vars.delete(name);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (itemsToEdit.includes("type")) {
|
|
72
|
+
updatedVariable.type = await select({
|
|
73
|
+
message: "Select the new variable type:",
|
|
74
|
+
choices: [
|
|
75
|
+
{ name: "Public", value: VariableType.Public },
|
|
76
|
+
{ name: "Private", value: VariableType.Private },
|
|
77
|
+
],
|
|
78
|
+
default: variableConfiguration.type,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
logger.debug(`Editing variable type for "${name}" to "${updatedVariable.type}"`);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
config.vars.set(updatedVariable.name, updatedVariable);
|
|
85
|
+
config.save();
|
|
86
|
+
} else {
|
|
87
|
+
logger.debug(`Adding edited variable value for: ${name}`);
|
|
88
|
+
|
|
89
|
+
let valuesToSet = Array.from(config.envs.values()).map(env => ({
|
|
90
|
+
envName: env.name,
|
|
91
|
+
value: '',
|
|
92
|
+
}));
|
|
93
|
+
|
|
94
|
+
const shouldGloballySet = await confirm({
|
|
95
|
+
message: "Do you want to set this variable for all environments?",
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
if (shouldGloballySet) {
|
|
99
|
+
const request = {
|
|
100
|
+
message: `Enter the global value for ${variableConfiguration.name}:`,
|
|
101
|
+
mask: variableConfiguration.type === VariableType.Private ? "*" : undefined,
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const globalValue = variableConfiguration.type === VariableType.Private
|
|
105
|
+
? await password(request)
|
|
106
|
+
: await input(request);
|
|
107
|
+
|
|
108
|
+
logger.debug(`Setting variable "${variableConfiguration.name}" with global value "${globalValue}" for all environments`);
|
|
109
|
+
|
|
110
|
+
for (const [_, env] of config.envs) {
|
|
111
|
+
const envFile = new EnvironmentFile(env.file);
|
|
112
|
+
|
|
113
|
+
logger.debug(`Setting variable "${variableConfiguration.name}" with value "${globalValue}" in environment file: ${env.file}`);
|
|
114
|
+
|
|
115
|
+
envFile.vars.set(variableConfiguration.name, globalValue);
|
|
116
|
+
envFile.save();
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
const envsToEdit = await checkbox({
|
|
120
|
+
message: "Select the environments to edit the variable value for:",
|
|
121
|
+
choices: Array.from(config.envs.keys()),
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
logger.debug(`Selected environments for editing: ${envsToEdit.join(", ")}`);
|
|
125
|
+
|
|
126
|
+
for (const selectedEnv of envsToEdit) {
|
|
127
|
+
const env = config.envs.get(selectedEnv);
|
|
128
|
+
|
|
129
|
+
if (!env) {
|
|
130
|
+
throw new NotFoundError(`Environment not found: ${selectedEnv}`);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const envFile = new EnvironmentFile(env.file);
|
|
134
|
+
|
|
135
|
+
const request = {
|
|
136
|
+
message: `Enter the value for ${variableConfiguration.name} in environment ${selectedEnv}:`,
|
|
137
|
+
mask: variableConfiguration.type === VariableType.Private ? "*" : undefined,
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const newValue = variableConfiguration.type === VariableType.Private
|
|
141
|
+
? await password(request)
|
|
142
|
+
: await input(request);
|
|
143
|
+
|
|
144
|
+
envFile.vars.set(variableConfiguration.name, newValue);
|
|
145
|
+
envFile.save();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
} satisfies CommandModule;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Configuration, EnvironmentFile, VariableType } from "#lib/config";
|
|
2
|
+
import { NotFoundError } from "#lib/error";
|
|
3
|
+
import { Logger } from "#lib/logger";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
command: 'list',
|
|
7
|
+
describe: 'List all environment variables',
|
|
8
|
+
builder: (yargs) => yargs,
|
|
9
|
+
handler: async (argv) => {
|
|
10
|
+
const config = new Configuration();
|
|
11
|
+
const logger = new Logger(argv.level);
|
|
12
|
+
|
|
13
|
+
const activeEnv = config.active ? config.envs.get(config.active)! : undefined;
|
|
14
|
+
|
|
15
|
+
if (!activeEnv) {
|
|
16
|
+
throw new NotFoundError(`No active environment found. Please set an active environment using the "use" command.`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const envFile = new EnvironmentFile(activeEnv.file);
|
|
20
|
+
|
|
21
|
+
for (const [key, value] of envFile.vars) {
|
|
22
|
+
const variableConfiguration = config.vars.get(key);
|
|
23
|
+
if (variableConfiguration) {
|
|
24
|
+
const type = Configuration.getTypeDetails(variableConfiguration.type);
|
|
25
|
+
|
|
26
|
+
const maskedValue = type.value === VariableType.Private ? value.replaceAll(/./gm, '*') : value;
|
|
27
|
+
|
|
28
|
+
logger
|
|
29
|
+
.info(`Name: ${key}`)
|
|
30
|
+
.info(`Value: ${maskedValue}`)
|
|
31
|
+
.info(`Type: ${type.name} (${type.value})`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
} satisfies CommandModule;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { select } from "@inquirer/prompts";
|
|
2
|
+
|
|
3
|
+
import { Configuration, EnvironmentFile } from "#lib/config";
|
|
4
|
+
import { NotFoundError } from "#lib/error";
|
|
5
|
+
import { Logger } from "#lib/logger";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
command: 'remove',
|
|
9
|
+
describe: 'Remove an environment variable',
|
|
10
|
+
builder: (yargs) => yargs,
|
|
11
|
+
handler: async (argv) => {
|
|
12
|
+
const config = new Configuration();
|
|
13
|
+
const logger = new Logger(argv.level);
|
|
14
|
+
|
|
15
|
+
const name = await select({
|
|
16
|
+
message: "Select the variable to remove:",
|
|
17
|
+
choices: Array.from(config.vars.keys()),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
if (!config.vars.has(name)) {
|
|
21
|
+
throw new NotFoundError(`Variable not found: ${name}`);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
logger.debug(`Removing variable "${name}" from configuration and all environment files`);
|
|
25
|
+
|
|
26
|
+
config.vars.delete(name);
|
|
27
|
+
config.save();
|
|
28
|
+
|
|
29
|
+
for (const [_, env] of config.envs) {
|
|
30
|
+
const envFile = new EnvironmentFile(env.file);
|
|
31
|
+
|
|
32
|
+
if (envFile.vars.has(name)) {
|
|
33
|
+
logger.debug(`Removing variable "${name}" from environment file: ${env.file}`);
|
|
34
|
+
envFile.vars.delete(name);
|
|
35
|
+
envFile.save();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
} satisfies CommandModule;
|
package/cli/index.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import yargs from "yargs";
|
|
3
|
+
import { hideBin } from "yargs/helpers";
|
|
4
|
+
|
|
5
|
+
if (!process.isBun) {
|
|
6
|
+
const [red, reset] = process.stdout.isTTY && process.env.TERM !== "dumb" ? ["\x1b[31m", "\x1b[0m"] : ["", ""];
|
|
7
|
+
console.error(`${red}This script is intended to be run with Bun.${reset}`);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
await yargs(hideBin(process.argv))
|
|
12
|
+
.option("level", {
|
|
13
|
+
alias: "l",
|
|
14
|
+
type: "string",
|
|
15
|
+
description: "Set the log level",
|
|
16
|
+
default: process.env.LOG_LEVEL || "info",
|
|
17
|
+
})
|
|
18
|
+
.env('ENVEDIT')
|
|
19
|
+
.scriptName("envedit")
|
|
20
|
+
.usage("Usage: $0 <command>")
|
|
21
|
+
.command(await import("./cmd/index.ts").then((mod) => mod.default))
|
|
22
|
+
.showHelpOnFail(false)
|
|
23
|
+
.demandCommand()
|
|
24
|
+
.version()
|
|
25
|
+
.alias("h", "help")
|
|
26
|
+
.alias("v", "version")
|
|
27
|
+
.strict()
|
|
28
|
+
.parseAsync();
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
TN:
|
|
2
|
+
SF:lib/config.ts
|
|
3
|
+
FNF:12
|
|
4
|
+
FNH:12
|
|
5
|
+
DA:1,46
|
|
6
|
+
DA:2,50
|
|
7
|
+
DA:3,48
|
|
8
|
+
DA:4,52
|
|
9
|
+
DA:5,48
|
|
10
|
+
DA:8,62
|
|
11
|
+
DA:10,86
|
|
12
|
+
DA:12,133
|
|
13
|
+
DA:13,108
|
|
14
|
+
DA:14,114
|
|
15
|
+
DA:39,1
|
|
16
|
+
DA:41,27
|
|
17
|
+
DA:42,81
|
|
18
|
+
DA:43,10
|
|
19
|
+
DA:44,94
|
|
20
|
+
DA:45,22
|
|
21
|
+
DA:46,9
|
|
22
|
+
DA:48,154
|
|
23
|
+
DA:50,39
|
|
24
|
+
DA:52,103
|
|
25
|
+
DA:54,124
|
|
26
|
+
DA:55,118
|
|
27
|
+
DA:59,20
|
|
28
|
+
DA:60,12
|
|
29
|
+
DA:61,42
|
|
30
|
+
DA:62,52
|
|
31
|
+
DA:63,56
|
|
32
|
+
DA:64,102
|
|
33
|
+
DA:65,90
|
|
34
|
+
DA:66,26
|
|
35
|
+
DA:67,26
|
|
36
|
+
DA:68,12
|
|
37
|
+
DA:70,33
|
|
38
|
+
DA:73,22
|
|
39
|
+
DA:74,160
|
|
40
|
+
DA:76,99
|
|
41
|
+
DA:79,28
|
|
42
|
+
DA:80,70
|
|
43
|
+
DA:81,61
|
|
44
|
+
DA:82,9
|
|
45
|
+
DA:84,123
|
|
46
|
+
DA:85,136
|
|
47
|
+
DA:86,9
|
|
48
|
+
DA:88,32
|
|
49
|
+
DA:91,43
|
|
50
|
+
DA:92,123
|
|
51
|
+
DA:93,122
|
|
52
|
+
DA:94,9
|
|
53
|
+
DA:96,43
|
|
54
|
+
DA:99,38
|
|
55
|
+
DA:100,72
|
|
56
|
+
DA:102,127
|
|
57
|
+
DA:103,104
|
|
58
|
+
DA:104,72
|
|
59
|
+
DA:105,9
|
|
60
|
+
DA:107,28
|
|
61
|
+
DA:108,76
|
|
62
|
+
DA:109,30
|
|
63
|
+
DA:110,8
|
|
64
|
+
DA:112,2
|
|
65
|
+
DA:114,62
|
|
66
|
+
DA:115,33
|
|
67
|
+
DA:116,91
|
|
68
|
+
DA:117,42
|
|
69
|
+
DA:118,42
|
|
70
|
+
DA:119,36
|
|
71
|
+
DA:121,60
|
|
72
|
+
DA:122,32
|
|
73
|
+
DA:123,5
|
|
74
|
+
DA:124,9
|
|
75
|
+
DA:127,20
|
|
76
|
+
DA:128,50
|
|
77
|
+
DA:129,109
|
|
78
|
+
DA:130,86
|
|
79
|
+
DA:131,8
|
|
80
|
+
DA:133,2
|
|
81
|
+
LF:76
|
|
82
|
+
LH:76
|
|
83
|
+
end_of_record
|
|
84
|
+
TN:
|
|
85
|
+
SF:lib/error.ts
|
|
86
|
+
FNF:1
|
|
87
|
+
FNH:1
|
|
88
|
+
DA:1,42
|
|
89
|
+
DA:2,15
|
|
90
|
+
DA:3,19
|
|
91
|
+
DA:4,31
|
|
92
|
+
LF:4
|
|
93
|
+
LH:4
|
|
94
|
+
end_of_record
|
|
95
|
+
TN:
|
|
96
|
+
SF:lib/logger.ts
|
|
97
|
+
FNF:6
|
|
98
|
+
FNH:6
|
|
99
|
+
DA:1,47
|
|
100
|
+
DA:14,1
|
|
101
|
+
DA:16,177
|
|
102
|
+
DA:17,61
|
|
103
|
+
DA:20,43
|
|
104
|
+
DA:21,69
|
|
105
|
+
DA:22,32
|
|
106
|
+
DA:24,41
|
|
107
|
+
DA:25,68
|
|
108
|
+
DA:26,32
|
|
109
|
+
DA:28,41
|
|
110
|
+
DA:29,68
|
|
111
|
+
DA:30,32
|
|
112
|
+
DA:32,43
|
|
113
|
+
DA:33,69
|
|
114
|
+
DA:34,32
|
|
115
|
+
DA:36,43
|
|
116
|
+
DA:37,69
|
|
117
|
+
DA:38,30
|
|
118
|
+
DA:40,2
|
|
119
|
+
LF:20
|
|
120
|
+
LH:20
|
|
121
|
+
end_of_record
|
|
122
|
+
TN:
|
|
123
|
+
SF:test/util.ts
|
|
124
|
+
FNF:2
|
|
125
|
+
FNH:2
|
|
126
|
+
DA:1,21
|
|
127
|
+
DA:2,21
|
|
128
|
+
DA:3,23
|
|
129
|
+
DA:4,24
|
|
130
|
+
DA:7,30
|
|
131
|
+
DA:8,47
|
|
132
|
+
DA:9,22
|
|
133
|
+
DA:10,24
|
|
134
|
+
DA:11,17
|
|
135
|
+
DA:12,2
|
|
136
|
+
DA:13,4
|
|
137
|
+
LF:11
|
|
138
|
+
LH:11
|
|
139
|
+
end_of_record
|