@contentstorage/core 0.6.4 → 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.
|
@@ -18,7 +18,7 @@ export declare function initContentStorage(config: Pick<AppConfig, 'contentKey'
|
|
|
18
18
|
* Autocompletion for pathString is enabled via module augmentation of CustomContentStructure.
|
|
19
19
|
* `setContentLanguage()` must be called successfully before using this.
|
|
20
20
|
*
|
|
21
|
-
* @param
|
|
21
|
+
* @param contentId A dot-notation path string (e.g., 'HomePage.Login'). Autocompletion is provided.
|
|
22
22
|
* @param variables Variables help to render dynamic content inside text strings
|
|
23
23
|
* If not provided, and path is not found/value not string, undefined is returned.
|
|
24
24
|
* @returns The text string from the JSON, or the fallbackValue, or undefined.
|
|
@@ -50,7 +50,7 @@ export function initContentStorage(config) {
|
|
|
50
50
|
* Autocompletion for pathString is enabled via module augmentation of CustomContentStructure.
|
|
51
51
|
* `setContentLanguage()` must be called successfully before using this.
|
|
52
52
|
*
|
|
53
|
-
* @param
|
|
53
|
+
* @param contentId A dot-notation path string (e.g., 'HomePage.Login'). Autocompletion is provided.
|
|
54
54
|
* @param variables Variables help to render dynamic content inside text strings
|
|
55
55
|
* If not provided, and path is not found/value not string, undefined is returned.
|
|
56
56
|
* @returns The text string from the JSON, or the fallbackValue, or undefined.
|
|
@@ -135,7 +135,7 @@ export function getImage(contentId) {
|
|
|
135
135
|
current.contentstorage_type === 'image' &&
|
|
136
136
|
typeof current.url === 'string') {
|
|
137
137
|
const currentData = current;
|
|
138
|
-
const key = `https://
|
|
138
|
+
const key = `https://cdn.contentstorage.app/${currentData.url}`;
|
|
139
139
|
if (window.parent && window.parent !== window) {
|
|
140
140
|
const existingEntry = window.memoryMap.get(key);
|
|
141
141
|
const idSet = existingEntry ? existingEntry.ids : new Set();
|
|
@@ -11,7 +11,6 @@ import { jsonToTS } from '../type-generation/index.js';
|
|
|
11
11
|
export async function generateTypes() {
|
|
12
12
|
console.log(chalk.blue('Starting type generation...'));
|
|
13
13
|
const args = process.argv.slice(2);
|
|
14
|
-
console.log('Received arguments:', args);
|
|
15
14
|
const cliConfig = {};
|
|
16
15
|
for (let i = 0; i < args.length; i++) {
|
|
17
16
|
const arg = args[i];
|
|
@@ -28,11 +27,11 @@ export async function generateTypes() {
|
|
|
28
27
|
else if (key === 'output') {
|
|
29
28
|
cliConfig.typesOutputFile = value;
|
|
30
29
|
}
|
|
30
|
+
// Skip the value in the next iteration
|
|
31
31
|
i++;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
console.log('Parsed CLI config:', cliConfig);
|
|
36
35
|
let fileConfig = {};
|
|
37
36
|
try {
|
|
38
37
|
fileConfig = await loadConfig();
|
|
@@ -41,7 +40,6 @@ export async function generateTypes() {
|
|
|
41
40
|
console.log(chalk.yellow('Could not load a configuration file. Proceeding with CLI arguments.'));
|
|
42
41
|
}
|
|
43
42
|
const config = { ...fileConfig, ...cliConfig };
|
|
44
|
-
console.log('Final merged config:', config);
|
|
45
43
|
if (!config.typesOutputFile) {
|
|
46
44
|
console.error(chalk.red.bold("Configuration error: 'typesOutputFile' is missing."));
|
|
47
45
|
process.exit(1);
|
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.
|
|
5
|
+
"version": "1.0.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"description": "Fetch content from contentstorage and generate TypeScript types",
|
|
8
8
|
"module": "dist/index.js",
|