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
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM node:24-alpine3.21 AS build
RUN apk update && apk add curl
FROM node:24-alpine3.22 AS build
WORKDIR /app
COPY package.json yarn.lock ./
COPY package.json yarn.lock tsconfig.json ./
COPY ./ui/package.json ./ui/
COPY ./test-db-manager/package.json ./test-db-manager/
RUN yarn install --frozen-lockfile
Expand All @@ -21,4 +20,4 @@
COPY --from=build /app/ui/out /usr/share/nginx/html
COPY scripts/docker/replace-environment-variables.sh /tmp
RUN curl -o /tmp/read-secrets.sh "https://raw.githubusercontent.com/HSLdevcom/jore4-tools/main/docker/read-secrets.sh"
CMD /bin/sh -c 'source /tmp/read-secrets.sh && /tmp/replace-environment-variables.sh && nginx -g "daemon off;"'

Check warning on line 23 in Dockerfile

View workflow job for this annotation

GitHub Actions / Publish UI Docker image to ACR / shared_build_and_publish_docker_image

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

Check warning on line 23 in Dockerfile

View workflow job for this annotation

GitHub Actions / Publish UI Docker image to ACR / shared_build_and_publish_docker_image

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/
22 changes: 11 additions & 11 deletions codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
"private": true,
"scripts": {
"generate": "graphql-codegen --config ./codegen.js",
"ts:check": "echo No need to check syntax of generated TS && exit 0"
"ts:check": "yarn tsc --noEmit"
},
"dependencies": {
"@babel/core": "^7.28.3",
"@graphql-codegen/add": "^5.0.3",
"@graphql-codegen/cli": "^5.0.7",
"@graphql-codegen/introspection": "^4.0.3",
"@graphql-codegen/typescript": "^4.1.6",
"@graphql-codegen/typescript-operations": "^4.6.1",
"@babel/core": "^7.28.5",
"@graphql-codegen/add": "^6.0.0",
"@graphql-codegen/cli": "^6.1.0",
"@graphql-codegen/introspection": "^5.0.0",
"@graphql-codegen/typescript": "^5.0.6",
"@graphql-codegen/typescript-operations": "^5.0.6",
"@graphql-codegen/typescript-react-apollo": "^4.3.3",
"@graphql-tools/load": "^8.1.2",
"@graphql-tools/merge": "^9.1.1",
"@graphql-tools/schema": "^10.0.25",
"@graphql-tools/load": "^8.1.7",
"@graphql-tools/merge": "^9.1.6",
"@graphql-tools/schema": "^10.0.30",
"@parcel/watcher": "^2.5.0",
"graphql": "^16.11.0",
"graphql": "^16.12.0",
"graphql-tag": "^2.12.6"
}
}
11 changes: 2 additions & 9 deletions codegen/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"target": "ES2024",
"allowJs": false,
"strict": true,
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true
"composite": true,
"rootDir": "./"
}
}
2 changes: 1 addition & 1 deletion cypress/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import cypressGrepPlugin from '@cypress/grep/src/plugin';
import { plugin as cypressGrepPlugin } from '@cypress/grep/plugin';
import { defineConfig } from 'cypress';
import { GenerateCtrfReport } from 'cypress-ctrf-json-reporter';
import cypressSplit from 'cypress-split';
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/map/createTerminal.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StopInsertInput } from '@hsl/jore4-test-db-manager';
import {
ReusableComponentsVehicleModeEnum,
StopInsertInput,
StopRegistryGeoJsonType,
} from '@hsl/jore4-test-db-manager/dist/CypressSpecExports';
import {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/map/editTerminals.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
StopRegistryGeoJsonType,
TerminalInput,
} from '@hsl/jore4-test-db-manager';
} from '@hsl/jore4-test-db-manager/dist/CypressSpecExports';
import {
buildInfraLinksAlongRoute,
buildStopsOnInfraLinks,
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/stop-registry/terminals.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
StopRegistryGeoJsonType,
TerminalInput,
} from '@hsl/jore4-test-db-manager';
} from '@hsl/jore4-test-db-manager/dist/CypressSpecExports';
import {
buildInfraLinksAlongRoute,
buildStopsOnInfraLinks,
Expand Down
16 changes: 8 additions & 8 deletions cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
"cy:run:video": "CYPRESS_BASE_URL=${CYPRESS_BASE_URL:-http://localhost:3300} cypress run --browser chrome --config-file ./cypress.config.video.ts"
},
"dependencies": {
"@4tw/cypress-drag-drop": "^2.2.5",
"@cypress/grep": "^4.1.1",
"@4tw/cypress-drag-drop": "^2.3.1",
"@cypress/grep": "^5.0.0",
"@hsl/jore4-test-db-manager": "1.0.0",
"@hsl/timetables-data-inserter": "1.0.0",
"cypress": "^14.5.4",
"cypress-ctrf-json-reporter": "^0.0.12",
"cypress-split": "^1.24.21",
"cypress": "^15.7.1",
"cypress-ctrf-json-reporter": "^0.0.13",
"cypress-split": "^1.24.25",
"lodash": "^4.17.21",
"luxon": "^3.7.1",
"luxon": "^3.7.2",
"qs": "^6.14.0"
},
"devDependencies": {
"@types/lodash": "^4.17.20",
"@types/lodash": "^4.17.21",
"@types/luxon": "^3.7.1",
"@types/qs": "^6.14.0",
"find-test-names": "^1.29.18"
"find-test-names": "^1.29.19"
}
}
3 changes: 1 addition & 2 deletions cypress/pageObjects/RoutePropertiesForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import { TerminusNameInputs, TerminusValues } from './TerminusNameInputs';
import { ValidityPeriodFormInfo } from './ValidityPeriodForm';

export interface RouteFormInfo
extends ValidityPeriodFormInfo,
PriorityFormInfo {
extends ValidityPeriodFormInfo, PriorityFormInfo {
finnishName?: string;
label?: string;
variant?: string;
Expand Down
3 changes: 1 addition & 2 deletions cypress/pageObjects/StopForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { PriorityForm, PriorityFormInfo } from './PriorityForm';
import { ValidityPeriodFormInfo } from './ValidityPeriodForm';

export interface BaseStopFormInfo
extends ValidityPeriodFormInfo,
PriorityFormInfo {
extends ValidityPeriodFormInfo, PriorityFormInfo {
locationFin?: string;
locationSwe?: string;
longitude?: string;
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import './commands';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import registerCypressGrep from '@cypress/grep';
import { register as registerCypressGrep } from '@cypress/grep';
import { Settings } from 'luxon';

registerCypressGrep();
Expand Down
14 changes: 5 additions & 9 deletions cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"noEmit": true,
"composite": true,
"rootDir": "./",

"lib": ["dom", "dom.iterable", "ESNext"],
// be explicit about types included
// to avoid clashing with Jest types
"types": ["cypress", "./support", "@cypress/grep"],
"allowJs": false,
"strict": true,
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true
"types": ["cypress", "./support", "@cypress/grep"]
},
"include": ["./**/*.ts", "./**/*.tsx"]
}
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function getExtends({
? [
react.configs.flat['recommended'],
react.configs.flat['jsx-runtime'],
reactHooks.configs['recommended-latest'],
reactHooks.configs.flat['recommended-latest'],
jsxA11y.flatConfigs['recommended'],
]
: []),
Expand Down
9 changes: 9 additions & 0 deletions eslint/rules/react-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,14 @@ module.exports = {
// Verify the list of the dependencies for Hooks like useEffect and similar
// https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/src/rules/ExhaustiveDeps.ts
'react-hooks/exhaustive-deps': 'error',

// Allow refs to be accessed in render bodies
'react-hooks/refs': 0,

// Allow calling setState in useEffect
'react-hooks/set-state-in-effect': 0,

// We are not using React Compiler, don't warn about react-hook-form
'react-hooks/incompatible-library': 0,
},
};
35 changes: 18 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"license": "EUPL-1.2",
"engines": {
"node": ">=23.9.0",
"node": ">=24",
"yarn": "1.x"
},
"scripts": {
Expand All @@ -31,34 +31,35 @@
},
"dependencies": {},
"devDependencies": {
"@eslint/js": "^9.34.0",
"@eslint/js": "^9.39.1",
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
"@stylistic/eslint-plugin": "^5.2.3",
"@stylistic/eslint-plugin": "^5.6.1",
"@types/jest": "^30.0.0",
"@types/node": "^24.3.0",
"@types/node": "^24.10.1",
"concurrently": "^9.2.1",
"confusing-browser-globals": "^1.0.11",
"eslint": "^9.34.0",
"eslint": "^9.39.1",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-cypress": "^5.1.1",
"eslint-plugin-cypress": "^5.2.0",
"eslint-plugin-i18n-json": "4.0.1",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest": "^29.0.1",
"eslint-plugin-jest": "^29.2.1",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-lodash": "^8.0.0",
"eslint-plugin-n": "^17.21.3",
"eslint-plugin-n": "^17.23.1",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"globals": "^16",
"jest": "^30.1.0",
"jest-environment-jsdom": "^30.1.0",
"prettier": "^3.6.2",
"prettier-plugin-tailwindcss": "^0.6.14",
"ts-jest": "^29.4.1",
"eslint-plugin-react-hooks": "^7.0.1",
"globals": "^16.5.0",
"jest": "^30.2.0",
"jest-environment-jsdom": "^30.2.0",
"prettier": "^3.7.4",
"prettier-plugin-tailwindcss": "^0.7.2",
"ts-jest": "^29.4.6",
"ts-node": "^10.9.2",
"typescript": "^5.9.2",
"typescript-eslint": "^8.41.0"
"typescript": "^5.9.3",
"typescript-eslint": "^8.48.1",
"zod": "^3.25.76"
},
"workspaces": [
"codegen",
Expand Down
12 changes: 6 additions & 6 deletions test-db-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
"ts:build": "yarn tsc --build"
},
"dependencies": {
"@rollup/plugin-commonjs": "^28.0.6",
"@rollup/plugin-node-resolve": "^16.0.1",
"@rollup/plugin-commonjs": "^28.0.9",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-typescript": "^11.1.6",
"cross-fetch": "^4.1.0",
"graphql": "^16.11.0",
"graphql": "^16.12.0",
"graphql-tag": "^2.12.6",
"knex": "^3.1.0",
"lodash": "^4.17.21",
"luxon": "^3.7.1",
"luxon": "^3.7.2",
"pg": "^8.16.3",
"rollup": "^4.49.0",
"rollup-plugin-dts": "^6.2.3",
"rollup": "^4.53.3",
"rollup-plugin-dts": "^6.3.0",
"ts-node": "^10.9.2",
"uuid": "^11.1.0"
},
Expand Down
22 changes: 11 additions & 11 deletions test-db-manager/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import { nodeResolve } from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import { dts } from 'rollup-plugin-dts';

const commonPlugins = [
nodeResolve({ exportConditions: ['node'] }),
commonjs({
include: ['./index.js', /node_modules/],
}),
typescript({
tsconfig: './tsconfig.json',
compilerOptions: { declarationDir: './types' },
}),
];
const resolveNodeModulesPlugin = nodeResolve({ exportConditions: ['node'] });
const commonJsPlugin = commonjs({
include: ['./index.js', /node_modules/],
});
const tsPlugin = typescript({
tsconfig: './tsconfig.json',
compilerOptions: { declarationDir: './types' },
});

const commonPlugins = [resolveNodeModulesPlugin, commonJsPlugin, tsPlugin];

// Mark node modules as externals. Needed for knex's optional drivers.
const commonExternals = [/node_modules/];
Expand Down Expand Up @@ -94,7 +94,7 @@ const config = [
{ file: './ts-dist/CypressSpecExports.js', format: 'es' },
{ file: 'dist/CypressSpecExports.js', format: 'cjs' },
],
plugins: commonPlugins,
plugins: [nodeResolve({ browser: true }), commonJsPlugin, tsPlugin],
},
{
input: './src/CypressSpecExports.ts',
Expand Down
23 changes: 13 additions & 10 deletions test-db-manager/src/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68557,16 +68557,19 @@ export type GetAllStopPlaceLabelsAndIdsQuery = {
__typename?: 'query_root',
stop_registry?: {
__typename?: 'stop_registryStopPlaceRegister',
stopPlace?: Array<{
__typename?: 'stop_registry_ParentStopPlace'
} | {
__typename?: 'stop_registry_StopPlace',
id?: string | null,
privateCode?: {
__typename?: 'stop_registry_PrivateCode',
value?: string | null
} | null
} | null> | null
stopPlace?: Array<
| {
__typename?: 'stop_registry_ParentStopPlace'
}
| {
__typename?: 'stop_registry_StopPlace',
id?: string | null,
privateCode?: {
__typename?: 'stop_registry_PrivateCode',
value?: string | null
} | null
}
| null> | null
} | null
};

Expand Down
20 changes: 6 additions & 14 deletions test-db-manager/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "ES2024",
"composite": true,
"rootDir": "src",

"declaration": true,
"declarationMap": true,
"sourceMap": true,
"composite": true,
"outDir": "ts-dist",
"rootDir": "src",
"moduleResolution": "node",

// syntheticDefaultImports seem to be needed for avoiding "This module is declared with 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag." error from imports like "import padStart from 'lodash/padStart';"
"allowSyntheticDefaultImports": true,
// for some reason building this project gives errors if this is not defined
"skipLibCheck": true /* Skip type checking of all declaration files (*.d.ts). */,
"allowJs": false,
"strict": true,
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true
"allowSyntheticDefaultImports": true
},
"include": ["src"]
}
Loading
Loading