chore: nest TypeScript SDK under packages/ts (closes #31)#32
Conversation
- Move core, oauth2, logger, browser-storage to packages/ts/ for parity with packages/dart/ - Point npm workspaces and Makefile/package scripts at packages/ts/* - Update poc/ts-vue file: deps, README, dart-parity, architecture tree, Dart parity comments Closes #31 Co-authored-by: Cursor <cursoragent@cursor.com>
Reviewer's GuideRestructures the repository so all TypeScript SDK workspaces live under packages/ts, updates build/install tooling and workspace configuration accordingly, and aligns all documentation and Dart parity references to the new TS paths, including regenerating package-lock.json. Flow diagram for updated Makefile install/build/clean for TS packagesflowchart TD
start_install["make install"] --> install_core["cd packages/ts/core && npm install"]
install_core --> install_oauth2["cd packages/ts/oauth2 && npm install"]
install_oauth2 --> install_storage["cd packages/ts/browser-storage && npm install"]
install_storage --> install_logger["cd packages/ts/logger && npm install"]
install_logger --> install_ts_vue["cd poc/ts-vue && npm install"]
install_ts_vue --> install_mock_api["cd poc/mock-api && npm install"]
start_build["make build"] --> build_core["cd packages/ts/core && npm run build"]
build_core --> build_oauth2["cd packages/ts/oauth2 && npm run build"]
build_oauth2 --> build_storage["cd packages/ts/browser-storage && npm run build"]
build_storage --> build_logger["cd packages/ts/logger && npm run build"]
start_clean["make clean"] --> clean_core["rm -rf packages/ts/core/node_modules packages/ts/core/dist"]
start_clean --> clean_oauth2["rm -rf packages/ts/oauth2/node_modules packages/ts/oauth2/dist"]
start_clean --> clean_storage["rm -rf packages/ts/browser-storage/node_modules packages/ts/browser-storage/dist"]
start_clean --> clean_logger["rm -rf packages/ts/logger/node_modules packages/ts/logger/dist"]
start_clean --> clean_ts_vue["rm -rf poc/ts-vue/node_modules poc/ts-vue/dist"]
start_clean --> clean_mock_api["rm -rf poc/mock-api/node_modules"]
start_clean --> clean_dart_core["rm -rf packages/dart/morph_core/.dart_tool"]
start_clean --> clean_dart_oauth2["rm -rf packages/dart/morph_oauth2/.dart_tool"]
start_clean --> clean_dart_logger["rm -rf packages/dart/morph_logger/.dart_tool"]
start_clean --> clean_dart_storage["rm -rf packages/dart/morph_storage/.dart_tool"]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
There was a problem hiding this comment.
Code Review
This pull request restructures the repository by moving TypeScript packages into a packages/ts/ subdirectory and updating all internal references, build scripts, and documentation. Feedback includes correcting alignment and missing descriptions in the architecture documentation's directory tree, as well as addressing extraneous entries in the package-lock.json that resulted from the migration.
| │ ├── ts/ # TypeScript npm workspaces (@morph/*) | ||
| │ │ ├── core/ # @morph/core — types, config, HTTP pipeline, client facades | ||
| │ │ │ └── src/ | ||
| │ │ │ ├── client/ # MorphClient, HostClient, AuthHandle | ||
| │ │ │ ├── config/ # validate (CtxRef, hostByKey), interpolate ($variable) | ||
| │ │ │ ├── http/ # HostPipeline (depends on AuthPlugin interface) | ||
| │ │ │ ├── util/ # jwt, expiry, url, duration, httpTrace, oauthState | ||
| │ │ │ ├── runtime.ts # MorphRuntime coordinator | ||
| │ │ │ ├── types.ts # Public interfaces (AuthPlugin, StorageProvider, …) | ||
| │ │ │ ├── errors.ts # Error classes | ||
| │ │ │ └── index.ts # Public exports | ||
| │ │ ├── oauth2/ # @morph/oauth2 — OAuth2 token lifecycle plugin | ||
| │ │ │ └── src/ | ||
| │ │ │ ├── tokens/ # TokenLifecycle (implements AuthPlugin), TokenVault | ||
| │ │ │ ├── oauth/ # tokenHttp (grant HTTP) | ||
| │ │ │ ├── util/ # interpolate, expiry, exchangeSources | ||
| │ │ │ └── index.ts # oauth2Plugin() MorphPlugin factory | ||
| │ │ ├── browser-storage/ # @morph/browser-storage — browser storage adapters | ||
| │ │ │ └── src/ | ||
| │ │ │ ├── browserStorage.ts | ||
| │ │ │ └── index.ts # browserStoragePlugin() MorphPlugin factory | ||
| │ │ └── logger/ # @morph/logger — structured logging plugin | ||
| │ │ └── src/ | ||
| │ │ └── index.ts # loggerPlugin() MorphPlugin factory | ||
| │ └── dart/ # Dart Pub packages (morph_*), parity with TS track | ||
| │ ├── morph_core/ | ||
| │ ├── morph_oauth2/ | ||
| │ ├── morph_logger/ | ||
| │ └── morph_storage/ |
There was a problem hiding this comment.
The directory tree diagram has several alignment issues and a missing comment:
- The comments for the file structure are not vertically aligned (e.g., compare line 162 with 163).
- The comment for
browserStorage.ts(previously on line 177 in the old version) has been removed. - The indentation of the tree branches and comments is inconsistent across the block.
I've provided a suggestion that restores the missing comment and aligns all descriptions at the same column for better readability.
│ ├── ts/ # TypeScript npm workspaces (@morph/*)
│ │ ├── core/ # @morph/core — types, config, HTTP pipeline, client facades
│ │ │ └── src/
│ │ │ ├── client/ # MorphClient, HostClient, AuthHandle
│ │ │ ├── config/ # validate (CtxRef, hostByKey), interpolate ($variable)
│ │ │ ├── http/ # HostPipeline (depends on AuthPlugin interface)
│ │ │ ├── util/ # jwt, expiry, url, duration, httpTrace, oauthState
│ │ │ ├── runtime.ts # MorphRuntime coordinator
│ │ │ ├── types.ts # Public interfaces (AuthPlugin, StorageProvider, …)
│ │ │ ├── errors.ts # Error classes
│ │ │ └── index.ts # Public exports
│ │ ├── oauth2/ # @morph/oauth2 — OAuth2 token lifecycle plugin
│ │ │ └── src/
│ │ │ ├── tokens/ # TokenLifecycle (implements AuthPlugin), TokenVault
│ │ │ ├── oauth/ # tokenHttp (grant HTTP)
│ │ │ ├── util/ # interpolate, expiry, exchangeSources
│ │ │ └── index.ts # oauth2Plugin() MorphPlugin factory
│ │ ├── browser-storage/ # @morph/browser-storage — browser storage adapters
│ │ │ └── src/
│ │ │ ├── browserStorage.ts # createBrowserSessionStorage, createBrowserLocalStorage
│ │ │ └── index.ts # browserStoragePlugin() MorphPlugin factory
│ │ └── logger/ # @morph/logger — structured logging plugin
│ │ └── src/
│ │ └── index.ts # loggerPlugin() MorphPlugin factory
│ └── dart/ # Dart Pub packages (morph_*), parity with TS track
│ ├── morph_core/
│ ├── morph_oauth2/
│ ├── morph_logger/
│ └── morph_storage/| "packages/browser-storage": { | ||
| "name": "@morph/browser-storage", | ||
| "version": "0.1.0", | ||
| "extraneous": true, |
There was a problem hiding this comment.
The lockfile contains extraneous: true entries for the old package paths (e.g., packages/browser-storage, packages/core, etc.). This indicates that the old directories might still exist on disk or the lockfile wasn't fully pruned during the migration.
To ensure a clean state, it is recommended to:
- Delete the old package directories if they still exist.
- Remove
node_modulesand thepackage-lock.jsonfile. - Run
npm installagain to generate a clean lockfile without these extraneous entries.
- Align branch comments and restore browserStorage.ts description - Regenerate package-lock.json after clean npm install (remove extraneous entries) Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed Gemini review feedback:
|
Summary
Aligns repo layout so TypeScript workspaces live under
packages/ts/, mirroringpackages/dart/.Changes
core,oauth2,logger,browser-storage→packages/ts/package.json: workspacespackages/ts/*, build scripts updatedMakefile: install/build/clean paths updatedpoc/ts-vue/package.json:file:deps point at../../packages/ts/...README.md,docs/dart-parity.md,docs/architecture.md, GitHub issue templates) + Dart parity comments updated to new TS pathspackage-lock.jsonvianpm installVerification
npm run build:packages— passdart analyze+dart test—morph_core,morph_oauth2,morph_logger;morph_storageanalyze only (no test dir)Note
npm run build --prefix poc/ts-vuefailed locally with Node v24 +vue-tsc(Search string not found). Likely toolchain mismatch; TS packages build cleanly.Closes #31
Made with Cursor
Summary by Sourcery
Nest TypeScript SDK packages under packages/ts and update references
Enhancements: