switch to monorepo structure

This commit is contained in:
2025-05-06 11:00:35 +01:00
parent e1f927ad27
commit 07b7f1b51f
63 changed files with 2440 additions and 1011 deletions

34
packages/core/.gitignore vendored Normal file
View File

@@ -0,0 +1,34 @@
# dependencies (bun install)
node_modules
# output
out
dist
*.tgz
# code coverage
coverage
*.lcov
# logs
logs
_.log
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# caches
.eslintcache
.cache
*.tsbuildinfo
# IntelliJ based IDEs
.idea
# Finder (MacOS) folder config
.DS_Store

15
packages/core/README.md Normal file
View File

@@ -0,0 +1,15 @@
# @markone/core
To install dependencies:
```bash
bun install
```
To run:
```bash
bun run index.ts
```
This project was created using `bun init` in bun v1.2.12. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.

View File

@@ -0,0 +1,15 @@
{
"name": "@markone/core",
"module": "src/index.ts",
"type": "module",
"exports": {
"./bookmark": "./src/bookmark.ts",
"./user": "./src/user.ts"
},
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5"
}
}

View File

@@ -0,0 +1,18 @@
type BookmarkKind = "link" | "placeholder"
interface LinkBookmark {
kind: "link"
id: string
title: string
url: string
}
interface PlaceholderBookmark {
id: string
kind: "placeholder"
}
type Bookmark = LinkBookmark | PlaceholderBookmark
type BookmarkId = Bookmark["id"]
export type { Bookmark, BookmarkId, BookmarkKind, LinkBookmark }

13
packages/core/src/user.ts Normal file
View File

@@ -0,0 +1,13 @@
interface User {
id: string
username: string
}
const DEMO_USER = {
id: "01JTEP7T7A5YTM8YXEKHYQ46KK",
username: "demo-user",
unhashedPassword: "secure-hunter2",
} as const
export type { User }
export { DEMO_USER }

View File

@@ -0,0 +1,29 @@
{
"compilerOptions": {
// Environment setup & latest features
"lib": ["ESNext"],
"target": "ESNext",
"module": "NodeNext",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,
// Bundler mode
"moduleResolution": "NodeNext",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": false,
"noEmit": true,
// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
// Some stricter flags (disabled by default)
"noPropertyAccessFromIndexSignature": false,
"outDir": "dist"
},
"include": ["src"]
}