create-berna-stencil 1.0.19 → 1.0.21
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/.eleventy.js +1 -2
- package/.gitignore +1 -1
- package/bin/create.js +12 -12
- package/package.json +5 -6
- package/src/api/.htaccess +7 -8
- package/src/api/config.example.php +27 -0
- package/src/api/config.php +27 -0
- package/src/api/core/composer.lock +492 -492
- package/src/api/core/init.php +15 -17
- package/src/api/core/modules/Response.php +12 -0
- package/src/api/core/vendor/composer/installed.php +2 -2
- package/src/api/endpoints/protected/example-protected-endpoint.php +28 -0
- package/src/api/endpoints/public/example-public-endpoint.php +28 -0
- package/src/api/index.php +2 -2
- package/.env.example +0 -8
- package/src/api/core/.htaccess +0 -2
- package/src/api/endpoints/protected/prova-chiusa.php +0 -16
- package/src/api/endpoints/public/prova-aperta.php +0 -16
package/.eleventy.js
CHANGED
|
@@ -4,7 +4,7 @@ const Image = require("@11ty/eleventy-img");
|
|
|
4
4
|
const fs = require("fs");
|
|
5
5
|
const path = require("path");
|
|
6
6
|
|
|
7
|
-
const OUTPUT_DIR = "out";
|
|
7
|
+
const OUTPUT_DIR = "c:/laragon/www/Berna-Stencil-out";
|
|
8
8
|
|
|
9
9
|
module.exports = function (eleventyConfig) {
|
|
10
10
|
|
|
@@ -24,7 +24,6 @@ module.exports = function (eleventyConfig) {
|
|
|
24
24
|
// =====================================================
|
|
25
25
|
// PASSTHROUGH — Static files
|
|
26
26
|
// =====================================================
|
|
27
|
-
eleventyConfig.addPassthroughCopy(".env");
|
|
28
27
|
eleventyConfig.addPassthroughCopy("src/.htaccess");
|
|
29
28
|
eleventyConfig.addPassthroughCopy("src/api");
|
|
30
29
|
eleventyConfig.addPassthroughCopy("src/assets");
|
package/.gitignore
CHANGED
package/bin/create.js
CHANGED
|
@@ -12,25 +12,25 @@ const COPY_TARGETS = [
|
|
|
12
12
|
'.eleventy.js',
|
|
13
13
|
'.eleventyignore',
|
|
14
14
|
'.gitignore',
|
|
15
|
-
".env.example",
|
|
16
15
|
'README.md',
|
|
17
16
|
];
|
|
18
17
|
|
|
19
18
|
const PROJECT_PACKAGE = {
|
|
20
19
|
name: path.basename(targetDir),
|
|
21
|
-
version: '1.0.
|
|
20
|
+
version: '1.0.21',
|
|
22
21
|
private: true,
|
|
23
22
|
scripts: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
"build:css": "sass src/scss:c:/laragon/www/Berna-Stencil-out/css --no-source-map --style=compressed --quiet",
|
|
24
|
+
"build:js": "esbuild \"src/js/pages/*.js\" --bundle --outdir=c:/laragon/www/Berna-Stencil-out/js/pages --minify",
|
|
25
|
+
"build:11ty": "eleventy",
|
|
26
|
+
"build": "npm run build:css && npm run build:js && npm run build:11ty",
|
|
27
|
+
"serve:css": "sass --watch src/scss:c:/laragon/www/Berna-Stencil-out/css --no-source-map --quiet",
|
|
28
|
+
"serve:js": "esbuild \"src/js/pages/*.js\" --bundle --outdir=c:/laragon/www/Berna-Stencil-out/js/pages --watch",
|
|
29
|
+
"serve:11ty": "eleventy --serve --quiet",
|
|
30
|
+
"clean": "node _tools/cleanOutput.js",
|
|
31
|
+
"serve": "npm run clean && concurrently \"npm run serve:11ty\" \"npm run serve:css\" \"npm run serve:js\"",
|
|
32
|
+
"assistant": "node _tools/assistant.js",
|
|
33
|
+
"postinstall": "cd src/api/core && composer install --quiet"
|
|
34
34
|
},
|
|
35
35
|
dependencies: {
|
|
36
36
|
'@11ty/eleventy': '^3.1.2',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-berna-stencil",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"description": "Eleventy boilerplate with per-page SCSS/JS pipeline, esbuild bundling, multi-framework CSS support and a built-in page management CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eleventy",
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
".eleventy.js",
|
|
37
37
|
".eleventyignore",
|
|
38
38
|
".gitignore",
|
|
39
|
-
".env.example",
|
|
40
39
|
"README.md"
|
|
41
40
|
],
|
|
42
41
|
"engines": {
|
|
@@ -58,12 +57,12 @@
|
|
|
58
57
|
"sass": "^1.77.0"
|
|
59
58
|
},
|
|
60
59
|
"scripts": {
|
|
61
|
-
"build:css": "sass src/scss:out/css --no-source-map --style=compressed --quiet",
|
|
62
|
-
"build:js": "esbuild \"src/js/pages/*.js\" --bundle --outdir=out/js/pages --minify",
|
|
60
|
+
"build:css": "sass src/scss:c:/laragon/www/Berna-Stencil-out/css --no-source-map --style=compressed --quiet",
|
|
61
|
+
"build:js": "esbuild \"src/js/pages/*.js\" --bundle --outdir=c:/laragon/www/Berna-Stencil-out/js/pages --minify",
|
|
63
62
|
"build:11ty": "eleventy",
|
|
64
63
|
"build": "npm run build:css && npm run build:js && npm run build:11ty",
|
|
65
|
-
"serve:css": "sass --watch src/scss:out/css --no-source-map --quiet",
|
|
66
|
-
"serve:js": "esbuild \"src/js/pages/*.js\" --bundle --outdir=out/js/pages --watch",
|
|
64
|
+
"serve:css": "sass --watch src/scss:c:/laragon/www/Berna-Stencil-out/css --no-source-map --quiet",
|
|
65
|
+
"serve:js": "esbuild \"src/js/pages/*.js\" --bundle --outdir=c:/laragon/www/Berna-Stencil-out/js/pages --watch",
|
|
67
66
|
"serve:11ty": "eleventy --serve --quiet",
|
|
68
67
|
"clean": "node _tools/cleanOutput.js",
|
|
69
68
|
"serve": "npm run clean && concurrently \"npm run serve:11ty\" \"npm run serve:css\" \"npm run serve:js\"",
|
package/src/api/.htaccess
CHANGED
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
RewriteEngine On
|
|
3
3
|
RewriteBase /api/
|
|
4
4
|
|
|
5
|
-
# 1.
|
|
6
|
-
|
|
7
|
-
Require all denied
|
|
8
|
-
</FilesMatch>
|
|
5
|
+
# 1. Permetti index.php
|
|
6
|
+
RewriteRule ^index\.php$ - [L]
|
|
9
7
|
|
|
10
|
-
# 2.
|
|
11
|
-
#
|
|
12
|
-
RewriteRule
|
|
8
|
+
# 2. Invece di dare Forbidden [F], manda tutto a index.php
|
|
9
|
+
# Questo copre config.php e tutte le sottocartelle
|
|
10
|
+
RewriteRule \.php$ index.php [L]
|
|
11
|
+
RewriteRule ^(core|endpoints|modules|vendor)($|/) index.php [L]
|
|
13
12
|
|
|
14
|
-
# 3. Regola
|
|
13
|
+
# 3. Regola per gli endpoint
|
|
15
14
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
16
15
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
17
16
|
RewriteRule ^(.*)$ index.php [QSA,L]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
declare(strict_types=1);
|
|
3
|
+
|
|
4
|
+
if (!defined('CORE_ACCESS')) {
|
|
5
|
+
$errorPage = $_SERVER['DOCUMENT_ROOT'] . '/404.html';
|
|
6
|
+
http_response_code(404);
|
|
7
|
+
if (file_exists($errorPage)) {
|
|
8
|
+
header('Content-Type: text/html; charset=UTF-8');
|
|
9
|
+
echo file_get_contents($errorPage);
|
|
10
|
+
} else {
|
|
11
|
+
echo "404 Not Found";
|
|
12
|
+
}
|
|
13
|
+
exit;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return [
|
|
17
|
+
// Configurazioni di base
|
|
18
|
+
'API_KEY' => 'TOKEN',
|
|
19
|
+
'CORS_ALLOWED_ORIGINS' => '*',
|
|
20
|
+
|
|
21
|
+
// Configurazioni per l'invio delle Email
|
|
22
|
+
'MAIL_HOST' => 'smtp.gmail.com',
|
|
23
|
+
'MAIL_PORT' => 587, // Per i numeri puoi omettere gli apici
|
|
24
|
+
'MAIL_USERNAME' => 'YOUR_EMAIL',
|
|
25
|
+
'MAIL_PASSWORD' => 'APP_PASSWORD',
|
|
26
|
+
'MAIL_TO_ADDRESS' => 'EMAIL_TO_ADDRESS',
|
|
27
|
+
];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
declare(strict_types=1);
|
|
3
|
+
|
|
4
|
+
if (!defined('CORE_ACCESS')) {
|
|
5
|
+
$errorPage = $_SERVER['DOCUMENT_ROOT'] . '/404.html';
|
|
6
|
+
http_response_code(404);
|
|
7
|
+
if (file_exists($errorPage)) {
|
|
8
|
+
header('Content-Type: text/html; charset=UTF-8');
|
|
9
|
+
echo file_get_contents($errorPage);
|
|
10
|
+
} else {
|
|
11
|
+
echo "404 Not Found";
|
|
12
|
+
}
|
|
13
|
+
exit;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return [
|
|
17
|
+
// Configurazioni di base
|
|
18
|
+
'API_KEY' => 'TOKEN',
|
|
19
|
+
'CORS_ALLOWED_ORIGINS' => '*',
|
|
20
|
+
|
|
21
|
+
// Configurazioni per l'invio delle Email
|
|
22
|
+
'MAIL_HOST' => 'smtp.gmail.com',
|
|
23
|
+
'MAIL_PORT' => 587, // Per i numeri puoi omettere gli apici
|
|
24
|
+
'MAIL_USERNAME' => 'YOUR_EMAIL',
|
|
25
|
+
'MAIL_PASSWORD' => 'APP_PASSWORD',
|
|
26
|
+
'MAIL_TO_ADDRESS' => 'EMAIL_TO_ADDRESS',
|
|
27
|
+
];
|