nibula 1.1.3 → 1.2.0

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.
Files changed (52) hide show
  1. package/.eleventy.js +2 -9
  2. package/CHANGELOG.md +34 -49
  3. package/README.md +7 -3
  4. package/bin/create.js +3 -4
  5. package/bin/nibula.js +27 -55
  6. package/docs/Assistant CLI.md +1 -1
  7. package/docs/Components.md +3 -14
  8. package/docs/Creating pages.md +5 -5
  9. package/docs/Head and SEO.md +36 -14
  10. package/docs/Javascript.md +1 -3
  11. package/docs/Styling with SCSS.md +9 -3
  12. package/nginx.conf +75 -75
  13. package/package.json +5 -5
  14. package/src/backend/_core/index.js +267 -267
  15. package/src/backend/_core/init.js +52 -52
  16. package/src/backend/_core/modules/RateLimiter.js +58 -58
  17. package/src/backend/_core/modules/Response.js +59 -59
  18. package/src/backend/api/protected/example-protected.js +23 -23
  19. package/src/backend/api/public/example-public.js +24 -24
  20. package/src/backend/backend-node.service.example +30 -30
  21. package/src/backend/database/Database.js +46 -46
  22. package/src/backend/example.config.js +37 -37
  23. package/src/backend/package.json +18 -18
  24. package/src/frontend/.htaccess +51 -51
  25. package/src/frontend/assets/brand/apple-touch-icon.png +0 -0
  26. package/src/frontend/assets/brand/favicon-32.png +0 -0
  27. package/src/frontend/assets/brand/favicon-48.png +0 -0
  28. package/src/frontend/assets/brand/favicon.svg +54 -54
  29. package/src/frontend/assets/brand/logo.svg +54 -54
  30. package/src/frontend/components/global/header.njk +1 -1
  31. package/src/frontend/components/welcome.njk +0 -1
  32. package/src/frontend/data/site.json +48 -54
  33. package/src/frontend/layouts/base.njk +6 -15
  34. package/src/frontend/scss/modules/frameworks/_bootstrap.scss +66 -66
  35. package/src/frontend/scss/modules/frameworks/_bulma.scss +65 -65
  36. package/src/frontend/scss/modules/frameworks/_foundation.scss +98 -98
  37. package/src/frontend/scss/modules/frameworks/_uikit.scss +79 -79
  38. package/src/frontend/web.config +55 -55
  39. package/{_tools → tools}/modules/constants.js +2 -2
  40. /package/{_tools → tools}/assistant.js +0 -0
  41. /package/{_tools → tools}/buildJs.js +0 -0
  42. /package/{_tools → tools}/cleanOutput.js +0 -0
  43. /package/{_tools → tools}/modules/pageComponents.js +0 -0
  44. /package/{_tools → tools}/modules/updateData.js +0 -0
  45. /package/{_tools → tools}/modules/updateOutputPath.js +0 -0
  46. /package/{_tools → tools}/modules/updatePage.js +0 -0
  47. /package/{_tools → tools}/modules/utils.js +0 -0
  48. /package/{_tools → tools}/modules/validation.js +0 -0
  49. /package/{_tools → tools}/res/templates/template.js +0 -0
  50. /package/{_tools → tools}/res/templates/template.njk +0 -0
  51. /package/{_tools → tools}/res/templates/template.scss +0 -0
  52. /package/{_tools → tools}/res/templates/template.ts +0 -0
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,6 +1,6 @@
1
1
  {
2
2
  "name": "nibula",
3
- "version": "1.1.3",
3
+ "version": "1.2.0",
4
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
5
  "keywords": [
6
6
  "static-site-generator",
@@ -47,16 +47,16 @@
47
47
  "nibula": "bin/nibula.js"
48
48
  },
49
49
  "scripts": {
50
- "build:css": "sass src/frontend/scss:out/css --no-source-map --style=compressed --quiet --load-path=node_modules",
50
+ "build:css": "sass src/frontend/scss:out/css --no-source-map --style=compressed --quiet",
51
51
  "build:js": "esbuild \"src/frontend/ts/pages/*.ts\" --bundle --outdir=out/js/pages --minify",
52
52
  "build:11ty": "eleventy",
53
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",
54
+ "serve:css": "sass --watch src/frontend/scss:out/css --no-source-map --quiet",
55
55
  "serve:js": "esbuild \"src/frontend/ts/pages/*.ts\" --bundle --outdir=out/js/pages --watch",
56
56
  "serve:11ty": "eleventy --serve --quiet",
57
- "clean": "node _tools/cleanOutput.js",
57
+ "clean": "node tools/cleanOutput.js",
58
58
  "serve": "npm run clean && concurrently \"npm run serve:11ty\" \"npm run serve:css\" \"npm run serve:js\"",
59
- "assistant": "node _tools/assistant.js"
59
+ "assistant": "node tools/assistant.js"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@11ty/eleventy": "^3.1.2",