Skip to content

Commit

Permalink
Merge branch 'feat/auth-service-to-signals' of https://github.com/Bad…
Browse files Browse the repository at this point in the history
…minton-Apps/badman into feat/auth-service-to-signals
  • Loading branch information
cskiwi committed Feb 9, 2024
2 parents fb94693 + 7908200 commit 8365e1b
Show file tree
Hide file tree
Showing 434 changed files with 7,398 additions and 9,393 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/dynamic-changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
distribute-on:
small-changeset: 1 linux-medium-js
medium-changeset: 6 linux-medium-js
large-changeset: 10 linux-medium-js
40 changes: 40 additions & 0 deletions .github/workflows/main-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release Workflow

on:
# manual trigger
workflow_dispatch:
inputs:
# main branch name
prod-release:
description: 'Do prod release'
required: true
default: false
type: boolean
# main branch name
e2e-tests:
description: 'Do e2e tests'
required: true
default: true
type: boolean

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

run-name: ${{ inputs.prod-release && 'Prod' || 'Beta' }} release ${{ inputs.e2e-tests && 'with E2E tests' || '' }}

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- run: npm ci
- uses: nrwl/nx-set-shas@v4
- run: npx nx start-ci-run --stop-agents-after="e2e-ci"
- run: npx nx affected -t lint test build e2e-ci
52 changes: 0 additions & 52 deletions apps/api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,6 @@
"sourceRoot": "apps/api/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nx/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"target": "node",
"compiler": "tsc",
"outputPath": "dist/apps/api",
"main": "apps/api/src/main.ts",
"tsConfig": "apps/api/tsconfig.app.json",
"assets": [
"apps/api/src/assets",
{
"glob": "**/*",
"input": "libs/backend/translate/assets",
"output": "assets"
},
{
"glob": "**/*",
"input": "libs/backend/competition/assembly/src/compile",
"output": "compile/libs/assembly"
},
{
"glob": "**/*",
"input": "libs/backend/mailing/src/compile",
"output": "compile/libs/mailing"
}
],
"webpackConfig": "apps/api/webpack.config.js"
},
"configurations": {
"development": {
"optimization": false
},
"production": {
"optimization": true,
"extractLicenses": true,
"inspect": false
}
}
},
"serve": {
"executor": "@nx/js:node",
"defaultConfiguration": "development",
Expand All @@ -59,17 +18,6 @@
"buildTarget": "api:build:production"
}
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/api/jest.config.ts"
}
}
},
"tags": []
Expand Down
3 changes: 1 addition & 2 deletions apps/api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
}
],
"compilerOptions": {
"esModuleInterop": true,
"resolveJsonModule": true
"esModuleInterop": true
}
}
43 changes: 35 additions & 8 deletions apps/api/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
const { composePlugins, withNx } = require('@nx/webpack');
// Nx plugins for webpack.
module.exports = composePlugins(withNx(), (config) => {
// Update the webpack config as needed here.
// e.g. `config.plugins.push(new MyPlugin())`
config.devtool = 'source-map'
const { NxWebpackPlugin } = require('@nx/webpack');
const { join } = require('path');

return config;
});
module.exports = {
output: {
path: join(__dirname, '../../dist/apps/api'),
},
plugins: [
new NxWebpackPlugin({
target: 'node',
compiler: 'tsc',
main: './src/main.ts',
tsConfig: './tsconfig.app.json',
assets: [
'./src/assets',
{
glob: '**/*',
input: 'libs/backend/translate/assets',
output: 'assets',
},
{
glob: '**/*',
input: 'libs/backend/competition/assembly/src/compile',
output: 'compile/libs/assembly',
},
{
glob: '**/*',
input: 'libs/backend/mailing/src/compile',
output: 'compile/libs/mailing',
},
],
optimization: false,
outputHashing: 'none',
}),
],
};
18 changes: 3 additions & 15 deletions apps/badman-e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,22 @@ const baseURL = process.env['BASE_URL'] || 'http://localhost:5000';
*/
export default defineConfig({
...nxE2EPreset(__filename, { testDir: './src' }),

/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 2,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : '20%',
/* Timeout for each test, on average our test takes 3 seconds, so 10 should be plenty */
timeout: 60_000,
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
baseURL,
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
video: process.env.CI ? 'off' : 'on-first-retry',
},
reporter: [['html'], [process.env.CI ? 'github' : 'list']],
/* We build our projects and then api hosts itself and the client */
webServer: {
command: 'npx nx run-many -t build -p badman,api && node dist/apps/api/main.js',
command: 'node dist/apps/api/main.js',
url: `${baseURL}/api/health`,
reuseExistingServer: !process.env.CI,
cwd: workspaceRoot,
// Our build + serve takes a while, so we need to increase the timeout.
timeout: 120_000,
stdout: 'pipe',
// timeout: 120_000,
// stdout: 'pipe',
// stderr: 'pipe',
},

Expand Down
14 changes: 1 addition & 13 deletions apps/badman-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@
"name": "badman-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/badman-e2e/src",
"targets": {
"e2e": {
"executor": "@nx/playwright:playwright",
"outputs": ["{workspaceRoot}/dist/.playwright/apps/badman-e2e"],
"options": {
"config": "apps/badman-e2e/playwright.config.ts"
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
}
},
"projectType": "application",
"implicitDependencies": ["badman", "api"]
}
10 changes: 0 additions & 10 deletions apps/badman/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,6 @@
"options": {
"buildTarget": "badman:build"
}
},
"lint": {
"executor": "@nx/eslint:lint"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/badman/jest.config.ts"
}
}
}
}
44 changes: 1 addition & 43 deletions apps/scripts/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,11 @@
"sourceRoot": "apps/scripts/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nx/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"target": "node",
"compiler": "tsc",
"outputPath": "dist/apps/scripts",
"main": "apps/scripts/src/main.ts",
"tsConfig": "apps/scripts/tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "libs/backend/translate/assets",
"output": "assets"
}
],
"webpackConfig": "apps/scripts/webpack.config.js"
},
"configurations": {
"development": {},
"production": {
"optimization": true,
"extractLicenses": true,
"inspect": false
}
}
},
"serve": {
"executor": "@nx/js:node",
"defaultConfiguration": "development",
"options": {
"buildTarget": "scripts:build",
"port": 9240,
"inspect": "inspect",
"host": "0.0.0.0"
"buildTarget": "scripts:build"
},
"configurations": {
"development": {
Expand All @@ -49,17 +18,6 @@
"buildTarget": "scripts:build:production"
}
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/scripts"],
"options": {
"jestConfig": "apps/scripts/jest.config.js"
}
}
},
"tags": []
Expand Down
28 changes: 18 additions & 10 deletions apps/scripts/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
const { composePlugins, withNx } = require("@nx/webpack");
const { NxWebpackPlugin } = require('@nx/webpack');
const { join } = require('path');

// Nx plugins for webpack.
module.exports = composePlugins(withNx(), (config) => {
// Update the webpack config as needed here.
// e.g. `config.plugins.push(new MyPlugin())`
config.devtool = 'source-map'


return config;
});
module.exports = {
output: {
path: join(__dirname, '../../dist/apps/scripts'),
},
plugins: [
new NxWebpackPlugin({
target: 'node',
compiler: 'tsc',
main: './src/main.ts',
tsConfig: './tsconfig.app.json',
assets: ['./src/assets'],
optimization: false,
outputHashing: 'none',
}),
],
};
17 changes: 0 additions & 17 deletions apps/worker/belgium/flanders/games/jest.config.js

This file was deleted.

11 changes: 11 additions & 0 deletions apps/worker/belgium/flanders/games/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-disable */
export default {
displayName: 'worker-belgium-flanders-games',
preset: '../../../../../jest.preset.js',
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/apps/worker/badminton/belgium/flanders/games',
};
Loading

0 comments on commit 8365e1b

Please sign in to comment.