chore(scaffold): initialize pnpm workspace with build tooling
- Root package.json with @bytelyst/root, pnpm scripts (build, test, typecheck, clean) - pnpm-workspace.yaml declaring packages/* - tsconfig.base.json (ESM, strict, ES2022, NodeNext) - vitest.config.ts (globals, node environment) - .gitignore, .nvmrc (Node 20), .editorconfig - README.md with package overview and quick start
This commit is contained in:
parent
bf22b5ee4c
commit
d875df09a3
12
.editorconfig
Normal file
12
.editorconfig
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
coverage/
|
||||||
|
.DS_Store
|
||||||
|
*.tsbuildinfo
|
||||||
|
.env
|
||||||
|
.env.local
|
||||||
67
README.md
Normal file
67
README.md
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
# @bytelyst/common-platform
|
||||||
|
|
||||||
|
Shared packages for the ByteLyst ecosystem — used by [LysnrAI](https://github.com/saravanakumardb1/learning_voice_ai_agent) and [MindLyst](https://github.com/saravanakumardb1/learning_multimodal_memory_agents).
|
||||||
|
|
||||||
|
## Packages
|
||||||
|
|
||||||
|
| Package | Description | Peer Dependencies |
|
||||||
|
|---------|-------------|-------------------|
|
||||||
|
| `@bytelyst/errors` | Typed HTTP service errors (400–429) | — |
|
||||||
|
| `@bytelyst/cosmos` | Azure Cosmos DB client singleton + container registry | `@azure/cosmos` |
|
||||||
|
| `@bytelyst/config` | Zod-based env config loader + product identity | `zod` |
|
||||||
|
| `@bytelyst/auth` | JWT utilities, auth middleware, password hashing | `jose`, `bcryptjs` |
|
||||||
|
| `@bytelyst/api-client` | Configurable fetch wrapper with auth token injection | — |
|
||||||
|
| `@bytelyst/react-auth` | React auth context factory (typed provider + hook) | `react` |
|
||||||
|
| `@bytelyst/design-tokens` | Cross-platform design tokens (JSON → CSS/TS/Kotlin/Swift) | — |
|
||||||
|
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install dependencies
|
||||||
|
pnpm install
|
||||||
|
|
||||||
|
# Build all packages
|
||||||
|
pnpm build
|
||||||
|
|
||||||
|
# Run all tests
|
||||||
|
pnpm test
|
||||||
|
|
||||||
|
# Type-check all packages
|
||||||
|
pnpm typecheck
|
||||||
|
```
|
||||||
|
|
||||||
|
## Consuming from LysnrAI / MindLyst
|
||||||
|
|
||||||
|
During development, use `file:` references in consumer `package.json`:
|
||||||
|
|
||||||
|
```jsonc
|
||||||
|
// From Fastify services (3 levels up):
|
||||||
|
"@bytelyst/errors": "file:../../../learning_ai_common_plat/packages/errors"
|
||||||
|
|
||||||
|
// From Next.js dashboards at repo root (2 levels up):
|
||||||
|
"@bytelyst/errors": "file:../../learning_ai_common_plat/packages/errors"
|
||||||
|
|
||||||
|
// From MindLyst web (3 levels up — inside mindlyst-native/web/):
|
||||||
|
"@bytelyst/design-tokens": "file:../../../learning_ai_common_plat/packages/design-tokens"
|
||||||
|
```
|
||||||
|
|
||||||
|
All repos must be cloned side-by-side under the same parent directory.
|
||||||
|
|
||||||
|
## Design Tokens
|
||||||
|
|
||||||
|
Generate platform-specific token files from the canonical JSON:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd packages/design-tokens
|
||||||
|
pnpm generate
|
||||||
|
```
|
||||||
|
|
||||||
|
Outputs in `packages/design-tokens/generated/`:
|
||||||
|
- `tokens.css` — CSS custom properties (`--ml-*`)
|
||||||
|
- `tokens.ts` — TypeScript constants
|
||||||
|
- `MindLystTokens.kt` — Kotlin object for KMP
|
||||||
|
- `MindLystTheme.swift` — Swift structs for SwiftUI
|
||||||
|
|
||||||
|
## Roadmap
|
||||||
|
|
||||||
|
See [docs/ROADMAP.md](docs/ROADMAP.md) for the full phased extraction plan.
|
||||||
26
package.json
Normal file
26
package.json
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"name": "@bytelyst/root",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"build": "pnpm -r build",
|
||||||
|
"test": "pnpm -r test",
|
||||||
|
"typecheck": "pnpm -r exec tsc --noEmit",
|
||||||
|
"clean": "pnpm -r exec rm -rf dist"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/bcryptjs": "^2.4.6",
|
||||||
|
"@types/node": "^20.0.0",
|
||||||
|
"@types/react": "^19.0.0",
|
||||||
|
"typescript": "^5.7.0",
|
||||||
|
"vitest": "^3.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@azure/cosmos": ">=4.0.0",
|
||||||
|
"bcryptjs": ">=2.4.0",
|
||||||
|
"jose": ">=5.0.0",
|
||||||
|
"react": ">=18.0.0",
|
||||||
|
"zod": ">=3.20.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
2
pnpm-workspace.yaml
Normal file
2
pnpm-workspace.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
packages:
|
||||||
|
- "packages/*"
|
||||||
18
tsconfig.base.json
Normal file
18
tsconfig.base.json
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "NodeNext",
|
||||||
|
"moduleResolution": "NodeNext",
|
||||||
|
"lib": ["ES2022"],
|
||||||
|
"strict": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"declaration": true,
|
||||||
|
"declarationMap": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"outDir": "dist",
|
||||||
|
"rootDir": "src"
|
||||||
|
}
|
||||||
|
}
|
||||||
8
vitest.config.ts
Normal file
8
vitest.config.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { defineConfig } from "vitest/config";
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
test: {
|
||||||
|
globals: true,
|
||||||
|
environment: "node",
|
||||||
|
},
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue
Block a user