Skip to content

Commit

Permalink
Merge pull request #18411 from wireapp/v/RC-2024-12-02
Browse files Browse the repository at this point in the history
chore: RC 2024-12-02
  • Loading branch information
V-Gira authored Dec 2, 2024
2 parents fa6210e + 200e5f1 commit abb41d2
Show file tree
Hide file tree
Showing 260 changed files with 19,577 additions and 14,838 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = {
'src/worker/',
'src/script/components/Icon.tsx',
'*.js',
'src/types/i18n.d.ts',
],
parserOptions: {
project: ['./tsconfig.build.json', './server/tsconfig.json'],
Expand Down
5 changes: 3 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ updates:
- dependency-name: '@mediapipe/tasks-vision'
versions:
- '0.10.16'
- dependency-name: '@types/node'
- dependency-name: 'typescript'

# Server dependencies
- package-ecosystem: npm
Expand All @@ -55,9 +57,8 @@ updates:
- dependency-name: geolite2
versions:
- '>= 2.a'
- dependency-name: 'typescript'
- dependency-name: '@types/node'
versions:
- '>= 13.a'

# Github actions
- package-ecosystem: 'github-actions'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: yarn test --coverage --coverage-reporters=lcov --detectOpenHandles=false

- name: Monitor coverage
uses: codecov/codecov-action@v4.6.0
uses: codecov/codecov-action@v5.0.7
with:
fail_ci_if_error: false
files: ./coverage/lcov.info
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: yarn --immutable

- name: Sync translations
uses: crowdin/github-action@v2.3.0
uses: crowdin/github-action@v2.4.0
env:
GITHUB_TOKEN: ${{secrets.OTTO_THE_BOT_GH_TOKEN}}
GITHUB_ACTOR: otto-the-bot
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync_translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: yarn translate:merge

- name: Download translations
uses: crowdin/github-action@v2.3.0
uses: crowdin/github-action@v2.4.0
env:
GITHUB_TOKEN: ${{secrets.OTTO_THE_BOT_GH_TOKEN}}
CROWDIN_PROJECT_ID: 342359
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ yarn-error.log
!.yarn/plugins
!.yarn/releases
!.yarn/sdks

yalc.lock
.yalc
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ CHANGELOG.md
node_modules
npm-debug.log
yarn-error.log

src/types/i18n.d.ts
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ username: your-username
**Usage:**
1. Add string variable to "src/script/strings.ts" (source for the React part of our app) and text to "i18n/en-US.json" (source for the Knockout part of our app)
1. Create a PR and merge it after approval. When the PR gets merged, our CI will take care of uploading the english texts to Crowdin.
1. Add string variable to "i18n/en-US.json"
2. Create a PR and merge it after approval. When the PR gets merged, our CI will take care of uploading the english texts to Crowdin.
If our CI pipeline is broken, you still have the option to upload new strings manually. For this case do the following:
Expand Down
2 changes: 1 addition & 1 deletion app-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"wire-web-config-default-master": "https://github.com/wireapp/wire-web-config-wire#v0.31.36",
"wire-web-config-default-staging": "https://github.com/wireapp/wire-web-config-default#v0.31.35"
"wire-web-config-default-staging": "https://github.com/wireapp/wire-web-config-default#v0.31.36"
}
}
38 changes: 38 additions & 0 deletions bin/transalations_generate_types.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const fs = require('fs');
const path = require('path');

const escapeString = string => {
return string
.replace(/\\/g, '\\\\') // Escape backslashes first
.replace(/'/g, "\\'") // Escape single quotes
.replace(/\n/g, '\\n') // Escape newlines
.replace(/\r/g, '\\r') // Escape carriage returns
.replace(/\t/g, '\\t'); // Escape tabs
};

const generateTypeDefinitions = (jsonPath, outputPath) => {
const json = JSON.parse(fs.readFileSync(jsonPath, 'utf8'));

const header = `// This file is autogenerated by the script. DO NOT EDIT BY HAND.
// To update this file, run: yarn run translate:generate-types
`;

const body = Object.entries(json)
.map(([key, value]) => ` '${key}': \`${escapeString(value)}\`;`)
.join('\n');

const content = `${header}declare module 'I18n/en-US.json' {
const translations: {
${body}
};
export default translations;
}
`;

fs.writeFileSync(outputPath, content);
};

const ROOT_PATH = path.resolve(__dirname, '..');

generateTypeDefinitions(path.join(ROOT_PATH, 'src/i18n/en-US.json'), path.join(ROOT_PATH, 'src/types/i18n.d.ts'));
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"dependencies": {
"@datadog/browser-logs": "5.29.1",
"@datadog/browser-rum": "5.29.1",
"@datadog/browser-logs": "5.32.0",
"@datadog/browser-rum": "5.32.0",
"@emotion/react": "11.11.4",
"@lexical/history": "0.19.0",
"@lexical/react": "0.19.0",
"@mediapipe/tasks-vision": "0.10.17",
"@lexical/history": "0.20.2",
"@lexical/react": "0.20.2",
"@mediapipe/tasks-vision": "0.10.18",
"@wireapp/avs": "9.10.16",
"@wireapp/commons": "5.2.13",
"@wireapp/core": "46.6.0",
"@wireapp/react-ui-kit": "9.26.0",
"@wireapp/commons": "5.4.0",
"@wireapp/core": "46.8.0",
"@wireapp/react-ui-kit": "9.28.0",
"@wireapp/store-engine-dexie": "2.1.15",
"@wireapp/telemetry": "0.1.3",
"@wireapp/webapp-events": "0.24.3",
"amplify": "https://github.com/wireapp/amplify#head=master",
"beautiful-react-hooks": "5.0.2",
"classnames": "2.5.1",
"copy-webpack-plugin": "12.0.2",
"core-js": "3.39.0",
"countly-sdk-web": "24.4.1",
"date-fns": "4.1.0",
"dexie-batch": "0.4.3",
"dexie-encrypted": "2.0.0",
Expand All @@ -29,7 +29,7 @@
"jszip": "3.10.1",
"keyboardjs": "2.7.0",
"knockout": "3.5.1",
"lexical": "0.19.0",
"lexical": "0.20.2",
"libsodium-wrappers": "0.7.15",
"linkify-it": "5.0.0",
"long": "5.2.3",
Expand All @@ -40,10 +40,10 @@
"react": "18.3.1",
"react-dom": "18.3.1",
"react-error-boundary": "4.1.2",
"react-intl": "6.8.5",
"react-intl": "7.0.1",
"react-redux": "9.1.2",
"react-router": "6.27.0",
"react-router-dom": "6.27.0",
"react-router": "6.28.0",
"react-router-dom": "6.28.0",
"react-transition-group": "4.4.5",
"redux": "5.0.1",
"redux-logdown": "1.0.4",
Expand All @@ -52,7 +52,7 @@
"switch-path": "1.2.0",
"tsyringe": "4.8.0",
"underscore": "1.13.7",
"uuid": "11.0.2",
"uuid": "11.0.3",
"webgl-utils.js": "1.1.0",
"webrtc-adapter": "9.0.1",
"zustand": "4.5.5"
Expand All @@ -64,8 +64,8 @@
"@babel/preset-react": "7.25.9",
"@babel/preset-typescript": "7.26.0",
"@emotion/eslint-plugin": "11.11.0",
"@faker-js/faker": "9.1.0",
"@formatjs/cli": "6.3.6",
"@faker-js/faker": "9.2.0",
"@formatjs/cli": "6.3.11",
"@roamhq/wrtc": "0.8.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "16.0.1",
Expand All @@ -80,13 +80,13 @@
"@types/libsodium-wrappers": "0",
"@types/linkify-it": "5.0.0",
"@types/markdown-it": "14.1.1",
"@types/node": "22.8.7",
"@types/node": "22.9.0",
"@types/open-graph": "0.2.5",
"@types/platform": "1.3.6",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.1",
"@types/react-transition-group": "4.4.11",
"@types/redux-mock-store": "1.0.6",
"@types/redux-mock-store": "1.5.0",
"@types/seedrandom": "3.0.8",
"@types/sinon": "17.0.3",
"@types/speakingurl": "13.0.6",
Expand All @@ -113,7 +113,7 @@
"fake-indexeddb": "6.0.0",
"generate-changelog": "1.8.0",
"html-webpack-plugin": "5.6.3",
"husky": "9.1.6",
"husky": "9.1.7",
"i18next-scanner": "4.6.0",
"intersection-observer": "0.12.2",
"jest": "29.7.0",
Expand All @@ -122,16 +122,16 @@
"jest-jasmine2": "29.7.0",
"jest-transform-stub": "2.0.0",
"jsdom-worker": "0.3.0",
"less": "4.2.0",
"less": "4.2.1",
"less-loader": "12.2.0",
"lint-staged": "15.2.10",
"os-browserify": "0.3.0",
"path-browserify": "1.0.1",
"postcss": "8.4.47",
"postcss": "8.4.49",
"postcss-import": "16.1.0",
"postcss-less": "6.0.0",
"postcss-loader": "8.1.1",
"postcss-preset-env": "10.0.9",
"postcss-preset-env": "10.1.1",
"postcss-scss": "4.0.9",
"prettier": "3.3.2",
"raw-loader": "4.0.2",
Expand All @@ -140,12 +140,12 @@
"simple-git": "3.27.0",
"sinon": "18.0.0",
"style-loader": "4.0.0",
"stylelint": "16.10.0",
"stylelint": "16.11.0",
"stylelint-config-idiomatic-order": "10.0.0",
"svg-inline-loader": "0.8.2",
"text-encoding": "0.7.0",
"ts-node": "10.9.2",
"tsc-watch": "6.2.0",
"tsc-watch": "6.2.1",
"typescript": "5.5.2",
"webpack": "5.96.1",
"webpack-cli": "5.1.4",
Expand Down Expand Up @@ -202,7 +202,7 @@
"test:server": "cd server && yarn test",
"test:types": "tsc --project tsconfig.build.json --noEmit && cd server && tsc --noEmit",
"translate:extract": "i18next-scanner 'src/{page,script}/**/*.{js,html,htm}'",
"translate:merge": "formatjs extract --format './bin/translations_extract_formatter.js' --out-file './src/i18n/en-US.json' './src/script/strings.ts'"
"translate:merge": "formatjs extract --format './bin/translations_extract_formatter.js' --out-file './src/i18n/en-US.json'"
},
"resolutions": {
"libsodium": "0.7.10",
Expand Down
17 changes: 7 additions & 10 deletions server/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class Server {
this.initStaticRoutes();
this.initWebpack();
this.initSiteMap(this.config);
// eslint-disable-next-line import/no-named-as-default-member
this.app.use('/libs', express.static(path.join(__dirname, 'libs')));
this.app.use(Root());
this.app.use(HealthCheckRoute());
Expand Down Expand Up @@ -166,15 +167,12 @@ class Server {
private initStaticRoutes() {
this.app.use(RedirectRoutes(this.config, this.clientConfig));

this.app.use('/audio', express.static(path.join(__dirname, 'static/audio')));
this.app.use('/ext', express.static(path.join(__dirname, 'static/ext')));
this.app.use('/font', express.static(path.join(__dirname, 'static/font')));
this.app.use('/image', express.static(path.join(__dirname, 'static/image')));
this.app.use('/min', express.static(path.join(__dirname, 'static/min')));
this.app.use('/proto', express.static(path.join(__dirname, 'static/proto')));
this.app.use('/style', express.static(path.join(__dirname, 'static/style')));
this.app.use('/worker', express.static(path.join(__dirname, 'static/worker')));
this.app.use('/assets', express.static(path.join(__dirname, 'static/assets')));
const staticRoutes = ['audio', 'ext', 'font', 'image', 'min', 'proto', 'style', 'worker', 'assets'];

staticRoutes.forEach(route => {
// eslint-disable-next-line import/no-named-as-default-member
this.app.use(`/${route}`, express.static(path.join(__dirname, `static/${route}`)));
});

this.app.get('/favicon.ico', (_req, res) => res.sendFile(path.join(__dirname, 'static/image/favicon.ico')));
if (!this.config.DEVELOPMENT) {
Expand Down Expand Up @@ -213,7 +211,6 @@ class Server {
APP_BASE: this.config.APP_BASE,
OPEN_GRAPH: this.config.OPEN_GRAPH,
VERSION: this.config.VERSION,
COUNTLY_NONCE: this.config.COUNTLY_NONCE,
};
}

Expand Down
9 changes: 2 additions & 7 deletions server/bin/copy_server_assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ assetFolders.forEach(assetFolder => {
fs.copySync(path.resolve(__dirname, srcFolder, assetFolder), path.resolve(__dirname, distFolder, assetFolder));
});

// copy countly.min.js and the official countly boomerang plugin
fs.copySync(
path.resolve(__dirname, npmModulesFolder, 'countly-sdk-web/lib/countly.min.js'),
path.resolve(__dirname, distFolder, 'libs/countly/countly.min.js'),
);
fs.copySync(
path.resolve(__dirname, npmModulesFolder, 'countly-sdk-web/plugin/boomerang'),
path.resolve(__dirname, distFolder, 'libs/countly'),
path.resolve(__dirname, npmModulesFolder, '@wireapp/telemetry/lib/embed.js'),
path.resolve(__dirname, distFolder, 'libs/wire/telemetry/embed.js'),
);
17 changes: 3 additions & 14 deletions server/config/server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,7 @@ function parseCommaSeparatedList(list: string = ''): string[] {
return cleanedList.split(',');
}

// This is a constant that is used to use as CSP nonce for the countly script
const COUNTLY_NONCE = {
value: '36f73136-20aa-4c87-aff4-667cdc814d98',
cspString: "'nonce-36f73136-20aa-4c87-aff4-667cdc814d98'",
};

function mergedCSP(
{urls}: ConfigGeneratorParams,
env: Record<string, string>,
countlyCSPNonce: string,
): Record<string, Iterable<string>> {
function mergedCSP({urls}: ConfigGeneratorParams, env: Record<string, string>): Record<string, Iterable<string>> {
const objectSrc = parseCommaSeparatedList(env.CSP_EXTRA_OBJECT_SRC);
const csp = {
connectSrc: [...defaultCSP.connectSrc, urls.api, urls.ws, ...parseCommaSeparatedList(env.CSP_EXTRA_CONNECT_SRC)],
Expand All @@ -89,7 +79,7 @@ function mergedCSP(
manifestSrc: [...defaultCSP.manifestSrc, ...parseCommaSeparatedList(env.CSP_EXTRA_MANIFEST_SRC)],
mediaSrc: [...defaultCSP.mediaSrc, ...parseCommaSeparatedList(env.CSP_EXTRA_MEDIA_SRC)],
objectSrc: objectSrc.length > 0 ? objectSrc : ["'none'"],
scriptSrc: [...defaultCSP.scriptSrc, ...parseCommaSeparatedList(env.CSP_EXTRA_SCRIPT_SRC), countlyCSPNonce],
scriptSrc: [...defaultCSP.scriptSrc, ...parseCommaSeparatedList(env.CSP_EXTRA_SCRIPT_SRC)],
styleSrc: [...defaultCSP.styleSrc, ...parseCommaSeparatedList(env.CSP_EXTRA_STYLE_SRC)],
workerSrc: [...defaultCSP.workerSrc, ...parseCommaSeparatedList(env.CSP_EXTRA_WORKER_SRC)],
};
Expand All @@ -105,7 +95,7 @@ export function generateConfig(params: ConfigGeneratorParams, env: Env) {
COMMIT: commit,
VERSION: version,
CACHE_DURATION_SECONDS: 300,
CSP: mergedCSP(params, env, COUNTLY_NONCE.cspString),
CSP: mergedCSP(params, env),
BACKEND_REST: urls.api,
BACKEND_WS: urls.ws,
DEVELOPMENT: nodeEnv === 'development',
Expand All @@ -125,7 +115,6 @@ export function generateConfig(params: ConfigGeneratorParams, env: Env) {
ALLOWED_HOSTS: ['app.wire.com'],
DISALLOW: readFile(ROBOTS_DISALLOW_FILE, 'User-agent: *\r\nDisallow: /'),
},
COUNTLY_NONCE: COUNTLY_NONCE.value,
SSL_CERTIFICATE_KEY_PATH:
env.SSL_CERTIFICATE_KEY_PATH || path.join(__dirname, '../certificate/development-key.pem'),
SSL_CERTIFICATE_PATH: env.SSL_CERTIFICATE_PATH || path.join(__dirname, '../certificate/development-cert.pem'),
Expand Down
4 changes: 2 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "dist/index.js",
"license": "GPL-3.0",
"dependencies": {
"@wireapp/commons": "5.2.13",
"@wireapp/commons": "5.4.0",
"dotenv": "16.4.5",
"dotenv-extended": "2.9.0",
"express": "4.21.1",
Expand All @@ -20,7 +20,7 @@
"maxmind": "4.3.10",
"nocache": "4.0.0",
"opn": "6.0.0",
"pm2": "5.4.2"
"pm2": "5.4.3"
},
"devDependencies": {
"@types/express": "4.17.21",
Expand Down
Loading

0 comments on commit abb41d2

Please sign in to comment.