nibula 1.2.1 â 1.2.3
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 +0 -5
- package/CHANGELOG.md +9 -10
- package/README.md +1 -1
- package/bin/create.js +1 -1
- package/bin/nibula.js +1 -1
- package/nginx.conf +75 -75
- package/package.json +74 -74
- package/src/backend/_core/index.js +267 -267
- package/src/backend/_core/init.js +52 -52
- package/src/backend/_core/modules/RateLimiter.js +58 -58
- package/src/backend/_core/modules/Response.js +59 -59
- package/src/backend/api/protected/example-protected.js +23 -23
- package/src/backend/api/public/example-public.js +24 -24
- package/src/backend/backend-node.service.example +30 -30
- package/src/backend/database/Database.js +46 -46
- package/src/backend/example.config.js +37 -37
- package/src/backend/package.json +18 -18
- package/src/frontend/.htaccess +51 -51
- package/src/frontend/assets/brand/favicon.svg +54 -54
- package/src/frontend/assets/brand/logo.svg +54 -54
- package/src/frontend/data/site.json +48 -48
- package/src/frontend/web.config +55 -55
- package/tools/modules/updateOutputPath.js +29 -8
package/.eleventy.js
CHANGED
|
@@ -23,11 +23,6 @@ module.exports = function (eleventyConfig) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
eleventyConfig.addShortcode('mdFile', function(filePath) {
|
|
27
|
-
const content = fs.readFileSync(filePath, 'utf8');
|
|
28
|
-
return md.render(content);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
26
|
eleventyConfig.on("eleventy.before", () => {
|
|
32
27
|
copyRecursiveSync("src/backend", `${OUTPUT_DIR}/backend`);
|
|
33
28
|
});
|
package/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,14 @@ All notable changes to Nibula are documented here.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [1.2.
|
|
8
|
+
## [1.2.3] - 2026-07-29
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- `updateOutputPath` no longer strips custom flags from `build:css` and `serve:css`: the output path is now replaced in place instead of regenerating the whole script
|
|
12
|
+
- Missing `--load-path=node_modules` in the regenerated Sass scripts, which broke Bootstrap SCSS imports
|
|
13
|
+
- Malformed `outDir` in `tsconfig.json` when the output path is absolute (`./c:/...`)
|
|
14
|
+
|
|
15
|
+
## [1.2.2] - 2026-07-23
|
|
9
16
|
|
|
10
17
|
### Added
|
|
11
18
|
- **Full favicon set**: `favicon.svg`, `favicon-32.png` and `apple-touch-icon.png`
|
|
@@ -89,7 +96,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
89
96
|
scripts. Compiling the stylesheets with a different tool (a VS Code Sass
|
|
90
97
|
extension, for instance) will need the same load path configured.
|
|
91
98
|
|
|
92
|
-
|
|
93
99
|
## [1.1.0] - 2026-07-21
|
|
94
100
|
|
|
95
101
|
### Added
|
|
@@ -126,11 +132,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
126
132
|
### Notes
|
|
127
133
|
- Both backends are always scaffolded, so you can switch later without
|
|
128
134
|
re-creating the project. The PHP front controller only serves `.php` endpoint
|
|
129
|
-
files and the Node one only `.js`, so they coexist without conflict.
|
|
130
|
-
|
|
131
|
-
## [1.0.2]
|
|
132
|
-
|
|
133
|
-
- Previous release (PHP backend only).
|
|
134
|
-
|
|
135
|
-
[1.1.0]: https://github.com/Rhaastrake/Nibula/releases/tag/v1.1.0
|
|
136
|
-
[1.0.2]: https://github.com/Rhaastrake/Nibula/releases/tag/v1.0.2
|
|
135
|
+
files and the Node one only `.js`, so they coexist without conflict.
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ Building a website from scratch involves a lot of moving parts: templating, buil
|
|
|
21
21
|
- ðŠķ **Lightweight by default** â SCSS frameworks can be filtered so you ship only what you actually use
|
|
22
22
|
- ð **Open source** â free to use, free to modify, free to share
|
|
23
23
|
|
|
24
|
-

|
|
25
25
|

|
|
26
26
|

|
|
27
27
|
|
package/bin/create.js
CHANGED
package/bin/nibula.js
CHANGED
package/nginx.conf
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
# Example nginx directives for a Nibula site â covers BOTH backends.
|
|
2
|
-
#
|
|
3
|
-
# /api is served by Node (index.js) if it is running on 127.0.0.1:3000; if Node
|
|
4
|
-
# is unreachable, nginx falls back to the PHP front controller automatically.
|
|
5
|
-
# So the same config works whether you deployed the Node backend or the PHP one:
|
|
6
|
-
# - Node backend running -> Node answers /api
|
|
7
|
-
# - only PHP deployed -> Node is down -> falls back to PHP-FPM
|
|
8
|
-
#
|
|
9
|
-
# This is NOT a ready-to-use file: paste these directives inside your own
|
|
10
|
-
# server { } block (the one with server_name, listen and SSL) and set `root`
|
|
11
|
-
# to your `out` folder.
|
|
12
|
-
|
|
13
|
-
# Hide the nginx version from response headers
|
|
14
|
-
server_tokens off;
|
|
15
|
-
|
|
16
|
-
# Force HTTPS on future requests (applies site-wide, including /api)
|
|
17
|
-
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
|
18
|
-
|
|
19
|
-
root /var/www/your-site/out;
|
|
20
|
-
index index.html;
|
|
21
|
-
|
|
22
|
-
# Disable directory listing
|
|
23
|
-
autoindex off;
|
|
24
|
-
|
|
25
|
-
error_page 403 404 /404.html;
|
|
26
|
-
location = /404.html {
|
|
27
|
-
internal;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
# Never expose the backend source directory over HTTP.
|
|
31
|
-
location ^~ /backend/ {
|
|
32
|
-
return 404;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
# Block server config files anywhere in the tree (.htaccess, web.config).
|
|
36
|
-
location ~* (^|/)(\.htaccess|web\.config)$ {
|
|
37
|
-
return 404;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
# --- /api: Node primary, PHP fallback ---------------------------------------
|
|
41
|
-
# Try the Node backend first. If it is down (502/504), retry through the PHP
|
|
42
|
-
# front controller. Security headers for API responses are set by the backend.
|
|
43
|
-
location ^~ /api/ {
|
|
44
|
-
proxy_pass http://127.0.0.1:3000;
|
|
45
|
-
proxy_http_version 1.1;
|
|
46
|
-
proxy_set_header Host $host;
|
|
47
|
-
proxy_set_header X-Real-IP $remote_addr;
|
|
48
|
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
49
|
-
proxy_set_header X-Forwarded-Proto $scheme;
|
|
50
|
-
|
|
51
|
-
proxy_intercept_errors on;
|
|
52
|
-
error_page 502 504 = @php_backend;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
location @php_backend {
|
|
56
|
-
include fastcgi_params;
|
|
57
|
-
fastcgi_param SCRIPT_FILENAME $document_root/backend/_core/index.php;
|
|
58
|
-
|
|
59
|
-
# Adjust the PHP-FPM socket to your distro:
|
|
60
|
-
# Debian / Ubuntu : unix:/run/php/php8.3-fpm.sock
|
|
61
|
-
# RHEL / Fedora : unix:/run/php-fpm/php-fpm.sock
|
|
62
|
-
# TCP fallback : 127.0.0.1:9000
|
|
63
|
-
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
# Serve static files, fall back to the 404 page.
|
|
67
|
-
# A location with add_header does not inherit server-level headers,
|
|
68
|
-
# so Strict-Transport-Security is repeated here.
|
|
69
|
-
location / {
|
|
70
|
-
add_header X-Content-Type-Options "nosniff" always;
|
|
71
|
-
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
72
|
-
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
73
|
-
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
|
74
|
-
try_files $uri $uri/ /404.html;
|
|
75
|
-
}
|
|
1
|
+
# Example nginx directives for a Nibula site â covers BOTH backends.
|
|
2
|
+
#
|
|
3
|
+
# /api is served by Node (index.js) if it is running on 127.0.0.1:3000; if Node
|
|
4
|
+
# is unreachable, nginx falls back to the PHP front controller automatically.
|
|
5
|
+
# So the same config works whether you deployed the Node backend or the PHP one:
|
|
6
|
+
# - Node backend running -> Node answers /api
|
|
7
|
+
# - only PHP deployed -> Node is down -> falls back to PHP-FPM
|
|
8
|
+
#
|
|
9
|
+
# This is NOT a ready-to-use file: paste these directives inside your own
|
|
10
|
+
# server { } block (the one with server_name, listen and SSL) and set `root`
|
|
11
|
+
# to your `out` folder.
|
|
12
|
+
|
|
13
|
+
# Hide the nginx version from response headers
|
|
14
|
+
server_tokens off;
|
|
15
|
+
|
|
16
|
+
# Force HTTPS on future requests (applies site-wide, including /api)
|
|
17
|
+
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
|
18
|
+
|
|
19
|
+
root /var/www/your-site/out;
|
|
20
|
+
index index.html;
|
|
21
|
+
|
|
22
|
+
# Disable directory listing
|
|
23
|
+
autoindex off;
|
|
24
|
+
|
|
25
|
+
error_page 403 404 /404.html;
|
|
26
|
+
location = /404.html {
|
|
27
|
+
internal;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
# Never expose the backend source directory over HTTP.
|
|
31
|
+
location ^~ /backend/ {
|
|
32
|
+
return 404;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
# Block server config files anywhere in the tree (.htaccess, web.config).
|
|
36
|
+
location ~* (^|/)(\.htaccess|web\.config)$ {
|
|
37
|
+
return 404;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
# --- /api: Node primary, PHP fallback ---------------------------------------
|
|
41
|
+
# Try the Node backend first. If it is down (502/504), retry through the PHP
|
|
42
|
+
# front controller. Security headers for API responses are set by the backend.
|
|
43
|
+
location ^~ /api/ {
|
|
44
|
+
proxy_pass http://127.0.0.1:3000;
|
|
45
|
+
proxy_http_version 1.1;
|
|
46
|
+
proxy_set_header Host $host;
|
|
47
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
48
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
49
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
50
|
+
|
|
51
|
+
proxy_intercept_errors on;
|
|
52
|
+
error_page 502 504 = @php_backend;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
location @php_backend {
|
|
56
|
+
include fastcgi_params;
|
|
57
|
+
fastcgi_param SCRIPT_FILENAME $document_root/backend/_core/index.php;
|
|
58
|
+
|
|
59
|
+
# Adjust the PHP-FPM socket to your distro:
|
|
60
|
+
# Debian / Ubuntu : unix:/run/php/php8.3-fpm.sock
|
|
61
|
+
# RHEL / Fedora : unix:/run/php-fpm/php-fpm.sock
|
|
62
|
+
# TCP fallback : 127.0.0.1:9000
|
|
63
|
+
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
# Serve static files, fall back to the 404 page.
|
|
67
|
+
# A location with add_header does not inherit server-level headers,
|
|
68
|
+
# so Strict-Transport-Security is repeated here.
|
|
69
|
+
location / {
|
|
70
|
+
add_header X-Content-Type-Options "nosniff" always;
|
|
71
|
+
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
72
|
+
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
73
|
+
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
|
74
|
+
try_files $uri $uri/ /404.html;
|
|
75
|
+
}
|
package/package.json
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "nibula",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "A beginner-friendly static site generator built on Eleventy that stays close to vanilla HTML, CSS and JS â with a page-management CLI, an optional PHP backend, and SEO files generated for you.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"static-site-generator",
|
|
7
|
-
"ssg",
|
|
8
|
-
"eleventy",
|
|
9
|
-
"11ty",
|
|
10
|
-
"boilerplate",
|
|
11
|
-
"starter",
|
|
12
|
-
"scaffolding",
|
|
13
|
-
"cli",
|
|
14
|
-
"vanilla",
|
|
15
|
-
"vanilla-js",
|
|
16
|
-
"html",
|
|
17
|
-
"css",
|
|
18
|
-
"scss",
|
|
19
|
-
"sass",
|
|
20
|
-
"njk",
|
|
21
|
-
"nunjucks",
|
|
22
|
-
"components",
|
|
23
|
-
"backend",
|
|
24
|
-
"php",
|
|
25
|
-
"node",
|
|
26
|
-
"python",
|
|
27
|
-
"beginner-friendly",
|
|
28
|
-
"seo",
|
|
29
|
-
"sitemap",
|
|
30
|
-
"website-template",
|
|
31
|
-
"frontend"
|
|
32
|
-
],
|
|
33
|
-
"author": "Michele Garofalo",
|
|
34
|
-
"license": "Apache-2.0",
|
|
35
|
-
"homepage": "https://github.com/Rhaastrake/Nibula#readme",
|
|
36
|
-
"repository": {
|
|
37
|
-
"type": "git",
|
|
38
|
-
"url": "git+https://github.com/Rhaastrake/Nibula.git"
|
|
39
|
-
},
|
|
40
|
-
"bugs": {
|
|
41
|
-
"url": "https://github.com/Rhaastrake/Nibula/issues"
|
|
42
|
-
},
|
|
43
|
-
"outputDir": "out",
|
|
44
|
-
"bin": {
|
|
45
|
-
"nib": "bin/nibula.js",
|
|
46
|
-
"nbl": "bin/nibula.js",
|
|
47
|
-
"nibula": "bin/nibula.js"
|
|
48
|
-
},
|
|
49
|
-
"scripts": {
|
|
50
|
-
"build:css": "sass src/frontend/scss:out/css --no-source-map --style=compressed --quiet --load-path=node_modules",
|
|
51
|
-
"build:js": "esbuild \"src/frontend/ts/pages/*.ts\" --bundle --outdir=out/js/pages --minify",
|
|
52
|
-
"build:11ty": "eleventy",
|
|
53
|
-
"build": "npm run clean && npm run build:css && npm run build:js && npm run build:11ty",
|
|
54
|
-
"serve:css": "sass --watch src/frontend/scss:out/css --no-source-map --quiet --load-path=node_modules",
|
|
55
|
-
"serve:js": "esbuild \"src/frontend/ts/pages/*.ts\" --bundle --outdir=out/js/pages --watch",
|
|
56
|
-
"serve:11ty": "eleventy --serve --quiet",
|
|
57
|
-
"clean": "node tools/cleanOutput.js",
|
|
58
|
-
"serve": "npm run clean && concurrently \"npm run serve:11ty\" \"npm run serve:css\" \"npm run serve:js\"",
|
|
59
|
-
"assistant": "node tools/assistant.js"
|
|
60
|
-
},
|
|
61
|
-
"devDependencies": {
|
|
62
|
-
"@11ty/eleventy": "^3.1.2",
|
|
63
|
-
"@11ty/eleventy-img": "^6.0.4",
|
|
64
|
-
"bootstrap": "^5.3.8",
|
|
65
|
-
"bootstrap-icons": "^1.13.1",
|
|
66
|
-
"bulma": "^1.0.4",
|
|
67
|
-
"concurrently": "^9.2.1",
|
|
68
|
-
"esbuild": "^0.27.3",
|
|
69
|
-
"foundation-sites": "^6.9.0",
|
|
70
|
-
"glob": "^13.0.6",
|
|
71
|
-
"sass": "^1.77.0",
|
|
72
|
-
"uikit": "^3.25.13"
|
|
73
|
-
}
|
|
74
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "nibula",
|
|
3
|
+
"version": "1.2.3",
|
|
4
|
+
"description": "A beginner-friendly static site generator built on Eleventy that stays close to vanilla HTML, CSS and JS â with a page-management CLI, an optional PHP backend, and SEO files generated for you.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"static-site-generator",
|
|
7
|
+
"ssg",
|
|
8
|
+
"eleventy",
|
|
9
|
+
"11ty",
|
|
10
|
+
"boilerplate",
|
|
11
|
+
"starter",
|
|
12
|
+
"scaffolding",
|
|
13
|
+
"cli",
|
|
14
|
+
"vanilla",
|
|
15
|
+
"vanilla-js",
|
|
16
|
+
"html",
|
|
17
|
+
"css",
|
|
18
|
+
"scss",
|
|
19
|
+
"sass",
|
|
20
|
+
"njk",
|
|
21
|
+
"nunjucks",
|
|
22
|
+
"components",
|
|
23
|
+
"backend",
|
|
24
|
+
"php",
|
|
25
|
+
"node",
|
|
26
|
+
"python",
|
|
27
|
+
"beginner-friendly",
|
|
28
|
+
"seo",
|
|
29
|
+
"sitemap",
|
|
30
|
+
"website-template",
|
|
31
|
+
"frontend"
|
|
32
|
+
],
|
|
33
|
+
"author": "Michele Garofalo",
|
|
34
|
+
"license": "Apache-2.0",
|
|
35
|
+
"homepage": "https://github.com/Rhaastrake/Nibula#readme",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "git+https://github.com/Rhaastrake/Nibula.git"
|
|
39
|
+
},
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/Rhaastrake/Nibula/issues"
|
|
42
|
+
},
|
|
43
|
+
"outputDir": "out",
|
|
44
|
+
"bin": {
|
|
45
|
+
"nib": "bin/nibula.js",
|
|
46
|
+
"nbl": "bin/nibula.js",
|
|
47
|
+
"nibula": "bin/nibula.js"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build:css": "sass src/frontend/scss:out/css --no-source-map --style=compressed --quiet --load-path=node_modules",
|
|
51
|
+
"build:js": "esbuild \"src/frontend/ts/pages/*.ts\" --bundle --outdir=out/js/pages --minify",
|
|
52
|
+
"build:11ty": "eleventy",
|
|
53
|
+
"build": "npm run clean && npm run build:css && npm run build:js && npm run build:11ty",
|
|
54
|
+
"serve:css": "sass --watch src/frontend/scss:out/css --no-source-map --quiet --load-path=node_modules",
|
|
55
|
+
"serve:js": "esbuild \"src/frontend/ts/pages/*.ts\" --bundle --outdir=out/js/pages --watch",
|
|
56
|
+
"serve:11ty": "eleventy --serve --quiet",
|
|
57
|
+
"clean": "node tools/cleanOutput.js",
|
|
58
|
+
"serve": "npm run clean && concurrently \"npm run serve:11ty\" \"npm run serve:css\" \"npm run serve:js\"",
|
|
59
|
+
"assistant": "node tools/assistant.js"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@11ty/eleventy": "^3.1.2",
|
|
63
|
+
"@11ty/eleventy-img": "^6.0.4",
|
|
64
|
+
"bootstrap": "^5.3.8",
|
|
65
|
+
"bootstrap-icons": "^1.13.1",
|
|
66
|
+
"bulma": "^1.0.4",
|
|
67
|
+
"concurrently": "^9.2.1",
|
|
68
|
+
"esbuild": "^0.27.3",
|
|
69
|
+
"foundation-sites": "^6.9.0",
|
|
70
|
+
"glob": "^13.0.6",
|
|
71
|
+
"sass": "^1.77.0",
|
|
72
|
+
"uikit": "^3.25.13"
|
|
73
|
+
}
|
|
74
|
+
}
|