From 3ead33205f84fec8177ee451340066d9bc645343 Mon Sep 17 00:00:00 2001 From: Bryan Phelps Date: Tue, 1 Feb 2022 17:50:32 +0000 Subject: [PATCH 1/4] refactor: Move package.json and other front-end collateral into site/ --- .github/workflows/coder.yaml | 5 +- .gitignore | 5 +- Makefile | 4 +- .eslintignore => site/.eslintignore | 5 +- .eslintrc.yaml => site/.eslintrc.yaml | 0 .prettierignore => site/.prettierignore | 5 +- .prettierrc => site/.prettierrc | 0 {_jest => site/_jest}/setupTests.ts | 3 + site/components/ErrorSummary/index.tsx | 7 +- .../jest-runner.eslint.config.js | 0 jest.config.js => site/jest.config.js | 29 +-- package.json => site/package.json | 8 +- .../[organization]/[project]/index.tsx | 4 +- site/tsconfig.json | 6 +- tsconfig.json => site/tsconfig.test.json | 2 + site/util/array.test.ts | 6 +- site/util/array.ts | 8 +- yarn.lock => site/yarn.lock | 170 +++++++++--------- 18 files changed, 147 insertions(+), 120 deletions(-) rename .eslintignore => site/.eslintignore (88%) rename .eslintrc.yaml => site/.eslintrc.yaml (100%) rename .prettierignore => site/.prettierignore (93%) rename .prettierrc => site/.prettierrc (100%) rename {_jest => site/_jest}/setupTests.ts (82%) rename jest-runner.eslint.config.js => site/jest-runner.eslint.config.js (100%) rename jest.config.js => site/jest.config.js (56%) rename package.json => site/package.json (92%) rename tsconfig.json => site/tsconfig.test.json (74%) rename yarn.lock => site/yarn.lock (97%) diff --git a/.github/workflows/coder.yaml b/.github/workflows/coder.yaml index b63e0819419e2..33059583343b8 100644 --- a/.github/workflows/coder.yaml +++ b/.github/workflows/coder.yaml @@ -194,15 +194,18 @@ jobs: node-version: "14" - run: yarn install + working-directory: site - run: yarn build + working-directory: site - run: yarn test:coverage + working-directory: site - uses: codecov/codecov-action@v2 if: github.actor != 'dependabot[bot]' with: token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage/lcov.info + files: ./site/coverage/lcov.info flags: unittest-js fail_ci_if_error: true diff --git a/.gitignore b/.gitignore index be7d7fa45bb86..934e82ea3b8e1 100644 --- a/.gitignore +++ b/.gitignore @@ -16,9 +16,12 @@ yarn-error.log # Front-end ignore .next/ +site/.eslintcache site/.next/ +site/node_modules/ +site/yarn-error.log coverage/ # Build bin/ -site/out/ \ No newline at end of file +site/out/ diff --git a/Makefile b/Makefile index 7ae274ddf8086..88b0a52ba5b3d 100644 --- a/Makefile +++ b/Makefile @@ -74,6 +74,6 @@ provisionersdk/proto: provisionersdk/proto/provisioner.proto .PHONY: provisionersdk/proto site/out: - yarn build - yarn export + cd site && yarn build + cd site && yarn export .PHONY: site/out \ No newline at end of file diff --git a/.eslintignore b/site/.eslintignore similarity index 88% rename from .eslintignore rename to site/.eslintignore index 415b30504d02c..37ef71725b81c 100644 --- a/.eslintignore +++ b/site/.eslintignore @@ -2,4 +2,7 @@ # COPY PASTA OF .gitignore ############################################################################### node_modules -vendor \ No newline at end of file +vendor +out +coverage +.next \ No newline at end of file diff --git a/.eslintrc.yaml b/site/.eslintrc.yaml similarity index 100% rename from .eslintrc.yaml rename to site/.eslintrc.yaml diff --git a/.prettierignore b/site/.prettierignore similarity index 93% rename from .prettierignore rename to site/.prettierignore index 5aa7a67dd022c..14828404a51b1 100644 --- a/.prettierignore +++ b/site/.prettierignore @@ -12,6 +12,5 @@ yarn-error.log # Front-end ignore .next/ -site/.next/ -site/out/ -coverage/ \ No newline at end of file +coverage/ +out/ diff --git a/.prettierrc b/site/.prettierrc similarity index 100% rename from .prettierrc rename to site/.prettierrc diff --git a/_jest/setupTests.ts b/site/_jest/setupTests.ts similarity index 82% rename from _jest/setupTests.ts rename to site/_jest/setupTests.ts index a1b73e2f52651..5f2c86f457e2a 100644 --- a/_jest/setupTests.ts +++ b/site/_jest/setupTests.ts @@ -5,3 +5,6 @@ // Set up 'next-router-mock' to with our front-end tests: // https://github.com/scottrippey/next-router-mock#quick-start jest.mock("next/router", () => require("next-router-mock")) + +// Suppress isolated modules warning +export {} diff --git a/site/components/ErrorSummary/index.tsx b/site/components/ErrorSummary/index.tsx index d2b72c90b39ba..13555dcd996dd 100644 --- a/site/components/ErrorSummary/index.tsx +++ b/site/components/ErrorSummary/index.tsx @@ -1,10 +1,15 @@ import React from "react" export interface ErrorSummaryProps { - error: Error + error: Error | undefined } export const ErrorSummary: React.FC = ({ error }) => { // TODO: More interesting error page + + if (typeof error === "undefined") { + return
{"Unknown error"}
+ } + return
{error.toString()}
} diff --git a/jest-runner.eslint.config.js b/site/jest-runner.eslint.config.js similarity index 100% rename from jest-runner.eslint.config.js rename to site/jest-runner.eslint.config.js diff --git a/jest.config.js b/site/jest.config.js similarity index 56% rename from jest.config.js rename to site/jest.config.js index 8008e257904ac..5b19fd4383125 100644 --- a/jest.config.js +++ b/site/jest.config.js @@ -1,10 +1,15 @@ module.exports = { projects: [ { + globals: { + "ts-jest": { + tsconfig: "tsconfig.test.json", + }, + }, coverageReporters: ["text", "lcov"], displayName: "test", preset: "ts-jest", - roots: ["/site"], + roots: [""], setupFilesAfterEnv: ["/_jest/setupTests.ts"], transform: { "^.+\\.tsx?$": "ts-jest", @@ -17,20 +22,20 @@ module.exports = { { displayName: "lint", runner: "jest-runner-eslint", - testMatch: ["/site/**/*.js", "/site/**/*.ts", "/site/**/*.tsx"], + testMatch: ["/**/*.js", "/**/*.ts", "/**/*.tsx"], testPathIgnorePatterns: ["/.next/", "/out/"], }, ], collectCoverageFrom: [ - "/site/**/*.js", - "/site/**/*.ts", - "/site/**/*.tsx", - "!/site/**/*.stories.tsx", - "!/site/.next/**/*.*", - "!/site/api.ts", - "!/site/dev.ts", - "!/site/next-env.d.ts", - "!/site/next.config.js", - "!/site/out/**/*.*", + "/**/*.js", + "/**/*.ts", + "/**/*.tsx", + "!/**/*.stories.tsx", + "!/.next/**/*.*", + "!/api.ts", + "!/dev.ts", + "!/next-env.d.ts", + "!/next.config.js", + "!/out/**/*.*", ], } diff --git a/package.json b/site/package.json similarity index 92% rename from package.json rename to site/package.json index 704025278ae6c..5fa74089f4f6a 100644 --- a/package.json +++ b/site/package.json @@ -4,10 +4,10 @@ "repository": "https://github.com/coder/coder", "private": true, "scripts": { - "build": "NODE_ENV=production next build site", - "build:dev": "next build site", - "dev": "ts-node site/dev.ts", - "export": "next export site", + "build": "NODE_ENV=production next build", + "build:dev": "next build", + "dev": "ts-node dev.ts", + "export": "next export", "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}' && sql-formatter -l postgresql ./database/query.sql -o ./database/query.sql", "lint": "jest --selectProjects lint", diff --git a/site/pages/projects/[organization]/[project]/index.tsx b/site/pages/projects/[organization]/[project]/index.tsx index c011798f50ffd..c8ea27f58427a 100644 --- a/site/pages/projects/[organization]/[project]/index.tsx +++ b/site/pages/projects/[organization]/[project]/index.tsx @@ -78,8 +78,8 @@ const ProjectPage: React.FC = () => {
{ describe("firstOrItem", () => { it("returns null if empty array", () => { - expect(firstOrItem([])).toBeNull() + expect(firstOrItem([], null)).toBeNull() }) it("returns first item if array with more one item", () => { - expect(firstOrItem(["a", "b"])).toEqual("a") + expect(firstOrItem(["a", "b"], "c")).toEqual("a") }) it("returns item if single item", () => { - expect(firstOrItem("c")).toEqual("c") + expect(firstOrItem("c", "d")).toEqual("c") }) }) }) diff --git a/site/util/array.ts b/site/util/array.ts index 6be0442bc4ac4..6fbe0fe8b0593 100644 --- a/site/util/array.ts +++ b/site/util/array.ts @@ -4,9 +4,13 @@ * - If an array with 1 or more elements, returns the first element * - If a single item, returns that item */ -export const firstOrItem = (itemOrItems: T | T[]): T | null => { +export const firstOrItem = (itemOrItems: undefined | T | T[], defaults: T): T => { if (Array.isArray(itemOrItems)) { - return itemOrItems.length > 0 ? itemOrItems[0] : null + return itemOrItems.length > 0 ? itemOrItems[0] : defaults + } + + if (typeof itemOrItems === "undefined") { + return defaults } return itemOrItems diff --git a/yarn.lock b/site/yarn.lock similarity index 97% rename from yarn.lock rename to site/yarn.lock index 47742291527fd..4d687a8cad6e6 100644 --- a/yarn.lock +++ b/site/yarn.lock @@ -22,19 +22,19 @@ integrity sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q== "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.8.0": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.7.tgz#db990f931f6d40cb9b87a0dc7d2adc749f1dcbcf" - integrity sha512-aeLaqcqThRNZYmbMqtulsetOQZ/5gbR/dWruUCJcpas4Qoyy+QeagfDsPdMrqwsPRDNxJvBlRiZxxX7THO7qtA== + version "7.16.12" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.12.tgz#5edc53c1b71e54881315923ae2aedea2522bb784" + integrity sha512-dK5PtG1uiN2ikk++5OzSYsitZKny4wOCD0nrO4TqnW4BVBTQ2NGS3NgilvT/TEyxTST7LNyWV/T4tXDoD3fOgg== dependencies: "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.16.7" + "@babel/generator" "^7.16.8" "@babel/helper-compilation-targets" "^7.16.7" "@babel/helper-module-transforms" "^7.16.7" "@babel/helpers" "^7.16.7" - "@babel/parser" "^7.16.7" + "@babel/parser" "^7.16.12" "@babel/template" "^7.16.7" - "@babel/traverse" "^7.16.7" - "@babel/types" "^7.16.7" + "@babel/traverse" "^7.16.10" + "@babel/types" "^7.16.8" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -42,7 +42,7 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.16.7", "@babel/generator@^7.16.8", "@babel/generator@^7.7.2": +"@babel/generator@^7.16.8", "@babel/generator@^7.7.2": version "7.16.8" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.8.tgz#359d44d966b8cd059d543250ce79596f792f2ebe" integrity sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw== @@ -151,18 +151,18 @@ "@babel/types" "^7.16.7" "@babel/highlight@^7.10.4", "@babel/highlight@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.7.tgz#81a01d7d675046f0d96f82450d9d9578bdfd6b0b" - integrity sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw== + version "7.16.10" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" + integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw== dependencies: "@babel/helper-validator-identifier" "^7.16.7" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.16.8": - version "7.16.8" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.8.tgz#61c243a3875f7d0b0962b0543a33ece6ff2f1f17" - integrity sha512-i7jDUfrVBWc+7OKcBzEe5n7fbv3i2fWtxKzzCvOjnzSxMfWMigAhtfJ7qzZNGFNMsCCd67+uz553dYKWXPvCKw== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.10", "@babel/parser@^7.16.12", "@babel/parser@^7.16.7": + version "7.16.12" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.12.tgz#9474794f9a650cf5e2f892444227f98e28cdf8b6" + integrity sha512-VfaV15po8RiZssrkPweyvbGVSe4x2y+aciFCgn0n0/SJMR22cwofRV1mtnJQYcSB1wUTaA/X1LnA3es66MCO5A== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -279,10 +279,10 @@ "@babel/parser" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/traverse@^7.16.7", "@babel/traverse@^7.7.2": - version "7.16.8" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.8.tgz#bab2f2b09a5fe8a8d9cad22cbfe3ba1d126fef9c" - integrity sha512-xe+H7JlvKsDQwXRsBhSnq1/+9c+LlQcCK3Tn/l5sbx02HYns/cn7ibp9+RV1sIUqu7hKg91NWsgHurO9dowITQ== +"@babel/traverse@^7.16.10", "@babel/traverse@^7.16.7", "@babel/traverse@^7.7.2": + version "7.16.10" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.10.tgz#448f940defbe95b5a8029975b051f75993e8239f" + integrity sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw== dependencies: "@babel/code-frame" "^7.16.7" "@babel/generator" "^7.16.8" @@ -290,7 +290,7 @@ "@babel/helper-function-name" "^7.16.7" "@babel/helper-hoist-variables" "^7.16.7" "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.16.8" + "@babel/parser" "^7.16.10" "@babel/types" "^7.16.8" debug "^4.1.0" globals "^11.1.0" @@ -722,9 +722,9 @@ "@sinonjs/commons" "^1.7.0" "@testing-library/dom@^8.0.0": - version "8.11.1" - resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.11.1.tgz#03fa2684aa09ade589b460db46b4c7be9fc69753" - integrity sha512-3KQDyx9r0RKYailW2MiYrSSKEfH0GTkI51UGEvJenvcoDoeRYs0PZpi2SXqtnMClQvCqdtTTpOfFETDTVADpAg== + version "8.11.3" + resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.11.3.tgz#38fd63cbfe14557021e88982d931e33fb7c1a808" + integrity sha512-9LId28I+lx70wUiZjLvi1DB/WT2zGOxUh46glrSNMaWVx849kKAluezVzZrXJfTKKoQTmEOutLes/bHg4Bj3aA== dependencies: "@babel/code-frame" "^7.10.4" "@babel/runtime" "^7.12.5" @@ -907,9 +907,9 @@ integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== "@types/node@*": - version "17.0.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.8.tgz#50d680c8a8a78fe30abe6906453b21ad8ab0ad7b" - integrity sha512-YofkM6fGv4gDJq78g4j0mMuGMkZVxZDgtU0JRdx6FgiJDG+0fY0GKVolOV8WqVmEhLCXkQRjwDdKyPxJp/uucg== + version "17.0.14" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.14.tgz#33b9b94f789a8fedd30a68efdbca4dbb06b61f20" + integrity sha512-SbjLmERksKOGzWzPNuW7fJM7fk3YXVTFiZWB/Hs99gwhk+/dnrQRPBQjPW9aO+fi1tAffi9PrwFvsmOKmDTyng== "@types/node@14.18.9": version "14.18.9" @@ -1046,23 +1046,23 @@ "@typescript-eslint/types" "4.33.0" "@typescript-eslint/visitor-keys" "4.33.0" -"@typescript-eslint/scope-manager@5.10.1": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.1.tgz#f0539c73804d2423506db2475352a4dec36cd809" - integrity sha512-Lyvi559Gvpn94k7+ElXNMEnXu/iundV5uFmCUNnftbFrUbAJ1WBoaGgkbOBm07jVZa682oaBU37ao/NGGX4ZDg== +"@typescript-eslint/scope-manager@5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.2.tgz#92c0bc935ec00f3d8638cdffb3d0e70c9b879639" + integrity sha512-39Tm6f4RoZoVUWBYr3ekS75TYgpr5Y+X0xLZxXqcZNDWZdJdYbKd3q2IR4V9y5NxxiPu/jxJ8XP7EgHiEQtFnw== dependencies: - "@typescript-eslint/types" "5.10.1" - "@typescript-eslint/visitor-keys" "5.10.1" + "@typescript-eslint/types" "5.10.2" + "@typescript-eslint/visitor-keys" "5.10.2" "@typescript-eslint/types@4.33.0": version "4.33.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== -"@typescript-eslint/types@5.10.1": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.1.tgz#dca9bd4cb8c067fc85304a31f38ec4766ba2d1ea" - integrity sha512-ZvxQ2QMy49bIIBpTqFiOenucqUyjTQ0WNLhBM6X1fh1NNlYAC6Kxsx8bRTY3jdYsYg44a0Z/uEgQkohbR0H87Q== +"@typescript-eslint/types@5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.2.tgz#604d15d795c4601fffba6ecb4587ff9fdec68ce8" + integrity sha512-Qfp0qk/5j2Rz3p3/WhWgu4S1JtMcPgFLnmAKAW061uXxKSa7VWKZsDXVaMXh2N60CX9h6YLaBoy9PJAfCOjk3w== "@typescript-eslint/typescript-estree@4.33.0": version "4.33.0" @@ -1077,13 +1077,13 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.10.1": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.1.tgz#b268e67be0553f8790ba3fe87113282977adda15" - integrity sha512-PwIGnH7jIueXv4opcwEbVGDATjGPO1dx9RkUl5LlHDSe+FXxPwFL5W/qYd5/NHr7f6lo/vvTrAzd0KlQtRusJQ== +"@typescript-eslint/typescript-estree@5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.2.tgz#810906056cd3ddcb35aa333fdbbef3713b0fe4a7" + integrity sha512-WHHw6a9vvZls6JkTgGljwCsMkv8wu8XU8WaYKeYhxhWXH/atZeiMW6uDFPLZOvzNOGmuSMvHtZKd6AuC8PrwKQ== dependencies: - "@typescript-eslint/types" "5.10.1" - "@typescript-eslint/visitor-keys" "5.10.1" + "@typescript-eslint/types" "5.10.2" + "@typescript-eslint/visitor-keys" "5.10.2" debug "^4.3.2" globby "^11.0.4" is-glob "^4.0.3" @@ -1091,14 +1091,14 @@ tsutils "^3.21.0" "@typescript-eslint/utils@^5.10.0": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.1.tgz#fa682a33af47080ba2c4368ee0ad2128213a1196" - integrity sha512-RRmlITiUbLuTRtn/gcPRi4202niF+q7ylFLCKu4c+O/PcpRvZ/nAUwQ2G00bZgpWkhrNLNnvhZLbDn8Ml0qsQw== + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.2.tgz#1fcd37547c32c648ab11aea7173ec30060ee87a8" + integrity sha512-vuJaBeig1NnBRkf7q9tgMLREiYD7zsMrsN1DA3wcoMDvr3BTFiIpKjGiYZoKPllfEwN7spUjv7ZqD+JhbVjEPg== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.10.1" - "@typescript-eslint/types" "5.10.1" - "@typescript-eslint/typescript-estree" "5.10.1" + "@typescript-eslint/scope-manager" "5.10.2" + "@typescript-eslint/types" "5.10.2" + "@typescript-eslint/typescript-estree" "5.10.2" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -1110,12 +1110,12 @@ "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" -"@typescript-eslint/visitor-keys@5.10.1": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.1.tgz#29102de692f59d7d34ecc457ed59ab5fc558010b" - integrity sha512-NjQ0Xinhy9IL979tpoTRuLKxMc0zJC7QVSdeerXs2/QvOy2yRkzX5dRb10X5woNUdJgU8G3nYRDlI33sq1K4YQ== +"@typescript-eslint/visitor-keys@5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.2.tgz#fdbf272d8e61c045d865bd6c8b41bea73d222f3d" + integrity sha512-zHIhYGGGrFJvvyfwHk5M08C5B5K4bewkm+rrvNTKk1/S15YHR+SA/QUF8ZWscXSfEaB8Nn2puZj+iHcoxVOD/Q== dependencies: - "@typescript-eslint/types" "5.10.1" + "@typescript-eslint/types" "5.10.2" eslint-visitor-keys "^3.0.0" abab@^2.0.3, abab@^2.0.5: @@ -1327,9 +1327,9 @@ asynckit@^0.4.0: integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= axe-core@^4.3.5: - version "4.3.5" - resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.3.5.tgz#78d6911ba317a8262bfee292aeafcc1e04b49cc5" - integrity sha512-WKTW1+xAzhMS5dJsxWkliixlO/PqC4VhmO9T4juNYcaTg9jzWiJsou6m5pxWYGfigWbwzJWeFY6z47a+4neRXA== + version "4.4.0" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.4.0.tgz#f93be7f81017eb8bedeb1859cc8092cc918d2dc8" + integrity sha512-btWy2rze3NnxSSxb7LtNhPYYFrRoFBfjiGzmSc/5Hu47wApO2KNXjP/w7Nv2Uz/Fyr/pfEiwOkcXhDxu0jz5FA== axobject-query@^2.2.0: version "2.2.0" @@ -1497,9 +1497,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001267, caniuse-lite@^1.0.30001283, caniuse-lite@^1.0.30001286: - version "1.0.30001303" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001303.tgz#9b168e4f43ccfc372b86f4bc5a551d9b909c95c9" - integrity sha512-/Mqc1oESndUNszJP0kx0UaQU9kEv9nNtJ7Kn8AdA0mNnH8eR1cj0kG+NbNuC1Wq/b21eA8prhKRA3bbkjONegQ== + version "1.0.30001304" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001304.tgz#38af55ed3fc8220cb13e35e6e7309c8c65a05559" + integrity sha512-bdsfZd6K6ap87AGqSHJP/s1V+U6Z5lyrcbBu3ovbCCf8cSYpwTtGrCBObMpJqwxfTbLW6YTIdbb1jEeTelcpYQ== chalk@^2.0.0: version "2.4.2" @@ -1631,14 +1631,14 @@ cookie@0.4.1: integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== core-js-pure@^3.20.2: - version "3.20.3" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.20.3.tgz#6cc4f36da06c61d95254efc54024fe4797fd5d02" - integrity sha512-Q2H6tQ5MtPtcC7f3HxJ48i4Q7T9ybPKgvWyuH7JXIoNa2pm0KuBnycsET/qw1SLLZYfbsbrZQNMeIOClb+6WIA== + version "3.21.0" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.21.0.tgz#819adc8dfb808205ce25b51d50591becd615db7e" + integrity sha512-VaJUunCZLnxuDbo1rNOzwbet9E1K9joiXS5+DQMPtgxd24wfsZbJZMMfQLGYMlCUvSxLfsRUUhoOR2x28mFfeg== core-js@^3.16.2: - version "3.20.3" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.20.3.tgz#c710d0a676e684522f3db4ee84e5e18a9d11d69a" - integrity sha512-vVl8j8ph6tRS3B8qir40H7yw7voy17xL0piAjlbBUsH7WIfzoedL/ZOr1OV9FyZQLWXsayOJyV4tnRyXR85/ag== + version "3.21.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.21.0.tgz#f479dbfc3dffb035a0827602dd056839a774aa71" + integrity sha512-YUdI3fFu4TF/2WykQ2xzSiTQdldLB4KVuL9WeAy5XONZYt5Cun/fpQvctoKbCgvPhmzADeesTk/j2Rdx77AcKQ== cosmiconfig@^6.0.0: version "6.0.0" @@ -1828,9 +1828,9 @@ doctrine@^3.0.0: esutils "^2.0.2" dom-accessibility-api@^0.5.9: - version "0.5.10" - resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.10.tgz#caa6d08f60388d0bb4539dd75fe458a9a1d0014c" - integrity sha512-Xu9mD0UjrJisTmv7lmVSDMagQcU9R5hwAbxsaAE/35XPnPLJobbuREfV/rraiSaEj/UOvgrzQs66zyTWTlyd+g== + version "0.5.11" + resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.11.tgz#79d5846c4f90eba3e617d9031e921de9324f84ed" + integrity sha512-7X6GvzjYf4yTdRKuCVScV+aA9Fvh5r8WzWrXBH9w82ZWB/eYDMGCnazoC/YAqAzUJWHzLOnZqr46K3iEyUhUvw== dom-helpers@^5.0.1: version "5.2.1" @@ -1860,9 +1860,9 @@ ee-first@1.1.1: integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= electron-to-chromium@^1.4.17: - version "1.4.44" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.44.tgz#8a41923afdd6ef5ddabe001626036ba5d1d64ae6" - integrity sha512-tHGWiUUmY7GABK8+DNcr474cnZDTzD8x1736SlDosVH8+/vRJeqfaIBAEHFtMjddz/0T4rKKYsxEc8BwQRdBpw== + version "1.4.59" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.59.tgz#657f2588c048fb95975779f8fea101fad854de89" + integrity sha512-AOJ3cAE0TWxz4fQ9zkND5hWrQg16nsZKVz9INOot1oV//u4wWu5xrj9CQMmPTYskkZRunSRc9sAnr4EkexXokg== emittery@^0.8.1: version "0.8.1" @@ -2008,9 +2008,9 @@ eslint-import-resolver-typescript@2.5.0: tsconfig-paths "^3.9.0" eslint-module-utils@^2.7.2: - version "2.7.2" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.2.tgz#1d0aa455dcf41052339b63cada8ab5fd57577129" - integrity sha512-zquepFnWCY2ISMFwD/DqzaM++H+7PDzOpUvotJWm/y1BAFt5R4oeULgdrTejKqLkz7MA/tgstsUMNYc7wNdTrg== + version "2.7.3" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz#ad7e3a10552fdd0642e1e55292781bd6e34876ee" + integrity sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ== dependencies: debug "^3.2.7" find-up "^2.1.0" @@ -2404,9 +2404,9 @@ flat-cache@^3.0.4: rimraf "^3.0.2" flatted@^3.1.0: - version "3.2.4" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2" - integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== + version "3.2.5" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" + integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== follow-redirects@^1.0.0: version "1.14.7" @@ -2751,7 +2751,7 @@ is-callable@^1.1.4, is-callable@^1.2.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== -is-core-module@^2.2.0, is-core-module@^2.8.0: +is-core-module@^2.2.0, is-core-module@^2.8.0, is-core-module@^2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== @@ -4015,9 +4015,9 @@ picomatch@^2.0.4, picomatch@^2.2.3: integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== pirates@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.4.tgz#07df81e61028e402735cdd49db701e4885b4e6e6" - integrity sha512-ZIrVPH+A52Dw84R0L3/VS9Op04PuQ2SEoJL6bkshmiTic/HldyW9Tf7oH5mhJZBK7NmDx27vSMrYEXPXclpDKw== + version "4.0.5" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" + integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== pkg-dir@^4.2.0: version "4.2.0" @@ -4232,11 +4232,11 @@ resolve.exports@^1.1.0: integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== resolve@^1.20.0: - version "1.21.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.21.0.tgz#b51adc97f3472e6a5cf4444d34bc9d6b9037591f" - integrity sha512-3wCbTpk5WJlyE4mSOtDLhqQmGFi0/TD9VPwmiolnk8U0wRgMEktqCXd3vy5buTO3tljvalNvKrjHEfrd2WpEKA== + version "1.22.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" + integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== dependencies: - is-core-module "^2.8.0" + is-core-module "^2.8.1" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" From a8600ffbffdb6e6a2a9185c3f5dea07976a3c567 Mon Sep 17 00:00:00 2001 From: Bryan Phelps Date: Tue, 1 Feb 2022 21:18:02 +0000 Subject: [PATCH 2/4] Fix lint/format jobs for front-end --- .github/workflows/coder.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/coder.yaml b/.github/workflows/coder.yaml index 33059583343b8..cfc7cab5d92fb 100644 --- a/.github/workflows/coder.yaml +++ b/.github/workflows/coder.yaml @@ -61,9 +61,11 @@ jobs: - name: Install node_modules run: yarn install + working-directory: site - name: "yarn lint" run: yarn lint + working-directory: site gen: name: "style/gen" @@ -113,6 +115,7 @@ jobs: - name: Install node_modules run: yarn install + working-directory: site - name: "make ${{ matrix.style }}" run: "make --output-sync -j ${{ matrix.style }}" From f2158088cc7b1615763f3470296f97f717cb5bc4 Mon Sep 17 00:00:00 2001 From: Bryan Phelps Date: Tue, 1 Feb 2022 21:22:57 +0000 Subject: [PATCH 3/4] Fix format command in makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 88b0a52ba5b3d..4e2fa04949ce5 100644 --- a/Makefile +++ b/Makefile @@ -26,9 +26,9 @@ fmt/prettier: @echo "--- prettier" # Avoid writing files in CI to reduce file write activity ifdef CI - yarn run format:check + cd site && yarn run format:check else - yarn run format:write + cd site && yarn run format:write endif .PHONY: fmt/prettier From e62914c2d5168abcc06a85580249a4522cbdaeae Mon Sep 17 00:00:00 2001 From: Bryan Phelps Date: Tue, 1 Feb 2022 21:28:36 +0000 Subject: [PATCH 4/4] Formatting --- site/.eslintrc.yaml | 3 +-- site/jest.config.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/site/.eslintrc.yaml b/site/.eslintrc.yaml index f9ef172e06a86..5f8386529919a 100644 --- a/site/.eslintrc.yaml +++ b/site/.eslintrc.yaml @@ -18,8 +18,7 @@ parser: "@typescript-eslint/parser" parserOptions: ecmaVersion: 2018 project: - - "./tsconfig.json" - - "./site/tsconfig.json" + - "./tsconfig.test.json" sourceType: module ecmaFeatures: jsx: true diff --git a/site/jest.config.js b/site/jest.config.js index 5b19fd4383125..2a223276c0c93 100644 --- a/site/jest.config.js +++ b/site/jest.config.js @@ -23,7 +23,7 @@ module.exports = { displayName: "lint", runner: "jest-runner-eslint", testMatch: ["/**/*.js", "/**/*.ts", "/**/*.tsx"], - testPathIgnorePatterns: ["/.next/", "/out/"], + testPathIgnorePatterns: ["/.next/", "/out/", "/_jest/", "jest.config.js", "jest-runner.*.js", "next.config.js"], }, ], collectCoverageFrom: [