Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ help: ## Show available targets
# ---------------------------------------------------------------------------

install: ## Install all npm dependencies (packages + vue + mock-api)
cd packages/core && npm install
cd packages/oauth2 && npm install
cd packages/browser-storage && npm install
cd packages/logger && npm install
cd packages/ts/core && npm install
cd packages/ts/oauth2 && npm install
cd packages/ts/browser-storage && npm install
cd packages/ts/logger && npm install
cd poc/ts-vue && npm install
cd poc/mock-api && npm install

build: ## Build all SDK packages (core → oauth2 → browser-storage → logger)
cd packages/core && npm run build
cd packages/oauth2 && npm run build
cd packages/browser-storage && npm run build
cd packages/logger && npm run build
cd packages/ts/core && npm run build
cd packages/ts/oauth2 && npm run build
cd packages/ts/browser-storage && npm run build
cd packages/ts/logger && npm run build

dart-get: ## Dart: pub get (packages/dart/morph_core)
cd packages/dart/morph_core && dart pub get
Expand Down Expand Up @@ -105,10 +105,10 @@ stop: down ## Alias for 'down'
# ---------------------------------------------------------------------------

clean: ## Remove node_modules and dist artefacts
rm -rf packages/core/node_modules packages/core/dist
rm -rf packages/oauth2/node_modules packages/oauth2/dist
rm -rf packages/browser-storage/node_modules packages/browser-storage/dist
rm -rf packages/logger/node_modules packages/logger/dist
rm -rf packages/ts/core/node_modules packages/ts/core/dist
rm -rf packages/ts/oauth2/node_modules packages/ts/oauth2/dist
rm -rf packages/ts/browser-storage/node_modules packages/ts/browser-storage/dist
rm -rf packages/ts/logger/node_modules packages/ts/logger/dist
rm -rf poc/ts-vue/node_modules poc/ts-vue/dist
rm -rf poc/mock-api/node_modules
rm -rf packages/dart/morph_core/.dart_tool
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ See **[docs/README.md](docs/README.md)** for the full documentation index.

| Path | Package | Role |
|------|---------|------|
| `packages/core/` | `@morph/core` | Types, config, HTTP pipeline, MorphClient, AuthHandle |
| `packages/oauth2/` | `@morph/oauth2` | TokenLifecycle, TokenVault, OAuth helpers |
| `packages/browser-storage/` | `@morph/browser-storage` | sessionStorage / localStorage adapters |
| `packages/logger/` | `@morph/logger` | Structured logging and HTTP trace plugin |
| `packages/ts/core/` | `@morph/core` | Types, config, HTTP pipeline, MorphClient, AuthHandle |
| `packages/ts/oauth2/` | `@morph/oauth2` | TokenLifecycle, TokenVault, OAuth helpers |
| `packages/ts/browser-storage/` | `@morph/browser-storage` | sessionStorage / localStorage adapters |
| `packages/ts/logger/` | `@morph/logger` | Structured logging and HTTP trace plugin |
| `packages/dart/morph_core/` | `morph_core` | **Dart** — config validation + indexes (parity with TS `validate.ts`); runtime/OAuth TBD — [docs/dart-parity.md](docs/dart-parity.md) |
| `poc/ts-vue/` | | Vue 3 demo app |
| `poc/keycloak/` | | Docker Keycloak realm + setup/test scripts |
Expand Down
52 changes: 29 additions & 23 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,29 +156,35 @@ The `allowedAuth` list enables **request-time validation**: if a request through
```
morph-api-client/
├── packages/
│ ├── 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
│ ├── 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 on lines +159 to +187
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/

├── poc/
│ ├── ts-vue/ # Vue 3 PoC app
│ ├── keycloak/ # Docker Keycloak realm
Expand Down
4 changes: 2 additions & 2 deletions docs/dart-parity.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Dart / Flutter SDK parity

The TypeScript implementation is the reference (`packages/core`, `packages/oauth2`,
`packages/browser-storage`, `packages/logger`). **Dart/Flutter parity** is tracked on
The TypeScript implementation is the reference (`packages/ts/core`, `packages/ts/oauth2`,
`packages/ts/browser-storage`, `packages/ts/logger`). **Dart/Flutter parity** is tracked on
GitHub:
- **[issue #1](https://github.com/burgan-tech/morph-api-client/issues/1)** — scaffold (`morph_core`, CI entry).
- **[issue #3](https://github.com/burgan-tech/morph-api-client/issues/3)** — **full Dart/TS feature parity** (remaining gaps).
Expand Down
4 changes: 2 additions & 2 deletions docs/github-issue-1-body-issue-only.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Local run: `make dart-all` or `cd packages/dart/morph_core && dart pub get && da

## Later phases (sub-issues or checklist)

- [ ] Strongly typed `MorphConfig` / `MorphOptions` aligned with `packages/core/src/types.ts`
- [ ] Runtime + topological plugin install (parity with `packages/core/src/runtime.ts`)
- [ ] Strongly typed `MorphConfig` / `MorphOptions` aligned with `packages/ts/core/src/types.ts`
- [ ] Runtime + topological plugin install (parity with `packages/ts/core/src/runtime.ts`)
- [ ] Port `@morph/oauth2` (new package e.g. `packages/dart/morph_oauth2` or `lib/src/oauth2/`)
- [ ] Storage adapters (Flutter / VM) per `docs/platform-adapters.md`
- [ ] Logger / HTTP trace hooks
Expand Down
4 changes: 2 additions & 2 deletions docs/github-issue-1-body.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Local run: `make dart-all` or `cd packages/dart/morph_core && dart pub get && da

## Later phases (sub-issues or checklist)

- [ ] Strongly typed `MorphConfig` / `MorphOptions` aligned with `packages/core/src/types.ts`
- [ ] Runtime + topological plugin install (parity with `packages/core/src/runtime.ts`)
- [ ] Strongly typed `MorphConfig` / `MorphOptions` aligned with `packages/ts/core/src/types.ts`
- [ ] Runtime + topological plugin install (parity with `packages/ts/core/src/runtime.ts`)
- [ ] Port `@morph/oauth2` (new package e.g. `packages/dart/morph_oauth2` or `lib/src/oauth2/`)
- [ ] Storage adapters (Flutter / VM) per `docs/platform-adapters.md`
- [ ] Logger / HTTP trace hooks
Expand Down
2 changes: 1 addition & 1 deletion docs/github-issue-dart-full-parity-body.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Goal

Deliver a **Dart/Flutter Morph API Client** with **functional parity** to the existing TypeScript implementation (`packages/core`, `packages/oauth2`, `packages/browser-storage`, `packages/logger`): same **JSON configuration schema**, same **OAuth2 / multi-context token lifecycle**, **HTTP pipeline behavior** (auth resolution, retry, trace, 401 recovery), and **plugin composition** (`provides` / `requires`, `provideAuth` / `provideStorage`, logger chaining).
Deliver a **Dart/Flutter Morph API Client** with **functional parity** to the existing TypeScript implementation (`packages/ts/core`, `packages/ts/oauth2`, `packages/ts/browser-storage`, `packages/ts/logger`): same **JSON configuration schema**, same **OAuth2 / multi-context token lifecycle**, **HTTP pipeline behavior** (auth resolution, retry, trace, 401 recovery), and **plugin composition** (`provides` / `requires`, `provideAuth` / `provideStorage`, logger chaining).

Foundation: Phase 1 scaffold in `packages/dart/morph_core` ([#1](https://github.com/burgan-tech/morph-api-client/issues/1), base branch **`f/plugin`**).

Expand Down
Loading
Loading