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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .aiderignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!apps/
!libs/
22 changes: 21 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ jobs:
- .terraformrc
- project/terraform/.terraform
root: ~/
unit:
tsc-check:
executor: docker-node
parameters:
resource_class:
Expand All @@ -524,6 +524,17 @@ jobs:
name: Run Unit Tests
- store_test_results:
path: ./tmp/reports/test-unit
unit:
executor: docker-node
parameters:
resource_class:
type: string
resource_class: << parameters.resource_class >>
steps:
- restore-workspace
- run:
command: nx run-many --target=tsc-check
name: Run tsc Check
orbs:
node: circleci/node@5.1.0
nx: nrwl/nx@1.6.2
Expand Down Expand Up @@ -660,6 +671,15 @@ workflows:
requires:
- setup-workspace
resource_class: large
- tsc-check:
filters:
branches:
ignore:
- master
- staging
requires:
- setup-workspace
resource_class: large
- codegen:
filters:
branches:
Expand Down
20 changes: 20 additions & 0 deletions .circleci/config/jobs/tsc-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
parameters:
resource_class:
type: string

executor: docker-node

resource_class: << parameters.resource_class >>

steps:
- restore-workspace
# - clear-jest-cache
- run:
name: 'Run Unit Tests'
command: pnpm cli tasks unit --stage ci
environment:
JEST_JUNIT_OUTPUT_DIR: ./tmp/reports/test-unit
# JEST_JUNIT_OUTPUT_NAME: 'unit-specs-results.xml'
# https://discuss.circleci.com/t/insights-test-panel-doesnt-show-any-information/45070/13
- store_test_results:
path: ./tmp/reports/test-unit
11 changes: 2 additions & 9 deletions .circleci/config/jobs/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ resource_class: << parameters.resource_class >>

steps:
- restore-workspace
# - clear-jest-cache
- run:
name: 'Run Unit Tests'
command: pnpm cli tasks unit --stage ci
environment:
JEST_JUNIT_OUTPUT_DIR: ./tmp/reports/test-unit
# JEST_JUNIT_OUTPUT_NAME: 'unit-specs-results.xml'
# https://discuss.circleci.com/t/insights-test-panel-doesnt-show-any-information/45070/13
- store_test_results:
path: ./tmp/reports/test-unit
name: 'Run tsc Check'
command: nx run-many --target=tsc-check
9 changes: 9 additions & 0 deletions .circleci/config/workflows/app-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ jobs:
- staging
requires:
- setup-workspace
- tsc-check:
resource_class: large
filters:
branches:
ignore:
- master
- staging
requires:
- setup-workspace
- codegen:
resource_class: medium
filters:
Expand Down
10 changes: 8 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
},
"env": {
"browser": true,
"node": true,
"jest/globals": true
},
"globals": {
Expand Down Expand Up @@ -49,5 +48,12 @@
"react": {
"version": "detect"
}
}
},
"overrides": [
{
"files": "*.json",
"parser": "jsonc-eslint-parser",
"rules": {}
}
]
}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@

# Ignore everything in 'dist/libs/tools' except 'workspace'
/dist/libs/tools/*
!/dist/libs/tools/workspace/
!/dist/libs/tools/eslint-plugin/
!/dist/libs/tools/tsc-check/
!/dist/libs/tools/workspace/

!/dist/libs/external/
/dist/libs/external/*
Expand Down Expand Up @@ -72,3 +73,5 @@ out

vite.config.*.timestamp*
.aider*

vitest.config.*.timestamp*
9 changes: 4 additions & 5 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# Turn off for now

pnpm cli tasks build --stage test
pnpm cli tasks unit --stage test
pnpm cli tasks int --stage test
# pnpm cli tasks build --stage test
# pnpm cli tasks unit --stage test
# pnpm cli tasks int --stage test
# nx run-many --target=tsc-check
pnpm nx e2e web-e2e -c test

# ./scripts/git/branch-name-check.sh
5 changes: 2 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
"markdown",
"graphql"
],
// "eslint.run": "onSave",
// "eslint.validate": ["json"],
"json.format.enable": true,
"typescript.tsdk": "node_modules/typescript/lib",
"[terraform]": {
"editor.defaultFormatter": "hashicorp.terraform"
}
},
"eslint.validate": ["json"]
}
3 changes: 0 additions & 3 deletions apps/api/src/exceptions/all-exceptions.filter.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import type { ArgumentsHost } from '@nestjs/common'
import type { HttpServer } from '@nestjs/common/interfaces'
import type { Request } from 'express'

import { PinoLoggerService } from '@codelab/backend/infra/adapter/logger'
import { Catch, HttpException, Injectable } from '@nestjs/common'
import { BaseExceptionFilter } from '@nestjs/core'
import * as Sentry from '@sentry/nestjs'
import { SentryExceptionCaptured } from '@sentry/nestjs'
import { ValidationException } from 'typebox-validators'

@Injectable()
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/root.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {
GraphQLSchemaModule,
SchemaService,
} from '@codelab/backend-infra-adapter/neo4j-schema'
import { Global, Module } from '@nestjs/common'
import { Module } from '@nestjs/common'
import { APP_GUARD } from '@nestjs/core'
import { CommandBus, CqrsModule } from '@nestjs/cqrs'
import { CqrsModule } from '@nestjs/cqrs'
import { SentryModule } from '@sentry/nestjs/setup'

import { ApiModule } from './api/api.module'
Expand Down
1 change: 1 addition & 0 deletions apps/api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"moduleResolution": "node",
"sourceMap": true,
"target": "es2021",
"experimentalDecorators": true,
"strictNullChecks": true,
"noImplicitAny": true,
"strictBindCallApply": true,
Expand Down
2 changes: 2 additions & 0 deletions apps/design-system/.storybook/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import '../../../libs/frontend/shared/style/css/global.css';
@import '../../../libs/frontend/shared/style/css/shadcn.global.css';
6 changes: 5 additions & 1 deletion apps/design-system/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'
import type { StorybookConfig } from '@storybook/react-vite'

import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'
import { mergeConfig } from 'vite'

const storybookConfig: StorybookConfig = {
Expand All @@ -9,6 +10,9 @@ const storybookConfig: StorybookConfig = {
'@nx/react/plugins/storybook',
],
framework: {
/**
* Decorator issue with `@storybook/nextjs`
*/
name: '@storybook/react-vite',
options: {},
},
Expand Down
2 changes: 1 addition & 1 deletion apps/design-system/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import './styles/main.css'
import './main.css'
import type { Preview } from '@storybook/react'

