Skip to content

Commit aa267e6

Browse files
committed
Merge branch 'main' into workflow
2 parents 9e29a51 + 2818b3c commit aa267e6

File tree

13 files changed

+572
-51
lines changed

13 files changed

+572
-51
lines changed

.github/workflows/coder-test-stability.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ jobs:
3939
- 1
4040
- 2
4141
steps:
42-
- uses: actions/checkout@v2
42+
- uses: actions/checkout@v3
4343

4444
- uses: actions/setup-go@v2
4545
with:
4646
go-version: "^1.17"
4747

48-
- uses: actions/cache@v2
48+
- uses: actions/cache@v3
4949
with:
5050
# Go mod cache, Linux build cache, Mac build cache, Windows build cache
5151
path: |

.github/workflows/coder.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555

5656
- name: Cache Node
5757
id: cache-node
58-
uses: actions/cache@v2
58+
uses: actions/cache@v3
5959
with:
6060
path: |
6161
**/node_modules
@@ -104,7 +104,7 @@ jobs:
104104

105105
- name: Cache Node
106106
id: cache-node
107-
uses: actions/cache@v2
107+
uses: actions/cache@v3
108108
with:
109109
path: |
110110
**/node_modules
@@ -135,7 +135,7 @@ jobs:
135135
with:
136136
go-version: "^1.17"
137137

138-
- uses: actions/cache@v2
138+
- uses: actions/cache@v3
139139
with:
140140
# Go mod cache, Linux build cache, Mac build cache, Windows build cache
141141
path: |
@@ -248,7 +248,7 @@ jobs:
248248

249249
- name: Cache Node
250250
id: cache-node
251-
uses: actions/cache@v2
251+
uses: actions/cache@v3
252252
with:
253253
path: |
254254
**/node_modules
@@ -308,11 +308,11 @@ jobs:
308308
# https://github.com/coder/coder/issues/384
309309
# - windows-2022
310310
steps:
311-
- uses: actions/checkout@v2
311+
- uses: actions/checkout@v3
312312

313313
- name: Cache Node
314314
id: cache-node
315-
uses: actions/cache@v2
315+
uses: actions/cache@v3
316316
with:
317317
path: |
318318
**/node_modules
@@ -339,7 +339,7 @@ jobs:
339339
with:
340340
install-only: true
341341

342-
- uses: actions/cache@v2
342+
- uses: actions/cache@v3
343343
with:
344344
# Go mod cache, Linux build cache, Mac build cache, Windows build cache
345345
path: |

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
"files.exclude": {
6868
"**/node_modules": true
6969
},
70+
// Ensure files always have a newline.
71+
"files.insertFinalNewline": true,
7072
"go.lintTool": "golangci-lint",
7173
"go.lintFlags": ["--fast"],
7274
"go.lintOnSave": "package",
@@ -85,5 +87,5 @@
8587
},
8688
// We often use a version of TypeScript that's ahead of the version shipped
8789
// with VS Code.
88-
"typescript.tsdk": "./site/node_modules/typescript/lib"
90+
"typescript.tsdk": "./site/node_modules/typescript/lib",
8991
}

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ gen: database/generate peerbroker/proto provisionersdk/proto provisionerd/proto
5151

