@pixelated-tech/components 3.7.9 â 3.7.11
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/components/config/config.client.js +1 -1
- package/dist/components/config/config.js +12 -14
- package/dist/components/sitebuilder/page/documentation/api-examples/save-route-example.js +2 -2
- package/dist/scripts/release.sh +2 -2
- package/dist/types/components/config/config.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@ export const usePixelatedConfig = () => {
|
|
|
33
33
|
}
|
|
34
34
|
// Also return null if config is empty (no environment config loaded)
|
|
35
35
|
if (Object.keys(ctx).length === 0) {
|
|
36
|
-
console.warn('Pixelated config is empty. Check that
|
|
36
|
+
console.warn('Pixelated config is empty. Check that src/app/config/pixelated.config.json is available.');
|
|
37
37
|
return null;
|
|
38
38
|
}
|
|
39
39
|
return ctx;
|
|
@@ -7,23 +7,21 @@ const debug = false;
|
|
|
7
7
|
* This function is intended for server-side use only.
|
|
8
8
|
*/
|
|
9
9
|
export function getFullPixelatedConfig() {
|
|
10
|
-
let raw =
|
|
11
|
-
let source =
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
console.error(`Failed to read config file at ${configPath}`, err);
|
|
22
|
-
}
|
|
10
|
+
let raw = '';
|
|
11
|
+
let source = 'none';
|
|
12
|
+
// Try reading from the conventional file location
|
|
13
|
+
const configPath = path.join(process.cwd(), 'src/app/config/pixelated.config.json');
|
|
14
|
+
if (fs.existsSync(configPath)) {
|
|
15
|
+
try {
|
|
16
|
+
raw = fs.readFileSync(configPath, 'utf8');
|
|
17
|
+
source = 'src/app/config/pixelated.config.json';
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
console.error(`Failed to read config file at ${configPath}`, err);
|
|
23
21
|
}
|
|
24
22
|
}
|
|
25
23
|
if (!raw) {
|
|
26
|
-
console.error('PIXELATED_CONFIG not found:
|
|
24
|
+
console.error('PIXELATED_CONFIG not found: src/app/config/pixelated.config.json is not available.');
|
|
27
25
|
return {};
|
|
28
26
|
}
|
|
29
27
|
// Handle decryption if the content is encrypted
|
|
@@ -18,9 +18,9 @@ export async function POST(request) {
|
|
|
18
18
|
// ===== OPTION 1: File-based storage =====
|
|
19
19
|
const result = await savePage(name, data);
|
|
20
20
|
// ===== OPTION 2: Contentful storage =====
|
|
21
|
-
// ===== OPTION 2: Contentful storage (recommended when using the unified PIXELATED config
|
|
21
|
+
// ===== OPTION 2: Contentful storage (recommended when using the unified PIXELATED config) =====
|
|
22
22
|
// The app reads the unified config on the server via `getFullPixelatedConfig()` which
|
|
23
|
-
// sources values from `
|
|
23
|
+
// sources values from `src/app/config/pixelated.config.json` and uses `PIXELATED_CONFIG_KEY` for decryption.
|
|
24
24
|
// Example (server-side):
|
|
25
25
|
// import { getFullPixelatedConfig } from '@pixelated-tech/components/server';
|
|
26
26
|
// const cfg = getFullPixelatedConfig();
|
package/dist/scripts/release.sh
CHANGED
|
@@ -143,7 +143,7 @@ fi
|
|
|
143
143
|
echo ""
|
|
144
144
|
echo "đž Step 5: Committing changes..."
|
|
145
145
|
echo "================================================="
|
|
146
|
-
if
|
|
146
|
+
if grep -q "\"config:encrypt\":" package.json && [ -f "./src/app/config/pixelated.config.json" ]; then
|
|
147
147
|
echo "đ Encrypting configuration..."
|
|
148
148
|
npm run config:encrypt
|
|
149
149
|
fi
|
|
@@ -200,7 +200,7 @@ else
|
|
|
200
200
|
echo "âšī¸ Tag v$new_version already exists"
|
|
201
201
|
fi
|
|
202
202
|
|
|
203
|
-
if
|
|
203
|
+
if grep -q "\"config:decrypt\":" package.json && [ -f "./src/app/config/pixelated.config.json" ]; then
|
|
204
204
|
echo "đ Decrypting configuration for local development..."
|
|
205
205
|
npm run config:decrypt
|
|
206
206
|
fi
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/components/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAMtD;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,eAAe,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/components/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAMtD;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,eAAe,CA4CxD;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,eAAe,CAwBpF"}
|