@env-lane/core 0.1.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/LICENSE +21 -0
- package/README.md +17 -0
- package/dist/index.cjs +942 -0
- package/dist/index.d.cts +221 -0
- package/dist/index.d.ts +221 -0
- package/dist/index.js +884 -0
- package/package.json +62 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
interface CheckResult {
|
|
2
|
+
ok: boolean;
|
|
3
|
+
selectorKey: string;
|
|
4
|
+
violations: Array<{
|
|
5
|
+
file: string;
|
|
6
|
+
relativeFile: string;
|
|
7
|
+
line?: number;
|
|
8
|
+
}>;
|
|
9
|
+
missingRequired: Array<{
|
|
10
|
+
file: string;
|
|
11
|
+
relativeFile: string;
|
|
12
|
+
target: string;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
declare function checkDotenvSelector(options?: {
|
|
16
|
+
cwd?: string;
|
|
17
|
+
configFile?: string;
|
|
18
|
+
target?: string;
|
|
19
|
+
build?: string;
|
|
20
|
+
requireOverride?: boolean;
|
|
21
|
+
}): Promise<CheckResult>;
|
|
22
|
+
|
|
23
|
+
type EnvLaneOutputFormat = 'text' | 'json' | 'dotenv';
|
|
24
|
+
interface EnvSortTargetConfig {
|
|
25
|
+
baseDir?: string;
|
|
26
|
+
file?: string;
|
|
27
|
+
template?: string;
|
|
28
|
+
files?: Record<string, string>;
|
|
29
|
+
}
|
|
30
|
+
interface EnvLaneConfig {
|
|
31
|
+
selector?: {
|
|
32
|
+
/** Environment selector variable. Defaults to ENV_BUILD. */
|
|
33
|
+
envKey?: string;
|
|
34
|
+
/** Default build name when no CLI/API build is supplied. Defaults to local. */
|
|
35
|
+
defaultBuild?: string;
|
|
36
|
+
/** List of valid build names. If empty, all builds are allowed. */
|
|
37
|
+
builds?: string[];
|
|
38
|
+
/** Forbid selector envKey in dotenv files. Defaults to true. */
|
|
39
|
+
forbidInDotenv?: boolean;
|
|
40
|
+
};
|
|
41
|
+
workspace?: {
|
|
42
|
+
/** Optional package globs. Defaults to pnpm-workspace.yaml, then packages/* and apps/*. */
|
|
43
|
+
packageGlobs?: string[];
|
|
44
|
+
/** Additional aliases, keyed by alias, value package name or relative directory. */
|
|
45
|
+
aliases?: Record<string, string>;
|
|
46
|
+
/** Default target when multiple packages exist. Defaults to error. */
|
|
47
|
+
defaultTarget?: string;
|
|
48
|
+
/** Whether root is exposed as a target. Defaults to true. */
|
|
49
|
+
includeRoot?: boolean;
|
|
50
|
+
};
|
|
51
|
+
dotenv?: {
|
|
52
|
+
/** Ordered dotenv patterns relative to target dir. {build} is interpolated. */
|
|
53
|
+
order?: string[];
|
|
54
|
+
/** Build name that maps to localOverrideFile. Defaults to local. */
|
|
55
|
+
localBuildName?: string;
|
|
56
|
+
/** Override file for local build. Defaults to .env.local. */
|
|
57
|
+
localOverrideFile?: string;
|
|
58
|
+
/** Fail if the selected override file is missing. Defaults to false. */
|
|
59
|
+
requireOverride?: boolean;
|
|
60
|
+
/** Merge process.env after dotenv files. Defaults to true. */
|
|
61
|
+
includeProcessEnv?: boolean;
|
|
62
|
+
};
|
|
63
|
+
vault?: {
|
|
64
|
+
enabled?: boolean;
|
|
65
|
+
disableUnsafeWarning?: boolean;
|
|
66
|
+
configFile?: string;
|
|
67
|
+
};
|
|
68
|
+
output?: {
|
|
69
|
+
/** Default output format for CLI. */
|
|
70
|
+
format?: EnvLaneOutputFormat;
|
|
71
|
+
};
|
|
72
|
+
sort?: Record<string, EnvSortTargetConfig>;
|
|
73
|
+
}
|
|
74
|
+
interface ResolvedEnvLaneConfig {
|
|
75
|
+
rootDir: string;
|
|
76
|
+
selector: Required<NonNullable<EnvLaneConfig['selector']>>;
|
|
77
|
+
workspace: Required<Omit<NonNullable<EnvLaneConfig['workspace']>, 'aliases'>> & {
|
|
78
|
+
aliases: Record<string, string>;
|
|
79
|
+
};
|
|
80
|
+
dotenv: Required<NonNullable<EnvLaneConfig['dotenv']>>;
|
|
81
|
+
vault: Required<NonNullable<EnvLaneConfig['vault']>>;
|
|
82
|
+
output: Required<NonNullable<EnvLaneConfig['output']>>;
|
|
83
|
+
sort?: Record<string, EnvSortTargetConfig>;
|
|
84
|
+
}
|
|
85
|
+
interface WorkspacePackage {
|
|
86
|
+
name?: string;
|
|
87
|
+
dir: string;
|
|
88
|
+
relativeDir: string;
|
|
89
|
+
aliases: string[];
|
|
90
|
+
isRoot: boolean;
|
|
91
|
+
}
|
|
92
|
+
interface EnvFileRef {
|
|
93
|
+
kind: 'base' | 'override' | 'custom';
|
|
94
|
+
path: string;
|
|
95
|
+
relativePath: string;
|
|
96
|
+
exists: boolean;
|
|
97
|
+
required: boolean;
|
|
98
|
+
order: number;
|
|
99
|
+
}
|
|
100
|
+
interface EnvSource {
|
|
101
|
+
source: 'dotenv' | 'process' | 'selector';
|
|
102
|
+
file?: string;
|
|
103
|
+
relativeFile?: string;
|
|
104
|
+
line?: number;
|
|
105
|
+
shellOverride?: boolean;
|
|
106
|
+
}
|
|
107
|
+
interface ResolveEnvOptions {
|
|
108
|
+
cwd?: string;
|
|
109
|
+
configFile?: string;
|
|
110
|
+
target?: string;
|
|
111
|
+
build?: string;
|
|
112
|
+
includeProcessEnv?: boolean;
|
|
113
|
+
requireOverride?: boolean;
|
|
114
|
+
redact?: boolean;
|
|
115
|
+
showSecrets?: boolean;
|
|
116
|
+
}
|
|
117
|
+
interface ResolvedEnv {
|
|
118
|
+
rootDir: string;
|
|
119
|
+
target: WorkspacePackage;
|
|
120
|
+
build: string;
|
|
121
|
+
selectorKey: string;
|
|
122
|
+
files: EnvFileRef[];
|
|
123
|
+
values: Record<string, string>;
|
|
124
|
+
sources: Record<string, EnvSource>;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
declare function defineConfig(config: EnvLaneConfig): EnvLaneConfig;
|
|
128
|
+
declare function findWorkspaceRoot(cwd?: string): Promise<string>;
|
|
129
|
+
declare function readPnpmWorkspaceGlobs(rootDir: string): string[];
|
|
130
|
+
declare function loadEnvLaneConfig(options?: {
|
|
131
|
+
cwd?: string;
|
|
132
|
+
configFile?: string;
|
|
133
|
+
}): Promise<ResolvedEnvLaneConfig>;
|
|
134
|
+
|
|
135
|
+
declare function resolveBuildName(options: ResolveEnvOptions, envKey: string, defaultBuild: string): string;
|
|
136
|
+
declare function listEnvFiles(options?: ResolveEnvOptions): Promise<EnvFileRef[]>;
|
|
137
|
+
declare function listEnvFilesForTarget(config: ResolvedEnvLaneConfig, target: WorkspacePackage, options?: ResolveEnvOptions): EnvFileRef[];
|
|
138
|
+
declare function resolveInjectedEnv(options?: ResolveEnvOptions): Promise<ResolvedEnv>;
|
|
139
|
+
|
|
140
|
+
interface Logger {
|
|
141
|
+
log(message: any, ...args: any[]): void;
|
|
142
|
+
info(message: any, ...args: any[]): void;
|
|
143
|
+
warn(message: any, ...args: any[]): void;
|
|
144
|
+
error(message: any, ...args: any[]): void;
|
|
145
|
+
success(message: any, ...args: any[]): void;
|
|
146
|
+
debug(message: any, ...args: any[]): void;
|
|
147
|
+
/** For interactive prompts or raw stdout writes */
|
|
148
|
+
write(message: string): void;
|
|
149
|
+
}
|
|
150
|
+
declare function setLogger(logger: Logger): void;
|
|
151
|
+
declare function getLogger(): Logger;
|
|
152
|
+
|
|
153
|
+
declare function isSecretLikeKey(key: string): boolean;
|
|
154
|
+
declare function redactValue(key: string, value: string, showSecrets?: boolean): string;
|
|
155
|
+
declare function redactRecord(values: Record<string, string>, showSecrets?: boolean): Record<string, string>;
|
|
156
|
+
|
|
157
|
+
declare function runWithInjectedEnv(options: {
|
|
158
|
+
cwd?: string;
|
|
159
|
+
configFile?: string;
|
|
160
|
+
target?: string;
|
|
161
|
+
build?: string;
|
|
162
|
+
command: string[];
|
|
163
|
+
runCwd?: 'target' | 'root' | string;
|
|
164
|
+
quiet?: boolean;
|
|
165
|
+
}): Promise<number>;
|
|
166
|
+
|
|
167
|
+
type SortOperationAction = 'move' | 'insert-commented' | 'append-extra' | 'append-duplicate' | 'group-duplicate';
|
|
168
|
+
interface EnvSortPlan {
|
|
169
|
+
filePath: string;
|
|
170
|
+
templateFilePath: string;
|
|
171
|
+
changed: boolean;
|
|
172
|
+
currentContent: string;
|
|
173
|
+
nextContent: string;
|
|
174
|
+
operations: Array<{
|
|
175
|
+
action: SortOperationAction;
|
|
176
|
+
key: string;
|
|
177
|
+
}>;
|
|
178
|
+
summary: {
|
|
179
|
+
movedCount: number;
|
|
180
|
+
insertedCommentedCount: number;
|
|
181
|
+
appendedExtraCount: number;
|
|
182
|
+
appendedDuplicateCount: number;
|
|
183
|
+
groupedDuplicateCount: number;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
declare function buildEnvSortPlan(envFilePath: string, templateFilePath: string): EnvSortPlan;
|
|
187
|
+
declare function sortEnvFile(envFilePath: string, templateFilePath: string): Promise<{
|
|
188
|
+
movedCount: number;
|
|
189
|
+
insertedCommentedCount: number;
|
|
190
|
+
appendedExtraCount: number;
|
|
191
|
+
appendedDuplicateCount: number;
|
|
192
|
+
groupedDuplicateCount: number;
|
|
193
|
+
applied: boolean;
|
|
194
|
+
filePath: string;
|
|
195
|
+
templateFilePath: string;
|
|
196
|
+
}>;
|
|
197
|
+
declare function sortEnvFilesFromConfig(configPath: string, keyArg?: string, envSuffixArg?: string): Promise<{
|
|
198
|
+
applied: boolean;
|
|
199
|
+
count: number;
|
|
200
|
+
results: {
|
|
201
|
+
movedCount: number;
|
|
202
|
+
insertedCommentedCount: number;
|
|
203
|
+
appendedExtraCount: number;
|
|
204
|
+
appendedDuplicateCount: number;
|
|
205
|
+
groupedDuplicateCount: number;
|
|
206
|
+
applied: boolean;
|
|
207
|
+
filePath: string;
|
|
208
|
+
templateFilePath: string;
|
|
209
|
+
}[];
|
|
210
|
+
}>;
|
|
211
|
+
|
|
212
|
+
type WorkspaceResolveOptions = Pick<ResolveEnvOptions, 'cwd' | 'configFile'> & {
|
|
213
|
+
config?: ResolvedEnvLaneConfig;
|
|
214
|
+
packages?: WorkspacePackage[];
|
|
215
|
+
};
|
|
216
|
+
declare function listWorkspacePackages(options?: WorkspaceResolveOptions): Promise<WorkspacePackage[]>;
|
|
217
|
+
declare function listWorkspacePackagesForConfig(config: ResolvedEnvLaneConfig): Promise<WorkspacePackage[]>;
|
|
218
|
+
declare function resolveTargetPackageFromList(target: string | undefined, config: ResolvedEnvLaneConfig, packages: WorkspacePackage[]): WorkspacePackage;
|
|
219
|
+
declare function resolveTargetPackage(target: string | undefined, options?: WorkspaceResolveOptions): Promise<WorkspacePackage>;
|
|
220
|
+
|
|
221
|
+
export { type CheckResult, type EnvFileRef, type EnvLaneConfig, type EnvLaneOutputFormat, type EnvSortPlan, type EnvSortTargetConfig, type EnvSource, type Logger, type ResolveEnvOptions, type ResolvedEnv, type ResolvedEnvLaneConfig, type SortOperationAction, type WorkspacePackage, buildEnvSortPlan, checkDotenvSelector, defineConfig, findWorkspaceRoot, getLogger, isSecretLikeKey, listEnvFiles, listEnvFilesForTarget, listWorkspacePackages, listWorkspacePackagesForConfig, loadEnvLaneConfig, readPnpmWorkspaceGlobs, redactRecord, redactValue, resolveBuildName, resolveInjectedEnv, resolveTargetPackage, resolveTargetPackageFromList, runWithInjectedEnv, setLogger, sortEnvFile, sortEnvFilesFromConfig };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
interface CheckResult {
|
|
2
|
+
ok: boolean;
|
|
3
|
+
selectorKey: string;
|
|
4
|
+
violations: Array<{
|
|
5
|
+
file: string;
|
|
6
|
+
relativeFile: string;
|
|
7
|
+
line?: number;
|
|
8
|
+
}>;
|
|
9
|
+
missingRequired: Array<{
|
|
10
|
+
file: string;
|
|
11
|
+
relativeFile: string;
|
|
12
|
+
target: string;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
declare function checkDotenvSelector(options?: {
|
|
16
|
+
cwd?: string;
|
|
17
|
+
configFile?: string;
|
|
18
|
+
target?: string;
|
|
19
|
+
build?: string;
|
|
20
|
+
requireOverride?: boolean;
|
|
21
|
+
}): Promise<CheckResult>;
|
|
22
|
+
|
|
23
|
+
type EnvLaneOutputFormat = 'text' | 'json' | 'dotenv';
|
|
24
|
+
interface EnvSortTargetConfig {
|
|
25
|
+
baseDir?: string;
|
|
26
|
+
file?: string;
|
|
27
|
+
template?: string;
|
|
28
|
+
files?: Record<string, string>;
|
|
29
|
+
}
|
|
30
|
+
interface EnvLaneConfig {
|
|
31
|
+
selector?: {
|
|
32
|
+
/** Environment selector variable. Defaults to ENV_BUILD. */
|
|
33
|
+
envKey?: string;
|
|
34
|
+
/** Default build name when no CLI/API build is supplied. Defaults to local. */
|
|
35
|
+
defaultBuild?: string;
|
|
36
|
+
/** List of valid build names. If empty, all builds are allowed. */
|
|
37
|
+
builds?: string[];
|
|
38
|
+
/** Forbid selector envKey in dotenv files. Defaults to true. */
|
|
39
|
+
forbidInDotenv?: boolean;
|
|
40
|
+
};
|
|
41
|
+
workspace?: {
|
|
42
|
+
/** Optional package globs. Defaults to pnpm-workspace.yaml, then packages/* and apps/*. */
|
|
43
|
+
packageGlobs?: string[];
|
|
44
|
+
/** Additional aliases, keyed by alias, value package name or relative directory. */
|
|
45
|
+
aliases?: Record<string, string>;
|
|
46
|
+
/** Default target when multiple packages exist. Defaults to error. */
|
|
47
|
+
defaultTarget?: string;
|
|
48
|
+
/** Whether root is exposed as a target. Defaults to true. */
|
|
49
|
+
includeRoot?: boolean;
|
|
50
|
+
};
|
|
51
|
+
dotenv?: {
|
|
52
|
+
/** Ordered dotenv patterns relative to target dir. {build} is interpolated. */
|
|
53
|
+
order?: string[];
|
|
54
|
+
/** Build name that maps to localOverrideFile. Defaults to local. */
|
|
55
|
+
localBuildName?: string;
|
|
56
|
+
/** Override file for local build. Defaults to .env.local. */
|
|
57
|
+
localOverrideFile?: string;
|
|
58
|
+
/** Fail if the selected override file is missing. Defaults to false. */
|
|
59
|
+
requireOverride?: boolean;
|
|
60
|
+
/** Merge process.env after dotenv files. Defaults to true. */
|
|
61
|
+
includeProcessEnv?: boolean;
|
|
62
|
+
};
|
|
63
|
+
vault?: {
|
|
64
|
+
enabled?: boolean;
|
|
65
|
+
disableUnsafeWarning?: boolean;
|
|
66
|
+
configFile?: string;
|
|
67
|
+
};
|
|
68
|
+
output?: {
|
|
69
|
+
/** Default output format for CLI. */
|
|
70
|
+
format?: EnvLaneOutputFormat;
|
|
71
|
+
};
|
|
72
|
+
sort?: Record<string, EnvSortTargetConfig>;
|
|
73
|
+
}
|
|
74
|
+
interface ResolvedEnvLaneConfig {
|
|
75
|
+
rootDir: string;
|
|
76
|
+
selector: Required<NonNullable<EnvLaneConfig['selector']>>;
|
|
77
|
+
workspace: Required<Omit<NonNullable<EnvLaneConfig['workspace']>, 'aliases'>> & {
|
|
78
|
+
aliases: Record<string, string>;
|
|
79
|
+
};
|
|
80
|
+
dotenv: Required<NonNullable<EnvLaneConfig['dotenv']>>;
|
|
81
|
+
vault: Required<NonNullable<EnvLaneConfig['vault']>>;
|
|
82
|
+
output: Required<NonNullable<EnvLaneConfig['output']>>;
|
|
83
|
+
sort?: Record<string, EnvSortTargetConfig>;
|
|
84
|
+
}
|
|
85
|
+
interface WorkspacePackage {
|
|
86
|
+
name?: string;
|
|
87
|
+
dir: string;
|
|
88
|
+
relativeDir: string;
|
|
89
|
+
aliases: string[];
|
|
90
|
+
isRoot: boolean;
|
|
91
|
+
}
|
|
92
|
+
interface EnvFileRef {
|
|
93
|
+
kind: 'base' | 'override' | 'custom';
|
|
94
|
+
path: string;
|
|
95
|
+
relativePath: string;
|
|
96
|
+
exists: boolean;
|
|
97
|
+
required: boolean;
|
|
98
|
+
order: number;
|
|
99
|
+
}
|
|
100
|
+
interface EnvSource {
|
|
101
|
+
source: 'dotenv' | 'process' | 'selector';
|
|
102
|
+
file?: string;
|
|
103
|
+
relativeFile?: string;
|
|
104
|
+
line?: number;
|
|
105
|
+
shellOverride?: boolean;
|
|
106
|
+
}
|
|
107
|
+
interface ResolveEnvOptions {
|
|
108
|
+
cwd?: string;
|
|
109
|
+
configFile?: string;
|
|
110
|
+
target?: string;
|
|
111
|
+
build?: string;
|
|
112
|
+
includeProcessEnv?: boolean;
|
|
113
|
+
requireOverride?: boolean;
|
|
114
|
+
redact?: boolean;
|
|
115
|
+
showSecrets?: boolean;
|
|
116
|
+
}
|
|
117
|
+
interface ResolvedEnv {
|
|
118
|
+
rootDir: string;
|
|
119
|
+
target: WorkspacePackage;
|
|
120
|
+
build: string;
|
|
121
|
+
selectorKey: string;
|
|
122
|
+
files: EnvFileRef[];
|
|
123
|
+
values: Record<string, string>;
|
|
124
|
+
sources: Record<string, EnvSource>;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
declare function defineConfig(config: EnvLaneConfig): EnvLaneConfig;
|
|
128
|
+
declare function findWorkspaceRoot(cwd?: string): Promise<string>;
|
|
129
|
+
declare function readPnpmWorkspaceGlobs(rootDir: string): string[];
|
|
130
|
+
declare function loadEnvLaneConfig(options?: {
|
|
131
|
+
cwd?: string;
|
|
132
|
+
configFile?: string;
|
|
133
|
+
}): Promise<ResolvedEnvLaneConfig>;
|
|
134
|
+
|
|
135
|
+
declare function resolveBuildName(options: ResolveEnvOptions, envKey: string, defaultBuild: string): string;
|
|
136
|
+
declare function listEnvFiles(options?: ResolveEnvOptions): Promise<EnvFileRef[]>;
|
|
137
|
+
declare function listEnvFilesForTarget(config: ResolvedEnvLaneConfig, target: WorkspacePackage, options?: ResolveEnvOptions): EnvFileRef[];
|
|
138
|
+
declare function resolveInjectedEnv(options?: ResolveEnvOptions): Promise<ResolvedEnv>;
|
|
139
|
+
|
|
140
|
+
interface Logger {
|
|
141
|
+
log(message: any, ...args: any[]): void;
|
|
142
|
+
info(message: any, ...args: any[]): void;
|
|
143
|
+
warn(message: any, ...args: any[]): void;
|
|
144
|
+
error(message: any, ...args: any[]): void;
|
|
145
|
+
success(message: any, ...args: any[]): void;
|
|
146
|
+
debug(message: any, ...args: any[]): void;
|
|
147
|
+
/** For interactive prompts or raw stdout writes */
|
|
148
|
+
write(message: string): void;
|
|
149
|
+
}
|
|
150
|
+
declare function setLogger(logger: Logger): void;
|
|
151
|
+
declare function getLogger(): Logger;
|
|
152
|
+
|
|
153
|
+
declare function isSecretLikeKey(key: string): boolean;
|
|
154
|
+
declare function redactValue(key: string, value: string, showSecrets?: boolean): string;
|
|
155
|
+
declare function redactRecord(values: Record<string, string>, showSecrets?: boolean): Record<string, string>;
|
|
156
|
+
|
|
157
|
+
declare function runWithInjectedEnv(options: {
|
|
158
|
+
cwd?: string;
|
|
159
|
+
configFile?: string;
|
|
160
|
+
target?: string;
|
|
161
|
+
build?: string;
|
|
162
|
+
command: string[];
|
|
163
|
+
runCwd?: 'target' | 'root' | string;
|
|
164
|
+
quiet?: boolean;
|
|
165
|
+
}): Promise<number>;
|
|
166
|
+
|
|
167
|
+
type SortOperationAction = 'move' | 'insert-commented' | 'append-extra' | 'append-duplicate' | 'group-duplicate';
|
|
168
|
+
interface EnvSortPlan {
|
|
169
|
+
filePath: string;
|
|
170
|
+
templateFilePath: string;
|
|
171
|
+
changed: boolean;
|
|
172
|
+
currentContent: string;
|
|
173
|
+
nextContent: string;
|
|
174
|
+
operations: Array<{
|
|
175
|
+
action: SortOperationAction;
|
|
176
|
+
key: string;
|
|
177
|
+
}>;
|
|
178
|
+
summary: {
|
|
179
|
+
movedCount: number;
|
|
180
|
+
insertedCommentedCount: number;
|
|
181
|
+
appendedExtraCount: number;
|
|
182
|
+
appendedDuplicateCount: number;
|
|
183
|
+
groupedDuplicateCount: number;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
declare function buildEnvSortPlan(envFilePath: string, templateFilePath: string): EnvSortPlan;
|
|
187
|
+
declare function sortEnvFile(envFilePath: string, templateFilePath: string): Promise<{
|
|
188
|
+
movedCount: number;
|
|
189
|
+
insertedCommentedCount: number;
|
|
190
|
+
appendedExtraCount: number;
|
|
191
|
+
appendedDuplicateCount: number;
|
|
192
|
+
groupedDuplicateCount: number;
|
|
193
|
+
applied: boolean;
|
|
194
|
+
filePath: string;
|
|
195
|
+
templateFilePath: string;
|
|
196
|
+
}>;
|
|
197
|
+
declare function sortEnvFilesFromConfig(configPath: string, keyArg?: string, envSuffixArg?: string): Promise<{
|
|
198
|
+
applied: boolean;
|
|
199
|
+
count: number;
|
|
200
|
+
results: {
|
|
201
|
+
movedCount: number;
|
|
202
|
+
insertedCommentedCount: number;
|
|
203
|
+
appendedExtraCount: number;
|
|
204
|
+
appendedDuplicateCount: number;
|
|
205
|
+
groupedDuplicateCount: number;
|
|
206
|
+
applied: boolean;
|
|
207
|
+
filePath: string;
|
|
208
|
+
templateFilePath: string;
|
|
209
|
+
}[];
|
|
210
|
+
}>;
|
|
211
|
+
|
|
212
|
+
type WorkspaceResolveOptions = Pick<ResolveEnvOptions, 'cwd' | 'configFile'> & {
|
|
213
|
+
config?: ResolvedEnvLaneConfig;
|
|
214
|
+
packages?: WorkspacePackage[];
|
|
215
|
+
};
|
|
216
|
+
declare function listWorkspacePackages(options?: WorkspaceResolveOptions): Promise<WorkspacePackage[]>;
|
|
217
|
+
declare function listWorkspacePackagesForConfig(config: ResolvedEnvLaneConfig): Promise<WorkspacePackage[]>;
|
|
218
|
+
declare function resolveTargetPackageFromList(target: string | undefined, config: ResolvedEnvLaneConfig, packages: WorkspacePackage[]): WorkspacePackage;
|
|
219
|
+
declare function resolveTargetPackage(target: string | undefined, options?: WorkspaceResolveOptions): Promise<WorkspacePackage>;
|
|
220
|
+
|
|
221
|
+
export { type CheckResult, type EnvFileRef, type EnvLaneConfig, type EnvLaneOutputFormat, type EnvSortPlan, type EnvSortTargetConfig, type EnvSource, type Logger, type ResolveEnvOptions, type ResolvedEnv, type ResolvedEnvLaneConfig, type SortOperationAction, type WorkspacePackage, buildEnvSortPlan, checkDotenvSelector, defineConfig, findWorkspaceRoot, getLogger, isSecretLikeKey, listEnvFiles, listEnvFilesForTarget, listWorkspacePackages, listWorkspacePackagesForConfig, loadEnvLaneConfig, readPnpmWorkspaceGlobs, redactRecord, redactValue, resolveBuildName, resolveInjectedEnv, resolveTargetPackage, resolveTargetPackageFromList, runWithInjectedEnv, setLogger, sortEnvFile, sortEnvFilesFromConfig };
|