@pixelated-tech/components 3.7.8 → 3.7.9

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.
@@ -9,7 +9,18 @@ import { encrypt, decrypt, isEncrypted } from '../components/config/crypto';
9
9
  * npx tsx src/scripts/config-vault.js decrypt <filePath> <key>
10
10
  */
11
11
  const [, , command, targetPath, argKey] = process.argv;
12
- const key = argKey || process.env.PIXELATED_CONFIG_KEY;
12
+ let key = argKey || process.env.PIXELATED_CONFIG_KEY;
13
+ // If key is still missing, try to load it from .env.local
14
+ if (!key) {
15
+ const envPath = path.join(process.cwd(), '.env.local');
16
+ if (fs.existsSync(envPath)) {
17
+ const envContent = fs.readFileSync(envPath, 'utf8');
18
+ const match = envContent.match(/^PIXELATED_CONFIG_KEY=(.*)$/m);
19
+ if (match && match[1]) {
20
+ key = match[1].trim();
21
+ }
22
+ }
23
+ }
13
24
  if (!command || !targetPath || !key) {
14
25
  console.log('Usage:');
15
26
  console.log(' encrypt <filePath> [key] - Encrypts the file in place');
@@ -11,7 +11,19 @@ import { encrypt, decrypt, isEncrypted } from '../components/config/crypto';
11
11
  */
12
12
 
13
13
  const [,, command, targetPath, argKey] = process.argv;
14
- const key = argKey || process.env.PIXELATED_CONFIG_KEY;
14
+ let key = argKey || process.env.PIXELATED_CONFIG_KEY;
15
+
16
+ // If key is still missing, try to load it from .env.local
17
+ if (!key) {
18
+ const envPath = path.join(process.cwd(), '.env.local');
19
+ if (fs.existsSync(envPath)) {
20
+ const envContent = fs.readFileSync(envPath, 'utf8');
21
+ const match = envContent.match(/^PIXELATED_CONFIG_KEY=(.*)$/m);
22
+ if (match && match[1]) {
23
+ key = match[1].trim();
24
+ }
25
+ }
26
+ }
15
27
 
16
28
  if (!command || !targetPath || !key) {
17
29
  console.log('Usage:');
@@ -36,6 +36,7 @@ prompt_remote_selection() {
36
36
  # Select remote
37
37
  REMOTE_NAME=$(prompt_remote_selection)
38
38
 
39
+ echo ""
39
40
  echo "🚀 Starting Release Process for $PROJECT_NAME"
40
41
  echo "================================================="
41
42
  echo ""
@@ -103,7 +104,9 @@ if [ "$current_branch" != "dev" ]; then
103
104
  exit 1
104
105
  fi
105
106
 
107
+ echo ""
106
108
  echo "đŸ“Ļ Step 1: Updating dependencies..."
109
+ echo "================================================="
107
110
  UPDATES=$(npm outdated | awk 'NR>1 {print $1"@"$4}' || true)
108
111
  if [ -n "$UPDATES" ]; then
109
112
  echo "Updating the following packages: $UPDATES"
@@ -117,19 +120,16 @@ npm audit fix --force 2>/dev/null || true
117
120
  echo ""
118
121
  echo "🔍 Step 2: Running lint..."
119
122
  echo "================================================="
120
- echo ""
121
123
  npm run lint
122
124
 
123
125
  echo ""
124
126
  echo "🔨 Step 3: Building project..."
125
127
  echo "================================================="
126
- echo ""
127
128
  npm run build
128
129
 
129
130
  echo ""
130
131
  echo "đŸˇī¸ Step 4: Version bump..."
131
132
  echo "================================================="
132
- echo ""
133
133
  prompt_version_type
134
134
  if [ "$version_type" != "none" ]; then
135
135
  if [ "$version_type" = "patch" ] || [ "$version_type" = "minor" ] || [ "$version_type" = "major" ]; then
@@ -143,8 +143,7 @@ fi
143
143
  echo ""
144
144
  echo "💾 Step 5: Committing changes..."
145
145
  echo "================================================="
146
- echo ""
147
- if npm run | grep -q "config:encrypt"; then
146
+ if npm run | grep -q "config:encrypt" && [ -f "./src/app/config/pixelated.config.json" ]; then
148
147
  echo "🔒 Encrypting configuration..."
149
148
  npm run config:encrypt
150
149
  fi
@@ -159,7 +158,6 @@ fi
159
158
  echo ""
160
159
  echo "📤 Step 6: Pushing dev branch..."
161
160
  echo "================================================="
162
- echo ""
163
161
  # Try to push, if it fails due to remote changes, fetch and rebase
164
162
  if ! git push $REMOTE_NAME dev; then
165
163
  echo "âš ī¸ Push failed, fetching remote changes and rebasing..."
@@ -179,7 +177,6 @@ fi
179
177
  echo ""
180
178
  echo "🔄 Step 7: Updating main branch..."
181
179
  echo "================================================="
182
- echo ""
183
180
  # Force main to match dev exactly
184
181
  git push $REMOTE_NAME dev:main --force
185
182
 
@@ -195,7 +192,6 @@ fi
195
192
  echo ""
196
193
  echo "đŸˇī¸ Step 8: Creating and pushing git tag..."
197
194
  echo "================================================="
198
- echo ""
199
195
  new_version=$(get_current_version)
200
196
  if ! git tag -l | grep -q "v$new_version"; then
201
197
  git tag "v$new_version"
@@ -204,7 +200,7 @@ else
204
200
  echo "â„šī¸ Tag v$new_version already exists"
205
201
  fi
206
202
 
207
- if npm run | grep -q "config:decrypt"; then
203
+ if npm run | grep -q "config:decrypt" && [ -f "./src/app/config/pixelated.config.json" ]; then
208
204
  echo "🔓 Decrypting configuration for local development..."
209
205
  npm run config:decrypt
210
206
  fi
@@ -212,7 +208,6 @@ fi
212
208
  echo ""
213
209
  echo "🔐 Step 9: Publishing to npm..."
214
210
  echo "================================================="
215
- echo ""
216
211
  should_publish=$(prompt_publish)
217
212
  if [ "$should_publish" = "yes" ]; then
218
213
  npm login
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixelated-tech/components",
3
- "version": "3.7.8",
3
+ "version": "3.7.9",
4
4
  "private": false,
5
5
  "author": {
6
6
  "name": "Pixelated Technologies",
@@ -86,7 +86,10 @@
86
86
  "test:run": "vitest run",
87
87
  "lint": "eslint --fix",
88
88
  "release": "./src/scripts/release.sh",
89
- "vault": "tsx src/scripts/config-vault.ts"
89
+ "vault": "tsx src/scripts/config-vault.ts",
90
+ "config:vault": "npm run vault --",
91
+ "config:encrypt": "npm run config:vault -- encrypt src/app/config/pixelated.config.json",
92
+ "config:decrypt": "npm run config:vault -- decrypt src/app/config/pixelated.config.json"
90
93
  },
91
94
  "scripts-old": {
92
95
  "buildBabel": "npm run buildClean && NODE_ENV=production babel src --out-dir dist --copy-files",