create-berna-stencil 1.0.24 → 1.0.26
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 -0
- package/.gitignore +2 -2
- package/_tools/assistant.js +6 -6
- package/_tools/modules/updateOutputPath.js +1 -4
- package/_tools/modules/updatePage.js +33 -72
- package/_tools/res/templates/template.js +23 -0
- package/_tools/res/templates/template.njk +8 -0
- package/_tools/res/templates/template.scss +17 -0
- package/bin/create.js +1 -1
- package/package.json +1 -1
- package/src/api/.htaccess +6 -11
- package/src/api/config.example.php +5 -20
- package/src/api/config.php +5 -20
- package/src/api/core/composer.lock +492 -492
- package/src/api/{index.php → core/index.php} +53 -24
- package/src/api/core/init.php +0 -13
- package/src/api/core/vendor/composer/installed.php +2 -2
- package/src/api/database/Database.php +24 -0
- package/src/api/database/migrations/create_example_db.sql +1 -0
- package/src/api/database/migrations/create_users_table.sql +9 -0
- package/src/api/database/models/User.php +61 -0
- package/src/api/database/seeds/users.php +0 -0
- package/src/api/database/services/UserService.php +0 -0
- package/src/api/endpoints/protected/auth-system.php +63 -0
- package/src/api/endpoints/protected/example-protected.php +17 -0
- package/src/api/endpoints/public/auth/login.php +34 -0
- package/src/api/endpoints/public/auth/register.php +39 -0
- package/src/api/endpoints/public/example-public.php +17 -0
- package/src/api/web.config +6 -24
- package/src/components/exampleComponent.njk +5 -2
- package/src/components/layouts/base.njk +26 -1
- package/src/data/site.json +53 -53
- package/src/js/modules/langSwitcher.js +1 -1
- package/src/web.config +30 -33
- package/_tools/res/templates.json +0 -56
- package/src/api/endpoints/protected/example-protected-endpoint.php +0 -28
- package/src/api/endpoints/public/example-public-endpoint.php +0 -28
|
@@ -20,7 +20,7 @@ export async function initLangSwitcher() {
|
|
|
20
20
|
|
|
21
21
|
applyLanguage(initialLang, data);
|
|
22
22
|
|
|
23
|
-
document.querySelectorAll("input[name='lang-
|
|
23
|
+
document.querySelectorAll("input[name='lang-button']").forEach((radio) => {
|
|
24
24
|
if (radio.value === initialLang) radio.checked = true;
|
|
25
25
|
|
|
26
26
|
radio.addEventListener("change", () => {
|
package/src/web.config
CHANGED
|
@@ -1,39 +1,36 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<configuration>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
<system.webServer>
|
|
4
|
+
|
|
5
|
+
<defaultDocument>
|
|
6
|
+
<files>
|
|
7
|
+
<clear />
|
|
8
|
+
<add value="index.html" />
|
|
9
|
+
</files>
|
|
10
|
+
</defaultDocument>
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<!-- 1. Se la richiesta è per la cartella API, ferma l'elaborazione (action type="None") -->
|
|
16
|
-
<rule name="Ignore API Directory" stopProcessing="true">
|
|
17
|
-
<match url="^api/.*" ignoreCase="true" />
|
|
18
|
-
<action type="None" />
|
|
19
|
-
</rule>
|
|
12
|
+
<httpErrors errorMode="Custom" existingResponse="Auto">
|
|
13
|
+
<remove statusCode="404" />
|
|
14
|
+
<error statusCode="404" path="/404.html" responseMode="ExecuteURL" />
|
|
15
|
+
</httpErrors>
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<action type="None" />
|
|
30
|
-
</rule>
|
|
17
|
+
<rewrite>
|
|
18
|
+
<rules>
|
|
19
|
+
<rule name="Ignore API Directory" stopProcessing="true">
|
|
20
|
+
<match url="^api(/.*)?$" ignoreCase="true" />
|
|
21
|
+
<action type="None" />
|
|
22
|
+
</rule>
|
|
23
|
+
</rules>
|
|
24
|
+
</rewrite>
|
|
31
25
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
<staticContent>
|
|
27
|
+
<remove fileExtension=".webp" />
|
|
28
|
+
<mimeMap fileExtension=".webp" mimeType="image/webp" />
|
|
29
|
+
</staticContent>
|
|
30
|
+
|
|
31
|
+
</system.webServer>
|
|
32
|
+
|
|
33
|
+
<system.web>
|
|
34
|
+
<compilation tempDirectory="D:\AspNetTemp\site\webfixer.it" />
|
|
35
|
+
</system.web>
|
|
39
36
|
</configuration>
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
".scss": [
|
|
3
|
-
"//==========================",
|
|
4
|
-
"// CSS MODULES IMPORTS",
|
|
5
|
-
"//==========================",
|
|
6
|
-
"",
|
|
7
|
-
"@use \"../modules/root\" as root;",
|
|
8
|
-
"",
|
|
9
|
-
"@import \"../modules/global\";",
|
|
10
|
-
"// Import any other module you need by import down here",
|
|
11
|
-
"@import \"../modules/notification\";",
|
|
12
|
-
"",
|
|
13
|
-
"//==========================",
|
|
14
|
-
"// PAGE CUSTOM CSS RULES FOR PAGE: {{pageName}}",
|
|
15
|
-
"//==========================",
|
|
16
|
-
"",
|
|
17
|
-
"// body {",
|
|
18
|
-
"// background-color: root.$primary;",
|
|
19
|
-
"// }"
|
|
20
|
-
],
|
|
21
|
-
".njk": [
|
|
22
|
-
"---",
|
|
23
|
-
"title: {{pageName}}",
|
|
24
|
-
"permalink: /{{ title | slug }}/",
|
|
25
|
-
"layout: includes.njk",
|
|
26
|
-
"---",
|
|
27
|
-
"",
|
|
28
|
-
"<!-- Add content via components in src/components/, not directly here.",
|
|
29
|
-
" Register them in src/layouts/includes.njk. -->"
|
|
30
|
-
],
|
|
31
|
-
".js": [
|
|
32
|
-
"//==========================",
|
|
33
|
-
"// JAVASCRIPT MODULES IMPORTS",
|
|
34
|
-
"//==========================",
|
|
35
|
-
"",
|
|
36
|
-
"// Call inside DOMContentLoaded",
|
|
37
|
-
"import { initLangSwitcher } from '../modules/langSwitcher.js';",
|
|
38
|
-
"",
|
|
39
|
-
"// Call anywhere",
|
|
40
|
-
"import { showNotification } from '../modules/notification.js';",
|
|
41
|
-
"",
|
|
42
|
-
"// Uncomment to enable optional modules (call inside DOMContentLoaded)",
|
|
43
|
-
"// import { initTextAreaAutoExpand } from '../modules/forms/textAreaAutoExpand.js';",
|
|
44
|
-
"// import { initNormalizePhoneNumber } from '../modules/forms/normalizePhoneNumber.js';",
|
|
45
|
-
"",
|
|
46
|
-
"//==========================",
|
|
47
|
-
"// \"{{pageName}}\" PAGE CUSTOM JAVASCRIPT",
|
|
48
|
-
"//==========================",
|
|
49
|
-
"",
|
|
50
|
-
"document.addEventListener(\"DOMContentLoaded\", () => {",
|
|
51
|
-
" initLangSwitcher();",
|
|
52
|
-
"});",
|
|
53
|
-
"",
|
|
54
|
-
"showNotification(\"{{pageName}} notification\", \"success\", 3000);"
|
|
55
|
-
]
|
|
56
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
|
|
3
|
-
declare(strict_types=1);
|
|
4
|
-
|
|
5
|
-
if (!defined('CORE_ACCESS')) {
|
|
6
|
-
$errorPage = $_SERVER['DOCUMENT_ROOT'] . '/404.html';
|
|
7
|
-
http_response_code(404);
|
|
8
|
-
if (file_exists($errorPage)) {
|
|
9
|
-
header('Content-Type: text/html; charset=UTF-8');
|
|
10
|
-
echo file_get_contents($errorPage);
|
|
11
|
-
} else {
|
|
12
|
-
echo "404 Not Found";
|
|
13
|
-
}
|
|
14
|
-
exit;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
require_once __DIR__ . '/../../core/modules/Response.php';
|
|
18
|
-
|
|
19
|
-
if ($method !== 'GET') {
|
|
20
|
-
Response::error('Method not allowed', 405);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
Response::success([
|
|
24
|
-
'message' => 'Protected endpoint is working',
|
|
25
|
-
'endpoint' => 'example-protected-endpoint',
|
|
26
|
-
'visibility' => 'protected',
|
|
27
|
-
'params' => $requestParams,
|
|
28
|
-
]);
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
|
|
3
|
-
declare(strict_types=1);
|
|
4
|
-
|
|
5
|
-
if (!defined('CORE_ACCESS')) {
|
|
6
|
-
$errorPage = $_SERVER['DOCUMENT_ROOT'] . '/404.html';
|
|
7
|
-
http_response_code(404);
|
|
8
|
-
if (file_exists($errorPage)) {
|
|
9
|
-
header('Content-Type: text/html; charset=UTF-8');
|
|
10
|
-
echo file_get_contents($errorPage);
|
|
11
|
-
} else {
|
|
12
|
-
echo "404 Not Found";
|
|
13
|
-
}
|
|
14
|
-
exit;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
require_once __DIR__ . '/../../core/modules/Response.php';
|
|
18
|
-
|
|
19
|
-
if ($method !== 'GET') {
|
|
20
|
-
Response::error('Method not allowed', 405);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
Response::success([
|
|
24
|
-
'message' => 'Public endpoint is working',
|
|
25
|
-
'endpoint' => 'example-public-endpoint',
|
|
26
|
-
'visibility' => 'public',
|
|
27
|
-
'params' => $requestParams,
|
|
28
|
-
]);
|