Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
jobs:
build:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

Expand All @@ -19,6 +20,7 @@ jobs:
*/node_modules
*/dist
client/lib
components/lib
key: ${{ runner.os }}-build-${{ hashFiles('common/config/rush/repo-state.json', '.github/workflows/ci-salt.txt') }}
# Only need a cache hit or miss,
# cached dependencies aren't used until following jobs
Expand Down Expand Up @@ -51,4 +53,5 @@ jobs:
*/node_modules
*/dist
client/lib
components/lib
key: ${{ steps.restore-build-cache.outputs.cache-primary-key }}
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
jobs:
deploy:
runs-on: ubuntu-22.04
timeout-minutes: 10
environment:
name: ${{ inputs.environment }}
url: ${{ inputs.url }}
Expand All @@ -29,6 +30,7 @@ jobs:
*/node_modules
*/dist
client/lib
components/lib
key: ${{ runner.os }}-build-${{ hashFiles('common/config/rush/repo-state.json', '.github/workflows/ci-salt.txt') }}
fail-on-cache-miss: true

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
jobs:
e2e-test:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

Expand All @@ -19,6 +20,7 @@ jobs:
*/node_modules
*/dist
client/lib
components/lib
key: ${{ runner.os }}-build-${{ hashFiles('common/config/rush/repo-state.json', '.github/workflows/ci-salt.txt') }}
fail-on-cache-miss: true

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
jobs:
install:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
jobs:
lint:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

Expand All @@ -19,6 +20,7 @@ jobs:
*/node_modules
*/dist
client/lib
components/lib
key: ${{ runner.os }}-build-${{ hashFiles('common/config/rush/repo-state.json', '.github/workflows/ci-salt.txt') }}
fail-on-cache-miss: true

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/type-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
jobs:
type-check:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

Expand All @@ -19,6 +20,7 @@ jobs:
*/node_modules
*/dist
client/lib
components/lib
key: ${{ runner.os }}-build-${{ hashFiles('common/config/rush/repo-state.json', '.github/workflows/ci-salt.txt') }}
fail-on-cache-miss: true

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
jobs:
unit-test:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

Expand All @@ -19,6 +20,7 @@ jobs:
*/node_modules
*/dist
client/lib
components/lib
key: ${{ runner.os }}-build-${{ hashFiles('common/config/rush/repo-state.json', '.github/workflows/ci-salt.txt') }}
fail-on-cache-miss: true