const preview: Preview = {
Expand Down
2 changes: 0 additions & 2 deletions apps/design-system/.storybook/styles/main.css

This file was deleted.

1 change: 0 additions & 1 deletion apps/sites/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"compilerOptions": {
"jsx": "preserve",
"allowJs": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": false,
"lib": ["es2021", "DOM"],
"types": ["node", "worker-loader", "cypher", "styled-components"],
Expand Down
7 changes: 4 additions & 3 deletions apps/web-e2e/src/modules/child-mapper/child-mapper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ test('should not render instances when the prop is not an array', async ({
await expect(page.getNotification()).toBeHidden()
})

test.afterAll('cleanup created components', async ({ request }) => {
await request.post('/api/v1/admin/setup-e2e-data')
})
// Disable temporarily so we can check the web page manually after spec runs
// test.afterAll('cleanup created components', async ({ request }) => {
// await request.post('/api/v1/admin/setup-e2e-data')
// })
7 changes: 5 additions & 2 deletions apps/web/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
"next/core-web-vitals",
"../../.eslintrc.json"
],
"ignorePatterns": ["!**/*"],
"ignorePatterns": ["!**/*", "storybook-static"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"parserOptions": {
"project": ["apps/web/tsconfig(.*)?.json"]
"project": [
"apps/web/tsconfig(.*)?.json",
"apps/web/tsconfig.storybook.json"
]
},
"rules": {
"jsx-a11y/anchor-is-valid": "off",
Expand Down
96 changes: 96 additions & 0 deletions apps/web/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import type { StorybookConfig } from '@storybook/react-vite'
import type { Options } from '@swc/core'

import { resolve } from 'path'

const storybookConfig: StorybookConfig = {
addons: [
'@storybook/addon-essentials',
'@storybook/addon-interactions',
// 'storybook-css-modules',
],
framework: {
name: '@storybook/nextjs',
options: {
builder: {
useSWC: true,
},
},
},
staticDirs: ['../public'],
stories: [
// '../components/**/*.stories.@(js|jsx|ts|tsx|mdx)',
'../../../libs/frontend/presentation/components/interface-form/**/*.stories.@(js|jsx|ts|tsx|mdx)',
// '../../../libs/frontend/application/**/*.stories.@(js|jsx|ts|tsx|mdx)',
],
/**
* This is not picked up unless certain conditions are met
*
* https://github.com/storybookjs/storybook/discussions/26836
*/
// swc: (config: Options, options: Options): Options => {
// return {
// ...config,
// // https://github.com/swc-project/swc/issues/2117
// jsc: {
// ...config.jsc,
// keepClassNames: true,
// parser: {
// decorators: true,
// syntax: 'typescript',
// },
// target: 'es2018',
// transform: {
// decoratorMetadata: true,
// legacyDecorator: true,
// useDefineForClassFields: false,
// },
// },
// }
// },
/**
* https://github.com/storybookjs/storybook/issues/27175
*/
typescript: {
reactDocgen: 'react-docgen-typescript',
// reactDocgenTypescriptOptions: {
// tsconfigPath: resolve(__dirname, '../tsconfig.storybook.json'),
// },
},
webpackFinal: async (config) => {
// Modify webpack config
if (config.module?.rules) {
config.module.rules.push({
test: /\.(ts|tsx)$/,
use: [
{
loader: 'swc-loader',
options: {
jsc: {
keepClassNames: true,
parser: {
decorators: true,
syntax: 'typescript',
},
target: 'es2018',
transform: {
decoratorMetadata: true,
legacyDecorator: true,
useDefineForClassFields: false,
},
},
},
},
],
})
}

return config
},
}

export default storybookConfig

// To customize your webpack configuration you can use the webpackFinal field.
// Check https://storybook.js.org/docs/react/builders/webpack#extending-storybooks-webpack-config
// and https://nx.dev/recipes/storybook/custom-builder-configs
Loading