@pixelated-tech/components 3.7.7 → 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.
@@ -8,11 +8,24 @@ import { encrypt, decrypt, isEncrypted } from '../components/config/crypto';
8
8
  * npx tsx src/scripts/config-vault.js encrypt <filePath> <key>
9
9
  * npx tsx src/scripts/config-vault.js decrypt <filePath> <key>
10
10
  */
11
- const [, , command, targetPath, key] = process.argv;
11
+ const [, , command, targetPath, argKey] = process.argv;
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
+ }
12
24
  if (!command || !targetPath || !key) {
13
25
  console.log('Usage:');
14
- console.log(' encrypt <filePath> <key> - Encrypts the file in place');
15
- console.log(' decrypt <filePath> <key> - Decrypts the file in place');
26
+ console.log(' encrypt <filePath> [key] - Encrypts the file in place');
27
+ console.log(' decrypt <filePath> [key] - Decrypts the file in place');
28
+ console.log('\nNote: Key can be passed as argument or via PIXELATED_CONFIG_KEY env var.');
16
29
  process.exit(1);
17
30
  }
18
31
  const fullPath = path.isAbsolute(targetPath) ? targetPath : path.resolve(process.cwd(), targetPath);
@@ -10,12 +10,26 @@ import { encrypt, decrypt, isEncrypted } from '../components/config/crypto';
10
10
  * npx tsx src/scripts/config-vault.js decrypt <filePath> <key>
11
11
  */
12
12
 
13
- const [,, command, targetPath, key] = process.argv;
13
+ const [,, command, targetPath, argKey] = process.argv;
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
+ }
14
27
 
15
28
  if (!command || !targetPath || !key) {
16
29
  console.log('Usage:');
17
- console.log(' encrypt <filePath> <key> - Encrypts the file in place');
18
- console.log(' decrypt <filePath> <key> - Decrypts the file in place');
30
+ console.log(' encrypt <filePath> [key] - Encrypts the file in place');
31
+ console.log(' decrypt <filePath> [key] - Decrypts the file in place');
32
+ console.log('\nNote: Key can be passed as argument or via PIXELATED_CONFIG_KEY env var.');
19
33
  process.exit(1);
20
34
  }
21
35
 
@@ -36,8 +36,10 @@ 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 "================================================="
42
+ echo ""
41
43
 
42
44
  # Function to get current version
43
45
  get_current_version() {
@@ -102,7 +104,9 @@ if [ "$current_branch" != "dev" ]; then
102
104
  exit 1
103
105
  fi
104
106
 
107
+ echo ""
105
108
  echo "đŸ“Ļ Step 1: Updating dependencies..."
109
+ echo "================================================="
106
110
  UPDATES=$(npm outdated | awk 'NR>1 {print $1"@"$4}' || true)
107
111
  if [ -n "$UPDATES" ]; then
108
112
  echo "Updating the following packages: $UPDATES"
@@ -113,13 +117,19 @@ else
113
117
  fi
114
118
  npm audit fix --force 2>/dev/null || true
115
119
 
120
+ echo ""
116
121
  echo "🔍 Step 2: Running lint..."
122
+ echo "================================================="
117
123
  npm run lint
118
124
 
125
+ echo ""
119
126
  echo "🔨 Step 3: Building project..."
127
+ echo "================================================="
120
128
  npm run build
121
129
 
130
+ echo ""
122
131
  echo "đŸˇī¸ Step 4: Version bump..."
132
+ echo "================================================="
123
133
  prompt_version_type
124
134
  if [ "$version_type" != "none" ]; then
125
135
  if [ "$version_type" = "patch" ] || [ "$version_type" = "minor" ] || [ "$version_type" = "major" ]; then
@@ -130,8 +140,10 @@ if [ "$version_type" != "none" ]; then
130
140
  fi
131
141
  fi
132
142
 
143
+ echo ""
133
144
  echo "💾 Step 5: Committing changes..."
134
- if npm run | grep -q "config:encrypt"; then
145
+ echo "================================================="
146
+ if npm run | grep -q "config:encrypt" && [ -f "./src/app/config/pixelated.config.json" ]; then
135
147
  echo "🔒 Encrypting configuration..."
136
148
  npm run config:encrypt
137
149
  fi
@@ -143,7 +155,9 @@ else
143
155
  git commit -m "$commit_message"
144
156
  fi
145
157
 
158
+ echo ""
146
159
  echo "📤 Step 6: Pushing dev branch..."
160
+ echo "================================================="
147
161
  # Try to push, if it fails due to remote changes, fetch and rebase
148
162
  if ! git push $REMOTE_NAME dev; then
149
163
  echo "âš ī¸ Push failed, fetching remote changes and rebasing..."
@@ -160,7 +174,9 @@ if ! git push $REMOTE_NAME dev; then
160
174
  fi
161
175
  fi
162
176
 
177
+ echo ""
163
178
  echo "🔄 Step 7: Updating main branch..."
179
+ echo "================================================="
164
180
  # Force main to match dev exactly
165
181
  git push $REMOTE_NAME dev:main --force
166
182
 
@@ -173,7 +189,9 @@ if git show-ref --verify --quiet refs/heads/main; then
173
189
  git checkout dev
174
190
  fi
175
191
 
192
+ echo ""
176
193
  echo "đŸˇī¸ Step 8: Creating and pushing git tag..."
194
+ echo "================================================="
177
195
  new_version=$(get_current_version)
178
196
  if ! git tag -l | grep -q "v$new_version"; then
179
197
  git tag "v$new_version"
@@ -182,12 +200,14 @@ else
182
200
  echo "â„šī¸ Tag v$new_version already exists"
183
201
  fi
184
202
 
185
- if npm run | grep -q "config:decrypt"; then
203
+ if npm run | grep -q "config:decrypt" && [ -f "./src/app/config/pixelated.config.json" ]; then
186
204
  echo "🔓 Decrypting configuration for local development..."
187
205
  npm run config:decrypt
188
206
  fi
189
207
 
208
+ echo ""
190
209
  echo "🔐 Step 9: Publishing to npm..."
210
+ echo "================================================="
191
211
  should_publish=$(prompt_publish)
192
212
  if [ "$should_publish" = "yes" ]; then
193
213
  npm login
@@ -200,6 +220,8 @@ else
200
220
  fi
201
221
 
202
222
  echo ""
223
+ echo ""
224
+ echo "================================================="
203
225
  echo "✅ Release complete!"
204
226
  echo "đŸ“Ļ Version: $(get_current_version)"
205
227
  echo "📋 Branches updated: dev, main"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixelated-tech/components",
3
- "version": "3.7.7",
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",