Expand Down
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"eslint.workingDirectories": [
"client",
"components",
"deploy",
"discord",
"eslint-config-jest",
Expand All @@ -10,7 +11,8 @@
"eslint-config",
"jest-stdout-reporter",
"markdownlint-config",
"scaffold"
"scaffold",
"typescript"
],
"files.associations": {
"rush.json": "jsonc",
Expand Down
23 changes: 13 additions & 10 deletions client/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@ export default {
env: {
test: {
plugins: [
// Jest still expects CommonJS
'@babel/plugin-transform-modules-commonjs',
],
},
},

only: [
// Only files in src/ are built & transpiled by Babel
'./src',
// jest-setup.ts is the only .ts module in the package root,
// needs to be transformed by Babel for Jest to understand it
'./jest-setup.ts',
],

plugins: [
'@babel/plugin-syntax-dynamic-import',
/**
* Most files built & transpiled by Babel are just in src/
* but other local projects and some config file extensions may also need processing:
* i.e. @trshcmpctr/components, jest-setup.ts
*/
ignore: [
'common/temp/node_modules/.pnpm',
'node_modules',
],

presets: [
Expand All @@ -38,4 +37,8 @@ export default {
}
],
],

targets: {
browsers: 'defaults',
},
};
5 changes: 5 additions & 0 deletions client/babel.config.lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Differences from babel.config.js:
* Does not need dynamic imports
* Does not need preset-env + corejs
* Does not need to target browsers
*/
export default {
only: [
Expand All @@ -18,4 +19,8 @@ export default {
}
],
],
targets: {
// Compile against the current node version
node: 'current',
},
};
25 changes: 24 additions & 1 deletion client/cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
{
"extends": "../tsconfig.base.json",
// Cypress throws and hangs if using "extends" with a package reference.
// Issue https://github.com/cypress-io/cypress/issues/28385
// supposedly fixed in Cypress 13.6.2 but reproducible here with:
// - Cypress 13.17.0
// - Node 20.19.5
// - Typescript 5.9.3
// "extends": "@trshcmpctr/typescript",

"compilerOptions": {
// Treat `import x from 'y'` as `import * as x from 'y'`
// when y has no default export
"esModuleInterop": true,

// Apply stricter rules around properties which have a ? prefix
"exactOptionalPropertyTypes": true,

// Enforce file case sensitivity
"forceConsistentCasingInFileNames": true,

// Core definitions + DOM definitions
"lib": [
"es5",
"dom"
],

// Ignore inconsistent global definitions, i.e. from Jest and Cypress
"skipLibCheck": true,

// Turn on all strict mode family options for
// "stronger guarantees of program correctness"
"strict": true,

// Downlevel for Cypress test runner (?)
"target": "es5",

Expand Down
30 changes: 11 additions & 19 deletions client/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
export default {
rootDir: './',
transform: {
// Only files in src/ are built & transpiled by Babel, so only these should be transformed.
// Note that the transform pattern is matched against the full path.
// This creates some trouble in CI because Drone's default workspace already includes src/ (/drone/src).
// To workaround this, include the package directory in the transform pattern (/client/src)
// as a defense against transforming unintended files.
// Unfortunately, we can't use <rootDir> in this pattern.
'\\/client\\/src\\/.+\\.[t|j]sx?$': [
'babel-jest',
],
// jest-setup.ts needs to be .ts to include types for
// extended Jest matchers from @testing-library/jest-dom
'\\/client\\/jest-setup\\.ts$': [
'babel-jest',
],
},
collectCoverage: true,
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/jest-setup.ts'],
moduleNameMapper: {
// See https://jestjs.io/docs/webpack#handling-static-assets
'\\.(css|less)$': '<rootDir>/__mocks__/styleMock.cjs',
},
setupFilesAfterEnv: ['<rootDir>/jest-setup.ts'],
testEnvironment: 'jsdom',
/**
* Most files built & transpiled by Babel are just in src/
* but other local projects and some config file extensions may also need processing:
* i.e. @trshcmpctr/components, jest-setup.ts
*/
transformIgnorePatterns: [
'common/temp/node_modules/.pnpm',
'node_modules',
],
};
6 changes: 4 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
"watch": "webpack --watch"
},
"dependencies": {
"@layoutit/voxcss": "~0.1.8",
"@trshcmpctr/components": "workspace:*",
"axios": "~1.13.2",
"core-js": "~3.47.0",
"prop-types": "~15.8.1",
Expand All @@ -50,29 +52,29 @@
},
"devDependencies": {
"@babel/core": "~7.28.5",
"@babel/plugin-syntax-dynamic-import": "~7.8.3",
"@babel/plugin-transform-modules-commonjs": "~7.27.1",
"@babel/preset-env": "~7.28.5",
"@babel/preset-react": "~7.28.5",
"@babel/preset-typescript": "~7.28.5",
"@testing-library/dom": "~10.4.0",
"@testing-library/jest-dom": "~6.9.1",
"@testing-library/react": "~16.3.0",
"@testing-library/user-event": "~14.6.1",
"@trshcmpctr/eslint-config": "workspace:*",
"@trshcmpctr/eslint-config-jest": "workspace:*",
"@trshcmpctr/eslint-config-node": "workspace:*",
"@trshcmpctr/eslint-config-react": "workspace:*",
"@trshcmpctr/eslint-config-typescript": "workspace:*",
"@trshcmpctr/jest-stdout-reporter": "workspace:*",
"@trshcmpctr/markdownlint-config": "workspace:*",
"@trshcmpctr/typescript": "workspace:*",
"@types/jest": "~30.0.0",
"@types/node": "~20.19.25",
"@types/prop-types": "~15.7.12",
"@types/react": "~19.2.5",
"@types/react-dom": "~19.2.3",
"babel-jest": "~30.2.0",
"babel-loader": "~10.0.0",
"babel-plugin-syntax-dynamic-import": "~6.18.0",
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very old!

"css-loader": "~7.1.1",
"cypress": "13.17.0",
"discord-api-types": "~0.38.33",
Expand Down
38 changes: 23 additions & 15 deletions client/src/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { createBrowserRouter, RouterProvider } from 'react-router';

import './App.css';

import { Flex } from '@trshcmpctr/components';

import { ErrorBoundary } from './components/ErrorBoundary';
import { Footer } from './components/Footer';
import { Header } from './components/Header';
Expand All @@ -14,21 +16,27 @@ export const App = () => {
return (
<StrictMode>
<ErrorBoundary displayName="AppErrorBoundary">
<article
style={{
display: 'flex',
flexDirection: 'column',
height: '100vh',
justifyContent: 'space-between',
padding: '6px 15px 0',
width: '100vw',
}}
>
<div>
<Header />
<RouterProvider router={router} />
</div>
<Footer />
<article>
<Flex
flexDirection="column"
justifyContent="space-between"
style={{
height: '100vh',
padding: '6px 15px 0',
width: '100vw',
}}
>
<Flex
flexDirection="column"
style={{
flexGrow: 1,
}}
>
<Header />
<RouterProvider router={router} />
</Flex>
<Footer />
</Flex>
</article>
</ErrorBoundary>
</StrictMode>
Expand Down
Loading