Skip to content

Commit cd98537

Browse files
fattila16a.fekete
authored andcommitted
test: update the snapshot tests with the new react-router examples
1 parent a57325f commit cd98537

File tree

2 files changed

+133
-0
lines changed

2 files changed

+133
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
source: tests/generate_plan_tests.rs
3+
expression: plan
4+
---
5+
{
6+
"providers": [],
7+
"buildImage": "[build_image]",
8+
"variables": {
9+
"CI": "true",
10+
"NIXPACKS_METADATA": "node",
11+
"NIXPACKS_SPA_OUTPUT_DIR": "dist",
12+
"NODE_ENV": "production",
13+
"NPM_CONFIG_PRODUCTION": "false"
14+
},
15+
"phases": {
16+
"build": {
17+
"name": "build",
18+
"dependsOn": [
19+
"install"
20+
],
21+
"cmds": [
22+
"npm run build"
23+
],
24+
"cacheDirectories": [
25+
"node_modules/.cache"
26+
]
27+
},
28+
"install": {
29+
"name": "install",
30+
"dependsOn": [
31+
"setup"
32+
],
33+
"cmds": [
34+
"npm i"
35+
],
36+
"cacheDirectories": [
37+
"/root/.npm"
38+
],
39+
"paths": [
40+
"/app/node_modules/.bin"
41+
]
42+
},
43+
"setup": {
44+
"name": "setup",
45+
"nixPkgs": [
46+
"nodejs_18",
47+
"npm-9_x"
48+
],
49+
"nixOverlays": [
50+
"https://github.com/railwayapp/nix-npm-overlay/archive/main.tar.gz"
51+
],
52+
"nixpkgsArchive": "[archive]"
53+
}
54+
},
55+
"start": {
56+
"cmd": "npm run start"
57+
}
58+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
source: tests/generate_plan_tests.rs
3+
expression: plan
4+
---
5+
{
6+
"providers": [],
7+
"buildImage": "[build_image]",
8+
"variables": {
9+
"CI": "true",
10+
"NIXPACKS_METADATA": "node",
11+
"NIXPACKS_SPA_OUTPUT_DIR": "dist",
12+
"NODE_ENV": "production",
13+
"NPM_CONFIG_PRODUCTION": "false"
14+
},
15+
"staticAssets": {
16+
"Caddyfile": "# global options\n{\n\tadmin off # theres no need for the admin api in railway's environment\n\tpersist_config off # storage isn't persistent anyway\n\tauto_https off # railway handles https for us, this would cause issues if left enabled\n\t# runtime logs\n\tlog {\n\t\tformat json # set runtime log format to json mode \n\t}\n\t# server options\n\tservers {\n\t\ttrusted_proxies static private_ranges 100.0.0.0/8 # trust railway's proxy\n\t}\n}\n\n# site block, listens on the $PORT environment variable, automatically assigned by railway\n:{$PORT:3000} {\n\t# access logs\n\tlog {\n\t\tformat json # set access log format to json mode\n\t}\n\n\t# health check for railway\n\trewrite /health /*\n\n\t# serve from the 'dist' folder (Vite builds into the 'dist' folder)\n root * ../app/{$NIXPACKS_SPA_OUTPUT_DIR}\n\n\t# enable gzipping responses\n\tencode gzip\n\n\t# serve files from 'dist'\n\tfile_server \n\n\t# if path doesn't exist, redirect it to 'index.html' for client side routing\n\ttry_files {path} /index.html\n}"
17+
},
18+
"phases": {
19+
"build": {
20+
"name": "build",
21+
"dependsOn": [
22+
"install"
23+
],
24+
"cmds": [
25+
"npm run build"
26+
],
27+
"cacheDirectories": [
28+
"node_modules/.cache"
29+
]
30+
},
31+
"caddy": {
32+
"name": "caddy",
33+
"dependsOn": [
34+
"setup"
35+
],
36+
"nixPkgs": [
37+
"caddy"
38+
],
39+
"nixOverlays": [],
40+
"nixpkgsArchive": "[archive]",
41+
"cmds": [
42+
"caddy fmt --overwrite /assets/Caddyfile"
43+
]
44+
},
45+
"install": {
46+
"name": "install",
47+
"dependsOn": [
48+
"setup"
49+
],
50+
"cmds": [
51+
"npm ci"
52+
],
53+
"cacheDirectories": [
54+
"/root/.npm"
55+
],
56+
"paths": [
57+
"/app/node_modules/.bin"
58+
]
59+
},
60+
"setup": {
61+
"name": "setup",
62+
"nixPkgs": [
63+
"nodejs_18",
64+
"npm-9_x"
65+
],
66+
"nixOverlays": [
67+
"https://github.com/railwayapp/nix-npm-overlay/archive/main.tar.gz"
68+
],
69+
"nixpkgsArchive": "[archive]"
70+
}
71+
},
72+
"start": {
73+
"cmd": "exec caddy run --config /assets/Caddyfile --adapter caddyfile 2>&1"
74+
}
75+
}

0 commit comments

Comments
 (0)