@smi-digital/create-smi-app 2.2.1 → 2.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smi-digital/create-smi-app",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -1,31 +1,2 @@
1
1
  #!/usr/bin/env sh
2
-
3
- # 1. Run standard linters and formatters
4
- npx lint-staged
5
-
6
- # 2. Ansible-Vault Auto-Encryptor
7
- # Find any staged files that end in .env and start with "production"
8
- STAGED_ENV_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '^production\..*\.env$')
9
-
10
- for file in $STAGED_ENV_FILES; do
11
- # Read the first line of the file
12
- FIRST_LINE=$(head -n 1 "$file")
13
-
14
- # Check if the first line indicates it is already an Ansible Vault file
15
- if [[ "$FIRST_LINE" != "\$ANSIBLE_VAULT;"* ]]; then
16
- echo "🔒 Auto-encrypting production secrets for: $file"
17
-
18
- # Check if .vault-password exists
19
- if [ ! -f ".vault-password" ]; then
20
- echo "❌ ERROR: .vault-password file not found. Cannot encrypt secrets."
21
- echo "Please create a .vault-password file containing your master password."
22
- exit 1
23
- fi
24
-
25
- # Encrypt the file using the local password
26
- ansible-vault encrypt "$file" --vault-password-file .vault-password
27
-
28
- # Re-stage the now-encrypted file
29
- git add "$file"
30
- fi
31
- done
2
+ npx lint-staged
@@ -9,6 +9,7 @@
9
9
  "prettier": "npx prettier --write .",
10
10
  "lint": "npx eslint .",
11
11
  "prepare": "husky",
12
+ "setup:vault": "git config filter.ansible-vault.clean \"ansible-vault encrypt --vault-password-file .vault-password --output=- -\" && git config filter.ansible-vault.smudge \"ansible-vault decrypt --vault-password-file .vault-password --output=- -\" && git config filter.ansible-vault.required true && echo '✅ Ansible-Vault Git Filters configured successfully!'",
12
13
  "knip": "knip",
13
14
  "depcruise": "depcruise . --exclude \"node_modules|dist|.husky|test\"",
14
15
  "depcheck": "npm run knip && npm run depcruise",
@@ -0,0 +1,2 @@
1
+ # Use Ansible-Vault Git filters for production environment files
2
+ production.*.env filter=ansible-vault diff=ansible-vault merge=ansible-vault
@@ -74,6 +74,10 @@
74
74
  "template": ".vault-password.template",
75
75
  "target": ".vault-password"
76
76
  },
77
+ {
78
+ "template": ".gitattributes.template",
79
+ "target": ".gitattributes"
80
+ },
77
81
  {
78
82
  "template": "production.frontend.env.template",
79
83
  "target": "production.frontend.env"