feat(apps): apps-engine split, dynamic import apps#40185
feat(apps): apps-engine split, dynamic import apps#40185d-gubert wants to merge 8 commits intofeat/apps-engine-split--pr2a-copy-to-appsfrom
Conversation
Copies src/server/ from @rocket.chat/apps-engine verbatim, then rewrites all relative definition/ imports to package imports (`@rocket.chat/apps-engine/definition/...`). apps-engine still contains its server code at this point — this is an additive copy only. The deletion happens in a later PR once @packages/apps is confirmed working independently. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copies src/client/ (AppClientManager, AppsEngineUIHost, AppsEngineUIClient) from @rocket.chat/apps-engine, rewriting relative definition/ imports to package imports. This code is a known rough edge: browser-side UI host logic does not semantically belong in a server orchestration package. It is consolidated here for pragmatic simplicity during the apps-engine split. A future @rocket.chat/apps-client package is tracked in the TODO comment added to src/client/index.ts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copies deno-runtime/ verbatim from @rocket.chat/apps-engine. The import map in deno.jsonc still points to ./../src/ which is only valid in the current location (apps-engine). Making the import map location-independent (using a runtime-generated map) is handled in a dedicated follow-up PR to keep the diff focused. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… directly The old src/bridges/IListenerBridge.ts used module augmentation (`declare module '@rocket.chat/apps-engine/server/bridges'`) to extend IListenerBridge with core-typings-specific overloads. Now that IListenerBridge lives in this package, the augmentation workaround is no longer needed. The extra overload signatures are merged directly into src/server/bridges/IListenerBridge.ts and the augmentation file is deleted. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- package.json: add all runtime deps from apps-engine (msgpack, adm-zip, esbuild, jose, semver, etc.), deno-related devDeps (npm-run-all, rimraf, ts-node), build/test scripts, and include deno-runtime/ and scripts/ in published files - tsconfig.json: enable experimentalDecorators and emitDecoratorMetadata required by the incoming server code - turbo.json: declare build outputs (dist/, deno-runtime/, .deno-cache/) - scripts/deno-cache.js: copied from apps-engine; validates Deno version and pre-caches deno-runtime dependencies Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Installs runtime and dev dependencies added to @rocket.chat/apps in the previous commit (adm-zip, debug, esbuild, jose, jsonrpc-lite, lodash.clonedeep, msgpack, semver, stack-trace, uuid, npm-run-all, rimraf, ts-node). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lass room.ts previously imported `AppManager` from the server layer (`@rocket.chat/apps-engine/server/AppManager.ts`) solely to type the private [PrivateManager] symbol field that backs the deprecated `usernames` getter. This created a cross-boundary import from the Deno subprocess into the Node.js host. Replace with a minimal inline `IRoomManager` interface that exposes only the one method actually called: getBridges().getInternalBridge().doGetUsernamesOfRoomById() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…th at spawn time
The static deno.jsonc used `"@rocket.chat/apps-engine/": "./../src/"` — a
relative path that only works when deno-runtime/ and apps-engine/src/ are
siblings in the same package. Now that deno-runtime lives in @rocket.chat/apps
and the definition source lives in @rocket.chat/apps-engine, the relative path
would resolve to the wrong location.
Solution: generate a `deno_runtime.jsonc` into the temp directory before each
Deno subprocess spawn. The generated config copies all settings from the static
deno.jsonc and injects `@rocket.chat/apps-engine/` as an absolute `file:` URL
resolved via `require.resolve('@rocket.chat/apps-engine/package.json')`. This
works correctly in any environment (monorepo dev, Meteor bundle, CI) without
assumptions about directory layout.
Changes:
- `getAppsEngineSourceDir()`: resolves apps-engine src/ via require.resolve
- `generateRuntimeDenoConfig()`: reads static config, injects resolved path,
writes to tempDir/deno_runtime.jsonc, returns the path
- `spawnProcess()`: calls generateRuntimeDenoConfig, uses the generated config,
adds appsEngineSrcDir to --allow-read
- deno.jsonc: remove the now-redundant static @rocket.chat/apps-engine/ entry
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
64502db to
f0a4b79
Compare
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments
Related to the "Apps-Engine split" stack: