+1
-1
@@ -15,7 +15,7 @@ package-lock.json
|
||||
.vscode/
|
||||
.env
|
||||
.env.*
|
||||
/coverage
|
||||
coverage
|
||||
/book
|
||||
/index.html
|
||||
# version file and tarball created by `npm pack` / `yarn pack`
|
||||
|
||||
+22
-22
@@ -1,30 +1,30 @@
|
||||
/build
|
||||
/dist
|
||||
/lib
|
||||
/node_modules
|
||||
/webapp
|
||||
node_modules
|
||||
/apps/web/webapp
|
||||
/*.log
|
||||
pnpm-lock.yaml
|
||||
electron/dist
|
||||
electron/pub
|
||||
**/.idea
|
||||
/.tmp
|
||||
/webpack-stats.json
|
||||
webpack-stats.json
|
||||
.vscode
|
||||
.vscode/
|
||||
.env
|
||||
/coverage
|
||||
coverage
|
||||
# Auto-generated file
|
||||
/src/modules.ts
|
||||
/src/modules.js
|
||||
/src/i18n/strings
|
||||
/build_config.yaml
|
||||
/apps/web/src/modules.ts
|
||||
/apps/web/src/modules.js
|
||||
src/i18n/strings
|
||||
/apps/web//build_config.yaml
|
||||
# Raises an error because it contains a template var breaking the script tag
|
||||
src/vector/index.html
|
||||
src/vector/modernizr.cjs
|
||||
/apps/web/src/vector/index.html
|
||||
/apps/web/src/vector/modernizr.cjs
|
||||
/docs/lib
|
||||
/book
|
||||
/debian/tmp
|
||||
debian/tmp
|
||||
/.npmrc
|
||||
package-lock.json
|
||||
|
||||
@@ -33,22 +33,22 @@ package-lock.json
|
||||
/docs/changelogs
|
||||
|
||||
# Legacy skinning file that some people might still have
|
||||
/src/component-index.js
|
||||
/apps/web/src/component-index.js
|
||||
|
||||
# Downloaded and already minified
|
||||
res/jitsi_external_api.min.js
|
||||
/apps/web/res/jitsi_external_api.min.js
|
||||
|
||||
# This file is also machine-generated
|
||||
/playwright/e2e/crypto/test_indexeddb_cryptostore_dump/dump.json
|
||||
/playwright/test-results/
|
||||
/playwright/html-report/
|
||||
/playwright/logs/
|
||||
/playwright/snapshots/
|
||||
/apps/web/playwright/e2e/crypto/test_indexeddb_cryptostore_dump/dump.json
|
||||
/apps/web/playwright/test-results/
|
||||
/apps/web/playwright/html-report/
|
||||
/apps/web/playwright/logs/
|
||||
/apps/web/playwright/snapshots/
|
||||
|
||||
# Shared components generated files
|
||||
packages/shared-components/dist/
|
||||
packages/shared-components/src/i18n/i18nKeys.d.ts
|
||||
packages/shared-components/typedoc/
|
||||
packages/shared-components/storybook-static/
|
||||
/packages/shared-components/dist/
|
||||
/packages/shared-components/src/i18n/i18nKeys.d.ts
|
||||
/packages/shared-components/typedoc/
|
||||
/packages/shared-components/storybook-static/
|
||||
|
||||
/.nx/
|
||||
|
||||
@@ -61,10 +61,10 @@ module.exports = {
|
||||
{ from: "res/css/views/settings/tabs/_SettingsTab.pcss", type: "css" },
|
||||
{ from: "res/css/structures/_RoomView.pcss", type: "css" },
|
||||
// Compound vars
|
||||
"node_modules/@vector-im/compound-design-tokens/assets/web/css/cpd-common-base.css",
|
||||
"node_modules/@vector-im/compound-design-tokens/assets/web/css/cpd-common-semantic.css",
|
||||
"node_modules/@vector-im/compound-design-tokens/assets/web/css/cpd-theme-light-base-mq.css",
|
||||
"node_modules/@vector-im/compound-design-tokens/assets/web/css/cpd-theme-light-semantic-mq.css",
|
||||
"../../node_modules/@vector-im/compound-design-tokens/assets/web/css/cpd-common-base.css",
|
||||
"../../node_modules/@vector-im/compound-design-tokens/assets/web/css/cpd-common-semantic.css",
|
||||
"../../node_modules/@vector-im/compound-design-tokens/assets/web/css/cpd-theme-light-base-mq.css",
|
||||
"../../node_modules/@vector-im/compound-design-tokens/assets/web/css/cpd-theme-light-semantic-mq.css",
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -28,9 +28,9 @@ const config: Config = {
|
||||
"\\.(gif|png|ttf|woff2)$": "<rootDir>/__mocks__/imageMock.js",
|
||||
"\\.svg$": "<rootDir>/__mocks__/svg.js",
|
||||
"\\$webapp/i18n/languages.json": "<rootDir>/__mocks__/languages.json",
|
||||
"^react$": "<rootDir>/node_modules/react",
|
||||
"^react-dom$": "<rootDir>/node_modules/react-dom",
|
||||
"^matrix-js-sdk$": "<rootDir>/node_modules/matrix-js-sdk/src",
|
||||
"^react$": "<rootDir>/../../node_modules/react",
|
||||
"^react-dom$": "<rootDir>/../../node_modules/react-dom",
|
||||
"^matrix-js-sdk$": "<rootDir>/../../node_modules/matrix-js-sdk/src",
|
||||
"^matrix-react-sdk$": "<rootDir>/src",
|
||||
"decoderWorker\\.min\\.js": "<rootDir>/__mocks__/empty.js",
|
||||
"decoderWorker\\.min\\.wasm": "<rootDir>/__mocks__/empty.js",
|
||||
@@ -39,8 +39,8 @@ const config: Config = {
|
||||
"workers/(.+)Factory": "<rootDir>/__mocks__/workerFactoryMock.js",
|
||||
"^!!raw-loader!.*": "jest-raw-loader",
|
||||
"recorderWorkletFactory": "<rootDir>/__mocks__/empty.js",
|
||||
"counterpart": "<rootDir>/node_modules/counterpart",
|
||||
"@vector-im/compound-web": "<rootDir>/node_modules/@vector-im/compound-web",
|
||||
"counterpart": "<rootDir>/../../node_modules/counterpart",
|
||||
"@vector-im/compound-web": "<rootDir>/../../node_modules/@vector-im/compound-web",
|
||||
},
|
||||
transformIgnorePatterns: [
|
||||
"/node_modules/(?!(mime|matrix-js-sdk|uuid|p-retry|is-network-error|react-merge-refs|is-ip|ip-regex|super-regex|function-timeout|time-span|convert-hrtime|clone-regexp|is-regexp|matrix-web-i18n|await-lock|@element-hq/web-shared-components|react-virtuoso|lodash)).+$",
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
],
|
||||
"scripts": {
|
||||
"i18n": "matrix-gen-i18n src res && pnpm i18n:sort && pnpm i18n:lint",
|
||||
"i18n:sort": "matrix-sort-i18n src/i18n/strings/en_EN.json && pnpm --dir packages/shared-components i18n:sort",
|
||||
"i18n:lint": "matrix-i18n-lint && prettier --log-level=silent --write src/i18n/strings/ --ignore-path /dev/null && pnpm --dir packages/shared-components i18n:lint",
|
||||
"i18n:sort": "matrix-sort-i18n src/i18n/strings/en_EN.json",
|
||||
"i18n:lint": "matrix-i18n-lint && prettier --log-level=silent --write src/i18n/strings/ --ignore-path /dev/null",
|
||||
"i18n:diff": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && pnpm i18n && matrix-compare-i18n-files src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json",
|
||||
"rethemendex": "sh ./res/css/rethemendex.sh",
|
||||
"build": "nx build",
|
||||
|
||||
@@ -6,6 +6,7 @@ Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { type Page } from "@playwright/test";
|
||||
|
||||
import type { EventType, Preset } from "matrix-js-sdk/src/matrix";
|
||||
@@ -19,7 +20,7 @@ import { isDendrite } from "../../plugins/homeserver/dendrite";
|
||||
// The fake call app does *just* enough to convince Element Web that a call is ongoing
|
||||
// and functions like PiP work. It does not actually do anything though, to limit the
|
||||
// surface we test.
|
||||
const widgetApi = readFile(require.resolve("matrix-widget-api/dist/api.min.js"), "utf-8");
|
||||
const widgetApi = readFile(fileURLToPath(import.meta.resolve("matrix-widget-api/dist/api.min.js")), "utf-8");
|
||||
const fakeCallClient = readFile("playwright/sample-files/fake-element-call.html", "utf-8");
|
||||
|
||||
function assertCommonCallParameters(
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"include": [
|
||||
"**/*.ts",
|
||||
"../src/@types/matrix-js-sdk.d.ts",
|
||||
"../node_modules/matrix-js-sdk/src/@types/*.d.ts",
|
||||
"../node_modules/matrix-js-sdk/node_modules/@matrix-org/olm/index.d.ts"
|
||||
"../../../node_modules/matrix-js-sdk/src/@types/*.d.ts",
|
||||
"../../../node_modules/matrix-js-sdk/node_modules/@matrix-org/olm/index.d.ts"
|
||||
]
|
||||
}
|
||||
|
||||
+21
-10
@@ -1,41 +1,50 @@
|
||||
{
|
||||
"$schema": "./node_modules/nx/schemas/project-schema.json",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "application",
|
||||
"implicitDependencies": ["@element-hq/web-shared-components"],
|
||||
"targets": {
|
||||
"prebuild:i18n": {
|
||||
"cache": true,
|
||||
"command": "node scripts/copy-res.ts",
|
||||
"inputs": ["{projectRoot}/src/i18n/strings/*.json"],
|
||||
"outputs": ["{projectRoot}/webapp/i18n/"]
|
||||
"inputs": [
|
||||
"{projectRoot}/src/i18n/strings/*.json",
|
||||
"{workspaceRoot}/packages/shared-components/src/i18n/strings/*.json"
|
||||
],
|
||||
"outputs": ["{projectRoot}/webapp/i18n/"],
|
||||
"options": { "cwd": "apps/web" }
|
||||
},
|
||||
"prebuild:module_system": {
|
||||
"cache": true,
|
||||
"command": "node module_system/scripts/install.ts",
|
||||
"inputs": ["{projectRoot}/build_config.yaml"],
|
||||
"outputs": ["{projectRoot}/src/modules.js", "{projectRoot}/package.json", "{workspaceRoot}/pnpm-lock.yaml"]
|
||||
"outputs": ["{projectRoot}/src/modules.js", "{projectRoot}/package.json", "{workspaceRoot}/pnpm-lock.yaml"],
|
||||
"options": { "cwd": "apps/web" }
|
||||
},
|
||||
"prebuild:rethemendex": {
|
||||
"cache": true,
|
||||
"executor": "nx:run-script",
|
||||
"options": {
|
||||
"script": "rethemendex"
|
||||
"script": "rethemendex",
|
||||
"cwd": "apps/web"
|
||||
},
|
||||
"inputs": ["{projectRoot}/res/css/**/*"],
|
||||
"outputs": ["{projectRoot}/res/css/_components.pcss"]
|
||||
},
|
||||
"build": {
|
||||
"command": "webpack-cli --disable-interpret --progress --mode production",
|
||||
"outputs": ["{projectRoot}/webapp"]
|
||||
"outputs": ["{projectRoot}/webapp"],
|
||||
"options": { "cwd": "apps/web" }
|
||||
},
|
||||
"start:i18n": {
|
||||
"command": "node scripts/copy-res.ts -w",
|
||||
"continuous": true
|
||||
"continuous": true,
|
||||
"options": { "cwd": "apps/web" }
|
||||
},
|
||||
"start": {
|
||||
"command": "webpack-dev-server --disable-interpret --output-path webapp --output-filename=bundles/_dev_/[name].js --output-chunk-filename=bundles/_dev_/[name].js --mode development",
|
||||
"dependsOn": ["prebuild:module_system", "prebuild:rethemendex", "start:i18n", "^start"],
|
||||
"continuous": true
|
||||
"continuous": true,
|
||||
"options": { "cwd": "apps/web" }
|
||||
},
|
||||
"lint:types": {
|
||||
"executor": "nx:run-commands",
|
||||
@@ -45,14 +54,16 @@
|
||||
"tsc --noEmit",
|
||||
"tsc --noEmit -p playwright"
|
||||
],
|
||||
"parallel": false
|
||||
"parallel": false,
|
||||
"cwd": "apps/web"
|
||||
},
|
||||
"dependsOn": ["^build"]
|
||||
},
|
||||
"test:unit": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"options": {
|
||||
"jestConfig": "jest.config.ts"
|
||||
"jestConfig": "{projectRoot}/jest.config.ts",
|
||||
"cwd": "apps/web"
|
||||
},
|
||||
"dependsOn": ["^build"]
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import webpack from "webpack";
|
||||
import { type Translations } from "matrix-web-i18n";
|
||||
|
||||
const EW_I18N_BASE_PATH = "src/i18n/strings/";
|
||||
const SC_I18N_BASE_PATH = "packages/shared-components/src/i18n/strings/";
|
||||
const SC_I18N_BASE_PATH = "../../packages/shared-components/src/i18n/strings/";
|
||||
|
||||
const INCLUDE_LANGS = [...new Set([...fs.readdirSync(EW_I18N_BASE_PATH)])]
|
||||
.filter((fn) => fn.endsWith(".json"))
|
||||
|
||||
@@ -15,9 +15,9 @@ import enElementWeb from "../../src/i18n/strings/en_EN.json";
|
||||
import deElementWeb from "../../src/i18n/strings/de_DE.json";
|
||||
// Cheat and import relatively here as these aren't exported by the module (should they be?)
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import enSharedComponents from "../../packages/shared-components/src/i18n/strings/en_EN.json";
|
||||
import enSharedComponents from "../../../../packages/shared-components/src/i18n/strings/en_EN.json";
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import deSharedComponents from "../../packages/shared-components/src/i18n/strings/de_DE.json";
|
||||
import deSharedComponents from "../../../../packages/shared-components/src/i18n/strings/de_DE.json";
|
||||
import { ModuleApi } from "../../src/modules/Api";
|
||||
|
||||
const lv = {
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
"strict": true,
|
||||
"paths": {
|
||||
"jest-matrix-react": ["./test/test-utils/jest-matrix-react"],
|
||||
"rollup/parseAst": ["./node_modules/rollup/dist/parseAst"]
|
||||
"rollup/parseAst": ["../../node_modules/rollup/dist/parseAst"]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"./node_modules/matrix-js-sdk/src/@types/*.d.ts",
|
||||
"../../node_modules/matrix-js-sdk/src/@types/*.d.ts",
|
||||
"./src/**/*.ts",
|
||||
"./src/**/*.tsx",
|
||||
"./test/**/*.ts",
|
||||
|
||||
@@ -438,7 +438,7 @@ export default (env: string, argv: Record<string, any>): webpack.Configuration =
|
||||
type: "javascript/auto",
|
||||
use: [
|
||||
{
|
||||
loader: path.resolve("./recorder-worklet-loader.cjs"),
|
||||
loader: path.join(__dirname, "recorder-worklet-loader.cjs"),
|
||||
},
|
||||
{
|
||||
loader: "babel-loader",
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
"license": "SEE LICENSE IN README.md",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"i18n": "pnpm -r i18n",
|
||||
"i18n:sort": "pnpm -r i18n:sort",
|
||||
"i18n:lint": "pnpm -r i18n:lint",
|
||||
"lint": "pnpm -r lint:types && pnpm lint:prettier && pnpm -r lint:js && pnpm -r lint:style && pnpm lint:workflows && pnpm lint:knip",
|
||||
"lint:prettier": "prettier --check .",
|
||||
"lint:prettier-fix": "prettier --log-level=warn --write .",
|
||||
|
||||
@@ -9,11 +9,13 @@ import type { StorybookConfig } from "@storybook/react-vite";
|
||||
import fs from "node:fs";
|
||||
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
||||
import { mergeConfig } from "vite";
|
||||
import { dirname } from "node:path";
|
||||
import { dirname, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
// Get a list of available languages so the language selector can display them at runtime
|
||||
const languageFiles = fs.readdirSync("src/i18n/strings").map((f) => f.slice(0, -5));
|
||||
const languageFiles = fs.readdirSync(join(__dirname, "..", "src", "i18n", "strings")).map((f) => f.slice(0, -5));
|
||||
|
||||
const languages: Record<string, string> = {};
|
||||
for (const lang of languageFiles) {
|
||||
|
||||
@@ -18,4 +18,4 @@ fi
|
||||
|
||||
DIST_VERSION=$("$DIR"/normalize-version.sh "$DIST_VERSION")
|
||||
|
||||
VERSION=$DIST_VERSION pnpm build
|
||||
VERSION=$DIST_VERSION pnpm --dir apps/web build
|
||||
|
||||
+15
-15
@@ -4,23 +4,23 @@ sonar.organization=element-hq
|
||||
# Encoding of the source code. Default is default system encoding
|
||||
#sonar.sourceEncoding=UTF-8
|
||||
|
||||
sonar.sources=src,res,packages/shared-components/src
|
||||
sonar.tests=test,playwright,src,packages
|
||||
sonar.test.inclusions=test/*,playwright/*,src/**/*.test.*,packages/*/src/**/*.test.*,packages/*/src/test/**/*
|
||||
sonar.exclusions=__mocks__,docs,element.io,nginx,src/vector/modernizr.cjs
|
||||
sonar.sources=apps/web/src,apps/web/res,packages/shared-components/src
|
||||
sonar.tests=apps/web/test,apps/web/playwright,packages
|
||||
sonar.test.inclusions=apps/web/test/*,apps/web/playwright/*,packages/*/src/**/*.test.*,packages/*/src/test/**/*
|
||||
sonar.exclusions=apps/web/__mocks__,docs,apps/web/element.io,apps/web/nginx,apps/web/src/vector/modernizr.cjs
|
||||
|
||||
sonar.cpd.exclusions=src/i18n/strings/*.json
|
||||
sonar.typescript.tsconfigPath=./tsconfig.json
|
||||
sonar.javascript.lcov.reportPaths=coverage/lcov.info,packages/shared-components/coverage/lcov.info
|
||||
sonar.cpd.exclusions=apps/web/src/i18n/strings/*.json,packages/*/src/i18n/strings/*.json
|
||||
sonar.javascript.lcov.reportPaths=apps/web/coverage/lcov.info,packages/shared-components/coverage/lcov.info
|
||||
sonar.coverage.exclusions=\
|
||||
test/**/*,\
|
||||
playwright/**/*,\
|
||||
res/**/*,\
|
||||
apps/web/test/**/*,\
|
||||
apps/web/playwright/**/*,\
|
||||
apps/web/res/**/*,\
|
||||
apps/web/scripts/**/*,\
|
||||
scripts/**/*,\
|
||||
src/components/views/dialogs/devtools/**/*,\
|
||||
src/utils/SessionLock.ts,\
|
||||
src/**/*.d.ts,\
|
||||
src/vector/mobile_guide/**/*,\
|
||||
apps/web/src/components/views/dialogs/devtools/**/*,\
|
||||
apps/web/src/utils/SessionLock.ts,\
|
||||
apps/web/src/**/*.d.ts,\
|
||||
apps/web/src/vector/mobile_guide/**/*,\
|
||||
packages/shared-components/src/test/**/*,\
|
||||
packages/shared-components/src/**/*.stories.tsx
|
||||
sonar.testExecutionReportPaths=coverage/jest-sonar-report.xml
|
||||
sonar.testExecutionReportPaths=apps/web/coverage/jest-sonar-report.xml
|
||||
|
||||
Reference in New Issue
Block a user