Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to vite and vitest and update matrix-widget-toolkit dependencies #702

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
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
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Once running, you can visit the widget URL (`http(s)://localhost:3000/`) and fol
In the project directory, you can run:

- `yarn dev`: Start the widget for development.
- `yarn start`: Start the widget for development with a self-signed HTTPS certificate.
- `yarn dev:https`: Start the widget for development with a self-signed HTTPS certificate.
- `yarn build`: Run the build step in all projects.
- `yarn test`: Watch all files for changes and run tests of the widget.
- `yarn lint`: Run eslint in all projects.
Expand Down
6 changes: 3 additions & 3 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"dependencies": {},
"devDependencies": {
"@axe-core/playwright": "^4.10.1",
"@playwright/test": "^1.49.1",
"@types/lodash": "^4.17.4",
"@playwright/test": "^1.50.0",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.4.6",
"eslint": "^8.57.0",
"eslint-plugin-playwright": "^1.6.1",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"testcontainers": "^10.16.0",
"typescript": "^5.4.5"
},
Expand Down
2 changes: 1 addition & 1 deletion e2e/src/scheduleBreakoutSessions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { expect } from '@playwright/test';
import { repeat } from 'lodash';
import { repeat } from 'lodash-es';
import { test } from './fixtures';

test.describe('Schedule Breakout Sessions', () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/src/scheduleMeeting.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { expect } from '@playwright/test';
import { repeat } from 'lodash';
import { repeat } from 'lodash-es';
import { test } from './fixtures';

test.describe('Schedule Meeting', () => {
Expand Down
5 changes: 4 additions & 1 deletion e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Package specific tsconfig that extends the root one.
{
"extends": "../tsconfig.json",
"include": ["src"]
"include": ["src"],
"compilerOptions": {
"noEmit": true
}
}
4 changes: 3 additions & 1 deletion matrix-meetings-bot/i18next-parser.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
* limitations under the License.
*/

module.exports = {
const i18NextParserConfig = {
locales: ['en', 'de'],
output: 'src/static/locales/$LOCALE/$NAMESPACE.json',
sort: true,
resetDefaultValueLocale: 'en',
};

export default i18NextParserConfig;
21 changes: 11 additions & 10 deletions matrix-meetings-bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"docker:inspect": "docker inspect nordeck/matrix-meetings-bot",
"prestart": "yarn build",
"build": "nest build && yarn copyfiles && yarn copyImages",
"depcheck": "depcheck",
"depcheck": "depcheck --ignores=\"typescript\",\"@types/jest\"",
"start": "PORT=3001 nest start",
"start:dev": "PORT=3001 nest start --watch",
"start:debug": "PORT=3001 nest start --debug --watch",
"copyfiles": "copyfiles -E -u 1 src/static/locales/**/*.json lib",
"copyImages": "copyfiles -E -u 1 src/static/images/* lib",
"lint": "eslint . --no-error-on-unmatched-pattern",
"lint": "eslint . --max-warnings=0",
"translate": "i18next 'src/**/*.{ts,tsx}'",
"test": "jest --watch",
"test:all": "jest --coverage --watchAll=false",
Expand All @@ -37,20 +37,20 @@
"@nestjs/microservices": "^10.4.15",
"@nestjs/platform-express": "^10.4.15",
"@nestjs/swagger": "^7.4.2",
"@nordeck/matrix-meetings-calendar": "1.0.0",
"@supercharge/promise-pool": "^3.2.0",
"base64url": "^3.0.1",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"express": "^4.21.2",
"html-entities": "^2.5.2",
"i18next": "^23.7.16",
"i18next-fs-backend": "^2.3.1",
"i18next": "^23.16.5",
"i18next-fs-backend": "^2.3.2",
"i18next-http-middleware": "^3.6.0",
"joi": "^17.13.3",
"lodash": "^4.17.20",
"lodash": "^4.17.21",
"luxon": "^3.3.0",
"matrix-bot-sdk": "npm:@nordeck/[email protected]",
"@nordeck/matrix-meetings-calendar": "1.0.0",
"mime-types": "^2.1.35",
"mustache": "^4.2.0",
"nestjs-pino": "^4.1.0",
Expand All @@ -64,8 +64,8 @@
},
"devDependencies": {
"@nestjs/cli": "^10.4.9",
"@types/jest": "^27.5.2",
"@types/lodash": "^4.17.4",
"@types/jest": "^29.5.14",
"@types/lodash": "^4.17.12",
"@types/luxon": "^3.2.0",
"@types/mime-types": "^2.1.4",
"@types/mustache": "^4.2.5",
Expand All @@ -76,9 +76,9 @@
"dotenv-cli": "^7.4.2",
"eslint": "^8.57.0",
"i18next-parser": "^9.1.0",
"jest": "^27.4.3",
"jest": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"ts-jest": "^27.1.5",
"ts-jest": "^29.2.5",
"ts-mockito": "^2.6.1",
"typescript": "^5.4.5"
},
Expand Down Expand Up @@ -112,6 +112,7 @@
"<rootDir>/test"
],
"moduleNameMapper": {
"@nordeck/matrix-meetings-calendar/src/testing/testUtils": "<rootDir>/../packages/calendar/src/testing/testUtils.ts",
"matrix-meetings-(.*)": "<rootDir>/../packages/$1/src/index.ts"
}
},
Expand Down
2 changes: 1 addition & 1 deletion matrix-meetings-bot/src/util/migrateMeetingTime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { mockCalendarEntry } from '@nordeck/matrix-meetings-calendar';
import { mockCalendarEntry } from '@nordeck/matrix-meetings-calendar/src/testing/testUtils';
import { migrateMeetingTime } from './migrateMeetingTime';

describe('migrateMeetingTime', () => {
Expand Down
2 changes: 1 addition & 1 deletion matrix-meetings-bot/test/RoomMessageService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { mockCalendarEntry } from '@nordeck/matrix-meetings-calendar';
import { mockCalendarEntry } from '@nordeck/matrix-meetings-calendar/src/testing/testUtils';
import { MatrixClient } from 'matrix-bot-sdk';
import {
anyString,
Expand Down
3 changes: 2 additions & 1 deletion matrix-meetings-bot/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"declaration": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"skipLibCheck": true
"skipLibCheck": true,
"moduleResolution": "node"
},
"include": ["./src/**/*"]
}
61 changes: 0 additions & 61 deletions matrix-meetings-widget/craco.config.js

This file was deleted.

4 changes: 3 additions & 1 deletion matrix-meetings-widget/i18next-parser.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
* limitations under the License.
*/

module.exports = {
const i18NextParserConfig = {
locales: ['en', 'de'],
output: 'public/locales/$LOCALE/$NAMESPACE.json',
sort: true,
resetDefaultValueLocale: 'en',
};

export default i18NextParserConfig;
37 changes: 37 additions & 0 deletions matrix-meetings-widget/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="A meetings widget for the Element messenger"
/>
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="manifest" href="/manifest.json" />
<title>NeoDateFix Widget</title>

<!--#echo var="__INJECT_SCRIPT_TAG__" encoding="none"-->

<script nonce='<!--#echo var="cspNonce"-->'>
__webpack_nonce__ = '<!--#echo var="cspNonce"-->';
// Set global for compatibility reason.
// globalThis ?? window is required to make with work in all environments (dev / prod).
global = globalThis ?? window;
</script>

<script nonce='<!--#echo var="cspNonce"-->' type="module">
// Copy environment variables to process.env for backward compatibility with CRA.
window.process = window.process ?? {};
window.process.env = import.meta.env;
</script>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
Loading
Loading