@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.
@@ -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 PIXELATED_CONFIG_JSON or PIXELATED_CONFIG_B64 environment variables are set.');
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 = process.env.PIXELATED_CONFIG_JSON || (process.env.PIXELATED_CONFIG_B64 && Buffer.from(process.env.PIXELATED_CONFIG_B64, 'base64').toString('utf8'));
11
- let source = process.env.PIXELATED_CONFIG_JSON ? 'PIXELATED_CONFIG_JSON' : (process.env.PIXELATED_CONFIG_B64 ? 'PIXELATED_CONFIG_B64' : 'none');
12
- // If not in environment, try reading from the conventional file location
13
- if (!raw) {
14
- const configPath = path.join(process.cwd(), 'src/app/config/pixelated.config.json');
15
- if (fs.existsSync(configPath)) {
16
- try {
17
- raw = fs.readFileSync(configPath, 'utf8');
18
- source = 'src/app/config/pixelated.config.json';
19
- }
20
- catch (err) {
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: neither environment variables nor src/app/config/pixelated.config.json are available.');
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 blob) =====
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 `PIXELATED_CONFIG_JSON` or `PIXELATED_CONFIG_B64`.
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();
@@ -143,7 +143,7 @@ fi
143
143
  echo ""
144
144
  echo "💾 Step 5: Committing changes..."
145
145
  echo "================================================="
146
- if npm run | grep -q "config:encrypt" && [ -f "./src/app/config/pixelated.config.json" ]; then
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 npm run | grep -q "config:decrypt" && [ -f "./src/app/config/pixelated.config.json" ]; then
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,CA8CxD;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,eAAe,CAwBpF"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixelated-tech/components",
3
- "version": "3.7.9",
3
+ "version": "3.7.11",
4
4
  "private": false,
5
5
  "author": {
6
6
  "name": "Pixelated Technologies",