@env-spec/parser 0.1.1 → 0.3.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/dist/{chunk-W7OLHAQY.js → chunk-CHM43IJO.js} +79 -17
- package/dist/chunk-CHM43IJO.js.map +1 -0
- package/dist/{chunk-CO7WMO6T.mjs → chunk-RRVAHNIY.mjs} +79 -18
- package/dist/chunk-RRVAHNIY.mjs.map +1 -0
- package/dist/{classes-BGIxXMLF.d.mts → classes-CgmCxTZQ.d.mts} +39 -13
- package/dist/{classes-BGIxXMLF.d.ts → classes-CgmCxTZQ.d.ts} +39 -13
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +610 -471
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +465 -330
- package/dist/index.mjs.map +1 -1
- package/dist/simple-resolver.d.mts +1 -1
- package/dist/simple-resolver.d.ts +1 -1
- package/dist/simple-resolver.js +25 -14
- package/dist/simple-resolver.js.map +1 -1
- package/dist/simple-resolver.mjs +17 -6
- package/dist/simple-resolver.mjs.map +1 -1
- package/package.json +11 -8
- package/dist/chunk-CO7WMO6T.mjs.map +0 -1
- package/dist/chunk-W7OLHAQY.js.map +0 -1
|
@@ -28,29 +28,47 @@ declare class ParsedEnvSpecStaticValue {
|
|
|
28
28
|
get unescapedValue(): any;
|
|
29
29
|
toString(): string;
|
|
30
30
|
}
|
|
31
|
+
declare class ParsedEnvSpecRegexLiteral {
|
|
32
|
+
data: {
|
|
33
|
+
rawValue: string;
|
|
34
|
+
pattern: string;
|
|
35
|
+
flags: string;
|
|
36
|
+
_location?: any;
|
|
37
|
+
};
|
|
38
|
+
pattern: string;
|
|
39
|
+
flags: string;
|
|
40
|
+
constructor(data: {
|
|
41
|
+
rawValue: string;
|
|
42
|
+
pattern: string;
|
|
43
|
+
flags: string;
|
|
44
|
+
_location?: any;
|
|
45
|
+
});
|
|
46
|
+
get value(): RegExp;
|
|
47
|
+
toString(): string;
|
|
48
|
+
}
|
|
31
49
|
declare class ParsedEnvSpecKeyValuePair {
|
|
32
50
|
data: {
|
|
33
51
|
key: string;
|
|
34
|
-
val: ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall;
|
|
52
|
+
val: ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecRegexLiteral;
|
|
35
53
|
};
|
|
36
54
|
constructor(data: {
|
|
37
55
|
key: string;
|
|
38
|
-
val: ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall;
|
|
56
|
+
val: ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecRegexLiteral;
|
|
39
57
|
});
|
|
40
58
|
get key(): string;
|
|
41
|
-
get value(): ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall;
|
|
59
|
+
get value(): ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecRegexLiteral;
|
|
42
60
|
toString(): string;
|
|
43
61
|
}
|
|
44
62
|
declare class ParsedEnvSpecFunctionArgs {
|
|
45
63
|
data: {
|
|
46
|
-
values: Array<ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecKeyValuePair>;
|
|
64
|
+
values: Array<ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecKeyValuePair | ParsedEnvSpecRegexLiteral>;
|
|
47
65
|
_location?: any;
|
|
48
66
|
};
|
|
49
67
|
constructor(data: {
|
|
50
|
-
values: Array<ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecKeyValuePair>;
|
|
68
|
+
values: Array<ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecKeyValuePair | ParsedEnvSpecRegexLiteral>;
|
|
51
69
|
_location?: any;
|
|
52
70
|
});
|
|
53
|
-
get values(): (ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecKeyValuePair)[];
|
|
71
|
+
get values(): (ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecKeyValuePair | ParsedEnvSpecRegexLiteral)[];
|
|
54
72
|
get simplifiedValues(): Array<any> | Record<string, any>;
|
|
55
73
|
toString(): string;
|
|
56
74
|
}
|
|
@@ -72,14 +90,14 @@ declare class ParsedEnvSpecFunctionCall {
|
|
|
72
90
|
declare class ParsedEnvSpecDecorator {
|
|
73
91
|
data: {
|
|
74
92
|
name: string;
|
|
75
|
-
value: ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecFunctionArgs | undefined;
|
|
93
|
+
value: ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecFunctionArgs | ParsedEnvSpecRegexLiteral | undefined;
|
|
76
94
|
isBareFnCall?: boolean;
|
|
77
95
|
_location?: any;
|
|
78
96
|
};
|
|
79
|
-
value?: ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecFunctionArgs;
|
|
97
|
+
value?: ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecFunctionArgs | ParsedEnvSpecRegexLiteral;
|
|
80
98
|
constructor(data: {
|
|
81
99
|
name: string;
|
|
82
|
-
value: ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecFunctionArgs | undefined;
|
|
100
|
+
value: ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecFunctionArgs | ParsedEnvSpecRegexLiteral | undefined;
|
|
83
101
|
isBareFnCall?: boolean;
|
|
84
102
|
_location?: any;
|
|
85
103
|
});
|
|
@@ -149,15 +167,15 @@ declare class ParsedEnvSpecBlankLine {
|
|
|
149
167
|
declare class ParsedEnvSpecConfigItem {
|
|
150
168
|
data: {
|
|
151
169
|
key: string;
|
|
152
|
-
value: ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | undefined;
|
|
170
|
+
value: ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecRegexLiteral | undefined;
|
|
153
171
|
preComments: Array<ParsedEnvSpecDecoratorComment | ParsedEnvSpecComment>;
|
|
154
172
|
postComment: ParsedEnvSpecDecoratorComment | ParsedEnvSpecComment | undefined;
|
|
155
173
|
_location?: any;
|
|
156
174
|
};
|
|
157
|
-
value: ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | undefined;
|
|
175
|
+
value: ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecRegexLiteral | undefined;
|
|
158
176
|
constructor(data: {
|
|
159
177
|
key: string;
|
|
160
|
-
value: ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | undefined;
|
|
178
|
+
value: ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecRegexLiteral | undefined;
|
|
161
179
|
preComments: Array<ParsedEnvSpecDecoratorComment | ParsedEnvSpecComment>;
|
|
162
180
|
postComment: ParsedEnvSpecDecoratorComment | ParsedEnvSpecComment | undefined;
|
|
163
181
|
_location?: any;
|
|
@@ -173,9 +191,17 @@ declare class ParsedEnvSpecFile {
|
|
|
173
191
|
contents: Array<ParsedEnvSpecFileNode>;
|
|
174
192
|
constructor(_contents: Array<ParsedEnvSpecFileNode>);
|
|
175
193
|
get configItems(): ParsedEnvSpecConfigItem[];
|
|
194
|
+
/** all comment blocks before the first config item (the "header" area) */
|
|
195
|
+
get headerBlocks(): ParsedEnvSpecCommentBlock[];
|
|
196
|
+
/** primary header block - the last comment block before the first config item */
|
|
176
197
|
get header(): ParsedEnvSpecCommentBlock | undefined;
|
|
177
198
|
get decoratorsObject(): Record<string, ParsedEnvSpecDecorator>;
|
|
178
199
|
get decoratorsArray(): ParsedEnvSpecDecorator[];
|
|
200
|
+
/**
|
|
201
|
+
* Comment blocks that are NOT part of the header and NOT attached to a config item.
|
|
202
|
+
* Any decorators in these blocks are misplaced.
|
|
203
|
+
*/
|
|
204
|
+
get orphanCommentBlocks(): ParsedEnvSpecCommentBlock[];
|
|
179
205
|
toString(): string;
|
|
180
206
|
/**
|
|
181
207
|
* simple helper to convert an object in a basic case
|
|
@@ -184,4 +210,4 @@ declare class ParsedEnvSpecFile {
|
|
|
184
210
|
toSimpleObj(): Record<string, any>;
|
|
185
211
|
}
|
|
186
212
|
|
|
187
|
-
export { ParsedEnvSpecFile as P, ParsedEnvSpecDecorator as a, ParsedEnvSpecStaticValue as b, ParsedEnvSpecFunctionCall as c, ParsedEnvSpecFunctionArgs as d, ParsedEnvSpecKeyValuePair as e,
|
|
213
|
+
export { ParsedEnvSpecFile as P, ParsedEnvSpecDecorator as a, ParsedEnvSpecStaticValue as b, ParsedEnvSpecFunctionCall as c, ParsedEnvSpecFunctionArgs as d, ParsedEnvSpecKeyValuePair as e, ParsedEnvSpecRegexLiteral as f, ParsedEnvSpecBlankLine as g, ParsedEnvSpecComment as h, ParsedEnvSpecCommentBlock as i, ParsedEnvSpecConfigItem as j, ParsedEnvSpecDecoratorComment as k, ParsedEnvSpecDivider as l };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ParsedEnvSpecFile, a as ParsedEnvSpecDecorator, b as ParsedEnvSpecStaticValue, c as ParsedEnvSpecFunctionCall, d as ParsedEnvSpecFunctionArgs, e as ParsedEnvSpecKeyValuePair } from './classes-
|
|
2
|
-
export {
|
|
1
|
+
import { P as ParsedEnvSpecFile, a as ParsedEnvSpecDecorator, b as ParsedEnvSpecStaticValue, c as ParsedEnvSpecFunctionCall, d as ParsedEnvSpecFunctionArgs, e as ParsedEnvSpecKeyValuePair, f as ParsedEnvSpecRegexLiteral } from './classes-CgmCxTZQ.mjs';
|
|
2
|
+
export { g as ParsedEnvSpecBlankLine, h as ParsedEnvSpecComment, i as ParsedEnvSpecCommentBlock, j as ParsedEnvSpecConfigItem, k as ParsedEnvSpecDecoratorComment, l as ParsedEnvSpecDivider } from './classes-CgmCxTZQ.mjs';
|
|
3
3
|
|
|
4
4
|
declare function ensureHeader(file: ParsedEnvSpecFile, newHeaderContents?: string): void;
|
|
5
5
|
declare function createDummyDecoratorNode(decoratorName: string, valueStr: string, opts?: {
|
|
@@ -23,7 +23,7 @@ declare const envSpecUpdater: {
|
|
|
23
23
|
deleteItem: typeof deleteItem;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
type ParsedEnvSpecValueNode = ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecFunctionArgs | ParsedEnvSpecKeyValuePair;
|
|
26
|
+
type ParsedEnvSpecValueNode = ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecFunctionArgs | ParsedEnvSpecKeyValuePair | ParsedEnvSpecRegexLiteral;
|
|
27
27
|
/**
|
|
28
28
|
* takes in a value node and runs expansion (execs, refs) according to options
|
|
29
29
|
* returns a new value node with all expansions applied
|
|
@@ -32,4 +32,4 @@ declare function expand(val: ParsedEnvSpecValueNode, _opts?: {}): ParsedEnvSpecV
|
|
|
32
32
|
|
|
33
33
|
declare function parseEnvSpecDotEnvFile(source: string): ParsedEnvSpecFile;
|
|
34
34
|
|
|
35
|
-
export { ParsedEnvSpecDecorator, ParsedEnvSpecFile, ParsedEnvSpecFunctionArgs, ParsedEnvSpecFunctionCall, ParsedEnvSpecKeyValuePair, ParsedEnvSpecStaticValue, envSpecUpdater, expand, parseEnvSpecDotEnvFile };
|
|
35
|
+
export { ParsedEnvSpecDecorator, ParsedEnvSpecFile, ParsedEnvSpecFunctionArgs, ParsedEnvSpecFunctionCall, ParsedEnvSpecKeyValuePair, ParsedEnvSpecRegexLiteral, ParsedEnvSpecStaticValue, envSpecUpdater, expand, parseEnvSpecDotEnvFile };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ParsedEnvSpecFile, a as ParsedEnvSpecDecorator, b as ParsedEnvSpecStaticValue, c as ParsedEnvSpecFunctionCall, d as ParsedEnvSpecFunctionArgs, e as ParsedEnvSpecKeyValuePair } from './classes-
|
|
2
|
-
export {
|
|
1
|
+
import { P as ParsedEnvSpecFile, a as ParsedEnvSpecDecorator, b as ParsedEnvSpecStaticValue, c as ParsedEnvSpecFunctionCall, d as ParsedEnvSpecFunctionArgs, e as ParsedEnvSpecKeyValuePair, f as ParsedEnvSpecRegexLiteral } from './classes-CgmCxTZQ.js';
|
|
2
|
+
export { g as ParsedEnvSpecBlankLine, h as ParsedEnvSpecComment, i as ParsedEnvSpecCommentBlock, j as ParsedEnvSpecConfigItem, k as ParsedEnvSpecDecoratorComment, l as ParsedEnvSpecDivider } from './classes-CgmCxTZQ.js';
|
|
3
3
|
|
|
4
4
|
declare function ensureHeader(file: ParsedEnvSpecFile, newHeaderContents?: string): void;
|
|
5
5
|
declare function createDummyDecoratorNode(decoratorName: string, valueStr: string, opts?: {
|
|
@@ -23,7 +23,7 @@ declare const envSpecUpdater: {
|
|
|
23
23
|
deleteItem: typeof deleteItem;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
type ParsedEnvSpecValueNode = ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecFunctionArgs | ParsedEnvSpecKeyValuePair;
|
|
26
|
+
type ParsedEnvSpecValueNode = ParsedEnvSpecStaticValue | ParsedEnvSpecFunctionCall | ParsedEnvSpecFunctionArgs | ParsedEnvSpecKeyValuePair | ParsedEnvSpecRegexLiteral;
|
|
27
27
|
/**
|
|
28
28
|
* takes in a value node and runs expansion (execs, refs) according to options
|
|
29
29
|
* returns a new value node with all expansions applied
|
|
@@ -32,4 +32,4 @@ declare function expand(val: ParsedEnvSpecValueNode, _opts?: {}): ParsedEnvSpecV
|
|
|
32
32
|
|
|
33
33
|
declare function parseEnvSpecDotEnvFile(source: string): ParsedEnvSpecFile;
|
|
34
34
|
|
|
35
|
-
export { ParsedEnvSpecDecorator, ParsedEnvSpecFile, ParsedEnvSpecFunctionArgs, ParsedEnvSpecFunctionCall, ParsedEnvSpecKeyValuePair, ParsedEnvSpecStaticValue, envSpecUpdater, expand, parseEnvSpecDotEnvFile };
|
|
35
|
+
export { ParsedEnvSpecDecorator, ParsedEnvSpecFile, ParsedEnvSpecFunctionArgs, ParsedEnvSpecFunctionCall, ParsedEnvSpecKeyValuePair, ParsedEnvSpecRegexLiteral, ParsedEnvSpecStaticValue, envSpecUpdater, expand, parseEnvSpecDotEnvFile };
|