]> git.codecow.com Git - libnemo.git/commitdiff
Simplify build output.
authorChris Duncan <chris@zoso.dev>
Tue, 31 Mar 2026 10:23:19 +0000 (03:23 -0700)
committerChris Duncan <chris@zoso.dev>
Tue, 31 Mar 2026 10:23:19 +0000 (03:23 -0700)
esbuild/config.mjs
package.json
src/index.ts [moved from src/main.ts with 100% similarity]
tsconfig.json

index 92f5b05af79fc8ffa7e69d819e778220050c1573..c72c22ffe9e3b0114a6a4ee2e9b78ceb9bf91e3a 100644 (file)
@@ -27,7 +27,7 @@ export const browserOptions = {
        target: 'es2022',
        dropLabels: ['NODE'],
        entryPoints: [
-               { in: './src/main.ts', out: 'browser.min' }
+               { in: './src/index.ts', out: 'browser' }
        ],
        inject: [
                './esbuild/inject/buffer.mjs'
@@ -46,7 +46,7 @@ export const nodeOptions = {
        target: 'node22',
        dropLabels: ['BROWSER'],
        entryPoints: [
-               { in: './src/main.ts', out: 'nodejs.min' }
+               { in: './src/index.ts', out: 'index' }
        ],
        external: ['node:worker_threads'],
        inject: [
index ff1c3a38542655beaab5da2f8dc80f095ee5e615..8af1085434caa19ce077c1e66120c169d25d1e1a 100644 (file)
@@ -43,9 +43,9 @@
                "url": "git+https://zoso.dev/libnemo.git"
        },
        "scripts": {
-               "clean": "rm -rf dist types && tsc",
-               "build": "npm run clean && node esbuild/dev.mjs && cp -r types dist",
-               "build:prod": "npm run clean && node esbuild/prod.mjs && cp -r types dist",
+               "clean": "rm -rf dist && tsc",
+               "build": "npm run clean && node esbuild/dev.mjs",
+               "build:prod": "npm run clean && node esbuild/prod.mjs",
                "prepublishOnly": "npm run test:prod",
                "reinstall": "rm -rf node_modules package-lock.json && npm cache clean --force && npm i",
                "test": "npm run build && npm run test:node",
@@ -54,9 +54,6 @@
                "test:node": "node --test --test-force-exit --no-experimental-strip-types --env-file .env",
                "test:prod": "npm run build:prod && npm run test:node"
        },
-       "imports": {
-               "#types": "./src/types.d.ts"
-       },
        "dependencies": {
                "@ledgerhq/hw-transport-web-ble": "^6.33.1",
                "@ledgerhq/hw-transport-webhid": "^6.34.0",
        "type": "module",
        "exports": {
                ".": {
-                       "types": "./dist/types/main.d.ts",
-                       "node": "./dist/nodejs.min.js",
-                       "browser": "./dist/browser.min.js",
-                       "import": "./dist/main.js",
-                       "default": "./dist/global.min.js"
+                       "types": "./dist/index.d.ts",
+                       "browser": "./dist/browser.js",
+                       "node": "./dist/index.js",
+                       "import": "./dist/index.js",
+                       "default": "./dist/index.js"
                }
        },
-       "unpkg": "dist/browser.min.js"
+       "unpkg": "dist/browser.js"
 }
similarity index 100%
rename from src/main.ts
rename to src/index.ts
index 9839a273b2983b03e37925c7c0257421197530f9..0dfacf303f485071b97121b84ed26f9dc3a69910 100644 (file)
@@ -3,7 +3,7 @@
                "alwaysStrict": true,
                "checkJs": true,
                "declaration": true,
-               "declarationDir": "./types",
+               "declarationDir": "./dist",
                "emitDeclarationOnly": true,
                "forceConsistentCasingInFileNames": true,
                "isolatedModules": true,
@@ -13,7 +13,7 @@
                "noFallthroughCasesInSwitch": true,
                "rootDir": "src",
                "strict": true,
-               "target": "es2024",
+               "target": "es2022",
                "lib": [
                        "DOM",
                        "ES2022"