5252
install: bin
5353
@echo "--- Copying from bin to $(INSTALL_DIR)"
54-
cp -r ./dist/coder_$(GOOS)_$(GOARCH) $(INSTALL_DIR)
54+
cp -r ./dist/coder_$(GOOS)_$(GOARCH)/* $(INSTALL_DIR)
5555
@echo "-- CLI available at $(shell ls $(INSTALL_DIR)/coder*)"
5656
.PHONY: install
5757

@@ -93,7 +93,3 @@ site/out:
9393
# Restores GITKEEP files!
9494
git checkout HEAD site/out
9595
.PHONY: site/out
96-
97-
template/%s:
98-
99-
# Embed Terraform for each platform.

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ require (
6262
github.com/pion/datachannel v1.5.2
6363
github.com/pion/logging v0.2.2
6464
github.com/pion/transport v0.13.0
65-
github.com/pion/webrtc/v3 v3.1.25
65+
github.com/pion/webrtc/v3 v3.1.26
6666
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
6767
github.com/quasilyte/go-ruleguard/dsl v0.3.17
6868
github.com/rs/zerolog v1.26.1
6969
github.com/spf13/cobra v1.4.0
70-
github.com/stretchr/testify v1.7.1-0.20210427113832-6241f9ab9942
70+
github.com/stretchr/testify v1.7.1
7171
github.com/tabbed/pqtype v0.1.1
7272
github.com/unrolled/secure v1.10.0
7373
github.com/urfave/cli/v2 v2.3.0
@@ -80,9 +80,9 @@ require (
8080
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
8181
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
8282
google.golang.org/api v0.73.0
83-
google.golang.org/protobuf v1.27.1
83+
google.golang.org/protobuf v1.28.0
8484
nhooyr.io/websocket v1.8.7
85-
storj.io/drpc v0.0.29
85+
storj.io/drpc v0.0.30
8686
)
8787

8888
require (
@@ -185,7 +185,7 @@ require (
185185
github.com/pion/mdns v0.0.5 // indirect
186186
github.com/pion/randutil v0.1.0 // indirect
187187
github.com/pion/rtcp v1.2.9 // indirect
188-
github.com/pion/rtp v1.7.7 // indirect
188+
github.com/pion/rtp v1.7.9 // indirect
189189
github.com/pion/sctp v1.8.2 // indirect
190190
github.com/pion/sdp/v3 v3.0.4 // indirect
191191
github.com/pion/srtp/v2 v2.0.5 // indirect

go.sum

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,8 +1429,8 @@ github.com/pion/rtcp v1.2.9 h1:1ujStwg++IOLIEoOiIQ2s+qBuJ1VN81KW+9pMPsif+U=
14291429
github.com/pion/rtcp v1.2.9/go.mod h1:qVPhiCzAm4D/rxb6XzKeyZiQK69yJpbUDJSF7TgrqNo=
14301430
github.com/pion/rtp v1.7.0/go.mod h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko=
14311431
github.com/pion/rtp v1.7.4/go.mod h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko=
1432-
github.com/pion/rtp v1.7.7 h1:MzaAfCVicTVxiZpM2o99+YFrKxyRsQ38nnIi4vJPuUY=
1433-
github.com/pion/rtp v1.7.7/go.mod h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko=
1432+
github.com/pion/rtp v1.7.9 h1:17W5Mt2IM3MVfOh7yRfzXbbKXYzBZxV8eG4KKAy+0bg=
1433+
github.com/pion/rtp v1.7.9/go.mod h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko=
14341434
github.com/pion/sctp v1.8.0/go.mod h1:xFe9cLMZ5Vj6eOzpyiKjT9SwGM4KpK/8Jbw5//jc+0s=
14351435
github.com/pion/sctp v1.8.2 h1:yBBCIrUMJ4yFICL3RIvR4eh/H2BTTvlligmSTy+3kiA=
14361436
github.com/pion/sctp v1.8.2/go.mod h1:xFe9cLMZ5Vj6eOzpyiKjT9SwGM4KpK/8Jbw5//jc+0s=
@@ -1448,8 +1448,8 @@ github.com/pion/turn/v2 v2.0.8 h1:KEstL92OUN3k5k8qxsXHpr7WWfrdp7iJZHx99ud8muw=
14481448
github.com/pion/turn/v2 v2.0.8/go.mod h1:+y7xl719J8bAEVpSXBXvTxStjJv3hbz9YFflvkpcGPw=
14491449
github.com/pion/udp v0.1.1 h1:8UAPvyqmsxK8oOjloDk4wUt63TzFe9WEJkg5lChlj7o=
14501450
github.com/pion/udp v0.1.1/go.mod h1:6AFo+CMdKQm7UiA0eUPA8/eVCTx8jBIITLZHc9DWX5M=
1451-
github.com/pion/webrtc/v3 v3.1.25 h1:8bTa2lLI5rszkKCKVO6L9VlKhhmmwMXZ/beSWLwQK14=
1452-
github.com/pion/webrtc/v3 v3.1.25/go.mod h1:BA9hvF1mCu64w/to7nHrSNMxx+zMqVst990zA7xgfCM=
1451+
github.com/pion/webrtc/v3 v3.1.26 h1:KoPw7WtAn+fzozHm/E08qnjSAkHCBlGm4R0DLyPHKYc=
1452+
github.com/pion/webrtc/v3 v3.1.26/go.mod h1:hdduI+Rx0cpGvva18j0gKy/Iak611WPyhUIXs5W/FuI=
14531453
github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
14541454
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
14551455
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
@@ -1652,8 +1652,9 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
16521652
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
16531653
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
16541654
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
1655-
github.com/stretchr/testify v1.7.1-0.20210427113832-6241f9ab9942 h1:t0lM6y/M5IiUZyvbBTcngso8SZEZICH7is9B6g/obVU=
16561655
github.com/stretchr/testify v1.7.1-0.20210427113832-6241f9ab9942/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
1656+
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
1657+
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
16571658
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
16581659
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
16591660
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
@@ -2461,8 +2462,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
24612462
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
24622463
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
24632464
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
2464-
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
24652465
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
2466+
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
2467+
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
24662468
gopkg.in/DataDog/dd-trace-go.v1 v1.34.0/go.mod h1:HtrC65fyJ6lWazShCC9rlOeiTSZJ0XtZhkwjZM2WpC4=
24672469
gopkg.in/DataDog/dd-trace-go.v1 v1.36.0/go.mod h1:Cv0Bzs/zTzzrUDSw8Q+q/vC+uwPD+R530npGo0lfiCE=
24682470
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
@@ -2722,8 +2724,8 @@ sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
27222724
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
27232725
sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck=
27242726
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
2725-
storj.io/drpc v0.0.29 h1:Ihd4ls/JQFr0lctefie3iu+3QM4duccCKr9uMzf4sKY=
2726-
storj.io/drpc v0.0.29/go.mod h1:6rcOyR/QQkSTX/9L5ZGtlZaE2PtXTTZl8d+ulSeeYEg=
2727+
storj.io/drpc v0.0.30 h1:jqPe4T9KEu3CDBI05A2hCMgMSHLtd/E0N0yTF9QreIE=
2728+
storj.io/drpc v0.0.30/go.mod h1:6rcOyR/QQkSTX/9L5ZGtlZaE2PtXTTZl8d+ulSeeYEg=
27272729
zombiezen.com/go/capnproto2 v2.18.0+incompatible/go.mod h1:XO5Pr2SbXgqZwn0m0Ru54QBqpOf4K5AYBO+8LAOBQEQ=
27282730
zombiezen.com/go/capnproto2 v2.18.2+incompatible h1:v3BD1zbruvffn7zjJUU5Pn8nZAB11bhZSQC4W+YnnKo=
27292731
zombiezen.com/go/capnproto2 v2.18.2+incompatible/go.mod h1:XO5Pr2SbXgqZwn0m0Ru54QBqpOf4K5AYBO+8LAOBQEQ=

site/.storybook/preview.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { light, dark } from "../src/theme"
44
import { addDecorator } from "node_modules/@storybook/react"
55
import { createMemoryHistory } from "history"
66
import { unstable_HistoryRouter as HistoryRouter } from "react-router-dom"
7+
import "../src/theme/global-fonts"
78

89
addDecorator(withThemes(ThemeProvider, [light, dark]))
910

site/package.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,20 @@
2323
"typegen": "xstate typegen 'src/**/*.ts'"
2424
},
2525
"dependencies": {
26+
"@fontsource/fira-code": "4.5.5",
27+
"@fontsource/inter": "4.5.4",
2628
"@material-ui/core": "4.9.4",
2729
"@material-ui/icons": "4.5.1",
2830
"@material-ui/lab": "4.0.0-alpha.42",
29-
"@xstate/react": "^2.0.1",
31+
"@xstate/react": "2.0.1",
3032
"axios": "0.26.1",
3133
"formik": "2.2.9",
3234
"history": "5.3.0",
3335
"react": "17.0.2",
3436
"react-dom": "17.0.2",
3537
"react-router-dom": "6.2.2",
3638
"swr": "1.2.2",
37-
"xstate": "^4.30.6",
39+
"xstate": "4.30.6",
3840
"yup": "0.32.11"
3941
},
4042
"devDependencies": {
@@ -47,15 +49,17 @@
4749
"@storybook/react": "6.4.19",
4850
"@testing-library/react": "12.1.4",
4951
"@types/express": "4.17.13",
50-
"@types/jest": "^27.4.1",
52+
"@types/jest": "27.4.1",
5153
"@types/node": "14.18.12",
5254
"@types/react": "17.0.40",
5355
"@types/react-dom": "17.0.13",
5456
"@types/superagent": "4.1.15",
5557
"@typescript-eslint/eslint-plugin": "5.15.0",
5658
"@typescript-eslint/parser": "5.15.0",
57-
"@xstate/cli": "^0.1.4",
59+
"@xstate/cli": "0.1.4",
5860
"copy-webpack-plugin": "10.2.4",
61+
"css-loader": "6.7.1",
62+
"css-minimizer-webpack-plugin": "3.4.1",
5963
"eslint": "8.11.0",
6064
"eslint-config-prettier": "8.5.0",
6165
"eslint-import-resolver-alias": "1.1.2",
@@ -71,10 +75,12 @@
7175
"jest": "27.5.1",
7276
"jest-junit": "13.0.0",
7377
"jest-runner-eslint": "1.0.0",
74-
"msw": "^0.39.2",
78+
"mini-css-extract-plugin": "2.6.0",
79+
"msw": "0.39.2",
7580
"prettier": "2.6.0",
7681
"react-hot-loader": "4.13.0",
7782
"sql-formatter": "4.0.2",
83+
"style-loader": "3.3.1",
7884
"ts-jest": "27.1.3",
7985
"ts-loader": "9.2.8",
8086
"ts-node": "10.7.0",

site/src/app.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { WorkspacePage } from "./pages/workspaces/[workspace]"
1616
import { HealthzPage } from "./pages/healthz"
1717
import { AuthAndNav, RequireAuth } from "./components/Page"
1818
import { XServiceProvider } from "./xServices/StateContext"
19+
import "./theme/global-fonts"
1920

2021
export const App: React.FC = () => {
2122
return (

site/src/theme/global-fonts.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Monospace fonts used for code, button styles, and banners
2+
import "@fontsource/fira-code/400.css"
3+
import "@fontsource/fira-code/600.css"
4+
// Main body copy font
5+
import "@fontsource/inter/300.css"
6+
import "@fontsource/inter/400.css"
7+
import "@fontsource/inter/600.css"

site/webpack.dev.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import { commonWebpackConfig } from "./webpack.common"
1010

1111
const commonPlugins = commonWebpackConfig.plugins || []
1212

13+
const commonRules = commonWebpackConfig.module?.rules || []
14+
1315
const config: Configuration = {
1416
...commonWebpackConfig,
1517

@@ -68,6 +70,20 @@ const config: Configuration = {
6870
// https://webpack.js.org/configuration/mode/#mode-development
6971
mode: "development",
7072

73+
module: {
74+
rules: [
75+
...commonRules,
76+
77+
{
78+
test: /\.css$/i,
79+
// Use simple style-loader for CSS modules. This places styles directly
80+
// in <style> tags which is great for development, but poor for loading
81+
// in production
82+
use: ["style-loader", "css-loader"],
83+
},
84+
],
85+
},
86+
7187
output: {
7288
...commonWebpackConfig.output,
7389

site/webpack.prod.ts

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,46 @@
22
* @fileoverview This file contains a production configuration for webpack
33
* meant for producing optimized builds.
44
*/
5-
65
import CopyWebpackPlugin from "copy-webpack-plugin"
6+
import CSSMinimizerPlugin from "css-minimizer-webpack-plugin"
7+
import MiniCSSExtractPlugin from "mini-css-extract-plugin"
78
import { Configuration } from "webpack"
89
import { commonWebpackConfig } from "./webpack.common"
910

1011
const commonPlugins = commonWebpackConfig.plugins || []
1112

13+
const commonRules = commonWebpackConfig.module?.rules || []
14+
1215
export const config: Configuration = {
1316
...commonWebpackConfig,
17+
1418
mode: "production",
1519

1620
// Don't produce sourcemaps in production, to minmize bundle size
1721
devtool: false,
1822

23+
module: {
24+
rules: [
25+
...commonRules,
26+
// CSS files -> optimized
27+
{
28+
test: /\.css$/i,
29+
use: [MiniCSSExtractPlugin.loader, "css-loader"],
30+
},
31+
],
32+
},
33+
34+
optimization: {
35+
minimizer: [
36+
`...`, // This extends the 'default'/'existing' minimizers
37+
new CSSMinimizerPlugin(),
38+
],
39+
},
40+
1941
output: {
2042
...commonWebpackConfig.output,
2143

22-
// regenerate the entire out/ directory when producing production builds
44+
// regenerate the entire dist/ directory when producing production builds
2345
clean: true,
2446
},
2547

@@ -30,6 +52,13 @@ export const config: Configuration = {
3052
new CopyWebpackPlugin({
3153
patterns: [{ from: "static", to: "." }],
3254
}),
55+
56+
// MiniCSSExtractPlugin optimizes CSS
57+
new MiniCSSExtractPlugin({
58+
// REMARK: It's important to use [contenthash] here to invalidate caches.
59+
filename: "[name].[contenthash].css",
60+
chunkFilename: "[id].css",
61+
}),
3362
],
3463
}
3564

0 commit comments

Comments
 (0)