From f8f3f9df15f7d1f6680d6afc80a296972d55535c Mon Sep 17 00:00:00 2001 From: Tasso Date: Wed, 26 Nov 2025 01:00:51 -0300 Subject: [PATCH 1/3] Enable Meteor's *Modern Build Stack* --- .../patches/typia-npm-9.7.2-5c5d9c80b4.patch | 17 ++++++++ apps/meteor/.babelrc | 10 +---- apps/meteor/.swcrc | 9 ++++ apps/meteor/package.json | 5 ++- packages/core-typings/package.json | 42 +++++++++---------- packages/ui-kit/package.json | 2 +- yarn.lock | 27 ++++++++++-- 7 files changed, 75 insertions(+), 37 deletions(-) create mode 100644 .yarn/patches/typia-npm-9.7.2-5c5d9c80b4.patch create mode 100644 apps/meteor/.swcrc diff --git a/.yarn/patches/typia-npm-9.7.2-5c5d9c80b4.patch b/.yarn/patches/typia-npm-9.7.2-5c5d9c80b4.patch new file mode 100644 index 0000000000000..b6f291d1a58d7 --- /dev/null +++ b/.yarn/patches/typia-npm-9.7.2-5c5d9c80b4.patch @@ -0,0 +1,17 @@ +diff --git a/lib/index.mjs b/lib/index.mjs +index 35c18fc129e349205d3db64bfb7b9c589c726d35..7fe10a375d6e6d4d46bb1c4a776fdc75f062c3d3 100644 +--- a/lib/index.mjs ++++ b/lib/index.mjs +@@ -1,4 +1,4 @@ +-import * as module from './module.mjs'; ++import * as _module from './module.mjs'; + export { assert, assertEquals, assertGuard, assertGuardEquals, createAssert, createAssertEquals, createAssertGuard, createAssertGuardEquals, createEquals, createIs, createRandom, createValidate, createValidateEquals, equals, is, random, validate, validateEquals } from './module.mjs'; + import * as functional from './functional.mjs'; + export { functional }; +@@ -22,5 +22,5 @@ export { TypeGuardError } from './TypeGuardError.mjs'; + + + +-export { module as default }; ++export { _module as default }; + //# sourceMappingURL=index.mjs.map diff --git a/apps/meteor/.babelrc b/apps/meteor/.babelrc index d57e624148cca..67b35228620e0 100644 --- a/apps/meteor/.babelrc +++ b/apps/meteor/.babelrc @@ -1,7 +1,7 @@ { "presets": [ "@babel/preset-env", - "@babel/preset-react", + ["@babel/preset-react", { "runtime": "automatic" }], [ "@babel/preset-typescript", { @@ -9,14 +9,6 @@ } ] ], - "plugins": [ - [ - "@babel/plugin-transform-react-jsx", - { - "runtime": "automatic" - } - ] - ], "env": { "coverage": { "plugins": [ diff --git a/apps/meteor/.swcrc b/apps/meteor/.swcrc new file mode 100644 index 0000000000000..8dc1d1778cf83 --- /dev/null +++ b/apps/meteor/.swcrc @@ -0,0 +1,9 @@ +{ + "jsc": { + "transform": { + "react": { + "runtime": "automatic" + } + } + } +} diff --git a/apps/meteor/package.json b/apps/meteor/package.json index ec68da9bebcfe..077fdb21b28e0 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -451,7 +451,7 @@ "tweetnacl": "^1.0.3", "twilio": "^5.4.2", "twit": "^2.2.11", - "typia": "~9.7.2", + "typia": "patch:typia@npm%3A9.7.2#~/.yarn/patches/typia-npm-9.7.2-5c5d9c80b4.patch", "ua-parser-js": "~1.0.41", "underscore": "^1.13.7", "universal-perf-hooks": "^1.0.1", @@ -468,7 +468,8 @@ "mainModule": { "client": "client/main.ts", "server": "server/main.ts" - } + }, + "modern": true }, "browserslist": [ "last 2 versions", diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 256996a3c8799..fe7b07d6d9114 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -3,6 +3,27 @@ "name": "@rocket.chat/core-typings", "private": true, "version": "7.13.0-develop", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "files": [ + "/dist" + ], + "scripts": { + ".:build:build": "tsc -p tsconfig.json", + ".:build:clean": "rimraf dist", + ".:build:prepare": "ts-patch install && typia patch", + "build": "run-s .:build:prepare .:build:clean .:build:build", + "dev": "tsc --watch --preserveWatchOutput -p tsconfig.json", + "lint": "eslint --ext .js,.jsx,.ts,.tsx .", + "lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix", + "test": "echo \"no tests\" && exit 1" + }, + "dependencies": { + "@rocket.chat/icons": "~0.45.0", + "@rocket.chat/message-parser": "workspace:^", + "@rocket.chat/ui-kit": "workspace:~", + "typia": "patch:typia@npm%3A9.7.2#~/.yarn/patches/typia-npm-9.7.2-5c5d9c80b4.patch" + }, "devDependencies": { "@rocket.chat/apps-engine": "workspace:^", "@rocket.chat/eslint-config": "workspace:^", @@ -15,27 +36,6 @@ "ts-patch": "^3.3.0", "typescript": "~5.9.3" }, - "scripts": { - "lint": "eslint --ext .js,.jsx,.ts,.tsx .", - "lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix", - "test": "echo \"no tests\" && exit 1", - ".:build:prepare": "ts-patch install && typia patch", - ".:build:clean": "rimraf dist", - ".:build:build": "tsc -p tsconfig.json", - "dev": "tsc --watch --preserveWatchOutput -p tsconfig.json", - "build": "run-s .:build:prepare .:build:clean .:build:build" - }, - "main": "./dist/index.js", - "typings": "./dist/index.d.ts", - "files": [ - "/dist" - ], - "dependencies": { - "@rocket.chat/icons": "~0.45.0", - "@rocket.chat/message-parser": "workspace:^", - "@rocket.chat/ui-kit": "workspace:~", - "typia": "~9.7.2" - }, "volta": { "extends": "../../package.json" } diff --git a/packages/ui-kit/package.json b/packages/ui-kit/package.json index 059c6c1635057..fc5bae921da19 100644 --- a/packages/ui-kit/package.json +++ b/packages/ui-kit/package.json @@ -31,7 +31,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "typia": "~9.7.2" + "typia": "patch:typia@npm%3A9.7.2#~/.yarn/patches/typia-npm-9.7.2-5c5d9c80b4.patch" }, "devDependencies": { "@rocket.chat/eslint-config": "workspace:~", diff --git a/yarn.lock b/yarn.lock index a40bc7177bf36..c521ce7963a43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8340,7 +8340,7 @@ __metadata: rimraf: "npm:^6.0.1" ts-patch: "npm:^3.3.0" typescript: "npm:~5.9.3" - typia: "npm:~9.7.2" + typia: "patch:typia@npm%3A9.7.2#~/.yarn/patches/typia-npm-9.7.2-5c5d9c80b4.patch" languageName: unknown linkType: soft @@ -9554,7 +9554,7 @@ __metadata: twilio: "npm:^5.4.2" twit: "npm:^2.2.11" typescript: "npm:~5.9.3" - typia: "npm:~9.7.2" + typia: "patch:typia@npm%3A9.7.2#~/.yarn/patches/typia-npm-9.7.2-5c5d9c80b4.patch" ua-parser-js: "npm:~1.0.41" underscore: "npm:^1.13.7" universal-perf-hooks: "npm:^1.0.1" @@ -10440,7 +10440,7 @@ __metadata: ts-jest: "npm:~29.4.5" ts-patch: "npm:^3.3.0" typescript: "npm:~5.9.3" - typia: "npm:~9.7.2" + typia: "patch:typia@npm%3A9.7.2#~/.yarn/patches/typia-npm-9.7.2-5c5d9c80b4.patch" peerDependencies: "@rocket.chat/icons": "*" languageName: unknown @@ -36277,7 +36277,7 @@ __metadata: languageName: node linkType: hard -"typia@npm:~9.7.2": +"typia@npm:9.7.2": version: 9.7.2 resolution: "typia@npm:9.7.2" dependencies: @@ -36296,6 +36296,25 @@ __metadata: languageName: node linkType: hard +"typia@patch:typia@npm%3A9.7.2#~/.yarn/patches/typia-npm-9.7.2-5c5d9c80b4.patch": + version: 9.7.2 + resolution: "typia@patch:typia@npm%3A9.7.2#~/.yarn/patches/typia-npm-9.7.2-5c5d9c80b4.patch::version=9.7.2&hash=cc0415" + dependencies: + "@samchon/openapi": "npm:^4.7.1" + "@standard-schema/spec": "npm:^1.0.0" + commander: "npm:^10.0.0" + comment-json: "npm:^4.2.3" + inquirer: "npm:^8.2.5" + package-manager-detector: "npm:^0.2.0" + randexp: "npm:^0.5.3" + peerDependencies: + typescript: ">=4.8.0 <5.10.0" + bin: + typia: lib/executable/typia.js + checksum: 10/db5a671719afedcafff4f48b684d7afb76803d32ccb98df64071fd02e32bd932496d5b1c348112a4deab97d65f53be554ae9fd391ce6f6a90a92a33a6e1086d8 + languageName: node + linkType: hard + "ua-parser-js@npm:~1.0.41": version: 1.0.41 resolution: "ua-parser-js@npm:1.0.41" From c880fd9575f36157ddf196aefb840c2115b34197 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 26 Nov 2025 11:58:02 -0300 Subject: [PATCH 2/3] chore(meteor): Update build configuration for modern stack and ES2022 support --- apps/meteor/.meteor/platforms | 3 ++- apps/meteor/.swcrc | 1 + apps/meteor/package.json | 10 +++++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/meteor/.meteor/platforms b/apps/meteor/.meteor/platforms index 8a3a35f9f6279..62ba921a0c051 100644 --- a/apps/meteor/.meteor/platforms +++ b/apps/meteor/.meteor/platforms @@ -1,2 +1,3 @@ -browser server +browser +modern \ No newline at end of file diff --git a/apps/meteor/.swcrc b/apps/meteor/.swcrc index 8dc1d1778cf83..003417d6c0619 100644 --- a/apps/meteor/.swcrc +++ b/apps/meteor/.swcrc @@ -1,5 +1,6 @@ { "jsc": { + "target": "es2022", "transform": { "react": { "runtime": "automatic" diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 077fdb21b28e0..727e64554e7ee 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -465,15 +465,19 @@ "zustand": "~5.0.8" }, "meteor": { + "disableLegacyBuild": true, "mainModule": { "client": "client/main.ts", "server": "server/main.ts" }, - "modern": true + "modern": { + "transpiler": { + "verbose": true + } + } }, "browserslist": [ - "last 2 versions", - "Firefox ESR" + "defaults" ], "volta": { "extends": "../../package.json" From 0a294e558b4263edd808dea155923d87c5965808 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 26 Nov 2025 12:01:22 -0300 Subject: [PATCH 3/3] chore(meteor): Simplify modern build configuration in package.json --- apps/meteor/package.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 727e64554e7ee..0ac98732adebc 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -470,11 +470,7 @@ "client": "client/main.ts", "server": "server/main.ts" }, - "modern": { - "transpiler": { - "verbose": true - } - } + "modern": true }, "browserslist": [ "defaults"