fix: build
Massimo Melina committed
Dec 13, 2021 at 23:23 UTC
68e0a42ef030fe3ada5bcb6743e89db9801c7dd7
7 files changed
+41
-46
NOTES.md
+2
@@ -20,4 +20,6 @@ https://www.tutorialspoint.com/koajs/koajs_quick_guide.htm
20
21
# To do
22
- vfs
23
+ - yaml
24
- sticky breadcrumbs
25
+- interruption of long requests if client aborted
\ No newline at end of file
frontend/README.md
+5
-43
@@ -1,46 +1,8 @@
1
-# Getting Started with Create React App
1
+# Building instructions
2
3
-This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
3
+1. Launch `npm run build` in the root
4
+2. Launch `npm run build` inside `frontend` folder
5
5
-## Available Scripts
6
+You'll find the output in `dist` folder.
7
7
-In the project directory, you can run:
8
-
9
-### `yarn start`
10
-
11
-Runs the app in the development mode.\
12
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13
-
14
-The page will reload if you make edits.\
15
-You will also see any lint errors in the console.
16
-
17
-### `yarn test`
18
-
19
-Launches the test runner in the interactive watch mode.\
20
-See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21
-
22
-### `yarn build`
23
-
24
-Builds the app for production to the `build` folder.\
25
-It correctly bundles React in production mode and optimizes the build for the best performance.
26
-
27
-The build is minified and the filenames include the hashes.\
28
-Your app is ready to be deployed!
29
-
30
-See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31
-
32
-### `yarn eject`
33
-
34
-**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35
-
36
-If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37
-
38
-Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39
-
40
-You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41
-
42
-## Learn More
43
-
44
-You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45
-
46
-To learn React, check out the [React documentation](https://reactjs.org/).
8
+Now you can run `node dist`, or `cd dist` and `node .`
\ No newline at end of file
frontend/package-lock.json
+28
@@ -21,6 +21,7 @@
21
"@types/node": "^12.0.0",
22
"@types/react": "^17.0.0",
23
"@types/react-dom": "^17.0.0",
24
+ "cross-env": "^7.0.3",
25
"react-scripts": "4.0.3",
26
"sass": "^1.45.0",
27
"typescript": "^4.1.2"
@@ -5969,6 +5970,24 @@
5970
"sha.js": "^2.4.8"
5971
}
5972
},
5973
+ "node_modules/cross-env": {
5974
+ "version": "7.0.3",
5975
+ "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
5976
+ "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
5977
+ "dev": true,
5978
+ "dependencies": {
5979
+ "cross-spawn": "^7.0.1"
5980
+ },
5981
+ "bin": {
5982
+ "cross-env": "src/bin/cross-env.js",
5983
+ "cross-env-shell": "src/bin/cross-env-shell.js"
5984
+ },
5985
+ "engines": {
5986
+ "node": ">=10.14",
5987
+ "npm": ">=6",
5988
+ "yarn": ">=1"
5989
+ }
5990
+ },
5991
"node_modules/cross-spawn": {
5992
"version": "7.0.3",
5993
"dev": true,
@@ -24372,6 +24391,15 @@
24391
"sha.js": "^2.4.8"
24392
}
24393
},
24394
+ "cross-env": {
24395
+ "version": "7.0.3",
24396
+ "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
24397
+ "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
24398
+ "dev": true,
24399
+ "requires": {
24400
+ "cross-spawn": "^7.0.1"
24401
+ }
24402
+ },
24403
"cross-spawn": {
24404
"version": "7.0.3",
24405
"dev": true,
frontend/package.json
+3
-2
@@ -5,7 +5,7 @@
5
"proxy": "http://localhost",
6
"scripts": {
7
"start": "react-scripts start",
8
- "build": "react-scripts build",
8
+ "build": "cross-env GENERATE_SOURCEMAP=false BUILD_PATH='../dist/frontend' react-scripts build",
9
"test": "react-scripts test",
10
"test-dep": "npm audit --production",
11
"eject": "react-scripts eject"
@@ -17,7 +17,6 @@
17
"web-vitals": "^1.0.1"
18
},
19
"devDependencies": {
20
- "sass": "^1.45.0",
20
"@testing-library/jest-dom": "^5.11.4",
21
"@testing-library/react": "^11.1.0",
22
"@testing-library/user-event": "^12.1.10",
@@ -25,7 +24,9 @@
24
"@types/node": "^12.0.0",
25
"@types/react": "^17.0.0",
26
"@types/react-dom": "^17.0.0",
27
+ "cross-env": "^7.0.3",
28
"react-scripts": "4.0.3",
29
+ "sass": "^1.45.0",
30
"typescript": "^4.1.2"
31
},
32
"eslintConfig": {
package.json
+1
@@ -12,6 +12,7 @@
12
"scripts": {
13
"watch-server": "nodemon --ignore tests/ --watch src -e ts,tsx --exec ts-node src/index.ts",
14
"start": "node dist",
15
+ "build": "tsc",
16
"test": "mocha -r ts-node/register 'tests/**/*.ts'"
17
},
18
"dependencies": {
src/frontend.ts
+1
-1
@@ -5,7 +5,7 @@ import mime from 'mime-types'
5
import { readFile } from 'fs'
6
import { DEV, FRONTEND_URI } from './const'
7
8
-const FRONTEND = 'frontend/build/'
8
+const FRONTEND = __dirname + '/frontend/'
9
10
export const serveFrontend = DEV ? serveProxyFrontend() : serveStaticFrontend()
11
tsconfig.json
+1
@@ -1,4 +1,5 @@
1
{
2
+ "exclude": ["frontend","tests"],
3
"compilerOptions": {
4
/* Visit https://aka.ms/tsconfig.json to read more about this file */
5