@smi-digital/create-smi-app 2.2.1 → 2.3.1
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 +1 -1
- package/templates/.husky/pre-commit +1 -30
- package/templates/base/package.json.template +1 -0
- package/templates/integrations/strapi-astro/.gitattributes.template +2 -0
- package/templates/integrations/strapi-astro/backend/src/index.ts.template +3 -1
- package/templates/integrations/strapi-astro/integration.config.json +4 -0
package/package.json
CHANGED
|
@@ -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",
|
|
@@ -21,6 +21,7 @@ export default {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// 3. Grant the permissions programmatically
|
|
24
|
+
/* eslint-disable no-await-in-loop */
|
|
24
25
|
for (const action of permissionsToOpen) {
|
|
25
26
|
const existingPermission = await strapi
|
|
26
27
|
.query('plugin::users-permissions.permission')
|
|
@@ -29,12 +30,13 @@ export default {
|
|
|
29
30
|
if (!existingPermission) {
|
|
30
31
|
await strapi.query('plugin::users-permissions.permission').create({
|
|
31
32
|
data: {
|
|
32
|
-
action
|
|
33
|
+
action,
|
|
33
34
|
role: publicRole.id,
|
|
34
35
|
},
|
|
35
36
|
});
|
|
36
37
|
console.log(`[BOOTSTRAP] Automatically granted public access to: ${action}`);
|
|
37
38
|
}
|
|
38
39
|
}
|
|
40
|
+
/* eslint-enable no-await-in-loop */
|
|
39
41
|
},
|
|
40
42
|
};
|
|
@@ -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"
|