Skip to content

Commit

Permalink
add common package
Browse files Browse the repository at this point in the history
  • Loading branch information
Lordfirespeed committed Oct 29, 2024
1 parent 8200c7c commit a64cb6c
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

## Monorepo subpackages
!/client
!/common
!/server
/client/*
/common/*
/server/*

## Editorconfig
Expand Down
4 changes: 4 additions & 0 deletions common/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
"extends": ["../biome.json"]
}
27 changes: 27 additions & 0 deletions common/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://json.schemastore.org/package",
"name": "@durhack/guilds-common",
"private": true,
"type": "module",
"scripts": {
"build": "tsup",
"dev": "tsup --watch src --watch tsconfig.json"
},
"files": ["dist/**/*"],
"exports": {
"./*": {
"types": "./dist/*.d.ts",
"default": "./dist/*.js"
}
},
"devDependencies": {
"@biomejs/biome": "^1.9.2",
"@types/node": "^22.7.4",
"tsup": "^8.2.3",
"typescript": "^5.6.2",
"zod": "^3.23.8"
},
"peerDependencies": {
"zod": "^3.23.8"
}
}
1 change: 1 addition & 0 deletions common/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// this file must not be deleted: https://github.com/egoist/tsup/issues/728#issuecomment-2379932126
25 changes: 25 additions & 0 deletions common/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"rootDir": "./src",
"baseUrl": "./",
"declaration": true,
"sourceMap": true,
"outDir": "./dist",
"noImplicitAny": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"newLine": "lf",
"paths": {
"@/*": ["./src/*"]
}
},
"exclude": ["./dist", "./node_modules"],
"include": ["src"]
}
15 changes: 15 additions & 0 deletions common/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineConfig } from "tsup"

export default defineConfig([
{
entry: ["./src/**/*"],
target: "esnext",
format: "esm",
dts: true,
splitting: true,
sourcemap: true,
clean: true,
minify: false,
outDir: "dist",
},
])
18 changes: 18 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
packages:
- 'client'
- 'server'
- 'common'

0 comments on commit a64cb6c

Please sign in to comment.