Skip to content

Commit b763cc9

Browse files
committed
fix: add bundler and update actions
1 parent c90ffe3 commit b763cc9

File tree

4 files changed

+46
-26
lines changed

4 files changed

+46
-26
lines changed

.github/workflows/npm-publish.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,23 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919

20+
- name: Setup Bun
21+
uses: oven-sh/setup-bun@v1
22+
with:
23+
bun-version: latest
24+
2025
- name: Setup Node.js
2126
uses: actions/setup-node@v4
2227
with:
2328
node-version: "20.x"
2429
registry-url: "https://registry.npmjs.org"
2530

31+
- name: Install Dependencies
32+
run: bun install
33+
34+
- name: Build
35+
run: bun run build
36+
2637
- name: Publish to NPM
2738
run: npm publish --access public
2839
env:

bun.lockb

43.8 KB
Binary file not shown.

packages/tinyqrc/package.json

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "tinyqrc",
33
"description": "A tiny QR code generator, written in TypeScript.",
4-
"version": "0.0.3",
4+
"version": "0.0.4",
55
"author": "Christo Todorov <[email protected]>",
66
"license": "MIT",
77
"repository": "https://github.com/chroxify/tinyqrc",
@@ -13,14 +13,34 @@
1313
"qr-code-generator-typescript",
1414
"qr-code-generator-typescript-library"
1515
],
16-
"module": "src/index.ts",
16+
"main": "./dist/index.js",
17+
"module": "./dist/index.mjs",
18+
"types": "./dist/index.d.ts",
19+
"files": [
20+
"dist"
21+
],
1722
"exports": {
18-
".": "./src/index.ts",
19-
"./constants": "./src/constants.ts"
23+
".": {
24+
"types": "./dist/index.d.ts",
25+
"import": "./dist/index.mjs",
26+
"require": "./dist/index.js"
27+
},
28+
"./constants": {
29+
"types": "./dist/constants.d.ts",
30+
"import": "./dist/constants.mjs",
31+
"require": "./dist/constants.js"
32+
}
33+
},
34+
"scripts": {
35+
"build": "tsc && tsc --module ESNext --outDir dist/esm && mv dist/esm/index.js dist/index.mjs && rm -rf dist/esm",
36+
"dev": "tsc --watch",
37+
"clean": "rm -rf dist",
38+
"prepublishOnly": "bun run build"
2039
},
2140
"type": "module",
2241
"devDependencies": {
23-
"@types/bun": "latest"
42+
"@types/bun": "latest",
43+
"typescript": "^5.0.0"
2444
},
2545
"peerDependencies": {
2646
"typescript": "^5.0.0"

packages/tinyqrc/tsconfig.json

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,16 @@
11
{
22
"compilerOptions": {
3-
// Enable latest features
3+
"target": "ES2020",
4+
"module": "CommonJS",
45
"lib": ["ESNext", "DOM"],
5-
"target": "ESNext",
6-
"module": "ESNext",
7-
"moduleDetection": "force",
8-
"jsx": "react-jsx",
9-
"allowJs": true,
10-
11-
// Bundler mode
12-
"moduleResolution": "bundler",
13-
"allowImportingTsExtensions": true,
14-
"verbatimModuleSyntax": true,
15-
"noEmit": true,
16-
17-
// Best practices
6+
"declaration": true,
7+
"outDir": "dist",
188
"strict": true,
9+
"esModuleInterop": true,
1910
"skipLibCheck": true,
20-
"noFallthroughCasesInSwitch": true,
21-
22-
// Some stricter flags (disabled by default)
23-
"noUnusedLocals": false,
24-
"noUnusedParameters": false,
25-
"noPropertyAccessFromIndexSignature": false
26-
}
11+
"forceConsistentCasingInFileNames": true,
12+
"moduleResolution": "node"
13+
},
14+
"include": ["src/**/*"],
15+
"exclude": ["node_modules", "dist"]
2716
}

0 commit comments

Comments
 (0)