- Add LICENSE-MIT and LICENSE-APACHE for dual MIT / Apache-2.0 distribution - Update root LICENSE pointer, README.md, Deno workspace manifests, and Cargo.toml - Add deno.lock dependency lockfile - Format AGENTS.md system guidelines - Import task lifecycle scaffolding and historical story specifications (extract-auth-yes, setup-ts architecture, modular workspace)
3.6 KiB
3.6 KiB
TASK METADATA
- Target Files:
auth-yes/deno.json,auth-yes/sdk/deno.json,auth-yes/server/deno.json,auth-yes/ui/deno.json,auth-yes/sdk/gen/* - Core Objective: Architect the modular Deno workspace structure for the
standalone auth-yes repository to ensure
@auth-yes/sdkis fully isolated and cleanly exportable. - Dependencies: None.
- Additional Important Notes:
- Package naming standard:
@auth-yes/sdk,@auth-yes/server,@auth-yes/ui. @auth-yes/sdkmust have zero database or server imports and be consumable independently.- UI JSX compilation relies on
"jsx": "react-jsx"with"jsxImportSource": "jsr:@hono/hono@4/jsx"(pure Hono SSR, zero React dependencies).
- Package naming standard:
Architectural Considerations & Risks
- Risks: The primary risk is a circular dependency or importing server-side logic into the SDK, which would break the isolation of the SDK. If the SDK depends on the server, external consumers (like ed-droid) will be forced to download unnecessary and potentially insecure backend dependencies.
- Dependency Decoupling for Contracts: The generated ConnectRPC contracts
(
auth_pb.tsandauth_connect.ts) currently reside inserver/gen/. To ensure the SDK has 100% zero dependencies on./server, these generated files must be moved into the SDK (e.g.,sdk/gen/). This way, consumers of@auth-yes/sdkwill have all necessary type definitions and client stubs without needing any server files. The server package can then import these service contracts from the SDK. - JSX Compiler Standard (Zero React): TypeScript and Deno use
"jsx": "react-jsx"as the compiler standard for the modern JSX transform. When paired with"jsxImportSource": "jsr:@hono/hono@4/jsx", TypeScript targets Hono's lightweight native SSR engine without pulling in any React runtime or dependencies. - Alternatives: We could extract the proto contracts into a separate fourth
workspace member (e.g.,
api-contracts). However, moving them directly into the SDK is simpler and provides exactly what external consumers need in a single package.
Proposed Implementation
Phase 1: Root Workspace Definition
- Create a root
deno.jsoninauth-yes/managing workspace members:"./sdk","./server","./ui". - Configure workspace-wide tasks (
lint,fmt,check,test).
Phase 2: SDK Package Isolation
- Create
auth-yes/sdk/deno.jsonwith package name@auth-yes/sdk, version0.1.0, and export definition ("exports": "./mod.ts"). - Move the generated ConnectRPC contracts from
server/gen/intosdk/gen/. - Update
sdk/mod.tsto export client functions and proto types, ensuring zero imports point to../serveror../ui.
Phase 3: Server and UI Package Configuration
- Create
auth-yes/server/deno.jsonwith package name@auth-yes/server. - Update
auth-yes/server/main.tsto import service contracts directly from@auth-yes/sdk. - Create
auth-yes/ui/deno.jsonwith package name@auth-yes/ui, including:"compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "jsr:@hono/hono@4/jsx" } - Verify that the Rust
spire_fficrate is properly referenced byserver/and is not exposed or imported by@auth-yes/sdk.
Phase 4: Workspace Verification & Quality Gates
- Run
deno fmtacross all workspace members. - Run
deno lintto ensure zero import violations. - Run
deno check sdk/**/*.ts server/**/*.ts ui/**/*.tsto verify clean cross-package type resolutions. - Run
deno test -Ato verify test suite execution.