@scaleway/configuration-loader 2.8.0 → 2.9.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/CHANGELOG.md +161 -1
- package/dist/config-loader.js +2 -2
- package/dist/yml-loader.js +8 -7
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,175 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 2.
|
|
3
|
+
## 2.9.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
+
- chore(engines): remove node engines (#3336)
|
|
8
|
+
|
|
9
|
+
- chore(release): publish
|
|
10
|
+
|
|
11
|
+
- chore: fix a few typos (#47)
|
|
12
|
+
|
|
13
|
+
- chore(deps): update pnpm to v10.33.0 (#2905)
|
|
14
|
+
|
|
15
|
+
- chore(minor-deps): update dependency @scaleway/eslint-config-react to ^3.10.0 (#238)
|
|
16
|
+
|
|
7
17
|
- fix(oxlint): enable 12 tiny unicorn rules as error (#3573)
|
|
8
18
|
|
|
19
|
+
- chore(minor-deps): update dependency @scaleway/eslint-config-react to ^3.14.1 (#378)
|
|
20
|
+
|
|
21
|
+
- chore(patch-deps): update dependency @types/node to v20.19.43 (#3094)
|
|
22
|
+
|
|
23
|
+
- chore(release): publish
|
|
24
|
+
|
|
25
|
+
- chore(packages): upgrade deps (#3157)
|
|
26
|
+
|
|
27
|
+
- feat: update to Node18, remove cross-fetch, and run tests on node+jsdom (#386)
|
|
28
|
+
|
|
29
|
+
- chore(release): publish
|
|
30
|
+
|
|
31
|
+
- chore(deps): update node.js to >=20.19.1 (#2094)
|
|
32
|
+
|
|
33
|
+
- chore(release): publish
|
|
34
|
+
|
|
35
|
+
- chore(release): publish
|
|
36
|
+
|
|
37
|
+
- chore(release): publish
|
|
38
|
+
|
|
39
|
+
- chore(deps): update dependency @types/node to v18.19.130 (#2610)
|
|
40
|
+
|
|
41
|
+
- chore(release): publish
|
|
42
|
+
|
|
43
|
+
- test(vitest): use vitest instead of jest (#1124)
|
|
44
|
+
|
|
45
|
+
- chore(release): publish
|
|
46
|
+
|
|
47
|
+
- chore(release): publish
|
|
48
|
+
|
|
49
|
+
- chore(release): publish
|
|
50
|
+
|
|
51
|
+
- chore(release): publish
|
|
52
|
+
|
|
53
|
+
- feat: publish packages as ESM only (#2624)
|
|
54
|
+
|
|
55
|
+
- chore(release): publish
|
|
56
|
+
|
|
57
|
+
- fix(build): export all types (#1261)
|
|
58
|
+
|
|
59
|
+
- chore(release): publish
|
|
60
|
+
|
|
61
|
+
- feat(configuration-loader): list all configurations at once (#336)
|
|
62
|
+
|
|
63
|
+
- feat(configuration-loader): add async config loading and file permission check (#2860)
|
|
64
|
+
|
|
65
|
+
- chore(release): publish
|
|
66
|
+
|
|
67
|
+
- chore(deps): update node.js to >=20.19.4 (#2280)
|
|
68
|
+
|
|
69
|
+
- chore(deps): update dependency prettier to v3.8.3 (#2907)
|
|
70
|
+
|
|
71
|
+
- chore(client): clean up client usage inside sdk (#1952)
|
|
72
|
+
|
|
73
|
+
- chore: remove linter warnings, and move jsdom to devDep (#1154)
|
|
74
|
+
|
|
75
|
+
- chore(release): publish
|
|
76
|
+
|
|
77
|
+
- chore(deps): update node.js to >=20.20.2 (#2960)
|
|
78
|
+
|
|
79
|
+
- chore(release): publish
|
|
80
|
+
|
|
81
|
+
- fix(release): run by commit and github release cli (#3185)
|
|
82
|
+
|
|
83
|
+
- build: adjust package version (#16)
|
|
84
|
+
|
|
85
|
+
- chore(deps): update node.js to >=20.19.6 (#2604)
|
|
86
|
+
|
|
87
|
+
- chore(release): publish
|
|
88
|
+
|
|
89
|
+
- chore(deps): update dependency vitest to v4 [security] (#2998)
|
|
90
|
+
|
|
91
|
+
- test: check homeDir with empty xdg_config_home (#269)
|
|
92
|
+
|
|
93
|
+
- chore(release): publish
|
|
94
|
+
|
|
95
|
+
- chore(deps): update dependency typescript to ^4.9.3 (#241)
|
|
96
|
+
|
|
97
|
+
- feat: prepare v1 release (#454)
|
|
98
|
+
|
|
99
|
+
- chore(release): publish
|
|
100
|
+
|
|
101
|
+
- chore(release): publish
|
|
102
|
+
|
|
103
|
+
- chore(lerna): remove lerna and use pnpm auto release repo pkg (#3174)
|
|
104
|
+
|
|
105
|
+
- chore(release): publish
|
|
106
|
+
|
|
107
|
+
- chore(release): publish
|
|
108
|
+
|
|
109
|
+
- chore(release): publish
|
|
110
|
+
|
|
111
|
+
- chore(release): publish
|
|
112
|
+
|
|
113
|
+
- chore(release): publish
|
|
114
|
+
|
|
115
|
+
- chore(release): publish
|
|
116
|
+
|
|
117
|
+
- chore(release): publish
|
|
118
|
+
|
|
119
|
+
- chore(release): publish
|
|
120
|
+
|
|
121
|
+
- chore(biome): use biome to format instead of prettier (#1947)
|
|
122
|
+
|
|
123
|
+
- chore(deps): update dependency husky to v9 (#1149)
|
|
124
|
+
|
|
125
|
+
- chore(deps): update dependency @typescript/native-preview to v7.0.0-dev.20260420.1 (#2906)
|
|
126
|
+
|
|
9
127
|
- fix(oxlint): enable 12 fully-fixed rules as error (#3574) (#3575)
|
|
10
128
|
|
|
129
|
+
- chore: migrate from ESLint to Biome for linting and formatting (#2551)
|
|
130
|
+
|
|
131
|
+
- fix(oxlint): enable unicorn/text-encoding-identifier-case as error (#3571)
|
|
132
|
+
|
|
133
|
+
- chore(build): from rollup to vite config (#1255)
|
|
134
|
+
|
|
135
|
+
- chore(release): publish
|
|
136
|
+
|
|
137
|
+
- fix: exclude generated config files from biome formatting (#2661)
|
|
138
|
+
|
|
139
|
+
- chore(typescript): upgrade version (#2916)
|
|
140
|
+
|
|
141
|
+
- chore(release): publish
|
|
142
|
+
|
|
143
|
+
- feat: migrate to GitHub (#1)
|
|
144
|
+
|
|
145
|
+
- chore(release): publish
|
|
146
|
+
|
|
147
|
+
- fix(oxlint): enable eslint/curly as error (#3511)
|
|
148
|
+
|
|
149
|
+
- chore(packages): add licence field, use exports field everywhere (#2147)
|
|
150
|
+
|
|
151
|
+
- feat(sdk): unify tools (#2903)
|
|
152
|
+
|
|
153
|
+
- fix(oxlint): enable unicorn/import-style as error (#3553)
|
|
154
|
+
|
|
155
|
+
- chore: commit generated files for release (#2876)
|
|
156
|
+
|
|
157
|
+
- chore(release): publish
|
|
158
|
+
|
|
159
|
+
- chore: add extension for nodenext (#2265)
|
|
160
|
+
|
|
161
|
+
- feat(sdk-react): add react sdk (#2794)
|
|
162
|
+
|
|
163
|
+
## 2.8.0
|
|
164
|
+
|
|
165
|
+
### Minor Changes
|
|
166
|
+
|
|
11
167
|
- fix(oxlint): enable unicorn/import-style as error (#3553)
|
|
12
168
|
|
|
169
|
+
- fix(oxlint): enable 12 fully-fixed rules as error (#3574) (#3575)
|
|
170
|
+
|
|
171
|
+
- fix(oxlint): enable 12 tiny unicorn rules as error (#3573)
|
|
172
|
+
|
|
13
173
|
- fix(oxlint): enable unicorn/text-encoding-identifier-case as error (#3571)
|
|
14
174
|
|
|
15
175
|
## 2.7.0
|
package/dist/config-loader.js
CHANGED
|
@@ -63,7 +63,7 @@ var loadProfileFromConfigurationFile = (params) => {
|
|
|
63
63
|
const configs = loadAllProfilesFromConfigurationFile(params);
|
|
64
64
|
const profileName = params?.profileName ?? "default";
|
|
65
65
|
const profileMap = configs[profileName];
|
|
66
|
-
if (typeof profileMap !== "object") throw new
|
|
66
|
+
if (typeof profileMap !== "object") throw new TypeError(`Could not find the desired profile '${profileName}' in the configuration file.`);
|
|
67
67
|
return profileMap;
|
|
68
68
|
};
|
|
69
69
|
/**
|
|
@@ -105,7 +105,7 @@ var loadProfileFromConfigurationFileAsync = async (params) => {
|
|
|
105
105
|
const configs = await loadAllProfilesFromConfigurationFileAsync(params);
|
|
106
106
|
const profileName = params?.profileName ?? "default";
|
|
107
107
|
const profileMap = configs[profileName];
|
|
108
|
-
if (typeof profileMap !== "object") throw new
|
|
108
|
+
if (typeof profileMap !== "object") throw new TypeError(`Could not find the desired profile '${profileName}' in the configuration file.`);
|
|
109
109
|
return profileMap;
|
|
110
110
|
};
|
|
111
111
|
//#endregion
|
package/dist/yml-loader.js
CHANGED
|
@@ -3,9 +3,9 @@ import { promisify } from "node:util";
|
|
|
3
3
|
//#region src/yml-loader.ts
|
|
4
4
|
var readFileAsync = promisify(readFile);
|
|
5
5
|
var statAsync = promisify(stat);
|
|
6
|
-
var STRIP_COMMENT_REGEX =
|
|
7
|
-
var DETECT_SECTION_REGEX =
|
|
8
|
-
var DETECT_ITEM_REGEX =
|
|
6
|
+
var STRIP_COMMENT_REGEX = new RegExp("(?<prefix>^|\\s)[;#]", "v");
|
|
7
|
+
var DETECT_SECTION_REGEX = new RegExp("^\\s*(?<section>[\\s\\S]+?):\\s*$", "v");
|
|
8
|
+
var DETECT_ITEM_REGEX = new RegExp("^\\s*(?<key>.+?)\\s*:\\s*(?<value>.+?)\\s*$", "v");
|
|
9
9
|
/**
|
|
10
10
|
* Converts YAML to configuration map.
|
|
11
11
|
*
|
|
@@ -19,18 +19,19 @@ var convertYamlToConfiguration = (input) => {
|
|
|
19
19
|
let currentSection = "default";
|
|
20
20
|
const map = {};
|
|
21
21
|
if (typeof input !== "string") return map;
|
|
22
|
-
input.split(
|
|
23
|
-
const line = rawLine.split(STRIP_COMMENT_REGEX)
|
|
22
|
+
input.split(new RegExp("\\r?\\n", "v")).forEach((rawLine) => {
|
|
23
|
+
const [line] = rawLine.split(STRIP_COMMENT_REGEX);
|
|
24
24
|
const newSection = DETECT_SECTION_REGEX.exec(line);
|
|
25
25
|
if (newSection) {
|
|
26
26
|
currentSection = void 0;
|
|
27
27
|
if (newSection[1] === "profiles") foundProfilesKey = true;
|
|
28
28
|
else if (foundProfilesKey) [, currentSection] = newSection;
|
|
29
|
-
} else if (currentSection) {
|
|
29
|
+
} else if (currentSection !== void 0) {
|
|
30
30
|
const item = DETECT_ITEM_REGEX.exec(line);
|
|
31
31
|
if (item) {
|
|
32
32
|
if (typeof map[currentSection] !== "object") map[currentSection] = {};
|
|
33
|
-
|
|
33
|
+
const [, key, value] = item;
|
|
34
|
+
map[currentSection][key] = value;
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/configuration-loader",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Load configuration via file or environment for NodeJS.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@repo/configs": "^0.1.1",
|
|
23
|
-
"@types/node": "26.
|
|
23
|
+
"@types/node": "26.6.2"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"typecheck": "tsc --noEmit",
|