Skip to content

chore: nest TypeScript SDK under packages/ts (closes #31)#32

Merged
cemal-yilmaz-bt merged 2 commits into
f/pluginfrom
chore/align-packages-ts-layout-issue-31
May 4, 2026
Merged

chore: nest TypeScript SDK under packages/ts (closes #31)#32
cemal-yilmaz-bt merged 2 commits into
f/pluginfrom
chore/align-packages-ts-layout-issue-31

Conversation

@cemal-yilmaz-bt
Copy link
Copy Markdown

@cemal-yilmaz-bt cemal-yilmaz-bt commented May 4, 2026

Summary

Aligns repo layout so TypeScript workspaces live under packages/ts/, mirroring packages/dart/.

Changes

  • Moved core, oauth2, logger, browser-storagepackages/ts/
  • Root package.json: workspaces packages/ts/*, build scripts updated
  • Makefile: install/build/clean paths updated
  • poc/ts-vue/package.json: file: deps point at ../../packages/ts/...
  • Docs (README.md, docs/dart-parity.md, docs/architecture.md, GitHub issue templates) + Dart parity comments updated to new TS paths
  • Regenerated root package-lock.json via npm install

Verification

  • npm run build:packages — pass
  • dart analyze + dart testmorph_core, morph_oauth2, morph_logger; morph_storage analyze only (no test dir)

Note

npm run build --prefix poc/ts-vue failed 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:

  • Update workspace, build scripts, and Makefile paths to target packages/ts TypeScript packages
  • Align documentation and Dart parity references to new TypeScript package locations
  • Adjust PoC Vue app dependencies to consume TypeScript packages from packages/ts

- 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>
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 4, 2026

Reviewer's Guide

Restructures 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 packages

flowchart 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"]
Loading

File-Level Changes

Change Details Files
Nest TypeScript SDK packages under packages/ts and update workspace tooling.
  • Move core, oauth2, browser-storage, and logger packages into packages/ts/ while keeping their internal source layout intact.
  • Restrict npm workspaces in the root package.json to packages/ts/* and update build:* scripts to point at packages/ts/* paths.
  • Adjust Makefile install/build/clean targets to use packages/ts/* paths for TS packages.
  • Update poc/ts-vue/package.json file: dependencies to reference ../../packages/ts/* instead of ../../packages/*.
  • Regenerate package-lock.json via npm install to reflect the new workspace locations.
package.json
Makefile
poc/ts-vue/package.json
package-lock.json
packages/ts/core/**
packages/ts/oauth2/**
packages/ts/browser-storage/**
packages/ts/logger/**
Update documentation and Dart parity comments to reference new TypeScript package paths under packages/ts.
  • Rewrite architecture.md repo tree to show packages/ts subtree for TS packages and packages/dart for Dart packages.
  • Update README.md package table to use packages/ts/* paths for TS SDKs.
  • Change all Dart source parity comments and doc references from packages/* to packages/ts/*, including links in morph_core, morph_oauth2, and morph_logger.
  • Adjust GitHub issue template bodies to reference packages/ts/... paths for TS sources when describing parity targets.
docs/architecture.md
README.md
docs/dart-parity.md
docs/github-issue-1-body-issue-only.md
docs/github-issue-1-body.md
docs/github-issue-dart-full-parity-body.md
packages/dart/morph_core/**
packages/dart/morph_logger/**
packages/dart/morph_oauth2/**

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dbec1028-50a3-4322-adbf-a8dd2c482854

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/align-packages-ts-layout-issue-31

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/architecture.md
Comment on lines +159 to +187
│ ├── 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/
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The directory tree diagram has several alignment issues and a missing comment:

  1. The comments for the file structure are not vertically aligned (e.g., compare line 162 with 163).
  2. The comment for browserStorage.ts (previously on line 177 in the old version) has been removed.
  3. 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/

Comment thread package-lock.json Outdated
"packages/browser-storage": {
"name": "@morph/browser-storage",
"version": "0.1.0",
"extraneous": true,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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:

  1. Delete the old package directories if they still exist.
  2. Remove node_modules and the package-lock.json file.
  3. Run npm install again 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>
@cemal-yilmaz-bt
Copy link
Copy Markdown
Author

Addressed Gemini review feedback:

  • docs/architecture.md: aligned the packages/ts/ tree (column alignment, consistent spacing, restored browserStorage.ts line comment).
  • package-lock.json: removed root/workspace node_modules, deleted lockfile, ran fresh npm install — no extraneous entries remain for old packages/core paths.

npm run build:packages verified locally after regen.

@cemal-yilmaz-bt cemal-yilmaz-bt merged commit e257149 into f/plugin May 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant