Skip to content

Commit 400a38b

Browse files
authored
Merge pull request #475 from OpenConext/feature/frontend_nov_25
Update npm packages & tooling
2 parents c834d6c + dbff33a commit 400a38b

30 files changed

+2511
-6030
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 6.0.0
44
- Upgrade from Symfony 6.4 to Symfony 7.3
55
- Maintenance release, Update tooling, packages
6+
- Update npm packages and frontend tooling.
67

78
Upgrade instructions:
89
- Ensure the `database_server_version` setting in parameters.yaml is up-to-date with the production db server version. e.g. `10.6.23-MariaDB`

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ mock service was created for end to end test purposes, but could be utilized in
3636
3. Update the service definition to point to this class: `class: Surfnet\StepupGateway\ApiBundle\Tests\TestDouble\Service\YubikeyService`
3737
4. Do not commit/push this change!
3838

39+
### Frontend Development
40+
41+
#### Template Preview
42+
For the purpose of testing the frontend templates a preview route is available to view all templates with mock data.
43+
44+
Available in `smoketest` environment only.
45+
Visit: `https://gateway.dev.openconext.local/preview/`
46+
47+
3948
### Running Behat tests
4049
#### .env settings in devconf/stepup
4150

composer.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"ext-json": "*",
2424
"ext-libxml": "*",
2525
"beberlei/assert": "^3.3.3",
26+
"doctrine/annotations": "^2.0",
2627
"doctrine/common": "^3.5.0",
2728
"doctrine/dbal": "^3.10.3",
2829
"doctrine/doctrine-bundle": "^2.18.1",
@@ -99,6 +100,7 @@
99100
],
100101
"check": [
101102
"@check-ci",
103+
"@eslint",
102104
"@rector"
103105
],
104106
"check-ci": [
@@ -128,9 +130,16 @@
128130
"rector": "./ci/qa/rector.sh --dry-run",
129131
"rector-fix": "./ci/qa/rector.sh",
130132
"dsv": "./bin/console doctrine:schema:validate --skip-sync",
133+
"eslint": "yarn eslint public/typescript",
131134
"frontend-install": [
132-
"yarn install --frozen-lockfile",
133-
"yarn encore production"
135+
"yarn install --frozen-lockfile",
136+
"yarn encore production",
137+
"./bin/console cache:clear",
138+
"@fix-dev-permissions"
139+
],
140+
"fix-dev-permissions": [
141+
"chown -R www-data:www-data /var/www/html/var/log",
142+
"chown -R www-data:www-data /var/www/html/var/cache"
134143
],
135144
"security-tests": [
136145
"composer audit",

composer.lock

Lines changed: 78 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/routes/smoketest/behat.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ gateway_test_remote_idp_sso:
1313
methods: [GET,POST]
1414
defaults: { _controller: Surfnet\StepupGateway\Behat\Controller\IdentityProviderController::ssoAction }
1515

16+
template_preview_controller:
17+
resource: Surfnet\StepupGateway\Behat\Controller\TemplatePreviewController
18+
type: attribute
19+
prefix: /

config/services_test.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ services:
4444
- '@twig'
4545
- '@logger'
4646

47+
Surfnet\StepupGateway\Behat\Controller\TemplatePreviewController:
48+
class: Surfnet\StepupGateway\Behat\Controller\TemplatePreviewController
49+
calls:
50+
- [setContainer, ['@Psr\Container\ContainerInterface']]
51+
tags:
52+
- 'controller.service_arguments'
53+
- 'container.service_subscriber'
54+
4755
##### SSO on 2FA overrides #####
4856
# For end to end testing, we do not actually encrypt & decrypt the cookie value.
4957
# Allowing for more easily checking the cookie for correct contents without having

eslint.config.mjs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import js from '@eslint/js';
2+
import typescriptEslint from 'typescript-eslint';
3+
4+
export default [
5+
{
6+
ignores: [
7+
'vendor/**',
8+
'node_modules/**',
9+
'var/**',
10+
'public/build/**',
11+
'.yarn-cache/**',
12+
'build/**',
13+
'dist/**',
14+
],
15+
},
16+
js.configs.recommended,
17+
...typescriptEslint.configs.recommendedTypeChecked,
18+
{
19+
files: ['**/*.ts', '**/*.tsx'],
20+
languageOptions: {
21+
parserOptions: {
22+
project: './tsconfig.json',
23+
tsconfigRootDir: import.meta.dirname,
24+
},
25+
},
26+
rules: {
27+
// Customize rules as needed
28+
'@typescript-eslint/no-explicit-any': 'warn',
29+
'@typescript-eslint/no-unused-vars': 'warn',
30+
},
31+
},
32+
{
33+
// Disable type-checking rules for JS files
34+
files: ['**/*.js', '**/*.jsx'],
35+
...typescriptEslint.configs.disableTypeChecked,
36+
},
37+
];
38+

eslint.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

jest.config.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

package.json

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
11
{
2-
"browserslist": "last 2 versions, ie 11, > 1%",
2+
"browserslist": [
3+
"last 2 versions",
4+
"ie 11",
5+
"> 1%"
6+
],
37
"devDependencies": {
48
"@babel/core": "^7.26.9",
59
"@babel/preset-env": "^7.26.9",
6-
"@symfony/webpack-encore": "^4",
10+
"@eslint/eslintrc": "^3.3.1",
11+
"@eslint/js": "^9.39.1",
12+
"@symfony/webpack-encore": "^5.3.1",
713
"@types/bootstrap": "^5.0.0",
8-
"@types/jest": "^27",
914
"@types/jquery": "^3.5.32",
10-
"@types/node": "^10",
11-
"@types/popper.js": "^1.11.0",
12-
"css-loader": "^6.11",
13-
"eslint": "^7",
14-
"eslint-config-airbnb": "^19.0",
15-
"eslint-loader": "^4",
16-
"eslint-plugin-import": "^2.31",
17-
"eslint-webpack-plugin": "^3.2.0",
18-
"jest": "^27",
19-
"less": "^3.12.2",
20-
"less-loader": "^11.1",
15+
"@types/node": "^20.0.0",
16+
"@typescript-eslint/eslint-plugin": "^8.47.0",
17+
"@typescript-eslint/parser": "^8.47.0",
18+
"autoprefixer": "^10.4.20",
19+
"css-loader": "^7.1.2",
20+
"eslint": "^9.39.1",
21+
"eslint-webpack-plugin": "^5.0.2",
22+
"less": "^4.4.2",
23+
"less-loader": "^12.3.0",
2124
"loader-utils": "^3.3",
2225
"postcss": ">=8.4.31",
23-
"sass": "^1.85.1",
24-
"sass-loader": "^13",
25-
"ts-jest": "^27",
26+
"postcss-loader": "^8.1.1",
27+
"sass": "^1.94.1",
28+
"sass-loader": "^16.0.6",
2629
"ts-loader": "^9",
27-
"typescript": "^4",
28-
"webpack": "^5.98.0",
29-
"webpack-cli": "^5.0.0",
30+
"typescript": "^5.9.3",
31+
"typescript-eslint": "^8.47.0",
32+
"webpack": "^5.103.0",
33+
"webpack-cli": "^6.0.1",
3034
"webpack-import-glob-loader": "^1.6.3"
3135
},
3236
"license": "Apache-2.0",
3337
"private": true,
3438
"dependencies": {
35-
"bootstrap": "^3",
39+
"bootstrap": "^5.3.3",
40+
"core-js": "^3.37.0",
3641
"jquery": "^3.7.1",
37-
"popper.js": "^1.16.1",
42+
"regenerator-runtime": "^0.14.1",
3843
"select2": "^4.0.3",
3944
"yargs-parser": ">=18.1.2"
40-
},
41-
"resolutions": {
42-
"json5": ">=2.2.2"
4345
}
4446
}

0 commit comments

Comments
 (0)