@contentstorage/core 0.6.2 → 0.6.3
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/lib/configLoader.js
CHANGED
|
@@ -26,7 +26,7 @@ export async function loadConfig() {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
|
-
console.log(chalk.blue('No content.config.js found.
|
|
29
|
+
console.log(chalk.blue('No content.config.js found. Continuing.'));
|
|
30
30
|
}
|
|
31
31
|
const mergedConfig = {
|
|
32
32
|
...DEFAULT_CONFIG,
|
|
@@ -12,25 +12,25 @@ export async function generateTypes() {
|
|
|
12
12
|
console.log(chalk.blue('Starting type generation...'));
|
|
13
13
|
const args = process.argv.slice(2);
|
|
14
14
|
const cliConfig = {};
|
|
15
|
-
args.
|
|
15
|
+
for (let i = 0; i < args.length; i++) {
|
|
16
|
+
const arg = args[i];
|
|
16
17
|
if (arg.startsWith('--')) {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
.replace(/^"(.*)"$/, '$1')
|
|
21
|
-
.replace(/^'(.*)'$/, '$1');
|
|
18
|
+
const key = arg.substring(2);
|
|
19
|
+
const value = args[i + 1];
|
|
20
|
+
if (value && !value.startsWith('--')) {
|
|
22
21
|
if (key === 'lang') {
|
|
23
|
-
cliConfig.languageCodes = [
|
|
22
|
+
cliConfig.languageCodes = [value.toUpperCase()];
|
|
24
23
|
}
|
|
25
24
|
else if (key === 'content-key') {
|
|
26
|
-
cliConfig.contentKey =
|
|
25
|
+
cliConfig.contentKey = value;
|
|
27
26
|
}
|
|
28
27
|
else if (key === 'output') {
|
|
29
|
-
cliConfig.typesOutputFile =
|
|
28
|
+
cliConfig.typesOutputFile = value;
|
|
30
29
|
}
|
|
30
|
+
i++;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
}
|
|
33
|
+
}
|
|
34
34
|
let fileConfig = {};
|
|
35
35
|
try {
|
|
36
36
|
fileConfig = await loadConfig();
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@contentstorage/core",
|
|
3
3
|
"author": "Kaido Hussar <kaidohus@gmail.com>",
|
|
4
4
|
"homepage": "https://contentstorage.app",
|
|
5
|
-
"version": "0.6.
|
|
5
|
+
"version": "0.6.3",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"description": "Fetch content from contentstorage and generate TypeScript types",
|
|
8
8
|
"module": "dist/index.js",
|