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.
@@ -1,51 +1,51 @@
1
- Options -Indexes
2
- ErrorDocument 404 /404.html
3
- ErrorDocument 403 /404.html
4
-
5
- <IfModule mod_rewrite.c>
6
- RewriteEngine On
7
- RewriteBase /
8
-
9
- # Block sensitive files (web.config, dotfiles)
10
- RewriteRule ^(web\.config|\..*)$ /404.html [L,NC]
11
- </IfModule>
12
-
13
- # === /api routing — covers BOTH backends ====================================
14
- #
15
- # Apache (unlike nginx) cannot health-check an upstream, so it cannot auto-fall
16
- # back from Node to PHP. The behaviour is:
17
- #
18
- # - mod_proxy available -> /api is proxied to the Node backend (127.0.0.1:3000)
19
- # - mod_proxy NOT present -> /api is rewritten to the PHP front controller
20
- #
21
- # Typical shared hosting (Aruba, cPanel) has no mod_proxy, so it uses PHP
22
- # automatically. On a VPS running Node, mod_proxy sends /api to Node.
23
- #
24
- # If you are on a server that HAS mod_proxy but you want to use PHP, comment out
25
- # the mod_proxy block below.
26
-
27
- # --- Node backend (if mod_proxy is available) ---
28
- <IfModule mod_proxy.c>
29
- ProxyPreserveHost On
30
- ProxyPass /api/ http://127.0.0.1:3000/api/ retry=0
31
- ProxyPassReverse /api/ http://127.0.0.1:3000/api/
32
-
33
- <IfModule mod_headers.c>
34
- RequestHeader set X-Forwarded-For "%{REMOTE_ADDR}s"
35
- RequestHeader set X-Forwarded-Proto "https"
36
- </IfModule>
37
- </IfModule>
38
-
39
- # --- PHP backend (fallback when mod_proxy is absent) ---
40
- <IfModule mod_rewrite.c>
41
- RewriteEngine On
42
- RewriteBase /
43
- RewriteRule ^api/(.*)$ backend/_core/index.php [QSA,L]
44
- </IfModule>
45
-
46
- # === Static files ===========================================================
47
- <IfModule mod_rewrite.c>
48
- RewriteCond %{REQUEST_FILENAME} -f [OR]
49
- RewriteCond %{REQUEST_FILENAME} -d
50
- RewriteRule ^ - [L]
51
- </IfModule>
1
+ Options -Indexes
2
+ ErrorDocument 404 /404.html
3
+ ErrorDocument 403 /404.html
4
+
5
+ <IfModule mod_rewrite.c>
6
+ RewriteEngine On
7
+ RewriteBase /
8
+
9
+ # Block sensitive files (web.config, dotfiles)
10
+ RewriteRule ^(web\.config|\..*)$ /404.html [L,NC]
11
+ </IfModule>
12
+
13
+ # === /api routing — covers BOTH backends ====================================
14
+ #
15
+ # Apache (unlike nginx) cannot health-check an upstream, so it cannot auto-fall
16
+ # back from Node to PHP. The behaviour is:
17
+ #
18
+ # - mod_proxy available -> /api is proxied to the Node backend (127.0.0.1:3000)
19
+ # - mod_proxy NOT present -> /api is rewritten to the PHP front controller
20
+ #
21
+ # Typical shared hosting (Aruba, cPanel) has no mod_proxy, so it uses PHP
22
+ # automatically. On a VPS running Node, mod_proxy sends /api to Node.
23
+ #
24
+ # If you are on a server that HAS mod_proxy but you want to use PHP, comment out
25
+ # the mod_proxy block below.
26
+
27
+ # --- Node backend (if mod_proxy is available) ---
28
+ <IfModule mod_proxy.c>
29
+ ProxyPreserveHost On
30
+ ProxyPass /api/ http://127.0.0.1:3000/api/ retry=0
31
+ ProxyPassReverse /api/ http://127.0.0.1:3000/api/
32
+
33
+ <IfModule mod_headers.c>
34
+ RequestHeader set X-Forwarded-For "%{REMOTE_ADDR}s"
35
+ RequestHeader set X-Forwarded-Proto "https"
36
+ </IfModule>
37
+ </IfModule>
38
+
39
+ # --- PHP backend (fallback when mod_proxy is absent) ---
40
+ <IfModule mod_rewrite.c>
41
+ RewriteEngine On
42
+ RewriteBase /
43
+ RewriteRule ^api/(.*)$ backend/_core/index.php [QSA,L]
44
+ </IfModule>
45
+
46
+ # === Static files ===========================================================
47
+ <IfModule mod_rewrite.c>
48
+ RewriteCond %{REQUEST_FILENAME} -f [OR]
49
+ RewriteCond %{REQUEST_FILENAME} -d
50
+ RewriteRule ^ - [L]
51
+ </IfModule>
@@ -1,54 +1,54 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" role="img" aria-label="Nibula">
2
- <defs>
3
- <linearGradient id="nibulaShieldBorder" x1="0" y1="0" x2="1" y2="1">
4
- <stop offset="0" stop-color="#8b6fc4"/>
5
- <stop offset="0.5" stop-color="#c9a06a"/>
6
- <stop offset="1" stop-color="#f2c17a"/>
7
- </linearGradient>
8
- <linearGradient id="nibulaN" x1="0" y1="1" x2="1" y2="0">
9
- <stop offset="0" stop-color="#6d4fa8"/>
10
- <stop offset="0.45" stop-color="#a978b0"/>
11
- <stop offset="0.75" stop-color="#e7a55f"/>
12
- <stop offset="1" stop-color="#f7d08a"/>
13
- </linearGradient>
14
- <linearGradient id="nibulaNib" x1="0" y1="0" x2="1" y2="1">
15
- <stop offset="0" stop-color="#f7d89a"/>
16
- <stop offset="0.55" stop-color="#e0a95f"/>
17
- <stop offset="1" stop-color="#b07d3e"/>
18
- </linearGradient>
19
- <linearGradient id="nibulaField" x1="0" y1="0" x2="0.6" y2="1">
20
- <stop offset="0" stop-color="#3a2c63"/>
21
- <stop offset="1" stop-color="#2a2150"/>
22
- </linearGradient>
23
- </defs>
24
-
25
- <path fill="none" stroke="url(#nibulaShieldBorder)" stroke-width="10" stroke-linejoin="round"
26
- d="M256 40 L440 132 L440 320 L256 472 L72 320 L72 132 Z"/>
27
- <path fill="url(#nibulaField)" stroke="url(#nibulaShieldBorder)" stroke-width="6" stroke-linejoin="round"
28
- d="M256 66 L418 147 L418 310 L256 442 L94 310 L94 147 Z"/>
29
-
30
- <!-- N as one closed outline: up left post, down inner-left, diagonal to inner-bottom-right,
31
- up right post, cut corner, down outer-right, close along the bottom -->
32
- <path fill="url(#nibulaN)" stroke="#1a1533" stroke-width="7" stroke-linejoin="round"
33
- d="M148 362
34
- L148 150
35
- L206 150
36
- L312 300
37
- L312 150
38
- L370 150
39
- L370 205
40
- L340 205
41
- L340 362
42
- L282 362
43
- L206 255
44
- L206 362
45
- Z"/>
46
-
47
- <g stroke="#1a1533" stroke-width="7" stroke-linejoin="round" stroke-linecap="round">
48
- <path fill="url(#nibulaNib)" d="M326 300 L382 300 L392 326 L336 326 Z"/>
49
- <path fill="none" stroke-width="5" d="M338 313 L386 313"/>
50
- <path fill="url(#nibulaNib)" d="M336 326 L392 326 L428 414 L370 380 Z"/>
51
- <path fill="none" stroke-width="5" d="M366 342 L402 384"/>
52
- <circle cx="376" cy="360" r="6.5" fill="#1a1533" stroke="none"/>
53
- </g>
54
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" role="img" aria-label="Nibula">
2
+ <defs>
3
+ <linearGradient id="nibulaShieldBorder" x1="0" y1="0" x2="1" y2="1">
4
+ <stop offset="0" stop-color="#8b6fc4"/>
5
+ <stop offset="0.5" stop-color="#c9a06a"/>
6
+ <stop offset="1" stop-color="#f2c17a"/>
7
+ </linearGradient>
8
+ <linearGradient id="nibulaN" x1="0" y1="1" x2="1" y2="0">
9
+ <stop offset="0" stop-color="#6d4fa8"/>
10
+ <stop offset="0.45" stop-color="#a978b0"/>
11
+ <stop offset="0.75" stop-color="#e7a55f"/>
12
+ <stop offset="1" stop-color="#f7d08a"/>
13
+ </linearGradient>
14
+ <linearGradient id="nibulaNib" x1="0" y1="0" x2="1" y2="1">
15
+ <stop offset="0" stop-color="#f7d89a"/>
16
+ <stop offset="0.55" stop-color="#e0a95f"/>
17
+ <stop offset="1" stop-color="#b07d3e"/>
18
+ </linearGradient>
19
+ <linearGradient id="nibulaField" x1="0" y1="0" x2="0.6" y2="1">
20
+ <stop offset="0" stop-color="#3a2c63"/>
21
+ <stop offset="1" stop-color="#2a2150"/>
22
+ </linearGradient>
23
+ </defs>
24
+
25
+ <path fill="none" stroke="url(#nibulaShieldBorder)" stroke-width="10" stroke-linejoin="round"
26
+ d="M256 40 L440 132 L440 320 L256 472 L72 320 L72 132 Z"/>
27
+ <path fill="url(#nibulaField)" stroke="url(#nibulaShieldBorder)" stroke-width="6" stroke-linejoin="round"
28
+ d="M256 66 L418 147 L418 310 L256 442 L94 310 L94 147 Z"/>
29
+
30
+ <!-- N as one closed outline: up left post, down inner-left, diagonal to inner-bottom-right,
31
+ up right post, cut corner, down outer-right, close along the bottom -->
32
+ <path fill="url(#nibulaN)" stroke="#1a1533" stroke-width="7" stroke-linejoin="round"
33
+ d="M148 362
34
+ L148 150
35
+ L206 150
36
+ L312 300
37
+ L312 150
38
+ L370 150
39
+ L370 205
40
+ L340 205
41
+ L340 362
42
+ L282 362
43
+ L206 255
44
+ L206 362
45
+ Z"/>
46
+
47
+ <g stroke="#1a1533" stroke-width="7" stroke-linejoin="round" stroke-linecap="round">
48
+ <path fill="url(#nibulaNib)" d="M326 300 L382 300 L392 326 L336 326 Z"/>
49
+ <path fill="none" stroke-width="5" d="M338 313 L386 313"/>
50
+ <path fill="url(#nibulaNib)" d="M336 326 L392 326 L428 414 L370 380 Z"/>
51
+ <path fill="none" stroke-width="5" d="M366 342 L402 384"/>
52
+ <circle cx="376" cy="360" r="6.5" fill="#1a1533" stroke="none"/>
53
+ </g>
54
+ </svg>
@@ -1,54 +1,54 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" role="img" aria-label="Nibula">
2
- <defs>
3
- <linearGradient id="nibulaShieldBorder" x1="0" y1="0" x2="1" y2="1">
4
- <stop offset="0" stop-color="#8b6fc4"/>
5
- <stop offset="0.5" stop-color="#c9a06a"/>
6
- <stop offset="1" stop-color="#f2c17a"/>
7
- </linearGradient>
8
- <linearGradient id="nibulaN" x1="0" y1="1" x2="1" y2="0">
9
- <stop offset="0" stop-color="#6d4fa8"/>
10
- <stop offset="0.45" stop-color="#a978b0"/>
11
- <stop offset="0.75" stop-color="#e7a55f"/>
12
- <stop offset="1" stop-color="#f7d08a"/>
13
- </linearGradient>
14
- <linearGradient id="nibulaNib" x1="0" y1="0" x2="1" y2="1">
15
- <stop offset="0" stop-color="#f7d89a"/>
16
- <stop offset="0.55" stop-color="#e0a95f"/>
17
- <stop offset="1" stop-color="#b07d3e"/>
18
- </linearGradient>
19
- <linearGradient id="nibulaField" x1="0" y1="0" x2="0.6" y2="1">
20
- <stop offset="0" stop-color="#3a2c63"/>
21
- <stop offset="1" stop-color="#2a2150"/>
22
- </linearGradient>
23
- </defs>
24
-
25
- <path fill="none" stroke="url(#nibulaShieldBorder)" stroke-width="10" stroke-linejoin="round"
26
- d="M256 40 L440 132 L440 320 L256 472 L72 320 L72 132 Z"/>
27
- <path fill="url(#nibulaField)" stroke="url(#nibulaShieldBorder)" stroke-width="6" stroke-linejoin="round"
28
- d="M256 66 L418 147 L418 310 L256 442 L94 310 L94 147 Z"/>
29
-
30
- <!-- N as one closed outline: up left post, down inner-left, diagonal to inner-bottom-right,
31
- up right post, cut corner, down outer-right, close along the bottom -->
32
- <path fill="url(#nibulaN)" stroke="#1a1533" stroke-width="7" stroke-linejoin="round"
33
- d="M148 362
34
- L148 150
35
- L206 150
36
- L312 300
37
- L312 150
38
- L370 150
39
- L370 205
40
- L340 205
41
- L340 362
42
- L282 362
43
- L206 255
44
- L206 362
45
- Z"/>
46
-
47
- <g stroke="#1a1533" stroke-width="7" stroke-linejoin="round" stroke-linecap="round">
48
- <path fill="url(#nibulaNib)" d="M326 300 L382 300 L392 326 L336 326 Z"/>
49
- <path fill="none" stroke-width="5" d="M338 313 L386 313"/>
50
- <path fill="url(#nibulaNib)" d="M336 326 L392 326 L428 414 L370 380 Z"/>
51
- <path fill="none" stroke-width="5" d="M366 342 L402 384"/>
52
- <circle cx="376" cy="360" r="6.5" fill="#1a1533" stroke="none"/>
53
- </g>
54
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" role="img" aria-label="Nibula">
2
+ <defs>
3
+ <linearGradient id="nibulaShieldBorder" x1="0" y1="0" x2="1" y2="1">
4
+ <stop offset="0" stop-color="#8b6fc4"/>
5
+ <stop offset="0.5" stop-color="#c9a06a"/>
6
+ <stop offset="1" stop-color="#f2c17a"/>
7
+ </linearGradient>
8
+ <linearGradient id="nibulaN" x1="0" y1="1" x2="1" y2="0">
9
+ <stop offset="0" stop-color="#6d4fa8"/>
10
+ <stop offset="0.45" stop-color="#a978b0"/>
11
+ <stop offset="0.75" stop-color="#e7a55f"/>
12
+ <stop offset="1" stop-color="#f7d08a"/>
13
+ </linearGradient>
14
+ <linearGradient id="nibulaNib" x1="0" y1="0" x2="1" y2="1">
15
+ <stop offset="0" stop-color="#f7d89a"/>
16
+ <stop offset="0.55" stop-color="#e0a95f"/>
17
+ <stop offset="1" stop-color="#b07d3e"/>
18
+ </linearGradient>
19
+ <linearGradient id="nibulaField" x1="0" y1="0" x2="0.6" y2="1">
20
+ <stop offset="0" stop-color="#3a2c63"/>
21
+ <stop offset="1" stop-color="#2a2150"/>
22
+ </linearGradient>
23
+ </defs>
24
+
25
+ <path fill="none" stroke="url(#nibulaShieldBorder)" stroke-width="10" stroke-linejoin="round"
26
+ d="M256 40 L440 132 L440 320 L256 472 L72 320 L72 132 Z"/>
27
+ <path fill="url(#nibulaField)" stroke="url(#nibulaShieldBorder)" stroke-width="6" stroke-linejoin="round"
28
+ d="M256 66 L418 147 L418 310 L256 442 L94 310 L94 147 Z"/>
29
+
30
+ <!-- N as one closed outline: up left post, down inner-left, diagonal to inner-bottom-right,
31
+ up right post, cut corner, down outer-right, close along the bottom -->
32
+ <path fill="url(#nibulaN)" stroke="#1a1533" stroke-width="7" stroke-linejoin="round"
33
+ d="M148 362
34
+ L148 150
35
+ L206 150
36
+ L312 300
37
+ L312 150
38
+ L370 150
39
+ L370 205
40
+ L340 205
41
+ L340 362
42
+ L282 362
43
+ L206 255
44
+ L206 362
45
+ Z"/>
46
+
47
+ <g stroke="#1a1533" stroke-width="7" stroke-linejoin="round" stroke-linecap="round">
48
+ <path fill="url(#nibulaNib)" d="M326 300 L382 300 L392 326 L336 326 Z"/>
49
+ <path fill="none" stroke-width="5" d="M338 313 L386 313"/>
50
+ <path fill="url(#nibulaNib)" d="M336 326 L392 326 L428 414 L370 380 Z"/>
51
+ <path fill="none" stroke-width="5" d="M366 342 L402 384"/>
52
+ <circle cx="376" cy="360" r="6.5" fill="#1a1533" stroke="none"/>
53
+ </g>
54
+ </svg>
@@ -1,48 +1,48 @@
1
- {
2
- "site_name": "Site name",
3
- "title": "Site title",
4
- "description": "Site description",
5
- "keywords": "keyword1, keyword2, keyword3",
6
- "domain": "yoursite.com",
7
- "url": "https://yoursite.com",
8
- "lang": "en",
9
- "author": "Name and surname",
10
- "theme": "dark",
11
- "legal": {
12
- "privacy": "",
13
- "cookie": "",
14
- "cookieControls": "",
15
- "terms": "",
16
- "copyright": {
17
- "year": "2026",
18
- "text": "All rights reserved."
19
- }
20
- },
21
- "pages": {
22
- "404": {
23
- "seo": {
24
- "title": "404 - Not found",
25
- "keywords": "",
26
- "noindex": true,
27
- "canonical": ""
28
- },
29
- "cdn": {
30
- "css": [],
31
- "js": []
32
- }
33
- },
34
- "homepage": {
35
- "seo": {
36
- "title": "Homepage",
37
- "description": "Description",
38
- "keywords": "",
39
- "noindex": false,
40
- "canonical": ""
41
- },
42
- "cdn": {
43
- "css": [],
44
- "js": []
45
- }
46
- }
47
- }
48
- }
1
+ {
2
+ "site_name": "Site name",
3
+ "title": "Site title",
4
+ "description": "Site description",
5
+ "keywords": "keyword1, keyword2, keyword3",
6
+ "domain": "yoursite.com",
7
+ "url": "https://yoursite.com",
8
+ "lang": "en",
9
+ "author": "Name and surname",
10
+ "theme": "dark",
11
+ "legal": {
12
+ "privacy": "",
13
+ "cookie": "",
14
+ "cookieControls": "",
15
+ "terms": "",
16
+ "copyright": {
17
+ "year": "2026",
18
+ "text": "All rights reserved."
19
+ }
20
+ },
21
+ "pages": {
22
+ "404": {
23
+ "seo": {
24
+ "title": "404 - Not found",
25
+ "keywords": "",
26
+ "noindex": true,
27
+ "canonical": ""
28
+ },
29
+ "cdn": {
30
+ "css": [],
31
+ "js": []
32
+ }
33
+ },
34
+ "homepage": {
35
+ "seo": {
36
+ "title": "Homepage",
37
+ "description": "Description",
38
+ "keywords": "",
39
+ "noindex": false,
40
+ "canonical": ""
41
+ },
42
+ "cdn": {
43
+ "css": [],
44
+ "js": []
45
+ }
46
+ }
47
+ }
48
+ }
@@ -1,55 +1,55 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!--
3
- IIS config for a Nibula site — covers BOTH backends.
4
-
5
- IIS (like Apache, unlike nginx) cannot health-check an upstream, so it cannot
6
- auto-fall back from Node to PHP. URL Rewrite processes rules top-down and the
7
- first match with stopProcessing="true" wins:
8
-
9
- - "ApiToNode" wins if present -> /api is reverse-proxied to the Node backend
10
- (requires the Application Request Routing + URL Rewrite modules, with proxy
11
- enabled: ARR > Server Proxy Settings > Enable proxy).
12
- - To use the PHP backend instead, remove or comment the "ApiToNode" rule;
13
- "ApiToPhp" then rewrites /api to the PHP front controller.
14
-
15
- On Windows shared hosting without ARR, keep only "ApiToPhp".
16
- -->
17
- <configuration>
18
- <system.webServer>
19
- <rewrite>
20
- <rules>
21
-
22
- <!-- Block sensitive files -->
23
- <rule name="BlockSensitive" stopProcessing="true">
24
- <match url="^(web\.config|\..*)$" ignoreCase="true" />
25
- <action type="CustomResponse" statusCode="404" />
26
- </rule>
27
-
28
- <!-- Node backend (requires ARR). Remove this rule to use PHP. -->
29
- <rule name="ApiToNode" stopProcessing="true">
30
- <match url="^api/(.*)" ignoreCase="true" />
31
- <action type="Rewrite" url="http://127.0.0.1:3000/api/{R:1}" appendQueryString="true" />
32
- <serverVariables>
33
- <set name="HTTP_X_FORWARDED_PROTO" value="https" />
34
- </serverVariables>
35
- </rule>
36
-
37
- <!-- PHP backend fallback: rewrite /api to the PHP front controller. -->
38
- <rule name="ApiToPhp" stopProcessing="true">
39
- <match url="^api/(.*)" ignoreCase="true" />
40
- <action type="Rewrite" url="backend/_core/index.php" appendQueryString="true" />
41
- </rule>
42
-
43
- </rules>
44
- </rewrite>
45
-
46
- <directoryBrowse enabled="false" />
47
-
48
- <httpErrors errorMode="Custom" existingResponse="Replace">
49
- <remove statusCode="404" />
50
- <remove statusCode="403" />
51
- <error statusCode="404" path="/404.html" responseMode="ExecuteURL" />
52
- <error statusCode="403" path="/404.html" responseMode="ExecuteURL" />
53
- </httpErrors>
54
- </system.webServer>
55
- </configuration>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ IIS config for a Nibula site — covers BOTH backends.
4
+
5
+ IIS (like Apache, unlike nginx) cannot health-check an upstream, so it cannot
6
+ auto-fall back from Node to PHP. URL Rewrite processes rules top-down and the
7
+ first match with stopProcessing="true" wins:
8
+
9
+ - "ApiToNode" wins if present -> /api is reverse-proxied to the Node backend
10
+ (requires the Application Request Routing + URL Rewrite modules, with proxy
11
+ enabled: ARR > Server Proxy Settings > Enable proxy).
12
+ - To use the PHP backend instead, remove or comment the "ApiToNode" rule;
13
+ "ApiToPhp" then rewrites /api to the PHP front controller.
14
+
15
+ On Windows shared hosting without ARR, keep only "ApiToPhp".
16
+ -->
17
+ <configuration>
18
+ <system.webServer>
19
+ <rewrite>
20
+ <rules>
21
+
22
+ <!-- Block sensitive files -->
23
+ <rule name="BlockSensitive" stopProcessing="true">
24
+ <match url="^(web\.config|\..*)$" ignoreCase="true" />
25
+ <action type="CustomResponse" statusCode="404" />
26
+ </rule>
27
+
28
+ <!-- Node backend (requires ARR). Remove this rule to use PHP. -->
29
+ <rule name="ApiToNode" stopProcessing="true">
30
+ <match url="^api/(.*)" ignoreCase="true" />
31
+ <action type="Rewrite" url="http://127.0.0.1:3000/api/{R:1}" appendQueryString="true" />
32
+ <serverVariables>
33
+ <set name="HTTP_X_FORWARDED_PROTO" value="https" />
34
+ </serverVariables>
35
+ </rule>
36
+
37
+ <!-- PHP backend fallback: rewrite /api to the PHP front controller. -->
38
+ <rule name="ApiToPhp" stopProcessing="true">
39
+ <match url="^api/(.*)" ignoreCase="true" />
40
+ <action type="Rewrite" url="backend/_core/index.php" appendQueryString="true" />
41
+ </rule>
42
+
43
+ </rules>
44
+ </rewrite>
45
+
46
+ <directoryBrowse enabled="false" />
47
+
48
+ <httpErrors errorMode="Custom" existingResponse="Replace">
49
+ <remove statusCode="404" />
50
+ <remove statusCode="403" />
51
+ <error statusCode="404" path="/404.html" responseMode="ExecuteURL" />
52
+ <error statusCode="403" path="/404.html" responseMode="ExecuteURL" />
53
+ </httpErrors>
54
+ </system.webServer>
55
+ </configuration>
@@ -6,11 +6,22 @@ const { isTypeScriptProject } = require('./utils');
6
6
  const OUTPUT_DIR_REGEX = /const OUTPUT_DIR\s*=\s*['"`]([^'"`]*)['"`]/;
7
7
  const TSCONFIG_OUTDIR_REGEX = /"outDir"\s*:\s*"[^"]*"/;
8
8
 
9
+ const OUT_SCRIPTS = [
10
+ ['build:css', '/css', 'sass src/frontend/scss:{OUT}/css --no-source-map --style=compressed --quiet --load-path=node_modules'],
11
+ ['serve:css', '/css', 'sass --watch src/frontend/scss:{OUT}/css --no-source-map --quiet --load-path=node_modules'],
12
+ ['build:js', '/js/pages', 'esbuild "{GLOB}" --bundle --outdir={OUT}/js/pages --minify'],
13
+ ['serve:js', '/js/pages', 'esbuild "{GLOB}" --bundle --outdir={OUT}/js/pages --watch'],
14
+ ];
15
+
9
16
  function parseOutputDir(content) {
10
17
  const match = content.match(OUTPUT_DIR_REGEX);
11
18
  return match ? match[1] : null;
12
19
  }
13
20
 
21
+ function isAbsolutePath(p) {
22
+ return path.isAbsolute(p) || /^[a-zA-Z]:/.test(p);
23
+ }
24
+
14
25
  function updateEleventyConfig(newPath) {
15
26
  const content = fs.readFileSync(PATHS.eleventyConfig, 'utf8');
16
27
  const updated = content.replace(OUTPUT_DIR_REGEX, `const OUTPUT_DIR = "${newPath}"`);
@@ -23,7 +34,7 @@ function updateEleventyConfig(newPath) {
23
34
  console.log(`[updated] .eleventy.js → ${newPath}`);
24
35
  }
25
36
 
26
- function updatePackageJson(newPath) {
37
+ function updatePackageJson(newPath, oldPath) {
27
38
  const pkg = JSON.parse(fs.readFileSync(PATHS.packageJson, 'utf8'));
28
39
  const scriptGlob = isTypeScriptProject()
29
40
  ? 'src/frontend/ts/pages/*.ts'
@@ -31,10 +42,19 @@ function updatePackageJson(newPath) {
31
42
 
32
43
  pkg.outputDir = newPath;
33
44
  pkg.scripts = pkg.scripts || {};
34
- pkg.scripts['build:css'] = `sass src/frontend/scss:${newPath}/css --no-source-map --style=compressed --quiet`;
35
- pkg.scripts['serve:css'] = `sass --watch src/frontend/scss:${newPath}/css --no-source-map --quiet`;
36
- pkg.scripts['build:js'] = `esbuild "${scriptGlob}" --bundle --outdir=${newPath}/js/pages --minify`;
37
- pkg.scripts['serve:js'] = `esbuild "${scriptGlob}" --bundle --outdir=${newPath}/js/pages --watch`;
45
+
46
+ for (const [name, suffix, template] of OUT_SCRIPTS) {
47
+ const current = pkg.scripts[name];
48
+ const token = oldPath ? `${oldPath}${suffix}` : null;
49
+
50
+ if (current && token && current.includes(token)) {
51
+ pkg.scripts[name] = current.split(token).join(`${newPath}${suffix}`);
52
+ } else {
53
+ pkg.scripts[name] = template
54
+ .replace(/\{OUT\}/g, newPath)
55
+ .replace(/\{GLOB\}/g, scriptGlob);
56
+ }
57
+ }
38
58
 
39
59
  fs.writeFileSync(PATHS.packageJson, `${JSON.stringify(pkg, null, 2)}\n`);
40
60
  console.log(`[updated] package.json → ${newPath}`);
@@ -43,15 +63,16 @@ function updatePackageJson(newPath) {
43
63
  function updateTsConfig(newPath) {
44
64
  if (!isTypeScriptProject()) return;
45
65
 
66
+ const outDir = isAbsolutePath(newPath) ? `${newPath}/ts` : `./${newPath}/ts`;
46
67
  const content = fs.readFileSync(PATHS.tsconfig, 'utf8');
47
- const updated = content.replace(TSCONFIG_OUTDIR_REGEX, `"outDir": "./${newPath}/ts"`);
68
+ const updated = content.replace(TSCONFIG_OUTDIR_REGEX, `"outDir": "${outDir}"`);
48
69
 
49
70
  if (content === updated) {
50
71
  console.log('[skip] outDir not found in tsconfig.json');
51
72
  return;
52
73
  }
53
74
  fs.writeFileSync(PATHS.tsconfig, updated);
54
- console.log(`[updated] tsconfig.json → ${newPath}/ts`);
75
+ console.log(`[updated] tsconfig.json → ${outDir}`);
55
76
  }
56
77
 
57
78
  function deleteOldOutput(oldPath) {
@@ -93,7 +114,7 @@ function updateOutputPath(rawPath) {
93
114
 
94
115
  console.log(`\nupdating output path → "${normalizedPath}"`);
95
116
  try {
96
- updatePackageJson(normalizedPath);
117
+ updatePackageJson(normalizedPath, oldPath);
97
118
  updateEleventyConfig(normalizedPath);
98
119
  updateTsConfig(normalizedPath);
99
120
  } catch (err) {