@smi-digital/create-smi-app 2.1.0 → 2.2.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/dist/index.js
CHANGED
|
@@ -664,6 +664,12 @@ async function createScaffold(options, targetDir, templatesDir) {
|
|
|
664
664
|
}
|
|
665
665
|
await createApps(projectRoot, getAppTargets(options));
|
|
666
666
|
await createIntegrations(options, projectRoot, templatesDir);
|
|
667
|
+
if (options.tools.includes("basic")) {
|
|
668
|
+
await runStep(
|
|
669
|
+
"Installing root dependencies",
|
|
670
|
+
async () => runCommandQuiet("npm", ["install"], projectRoot)
|
|
671
|
+
);
|
|
672
|
+
}
|
|
667
673
|
console.log(accent2(`\u25C6 Project scaffolded at ${projectRoot}`));
|
|
668
674
|
}
|
|
669
675
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# 1. Run standard linters and formatters
|
|
4
4
|
npx lint-staged
|
|
5
5
|
|
|
6
|
-
# 2. Ansible-Vault
|
|
6
|
+
# 2. Ansible-Vault Auto-Encryptor
|
|
7
7
|
# Find any staged files that end in .env and start with "production"
|
|
8
8
|
STAGED_ENV_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '^production\..*\.env$')
|
|
9
9
|
|
|
@@ -11,18 +11,21 @@ for file in $STAGED_ENV_FILES; do
|
|
|
11
11
|
# Read the first line of the file
|
|
12
12
|
FIRST_LINE=$(head -n 1 "$file")
|
|
13
13
|
|
|
14
|
-
# Check if the first line indicates it is an Ansible Vault file
|
|
14
|
+
# Check if the first line indicates it is already an Ansible Vault file
|
|
15
15
|
if [[ "$FIRST_LINE" != "\$ANSIBLE_VAULT;"* ]]; then
|
|
16
|
-
echo ""
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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"
|
|
27
30
|
fi
|
|
28
31
|
done
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# Place this in your /backend folder
|
|
4
4
|
# ========================================================
|
|
5
5
|
|
|
6
|
-
FROM node:
|
|
6
|
+
FROM node:24-alpine
|
|
7
7
|
# Installing libvips-dev for sharp Compatibility
|
|
8
8
|
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev vips-dev > /dev/null 2>&1
|
|
9
9
|
ARG NODE_ENV=production
|
|
@@ -9,24 +9,23 @@ export default {
|
|
|
9
9
|
|
|
10
10
|
if (!publicRole) return;
|
|
11
11
|
|
|
12
|
-
// 2.
|
|
13
|
-
|
|
14
|
-
const customApis = Object.keys(strapi.api);
|
|
12
|
+
// 2. Find all Custom APIs (Strapi v5 compatible)
|
|
13
|
+
const allContentTypes = Object.keys(strapi.contentTypes);
|
|
15
14
|
const permissionsToOpen: string[] = [];
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
for (const uid of allContentTypes) {
|
|
17
|
+
if (uid.startsWith('api::')) {
|
|
18
|
+
permissionsToOpen.push(`${uid}.find`);
|
|
19
|
+
permissionsToOpen.push(`${uid}.findOne`);
|
|
20
|
+
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
//
|
|
23
|
+
// 3. Grant the permissions programmatically
|
|
24
24
|
for (const action of permissionsToOpen) {
|
|
25
25
|
const existingPermission = await strapi
|
|
26
26
|
.query('plugin::users-permissions.permission')
|
|
27
27
|
.findOne({ where: { role: publicRole.id, action } });
|
|
28
28
|
|
|
29
|
-
// If the permission doesn't exist yet, create it
|
|
30
29
|
if (!existingPermission) {
|
|
31
30
|
await strapi.query('plugin::users-permissions.permission').create({
|
|
32
31
|
data: {
|