diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2bf740a..e0bfc56 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,56 +2,14 @@ name: Publish release on: release: types: [created] - workflow_dispatch: jobs: - publish-jsr: - name: Publish to JSR.io - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - steps: - - uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4 - - run: npm install -g jsr - - run: jsr publish - publish-npm: - name: Publish to NPM - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - steps: - - uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4 - - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4 - with: - node-version: 22 - registry-url: 'https://registry.npmjs.org' - cache: npm - - run: npm ci - - run: npm run build - - run: npm publish --provenance --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} - standalone: - name: Upload files to GitHub Releases - runs-on: ubuntu-latest + test-js: + name: 'jsbt v0.3.0' # Should match commit below + uses: paulmillr/jsbt/.github/workflows/test-js.yml@973650a225c0344aa5f993a6cd63835a262077e9 + with: + build-path: test/build + secrets: + NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} permissions: contents: write id-token: write - steps: - - uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4 - - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4 - with: - node-version: 22 - registry-url: 'https://registry.npmjs.org' - cache: npm - - run: npm ci - - run: npm run build - - run: | - cd build - npm ci - npm run build:release - cd .. - - run: gh release upload ${{ github.event.release.tag_name }} build/`npx jsbt outfile` - env: - GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/test-js.yml b/.github/workflows/test-js.yml index 32b3af8..963e5b9 100644 --- a/.github/workflows/test-js.yml +++ b/.github/workflows/test-js.yml @@ -4,5 +4,5 @@ on: - pull_request jobs: test-js: - name: "JS v0.2.2" # v0.2.2 == commit below - uses: paulmillr/jsbt/.github/workflows/test-js.yml@986dbfea9667eeb0e81bf606cbe9ed169fea89b2 + name: 'jsbt v0.3.0' # Should match commit below + uses: paulmillr/jsbt/.github/workflows/test-js.yml@973650a225c0344aa5f993a6cd63835a262077e9 diff --git a/.gitignore b/.gitignore index a971655..0df07e0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ node_modules -/build/micro-eth-signer.js /lib /index.js /index.d.ts -/test/fixtures/* \ No newline at end of file +/test/fixtures/* +/test/build \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ddd60e3..8299649 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,17 +9,17 @@ "version": "0.1.1", "license": "MIT", "dependencies": { - "@scure/base": "~1.1.5", + "@scure/base": "~1.2.1", "@scure/btc-signer": "~1.3.2", "enquirer": "2.4.1", - "micro-packed": "~0.6.2" + "micro-packed": "~0.7.1" }, "bin": { "ord": "lib/esm/cli.js" }, "devDependencies": { - "@noble/curves": "^1.4.0", - "@paulmillr/jsbt": "0.1.0", + "@noble/curves": "^1.8.0", + "@paulmillr/jsbt": "0.3.0", "@types/node": "20.12.7", "micro-bmark": "0.3.1", "micro-should": "0.5.0", @@ -28,11 +28,29 @@ } }, "node_modules/@noble/curves": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.0.tgz", - "integrity": "sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.0.tgz", + "integrity": "sha512-j84kjAbzEnQHaSIhRPUmB3/eVXu2k3dKPl2LOrR8fSOIL+89U+7lV117EWHtq/GHM3ReGHM46iRBdZfpc4HRUQ==", + "dev": true, + "license": "MIT", "dependencies": { - "@noble/hashes": "1.4.0" + "@noble/hashes": "1.7.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/curves/node_modules/@noble/hashes": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.0.tgz", + "integrity": "sha512-HXydb0DgzTpDPwbVeDGCG1gIu7X6+AuU6Zl6av/E/KG8LMsvPntvq+w17CHRpKBmN6Ybdrt1eP3k4cj8DJa78w==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" }, "funding": { "url": "https://paulmillr.com/funding/" @@ -50,18 +68,20 @@ } }, "node_modules/@paulmillr/jsbt": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@paulmillr/jsbt/-/jsbt-0.1.0.tgz", - "integrity": "sha512-TdowoHD36hkZARv6LW4jenkVTdK2vP0sy4ZM8E9MxaqAAIRdwmn3RlB+zWkEHi4hKTgLqMGkURfNkFtt0STX2Q==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@paulmillr/jsbt/-/jsbt-0.3.0.tgz", + "integrity": "sha512-lpHkZMDjG8U8SGWjYNN3q+slbiNFxRdnu2V7kDnL+OMdP8/EMGZuZjYaQ13gGsANFowKFpZdsh6q2gDfHXBn/w==", "dev": true, + "license": "MIT", "bin": { "jsbt": "jsbt.js" } }, "node_modules/@scure/base": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.6.tgz", - "integrity": "sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.1.tgz", + "integrity": "sha512-DGmGtC8Tt63J5GfHgfl5CuAXh96VF/LD8K9Hr/Gv0J2lAoRGlPOMpqMpMbCTOoOJMZCk2Xt+DskdDyn6dEFdzQ==", + "license": "MIT", "funding": { "url": "https://paulmillr.com/funding/" } @@ -80,6 +100,39 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/@scure/btc-signer/node_modules/@noble/curves": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", + "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/btc-signer/node_modules/@scure/base": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz", + "integrity": "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==", + "license": "MIT", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/btc-signer/node_modules/micro-packed": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/micro-packed/-/micro-packed-0.6.3.tgz", + "integrity": "sha512-VmVkyc7lIzAq/XCPFuLc/CwQ7Ehs5XDK3IwqsZHiBIDttAI9Gs7go6Lv4lNRuAIKrGKcRTtthFKUNyHS0S4wJQ==", + "license": "MIT", + "dependencies": { + "@scure/base": "~1.1.5" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@types/node": { "version": "20.12.7", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", @@ -124,11 +177,12 @@ "dev": true }, "node_modules/micro-packed": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/micro-packed/-/micro-packed-0.6.2.tgz", - "integrity": "sha512-a1C2m0WdjZSMleMylPihztSwQSt3pd97lbk6inQgYJ+AVWJIzNfufOQo3faBztJAdvr0h9gt190H9xp+sKKJGA==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/micro-packed/-/micro-packed-0.7.1.tgz", + "integrity": "sha512-Ab7jfxdnrwH3QtHNkz+hIwPxfl7IXPDcODZ0ED645uqHn/iijboGhBfUk5H53mdbmrbiQxagmUYkbzrYKEDwLA==", + "license": "MIT", "dependencies": { - "@scure/base": "~1.1.5" + "@scure/base": "~1.2.1" }, "funding": { "url": "https://paulmillr.com/funding/" diff --git a/package.json b/package.json index 049d92a..364e565 100644 --- a/package.json +++ b/package.json @@ -13,14 +13,14 @@ "module": "lib/esm/index.js", "types": "lib/index.d.ts", "dependencies": { - "@scure/base": "~1.1.5", + "@scure/base": "~1.2.1", "@scure/btc-signer": "~1.3.2", "enquirer": "2.4.1", - "micro-packed": "~0.6.2" + "micro-packed": "~0.7.1" }, "devDependencies": { - "@noble/curves": "^1.4.0", - "@paulmillr/jsbt": "0.1.0", + "@noble/curves": "^1.8.0", + "@paulmillr/jsbt": "0.3.0", "@types/node": "20.12.7", "micro-bmark": "0.3.1", "micro-should": "0.5.0", @@ -29,7 +29,7 @@ }, "scripts": { "build": "tsc && tsc -p tsconfig.cjs.json", - "build:release": "cd build; npm run build:release", + "build:release": "npx jsbt esbuild test/build", "lint": "prettier --check src", "format": "prettier --write src", "test": "node test/index.js", diff --git a/src/cbor.ts b/src/cbor.ts index 27f3154..7e2077d 100644 --- a/src/cbor.ts +++ b/src/cbor.ts @@ -1,5 +1,5 @@ -import * as P from "micro-packed"; import { utils } from "@scure/btc-signer"; +import * as P from "micro-packed"; type Bytes = Uint8Array; @@ -58,7 +58,7 @@ const cborUint = P.wrap({ if (value < 24) return INFO.encodeStream( w, - typeof value === "bigint" ? Number(value) : value, + typeof value === "bigint" ? Number(value) : value ); for (const ai in CBOR_LIMITS) { const [limit, intCoder, _] = CBOR_LIMITS[ai]; @@ -120,13 +120,13 @@ const cborArrLength = (inner: P.CoderType): P.CoderType => const cborLength = ( fn: (len: P.Length) => P.CoderType, // Indefinity-length strings accept other elements with different types, we validate that later - def: P.CoderType, + def: P.CoderType ): P.CoderType => P.wrap({ encodeStream(w, value: T | T[]) { if (Array.isArray(value)) throw new Error( - "cbor/length: encoding indefinite-length strings not supported", + "cbor/length: encoding indefinite-length strings not supported" ); const bytes = fn(null).encode(value); if (bytes.length < 24) { @@ -217,7 +217,7 @@ const cborValue: P.CoderType = P.mappedTag(P.bits(3), { simple: [7, cborSimple], // Floating-point numbers and simple values, as well as the "break" stop code }); -export const CBOR = P.apply(cborValue, { +export const CBOR: P.CoderType = P.apply(cborValue, { encode(from: CborValue): any { let value = from.data; if (from.TAG === "bytes") { @@ -251,7 +251,7 @@ export const CBOR = P.apply(cborValue, { (from.data as any).map(([k, v]: [any, any]) => [ this.encode(k), this.encode(v), - ]), + ]) ); } if (from.TAG === "tag") throw new Error("not implemented"); diff --git a/src/cli.ts b/src/cli.ts index ad95910..6cde103 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,24 +1,29 @@ #!/usr/bin/env node -import { constants as zlibc, brotliCompressSync } from "node:zlib"; +import { lstatSync, readFileSync, realpathSync } from "node:fs"; import { extname } from "node:path"; -import { lstatSync, realpathSync, readFileSync } from "node:fs"; +import { brotliCompressSync, constants as zlibc } from "node:zlib"; // @ts-ignore import Input from "enquirer/lib/prompts/input.js"; // @ts-ignore -import Select from "enquirer/lib/prompts/select.js"; import { hex } from "@scure/base"; import { Address, Decimal, + NETWORK, + TEST_NETWORK, Transaction, WIF, p2tr, - NETWORK, - TEST_NETWORK, utils, } from "@scure/btc-signer"; -import { Inscription, OutOrdinalReveal, p2tr_ord_reveal } from "./index.js"; +// @ts-ignore +import Select from "enquirer/lib/prompts/select.js"; +import { + type Inscription, + OutOrdinalReveal, + p2tr_ord_reveal, +} from "./index.js"; /* */ @@ -118,10 +123,13 @@ ${bold}Important:${reset} first sat is always inscribed. Batch inscriptions are `; type InputValidate = ( - input: string, + input: string ) => boolean | string | Promise; -export const select = async (message: string, choices: string[]) => { +export const select = async ( + message: string, + choices: string[] +): Promise => { try { return await new Select({ message, choices }).run(); } catch (e) { @@ -129,7 +137,10 @@ export const select = async (message: string, choices: string[]) => { } }; -export async function input(message: string, validate?: InputValidate) { +export async function input( + message: string, + validate?: InputValidate +): Promise { let opts: { message: string; validate?: InputValidate } = { message }; if (validate) opts.validate = validate; try { @@ -208,8 +219,8 @@ const usage = (err?: Error | string) => { if (err) console.error(`${red}ERROR${reset}: ${err}`); console.log( `Usage: ${green}ord-cli${reset} [--net ${Object.keys(NETWORKS).join( - "|", - )}] [--priv key] [--recovery key] [--compress=on|off] [--fee 10.1] [--addr address] `, + "|" + )}] [--priv key] [--recovery key] [--compress=on|off] [--fee 10.1] [--addr address] ` ); console.log(HELP_TEXT); process.exit(); @@ -220,7 +231,7 @@ async function getNetwork(opts: Opts) { const NET = NETWORKS[opts.net]; if (typeof opts.net !== "string" || !NET) return usage( - `wrong network ${opts.net}. Expected: ${Object.keys(NETWORKS).join(", ")}`, + `wrong network ${opts.net}. Expected: ${Object.keys(NETWORKS).join(", ")}` ); console.log(`${bold}Network:${reset} ${NET.name}`); return NET; @@ -240,17 +251,17 @@ function getKeys(net: NET, opts: Opts) { else { res[name] = utils.randomPrivateKeyBytes(); console.log( - `${KEYS[name]} private key: ${red}${WIF(net).encode(res[name])}${reset}`, + `${KEYS[name]} private key: ${red}${WIF(net).encode(res[name])}${reset}` ); } if (res[name].length !== 32) { return usage( - `wrong ${KEYS[name].toLowerCase()} private key, expected 32-bytes, got ${res[name].length}`, + `wrong ${KEYS[name].toLowerCase()} private key, expected 32-bytes, got ${res[name].length}` ); } } console.log( - `${bold}Important:${reset} if there is an issue with reveal transaction, you will need these keys to refund sent coins`, + `${bold}Important:${reset} if there is an issue with reveal transaction, you will need these keys to refund sent coins` ); return res as { priv: Uint8Array; recovery: Uint8Array }; } @@ -287,7 +298,7 @@ function getInscription(filePath: string, opts: Opts) { } else info.push(`${red}uncompressed${reset}`); // notify user that compression disabled if (data.length > MAX_STANDARD_TX_WEIGHT) return usage( - `File is too big ${data.length}. Limit ${MAX_STANDARD_TX_WEIGHT}`, + `File is too big ${data.length}. Limit ${MAX_STANDARD_TX_WEIGHT}` ); console.log(`${bold}File:${reset} ${filePath} (${info.join(", ")})`); return inscription; @@ -313,7 +324,7 @@ async function getAddr(net: NET, opts: Opts) { if (!address) address = await input( "Change address (where inscription will be sent on reveal)", - validate, + validate ); if (validate(address) !== true) return usage(`wrong address=${address}`); return address; @@ -323,7 +334,7 @@ function getPayment( privKey: Uint8Array, recovery: Uint8Array, inscription: Inscription, - net: NET, + net: NET ) { const pubKey = utils.pubSchnorr(privKey); const recoveryPub = utils.pubSchnorr(recovery); @@ -332,7 +343,7 @@ function getPayment( p2tr_ord_reveal(pubKey, [inscription]), net, false, - customScripts, + customScripts ); } @@ -344,7 +355,7 @@ function getTransaction( txid: string, index: number, amount: bigint, - fee: bigint, + fee: bigint ) { const tx = new Transaction({ customScripts }); tx.addInput({ @@ -384,11 +395,11 @@ async function main() { ZERO_32B, 0, DUST_RELAY_TX_FEE, - 1n, + 1n ); if (dummyTx.weight >= MAX_STANDARD_TX_WEIGHT) { return usage( - `File is too big: reveal transaction weight (${dummyTx.weight}) is higher than limit (${MAX_STANDARD_TX_WEIGHT})`, + `File is too big: reveal transaction weight (${dummyTx.weight}) is higher than limit (${MAX_STANDARD_TX_WEIGHT})` ); } const txFee = BigInt(Math.floor(dummyTx.vsize * fee)); @@ -400,8 +411,8 @@ async function main() { const minAmount = DUST_RELAY_TX_FEE + txFee; console.log( `Created. Please send at least ${formatSatoshi(minAmount)} to ${formatAddress( - payment.address!, - )}`, + payment.address! + )}` ); // Ask for UTXO console.log("Please enter UTXO information for transaction you sent:"); @@ -419,7 +430,7 @@ async function main() { txid, index, amount, - txFee, + txFee ); console.log("Reveal transaction created."); console.log(`${bold}Txid:${reset} ${tx.id}`); @@ -427,11 +438,11 @@ async function main() { console.log(hex.encode(tx.extract())); console.log( `Please broadcast this transaction to reveal inscription and transfer to your address (${formatAddress( - addr, - )})`, + addr + )})` ); console.log( - `${bold}Important:${reset} please freeze this UTXO in your wallet when received to avoid sending inscription as fees for other transactions.`, + `${bold}Important:${reset} please freeze this UTXO in your wallet when received to avoid sending inscription as fees for other transactions.` ); } catch (e) { return usage(e as Error); diff --git a/src/index.ts b/src/index.ts index e1285df..e8b7f32 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,13 +1,13 @@ -import { Coder, hex, utf8 } from "@scure/base"; -import * as P from "micro-packed"; +import { type Coder, hex, utf8 } from "@scure/base"; import { - Script, - ScriptType, - OptScript, - CustomScript, + type CustomScript, MAX_SCRIPT_BYTE_LENGTH, + type OptScript, + Script, + type ScriptType, utils, } from "@scure/btc-signer"; +import * as P from "micro-packed"; import { CBOR } from "./cbor.js"; type Bytes = Uint8Array; @@ -59,8 +59,19 @@ const TagEnum = { const TagCoderInternal = /* @__PURE__ */ P.map(P.U8, TagEnum); type TagName = keyof typeof TagEnum; type TagRaw = { tag: Bytes; data: Bytes }; +export type TagCodersType = { + pointer: P.CoderType; // U64 + contentType: P.CoderType; + parent: P.Coder; + metadata: P.CoderType; + metaprotocol: P.CoderType; + contentEncoding: P.CoderType; + delegate: P.Coder; + rune: P.CoderType; // U128 + note: P.CoderType; +}; -const TagCoders = /* @__PURE__ */ { +const TagCoders: TagCodersType = /* @__PURE__ */ { pointer: P.bigint(8, true, false, false), // U64 contentType: P.string(null), parent: InscriptionId, @@ -99,12 +110,12 @@ const TagCoder: P.Coder = { for (const field in tmp) { if (field === "parent" && tmp[field].length > 1) { res[field as TagName] = tmp[field].map((i) => - TagCoders.parent.decode(i), + TagCoders.parent.decode(i) ); continue; } res[field as TagName] = TagCoders[field as TagName].decode( - utils.concatBytes(...tmp[field]), + utils.concatBytes(...tmp[field]) ); } return res as Tags; @@ -198,7 +209,7 @@ const parseEnvelopes = (script: ScriptType, pos = 0) => { // Additional API for parsing inscriptions export function parseInscriptions( script: ScriptType, - strict = false, + strict = false ): Inscription[] | undefined { if (strict && (!utils.isBytes(script[0]) || script[0].length !== 32)) return; if (strict && script[1] !== "CHECKSIG") return; @@ -292,7 +303,10 @@ export const OutOrdinalReveal: Coder< * Create reveal transaction. Inscription created on spending output from this address by * revealing taproot script. */ -export function p2tr_ord_reveal(pubkey: Bytes, inscriptions: Inscription[]) { +export function p2tr_ord_reveal( + pubkey: Bytes, + inscriptions: Inscription[] +): { type: string; script: Uint8Array } { return { type: "tr_ord_reveal", script: P.apply(Script, P.coders.match([OutOrdinalReveal])).encode({ @@ -304,4 +318,4 @@ export function p2tr_ord_reveal(pubkey: Bytes, inscriptions: Inscription[]) { } // Internal methods for tests -export const __test__ = { TagCoders, TagCoder, parseEnvelopes }; +export const __test__: any = { TagCoders, TagCoder, parseEnvelopes }; diff --git a/test/build/input.js b/test/build/input.js new file mode 100644 index 0000000..f095d34 --- /dev/null +++ b/test/build/input.js @@ -0,0 +1 @@ +export * from "lib"; diff --git a/test/build/package-lock.json b/test/build/package-lock.json new file mode 100644 index 0000000..aff7971 --- /dev/null +++ b/test/build/package-lock.json @@ -0,0 +1,513 @@ +{ + "name": "build", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "build", + "version": "1.0.0", + "devDependencies": { + "esbuild": "0.24.2", + "lib": "file:../.." + } + }, + "..": { + "extraneous": true + }, + "../..": { + "name": "micro-ordinals", + "version": "0.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@scure/base": "~1.2.1", + "@scure/btc-signer": "~1.3.2", + "enquirer": "2.4.1", + "micro-packed": "~0.7.1" + }, + "bin": { + "ord": "lib/esm/cli.js" + }, + "devDependencies": { + "@noble/curves": "^1.8.0", + "@paulmillr/jsbt": "0.3.0", + "@types/node": "20.12.7", + "micro-bmark": "0.3.1", + "micro-should": "0.5.0", + "prettier": "3.3.2", + "typescript": "5.5.2" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.2.tgz", + "integrity": "sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.2.tgz", + "integrity": "sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.2.tgz", + "integrity": "sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.2.tgz", + "integrity": "sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.2.tgz", + "integrity": "sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.2.tgz", + "integrity": "sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.2.tgz", + "integrity": "sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.2.tgz", + "integrity": "sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.2.tgz", + "integrity": "sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.2.tgz", + "integrity": "sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.2.tgz", + "integrity": "sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.2.tgz", + "integrity": "sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.2.tgz", + "integrity": "sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.2.tgz", + "integrity": "sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.2.tgz", + "integrity": "sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.2.tgz", + "integrity": "sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.2.tgz", + "integrity": "sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.24.2.tgz", + "integrity": "sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.2.tgz", + "integrity": "sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.2.tgz", + "integrity": "sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.2.tgz", + "integrity": "sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.2.tgz", + "integrity": "sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.2.tgz", + "integrity": "sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.2.tgz", + "integrity": "sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.2.tgz", + "integrity": "sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.2.tgz", + "integrity": "sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.24.2", + "@esbuild/android-arm": "0.24.2", + "@esbuild/android-arm64": "0.24.2", + "@esbuild/android-x64": "0.24.2", + "@esbuild/darwin-arm64": "0.24.2", + "@esbuild/darwin-x64": "0.24.2", + "@esbuild/freebsd-arm64": "0.24.2", + "@esbuild/freebsd-x64": "0.24.2", + "@esbuild/linux-arm": "0.24.2", + "@esbuild/linux-arm64": "0.24.2", + "@esbuild/linux-ia32": "0.24.2", + "@esbuild/linux-loong64": "0.24.2", + "@esbuild/linux-mips64el": "0.24.2", + "@esbuild/linux-ppc64": "0.24.2", + "@esbuild/linux-riscv64": "0.24.2", + "@esbuild/linux-s390x": "0.24.2", + "@esbuild/linux-x64": "0.24.2", + "@esbuild/netbsd-arm64": "0.24.2", + "@esbuild/netbsd-x64": "0.24.2", + "@esbuild/openbsd-arm64": "0.24.2", + "@esbuild/openbsd-x64": "0.24.2", + "@esbuild/sunos-x64": "0.24.2", + "@esbuild/win32-arm64": "0.24.2", + "@esbuild/win32-ia32": "0.24.2", + "@esbuild/win32-x64": "0.24.2" + } + }, + "node_modules/lib": { + "resolved": "../..", + "link": true + } + } +} diff --git a/test/build/package.json b/test/build/package.json new file mode 100644 index 0000000..fc357d8 --- /dev/null +++ b/test/build/package.json @@ -0,0 +1,11 @@ +{ + "name": "build", + "private": true, + "version": "1.0.0", + "main": "input.js", + "type": "module", + "devDependencies": { + "lib": "file:../..", + "esbuild": "0.24.2" + } +} diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json index 3180636..f3df3c4 100644 --- a/tsconfig.cjs.json +++ b/tsconfig.cjs.json @@ -1,5 +1,5 @@ { - "extends": "@paulmillr/jsbt/tsconfigs/cjs.json", + "extends": "@paulmillr/jsbt/tsconfig.cjs.json", "compilerOptions": { "outDir": "lib" }, diff --git a/tsconfig.json b/tsconfig.json index 47df20f..3d98d79 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@paulmillr/jsbt/tsconfigs/esm.json", + "extends": "@paulmillr/jsbt/tsconfig.esm.json", "compilerOptions": { "outDir": "lib/esm" },