switch to monorepo structure
This commit is contained in:
34
packages/core/.gitignore
vendored
Normal file
34
packages/core/.gitignore
vendored
Normal 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
15
packages/core/README.md
Normal 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.
|
15
packages/core/package.json
Normal file
15
packages/core/package.json
Normal 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"
|
||||
}
|
||||
}
|
18
packages/core/src/bookmark.ts
Normal file
18
packages/core/src/bookmark.ts
Normal 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
13
packages/core/src/user.ts
Normal 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 }
|
29
packages/core/tsconfig.json
Normal file
29
packages/core/tsconfig.json
Normal 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"]
|
||||
}
|
Reference in New Issue
Block a user