Skip to content

Commit

Permalink
chore: bundle package with tsc
Browse files Browse the repository at this point in the history
  • Loading branch information
incognitojam committed Jan 18, 2025
1 parent fcddad7 commit 84c1ace
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Build artifacts
dist/

# Logs

logs
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# qdl.js

**Test**

Run tests in watch mode

```sh
bun test --watch
```

**Build**

Bundles JS and generates type declarations

```sh
bun run build
```
Binary file modified bun.lockb
Binary file not shown.
20 changes: 18 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,30 @@
"version": "0.1.0",
"license": "MIT",
"type": "module",
"main": "dist/qdl.js",
"types": "dist/qdl.d.ts",
"exports": {
".": "./src/qdl.js",
"./utils": "./src/utils.js"
".": {
"types": "./dist/qdl.d.ts",
"import": "./dist/qdl.js"
},
"./utils": {
"types": "./dist/utils.d.ts",
"import": "./dist/utils.js"
}
},
"scripts": {
"build": "rm -rf dist && tsc",
"postinstall": "bun run build"
},
"devDependencies": {
"@types/bun": "latest",
"@types/w3c-web-usb": "^1.0.10"
},
"dependencies": {
"crc-32": "^1.2.2"
},
"peerDependencies": {
"typescript": "^5.0.0"
}
}
15 changes: 12 additions & 3 deletions jsconfig.json → tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@

// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,

// Compilation
"outDir": "dist",
"declaration": true,
"sourceMap": true,
"incremental": true,
"tsBuildInfoFile": "node_modules/.tsbuildinfo",
// TODO: enable after disabling allowJs
// "isolatedDeclarations": true,

// Best practices
"strict": true,
Expand All @@ -21,5 +28,7 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"noPropertyAccessFromIndexSignature": true
}
},
"include": ["src/*.js"],
"exclude": ["src/*.spec.js", "dist", "node_modules"],
}

0 comments on commit 84c1ace

Please sign in to comment.