Skip to content

Commit 3f4a42e

Browse files
authored
fix: move frontend out of lib directory (#30)
Currently our frontend is built and moved to the lib/build directory in the package. Then the package is built and the files are compiled to the lib directory. This overwrites the frontend. Now the frontend lives in the build directory and the other files live in the lib directory.
1 parent d527a31 commit 3f4a42e

File tree

5 files changed

+36
-29
lines changed

5 files changed

+36
-29
lines changed

package/src/testingUtil.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@ function addStyleLinks(html) {
130130
}
131131

132132
fastify.register(fastifyStatic, {
133-
root: path.join(__dirname, "build"),
133+
root: path.join(__dirname, "..", "build"),
134134
prefix: "/", // optional: default '/'
135135
wildcard: true,
136136
decorateReply: false,
137137
});
138138

139139
fastify.get("/", async (request, reply) => {
140-
return reply.sendFile("index.html", path.join(__dirname, "build"));
140+
return reply.sendFile("index.html", path.join(__dirname, "..", "build"));
141141
});
142142

143143
fastify.get("/load", async (request, reply) => {
@@ -200,7 +200,7 @@ export const start = async (setupFunction) => {
200200
await getCssFiles();
201201
await setupFunction();
202202
await fastify.listen(3001);
203-
console.log("Debug server is running, open at 127.0.0.1:3001");
203+
console.log("Debug server is running, open at localhost:3001");
204204
while (isListening) {
205205
await sleep(50);
206206
}

test-app/package-lock.json

Lines changed: 23 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-runner/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
npm run build
2-
cp -r build ../package/lib
2+
cp -r build ../package/

test-runner/package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-runner/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"react": "^17.0.2",
3131
"react-dom": "^17.0.2",
3232
"react-scripts": "^5.0.0",
33-
"react-testing-visualizer": "^0.1.8",
33+
"react-testing-visualizer": "^1.0.1",
3434
"web-vitals": "^2.1.2"
3535
},
3636
"proxy": "http://localhost:3001",

0 commit comments

Comments
 (0)