mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: Bundle UI into coderd; add ./develop.sh script (#28)
This change bundles the static assets like we have for v1 - using the [`embed`](https://pkg.go.dev/embed) go package. Fixes #22 In addition, it sets up a development script that runs `coderd` locally and serves the front-end, with hot-reloading. The script used is `./develop.sh`:  > NOTE: The UI is still placeholder, of course. Need to start testing out a simple, placeholder flow for the new v2 world as a next step Summary of changes: - Add build steps for `go` in the `Makefile` - Add a step for production build, in which we use the `embed` tag - Add a step for development, which doesn't need the `embed` tag - so we don't need to build the front-end twice - Add `next export` build step to output front-end artifacts in `out` - Add a `site` package for `go` - Add `embed_static.go` and `embed.go`. This is mostly brought in as-is from v1, except removing some intercom/sentry CSP entries that we aren't using. - Add a [next development server](https://nextjs.org/docs/advanced-features/custom-server) - Add a `v2-dev` script, that runs `coderd` and the `next` dev server side-by-side - Use the `site` package as the fallback handler. - Add `.gitignore` entries for additional build collateral
This commit is contained in:
+8
-2
@@ -6,7 +6,8 @@
|
||||
"scripts": {
|
||||
"build": "NODE_ENV=production next build site",
|
||||
"build:dev": "next build site",
|
||||
"dev": "next dev site",
|
||||
"dev": "ts-node site/dev.ts",
|
||||
"export": "next export site",
|
||||
"format:check": "prettier --check '**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
|
||||
"format:write": "prettier --write '**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
|
||||
"test": "jest --selectProjects test",
|
||||
@@ -17,11 +18,14 @@
|
||||
"@material-ui/icons": "4.5.1",
|
||||
"@material-ui/lab": "4.0.0-alpha.42",
|
||||
"@testing-library/react": "12.1.2",
|
||||
"@types/express": "4.17.13",
|
||||
"@types/jest": "27.4.0",
|
||||
"@types/node": "14.18.4",
|
||||
"@types/react": "17.0.38",
|
||||
"@types/react-dom": "17.0.11",
|
||||
"@types/superagent": "4.1.14",
|
||||
"express": "4.17.2",
|
||||
"http-proxy-middleware": "2.0.1",
|
||||
"jest": "27.4.7",
|
||||
"next": "12.0.7",
|
||||
"prettier": "2.5.1",
|
||||
@@ -29,6 +33,8 @@
|
||||
"react-dom": "17.0.2",
|
||||
"ts-jest": "27.1.2",
|
||||
"ts-loader": "9.2.6",
|
||||
"ts-node": "10.4.0",
|
||||
"typescript": "4.5.4"
|
||||
}
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user