diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d6662f6..7c1e3f9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -39,11 +39,15 @@ jobs: - run: npm run build - name: ๐Ÿ” Validate build artifacts run: | - test -f dist/jmespath.umd.js || (echo "Missing UMD bundle" && exit 1) - test -f dist/jmespath.esm.js || (echo "Missing ESM bundle" && exit 1) - test -f dist/types/index.d.ts || (echo "Missing TypeScript declarations" && exit 1) - test -f dist/lib/bin/jp.js || (echo "Missing CLI binary" && exit 1) - head -1 dist/lib/bin/jp.js | grep -q "^#!" || (echo "CLI binary missing shebang" && exit 1) + test -f dist/index.umd.js || (echo "Missing UMD bundle" && exit 1) + test -f dist/index.umd.min.js || (echo "Missing minified UMD bundle" && exit 1) + test -f dist/index.esm.js || (echo "Missing browser ESM bundle" && exit 1) + test -f dist/index.esm.min.js || (echo "Missing minified browser ESM bundle" && exit 1) + test -f dist/index.cjs || (echo "Missing Node.js CommonJS bundle" && exit 1) + test -f dist/index.mjs || (echo "Missing Node.js ESM bundle" && exit 1) + test -f dist/index.d.ts || (echo "Missing TypeScript declarations" && exit 1) + test -f dist/cli.mjs || (echo "Missing CLI binary" && exit 1) + head -1 dist/cli.mjs | grep -q "^#!" || (echo "CLI binary missing shebang" && exit 1) echo "โœ… All build artifacts validated" - name: ๐Ÿงช Test build artifacts run: npm test -- test/build-artifacts.spec.ts diff --git a/package-lock.json b/package-lock.json index fe1afc7..e384be2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,33 +1,28 @@ { "name": "@jmespath-community/jmespath", - "version": "1.2.0", + "version": "1.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@jmespath-community/jmespath", - "version": "1.2.0", + "version": "1.3.0", "license": "MPL-2.0", "bin": { - "jp": "dist/lib/bin/jp.js" + "jp": "dist/cli.mjs" }, "devDependencies": { "@biomejs/biome": "2.0.6", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": "^13.0.0", - "@rollup/plugin-terser": "^0.4.0", - "@rollup/plugin-typescript": "^8.2.1", "@vitest/coverage-v8": "^3.2.4", "clean-publish": "^3.4.5", "coveralls-next": "^4.2.0", "husky": "^6.0.0", "lint-staged": "^11.0.0", "rimraf": "^3.0.2", - "rollup": "^2.50.5", - "rollup-plugin-typescript2": "^0.36.0", "shelljs": "^0.8.4", "tinybench": "^2.5.1", "ts-node": "^10.9.2", + "tsup": "^8.5.0", "typescript": "^5.8.3", "vitest": "^3.2.4" }, @@ -989,6 +984,8 @@ "version": "0.3.2", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" @@ -1049,99 +1046,10 @@ "node": ">=14" } }, - "node_modules/@rollup/plugin-json": { - "version": "4.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^3.0.8" - }, - "peerDependencies": { - "rollup": "^1.20.0 || ^2.0.0" - } - }, - "node_modules/@rollup/plugin-node-resolve": { - "version": "13.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^3.1.0", - "@types/resolve": "1.17.1", - "deepmerge": "^4.2.2", - "is-builtin-module": "^3.1.0", - "is-module": "^1.0.0", - "resolve": "^1.19.0" - }, - "engines": { - "node": ">= 10.0.0" - }, - "peerDependencies": { - "rollup": "^2.42.0" - } - }, - "node_modules/@rollup/plugin-terser": { - "version": "0.4.0", - "dev": true, - "license": "MIT", - "dependencies": { - "serialize-javascript": "^6.0.0", - "smob": "^0.0.6", - "terser": "^5.15.1" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^2.x || ^3.x" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/plugin-typescript": { - "version": "8.5.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^3.1.0", - "resolve": "^1.17.0" - }, - "engines": { - "node": ">=8.0.0" - }, - "peerDependencies": { - "rollup": "^2.14.0", - "tslib": "*", - "typescript": ">=3.7.0" - }, - "peerDependenciesMeta": { - "tslib": { - "optional": true - } - } - }, - "node_modules/@rollup/pluginutils": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" - }, - "engines": { - "node": ">= 8.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0" - } - }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.45.0.tgz", - "integrity": "sha512-2o/FgACbji4tW1dzXOqAV15Eu7DdgbKsF2QKcxfG4xbh5iwU7yr5RRP5/U+0asQliSYv5M4o7BevlGIoSL0LXg==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.45.1.tgz", + "integrity": "sha512-NEySIFvMY0ZQO+utJkgoMiCAjMrGvnbDLHvcmlA33UXJpYBCvlBEbMMtV837uCkS+plG2umfhn0T5mMAxGrlRA==", "cpu": [ "arm" ], @@ -1153,9 +1061,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.45.0.tgz", - "integrity": "sha512-PSZ0SvMOjEAxwZeTx32eI/j5xSYtDCRxGu5k9zvzoY77xUNssZM+WV6HYBLROpY5CkXsbQjvz40fBb7WPwDqtQ==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.45.1.tgz", + "integrity": "sha512-ujQ+sMXJkg4LRJaYreaVx7Z/VMgBBd89wGS4qMrdtfUFZ+TSY5Rs9asgjitLwzeIbhwdEhyj29zhst3L1lKsRQ==", "cpu": [ "arm64" ], @@ -1167,9 +1075,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.45.0.tgz", - "integrity": "sha512-BA4yPIPssPB2aRAWzmqzQ3y2/KotkLyZukVB7j3psK/U3nVJdceo6qr9pLM2xN6iRP/wKfxEbOb1yrlZH6sYZg==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.45.1.tgz", + "integrity": "sha512-FSncqHvqTm3lC6Y13xncsdOYfxGSLnP+73k815EfNmpewPs+EyM49haPS105Rh4aF5mJKywk9X0ogzLXZzN9lA==", "cpu": [ "arm64" ], @@ -1181,9 +1089,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.45.0.tgz", - "integrity": "sha512-Pr2o0lvTwsiG4HCr43Zy9xXrHspyMvsvEw4FwKYqhli4FuLE5FjcZzuQ4cfPe0iUFCvSQG6lACI0xj74FDZKRA==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.45.1.tgz", + "integrity": "sha512-2/vVn/husP5XI7Fsf/RlhDaQJ7x9zjvC81anIVbr4b/f0xtSmXQTFcGIQ/B1cXIYM6h2nAhJkdMHTnD7OtQ9Og==", "cpu": [ "x64" ], @@ -1195,9 +1103,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.45.0.tgz", - "integrity": "sha512-lYE8LkE5h4a/+6VnnLiL14zWMPnx6wNbDG23GcYFpRW1V9hYWHAw9lBZ6ZUIrOaoK7NliF1sdwYGiVmziUF4vA==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.45.1.tgz", + "integrity": "sha512-4g1kaDxQItZsrkVTdYQ0bxu4ZIQ32cotoQbmsAnW1jAE4XCMbcBPDirX5fyUzdhVCKgPcrwWuucI8yrVRBw2+g==", "cpu": [ "arm64" ], @@ -1209,9 +1117,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.45.0.tgz", - "integrity": "sha512-PVQWZK9sbzpvqC9Q0GlehNNSVHR+4m7+wET+7FgSnKG3ci5nAMgGmr9mGBXzAuE5SvguCKJ6mHL6vq1JaJ/gvw==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.45.1.tgz", + "integrity": "sha512-L/6JsfiL74i3uK1Ti2ZFSNsp5NMiM4/kbbGEcOCps99aZx3g8SJMO1/9Y0n/qKlWZfn6sScf98lEOUe2mBvW9A==", "cpu": [ "x64" ], @@ -1223,9 +1131,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.45.0.tgz", - "integrity": "sha512-hLrmRl53prCcD+YXTfNvXd776HTxNh8wPAMllusQ+amcQmtgo3V5i/nkhPN6FakW+QVLoUUr2AsbtIRPFU3xIA==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.45.1.tgz", + "integrity": "sha512-RkdOTu2jK7brlu+ZwjMIZfdV2sSYHK2qR08FUWcIoqJC2eywHbXr0L8T/pONFwkGukQqERDheaGTeedG+rra6Q==", "cpu": [ "arm" ], @@ -1237,9 +1145,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.45.0.tgz", - "integrity": "sha512-XBKGSYcrkdiRRjl+8XvrUR3AosXU0NvF7VuqMsm7s5nRy+nt58ZMB19Jdp1RdqewLcaYnpk8zeVs/4MlLZEJxw==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.45.1.tgz", + "integrity": "sha512-3kJ8pgfBt6CIIr1o+HQA7OZ9mp/zDk3ctekGl9qn/pRBgrRgfwiffaUmqioUGN9hv0OHv2gxmvdKOkARCtRb8Q==", "cpu": [ "arm" ], @@ -1251,9 +1159,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.45.0.tgz", - "integrity": "sha512-fRvZZPUiBz7NztBE/2QnCS5AtqLVhXmUOPj9IHlfGEXkapgImf4W9+FSkL8cWqoAjozyUzqFmSc4zh2ooaeF6g==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.45.1.tgz", + "integrity": "sha512-k3dOKCfIVixWjG7OXTCOmDfJj3vbdhN0QYEqB+OuGArOChek22hn7Uy5A/gTDNAcCy5v2YcXRJ/Qcnm4/ma1xw==", "cpu": [ "arm64" ], @@ -1265,9 +1173,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.45.0.tgz", - "integrity": "sha512-Btv2WRZOcUGi8XU80XwIvzTg4U6+l6D0V6sZTrZx214nrwxw5nAi8hysaXj/mctyClWgesyuxbeLylCBNauimg==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.45.1.tgz", + "integrity": "sha512-PmI1vxQetnM58ZmDFl9/Uk2lpBBby6B6rF4muJc65uZbxCs0EA7hhKCk2PKlmZKuyVSHAyIw3+/SiuMLxKxWog==", "cpu": [ "arm64" ], @@ -1279,9 +1187,9 @@ ] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.45.0.tgz", - "integrity": "sha512-Li0emNnwtUZdLwHjQPBxn4VWztcrw/h7mgLyHiEI5Z0MhpeFGlzaiBHpSNVOMB/xucjXTTcO+dhv469Djr16KA==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.45.1.tgz", + "integrity": "sha512-9UmI0VzGmNJ28ibHW2GpE2nF0PBQqsyiS4kcJ5vK+wuwGnV5RlqdczVocDSUfGX/Na7/XINRVoUgJyFIgipoRg==", "cpu": [ "loong64" ], @@ -1293,9 +1201,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.45.0.tgz", - "integrity": "sha512-sB8+pfkYx2kvpDCfd63d5ScYT0Fz1LO6jIb2zLZvmK9ob2D8DeVqrmBDE0iDK8KlBVmsTNzrjr3G1xV4eUZhSw==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.45.1.tgz", + "integrity": "sha512-7nR2KY8oEOUTD3pBAxIBBbZr0U7U+R9HDTPNy+5nVVHDXI4ikYniH1oxQz9VoB5PbBU1CZuDGHkLJkd3zLMWsg==", "cpu": [ "ppc64" ], @@ -1307,9 +1215,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.45.0.tgz", - "integrity": "sha512-5GQ6PFhh7E6jQm70p1aW05G2cap5zMOvO0se5JMecHeAdj5ZhWEHbJ4hiKpfi1nnnEdTauDXxPgXae/mqjow9w==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.45.1.tgz", + "integrity": "sha512-nlcl3jgUultKROfZijKjRQLUu9Ma0PeNv/VFHkZiKbXTBQXhpytS8CIj5/NfBeECZtY2FJQubm6ltIxm/ftxpw==", "cpu": [ "riscv64" ], @@ -1321,9 +1229,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.45.0.tgz", - "integrity": "sha512-N/euLsBd1rekWcuduakTo/dJw6U6sBP3eUq+RXM9RNfPuWTvG2w/WObDkIvJ2KChy6oxZmOSC08Ak2OJA0UiAA==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.45.1.tgz", + "integrity": "sha512-HJV65KLS51rW0VY6rvZkiieiBnurSzpzore1bMKAhunQiECPuxsROvyeaot/tcK3A3aGnI+qTHqisrpSgQrpgA==", "cpu": [ "riscv64" ], @@ -1335,9 +1243,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.45.0.tgz", - "integrity": "sha512-2l9sA7d7QdikL0xQwNMO3xURBUNEWyHVHfAsHsUdq+E/pgLTUcCE+gih5PCdmyHmfTDeXUWVhqL0WZzg0nua3g==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.45.1.tgz", + "integrity": "sha512-NITBOCv3Qqc6hhwFt7jLV78VEO/il4YcBzoMGGNxznLgRQf43VQDae0aAzKiBeEPIxnDrACiMgbqjuihx08OOw==", "cpu": [ "s390x" ], @@ -1349,9 +1257,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.45.0.tgz", - "integrity": "sha512-XZdD3fEEQcwG2KrJDdEQu7NrHonPxxaV0/w2HpvINBdcqebz1aL+0vM2WFJq4DeiAVT6F5SUQas65HY5JDqoPw==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.45.1.tgz", + "integrity": "sha512-+E/lYl6qu1zqgPEnTrs4WysQtvc/Sh4fC2nByfFExqgYrqkKWp1tWIbe+ELhixnenSpBbLXNi6vbEEJ8M7fiHw==", "cpu": [ "x64" ], @@ -1363,9 +1271,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.45.0.tgz", - "integrity": "sha512-7ayfgvtmmWgKWBkCGg5+xTQ0r5V1owVm67zTrsEY1008L5ro7mCyGYORomARt/OquB9KY7LpxVBZes+oSniAAQ==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.45.1.tgz", + "integrity": "sha512-a6WIAp89p3kpNoYStITT9RbTbTnqarU7D8N8F2CV+4Cl9fwCOZraLVuVFvlpsW0SbIiYtEnhCZBPLoNdRkjQFw==", "cpu": [ "x64" ], @@ -1377,9 +1285,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.45.0.tgz", - "integrity": "sha512-B+IJgcBnE2bm93jEW5kHisqvPITs4ddLOROAcOc/diBgrEiQJJ6Qcjby75rFSmH5eMGrqJryUgJDhrfj942apQ==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.45.1.tgz", + "integrity": "sha512-T5Bi/NS3fQiJeYdGvRpTAP5P02kqSOpqiopwhj0uaXB6nzs5JVi2XMJb18JUSKhCOX8+UE1UKQufyD6Or48dJg==", "cpu": [ "arm64" ], @@ -1391,9 +1299,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.45.0.tgz", - "integrity": "sha512-+CXwwG66g0/FpWOnP/v1HnrGVSOygK/osUbu3wPRy8ECXjoYKjRAyfxYpDQOfghC5qPJYLPH0oN4MCOjwgdMug==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.45.1.tgz", + "integrity": "sha512-lxV2Pako3ujjuUe9jiU3/s7KSrDfH6IgTSQOnDWr9aJ92YsFd7EurmClK0ly/t8dzMkDtd04g60WX6yl0sGfdw==", "cpu": [ "ia32" ], @@ -1405,9 +1313,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.45.0.tgz", - "integrity": "sha512-SRf1cytG7wqcHVLrBc9VtPK4pU5wxiB/lNIkNmW2ApKXIg+RpqwHfsaEK+e7eH4A1BpI6BX/aBWXxZCIrJg3uA==", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.45.1.tgz", + "integrity": "sha512-M/fKi4sasCdM8i0aWJjCSFm2qEnYRR8AMLG2kxp6wD13+tMGA4Z1tVAuHkNRjud5SW2EM3naLuK35w9twvf6aA==", "cpu": [ "x64" ], @@ -1456,28 +1364,23 @@ "license": "MIT" }, "node_modules/@types/estree": { - "version": "0.0.39", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", "dev": true, "license": "MIT" }, "node_modules/@types/node": { "version": "18.15.1", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/parse-json": { "version": "4.0.0", "dev": true, "license": "MIT" }, - "node_modules/@types/resolve": { - "version": "1.17.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@vitest/coverage-v8": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-3.2.4.tgz", @@ -1601,7 +1504,9 @@ } }, "node_modules/acorn": { - "version": "8.8.2", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", "bin": { @@ -1686,6 +1591,13 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, "node_modules/arg": { "version": "4.1.3", "dev": true, @@ -1718,13 +1630,6 @@ "js-tokens": "^9.0.1" } }, - "node_modules/ast-v8-to-istanbul/node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, - "license": "MIT" - }, "node_modules/ast-v8-to-istanbul/node_modules/estree-walker": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", @@ -1785,17 +1690,24 @@ "node_modules/buffer-from": { "version": "1.1.2", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, - "node_modules/builtin-modules": { - "version": "3.3.0", + "node_modules/bundle-require": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz", + "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==", "dev": true, "license": "MIT", + "dependencies": { + "load-tsconfig": "^0.2.3" + }, "engines": { - "node": ">=6" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependencies": { + "esbuild": ">=0.18" } }, "node_modules/cac": { @@ -1843,6 +1755,22 @@ "node": ">= 16" } }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/clean-publish": { "version": "3.4.5", "dev": true, @@ -1944,18 +1872,32 @@ "node_modules/commander": { "version": "2.20.3", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, - "node_modules/commondir": { - "version": "1.0.1", + "node_modules/concat-map": { + "version": "0.0.1", "dev": true, "license": "MIT" }, - "node_modules/concat-map": { - "version": "0.0.1", + "node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", "dev": true, "license": "MIT" }, + "node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, "node_modules/cosmiconfig": { "version": "7.1.0", "dev": true, @@ -2035,14 +1977,6 @@ "node": ">=6" } }, - "node_modules/deepmerge": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/delayed-stream": { "version": "1.0.0", "dev": true, @@ -2145,11 +2079,6 @@ "node": ">=0.8.0" } }, - "node_modules/estree-walker": { - "version": "1.0.1", - "dev": true, - "license": "MIT" - }, "node_modules/execa": { "version": "5.1.1", "dev": true, @@ -2216,32 +2145,16 @@ "node": ">=8" } }, - "node_modules/find-cache-dir": { - "version": "3.3.2", - "dev": true, - "license": "MIT", - "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/avajs/find-cache-dir?sponsor=1" - } - }, - "node_modules/find-up": { - "version": "4.1.0", + "node_modules/fix-dts-default-cjs-exports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz", + "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==", "dev": true, "license": "MIT", "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" + "magic-string": "^0.30.17", + "mlly": "^1.7.4", + "rollup": "^4.34.8" } }, "node_modules/foreground-child": { @@ -2476,20 +2389,6 @@ "dev": true, "license": "MIT" }, - "node_modules/is-builtin-module": { - "version": "3.2.1", - "dev": true, - "license": "MIT", - "dependencies": { - "builtin-modules": "^3.3.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-core-module": { "version": "2.11.0", "dev": true, @@ -2528,11 +2427,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-module": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, "node_modules/is-number": { "version": "7.0.0", "dev": true, @@ -2647,6 +2541,16 @@ "@pkgjs/parseargs": "^0.11.0" } }, + "node_modules/joycon": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", + "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "dev": true, @@ -2780,17 +2684,23 @@ "dev": true, "license": "MIT" }, - "node_modules/locate-path": { - "version": "5.0.0", + "node_modules/load-tsconfig": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", + "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", "dev": true, "license": "MIT", - "dependencies": { - "p-locate": "^4.1.0" - }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, + "node_modules/lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", + "dev": true, + "license": "MIT" + }, "node_modules/log-driver": { "version": "1.2.7", "dev": true, @@ -2865,28 +2775,6 @@ "source-map-js": "^1.2.0" } }, - "node_modules/make-dir": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/make-error": { "version": "1.3.6", "dev": true, @@ -2971,11 +2859,36 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/mlly": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.4.tgz", + "integrity": "sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.14.0", + "pathe": "^2.0.1", + "pkg-types": "^1.3.0", + "ufo": "^1.5.4" + } + }, "node_modules/ms": { "version": "2.1.3", "dev": true, "license": "MIT" }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, "node_modules/nanoid": { "version": "3.3.11", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", @@ -3014,6 +2927,16 @@ "node": ">=8" } }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/once": { "version": "1.4.0", "dev": true, @@ -3036,31 +2959,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-limit": { - "version": "2.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "4.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/p-map": { "version": "4.0.0", "dev": true, @@ -3075,14 +2973,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-try": { - "version": "2.2.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/package-json-from-dist": { "version": "1.0.1", "dev": true, @@ -3116,14 +3006,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/path-exists": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/path-is-absolute": { "version": "1.0.1", "dev": true, @@ -3208,15 +3090,26 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pkg-dir": { - "version": "4.2.0", + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", "dev": true, "license": "MIT", - "dependencies": { - "find-up": "^4.0.0" - }, "engines": { - "node": ">=8" + "node": ">= 6" + } + }, + "node_modules/pkg-types": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", + "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "confbox": "^0.1.8", + "mlly": "^1.7.4", + "pathe": "^2.0.1" } }, "node_modules/please-upgrade-node": { @@ -3256,12 +3149,22 @@ "node": "^10 || ^12 || >=14" } }, - "node_modules/queue-microtask": { - "version": "1.2.3", + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, - "funding": [ - { - "type": "github", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "dev": true, + "funding": [ + { + "type": "github", "url": "https://github.com/sponsors/feross" }, { @@ -3275,12 +3178,18 @@ ], "license": "MIT" }, - "node_modules/randombytes": { - "version": "2.1.0", + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", "dev": true, "license": "MIT", - "dependencies": { - "safe-buffer": "^5.1.0" + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, "node_modules/rechoir": { @@ -3358,54 +3267,45 @@ } }, "node_modules/rollup": { - "version": "2.79.2", + "version": "4.45.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.45.1.tgz", + "integrity": "sha512-4iya7Jb76fVpQyLoiVpzUrsjQ12r3dM7fIVz+4NwoYvZOShknRmiv+iu9CClZml5ZLGb0XMcYLutK6w9tgxHDw==", "dev": true, "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, "bin": { "rollup": "dist/bin/rollup" }, "engines": { - "node": ">=10.0.0" + "node": ">=18.0.0", + "npm": ">=8.0.0" }, "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.45.1", + "@rollup/rollup-android-arm64": "4.45.1", + "@rollup/rollup-darwin-arm64": "4.45.1", + "@rollup/rollup-darwin-x64": "4.45.1", + "@rollup/rollup-freebsd-arm64": "4.45.1", + "@rollup/rollup-freebsd-x64": "4.45.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.45.1", + "@rollup/rollup-linux-arm-musleabihf": "4.45.1", + "@rollup/rollup-linux-arm64-gnu": "4.45.1", + "@rollup/rollup-linux-arm64-musl": "4.45.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.45.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.45.1", + "@rollup/rollup-linux-riscv64-gnu": "4.45.1", + "@rollup/rollup-linux-riscv64-musl": "4.45.1", + "@rollup/rollup-linux-s390x-gnu": "4.45.1", + "@rollup/rollup-linux-x64-gnu": "4.45.1", + "@rollup/rollup-linux-x64-musl": "4.45.1", + "@rollup/rollup-win32-arm64-msvc": "4.45.1", + "@rollup/rollup-win32-ia32-msvc": "4.45.1", + "@rollup/rollup-win32-x64-msvc": "4.45.1", "fsevents": "~2.3.2" } }, - "node_modules/rollup-plugin-typescript2": { - "version": "0.36.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.36.0.tgz", - "integrity": "sha512-NB2CSQDxSe9+Oe2ahZbf+B4bh7pHwjV5L+RSYpCu7Q5ROuN94F9b6ioWwKfz3ueL3KTtmX4o2MUH2cgHDIEUsw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^4.1.2", - "find-cache-dir": "^3.3.2", - "fs-extra": "^10.0.0", - "semver": "^7.5.4", - "tslib": "^2.6.2" - }, - "peerDependencies": { - "rollup": ">=1.26.3", - "typescript": ">=2.4.0" - } - }, - "node_modules/rollup-plugin-typescript2/node_modules/@rollup/pluginutils": { - "version": "4.2.1", - "dev": true, - "license": "MIT", - "dependencies": { - "estree-walker": "^2.0.1", - "picomatch": "^2.2.2" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/rollup-plugin-typescript2/node_modules/estree-walker": { - "version": "2.0.2", - "dev": true, - "license": "MIT" - }, "node_modules/run-parallel": { "version": "1.2.0", "dev": true, @@ -3436,25 +3336,6 @@ "tslib": "^2.1.0" } }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, "node_modules/semver": { "version": "7.6.3", "dev": true, @@ -3471,14 +3352,6 @@ "dev": true, "license": "MIT" }, - "node_modules/serialize-javascript": { - "version": "6.0.2", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "randombytes": "^2.1.0" - } - }, "node_modules/shebang-command": { "version": "2.0.0", "dev": true, @@ -3540,15 +3413,12 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/smob": { - "version": "0.0.6", - "dev": true, - "license": "MIT" - }, "node_modules/source-map": { "version": "0.6.1", "dev": true, "license": "BSD-3-Clause", + "optional": true, + "peer": true, "engines": { "node": ">=0.10.0" } @@ -3565,6 +3435,8 @@ "version": "0.5.21", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -3681,6 +3553,86 @@ "dev": true, "license": "MIT" }, + "node_modules/sucrase": { + "version": "3.35.0", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz", + "integrity": "sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "glob": "^10.3.10", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/sucrase/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/sucrase/node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/sucrase/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sucrase/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/supports-color": { "version": "7.2.0", "dev": true, @@ -3707,6 +3659,8 @@ "version": "5.16.6", "dev": true, "license": "BSD-2-Clause", + "optional": true, + "peer": true, "dependencies": { "@jridgewell/source-map": "^0.3.2", "acorn": "^8.5.0", @@ -3776,6 +3730,29 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/through": { "version": "2.3.8", "dev": true, @@ -3875,6 +3852,33 @@ "node": ">=8.0" } }, + "node_modules/tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/ts-node": { "version": "10.9.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", @@ -3926,6 +3930,153 @@ "dev": true, "license": "0BSD" }, + "node_modules/tsup": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.0.tgz", + "integrity": "sha512-VmBp77lWNQq6PfuMqCHD3xWl22vEoWsKajkF8t+yMBawlUS8JzEI+vOVMeuNZIuMML8qXRizFKi9oD5glKQVcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bundle-require": "^5.1.0", + "cac": "^6.7.14", + "chokidar": "^4.0.3", + "consola": "^3.4.0", + "debug": "^4.4.0", + "esbuild": "^0.25.0", + "fix-dts-default-cjs-exports": "^1.0.0", + "joycon": "^3.1.1", + "picocolors": "^1.1.1", + "postcss-load-config": "^6.0.1", + "resolve-from": "^5.0.0", + "rollup": "^4.34.8", + "source-map": "0.8.0-beta.0", + "sucrase": "^3.35.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.11", + "tree-kill": "^1.2.2" + }, + "bin": { + "tsup": "dist/cli-default.js", + "tsup-node": "dist/cli-node.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@microsoft/api-extractor": "^7.36.0", + "@swc/core": "^1", + "postcss": "^8.4.12", + "typescript": ">=4.5.0" + }, + "peerDependenciesMeta": { + "@microsoft/api-extractor": { + "optional": true + }, + "@swc/core": { + "optional": true + }, + "postcss": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/tsup/node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/tsup/node_modules/postcss-load-config": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", + "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "lilconfig": "^3.1.1" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "jiti": ">=1.21.0", + "postcss": ">=8.0.9", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + }, + "postcss": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/tsup/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/tsup/node_modules/source-map": { + "version": "0.8.0-beta.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", + "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "whatwg-url": "^7.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/tsup/node_modules/yaml": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", + "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", + "dev": true, + "license": "ISC", + "optional": true, + "peer": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + } + }, "node_modules/typescript": { "version": "5.8.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", @@ -3940,6 +4091,13 @@ "node": ">=14.17" } }, + "node_modules/ufo": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz", + "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==", + "dev": true, + "license": "MIT" + }, "node_modules/universalify": { "version": "2.0.0", "dev": true, @@ -3976,13 +4134,6 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/vite-node/node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, - "license": "MIT" - }, "node_modules/vite-node/node_modules/fdir": { "version": "6.4.6", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.6.tgz", @@ -4011,46 +4162,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/vite-node/node_modules/rollup": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.45.0.tgz", - "integrity": "sha512-WLjEcJRIo7i3WDDgOIJqVI2d+lAC3EwvOGy+Xfq6hs+GQuAA4Di/H72xmXkOhrIWFg2PFYSKZYfH0f4vfKXN4A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "1.0.8" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.45.0", - "@rollup/rollup-android-arm64": "4.45.0", - "@rollup/rollup-darwin-arm64": "4.45.0", - "@rollup/rollup-darwin-x64": "4.45.0", - "@rollup/rollup-freebsd-arm64": "4.45.0", - "@rollup/rollup-freebsd-x64": "4.45.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.45.0", - "@rollup/rollup-linux-arm-musleabihf": "4.45.0", - "@rollup/rollup-linux-arm64-gnu": "4.45.0", - "@rollup/rollup-linux-arm64-musl": "4.45.0", - "@rollup/rollup-linux-loongarch64-gnu": "4.45.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.45.0", - "@rollup/rollup-linux-riscv64-gnu": "4.45.0", - "@rollup/rollup-linux-riscv64-musl": "4.45.0", - "@rollup/rollup-linux-s390x-gnu": "4.45.0", - "@rollup/rollup-linux-x64-gnu": "4.45.0", - "@rollup/rollup-linux-x64-musl": "4.45.0", - "@rollup/rollup-win32-arm64-msvc": "4.45.0", - "@rollup/rollup-win32-ia32-msvc": "4.45.0", - "@rollup/rollup-win32-x64-msvc": "4.45.0", - "fsevents": "~2.3.2" - } - }, "node_modules/vite-node/node_modules/vite": { "version": "6.3.5", "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz", @@ -4214,13 +4325,6 @@ } } }, - "node_modules/vitest/node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, - "license": "MIT" - }, "node_modules/vitest/node_modules/@vitest/mocker": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.4.tgz", @@ -4286,46 +4390,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/vitest/node_modules/rollup": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.45.0.tgz", - "integrity": "sha512-WLjEcJRIo7i3WDDgOIJqVI2d+lAC3EwvOGy+Xfq6hs+GQuAA4Di/H72xmXkOhrIWFg2PFYSKZYfH0f4vfKXN4A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "1.0.8" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.45.0", - "@rollup/rollup-android-arm64": "4.45.0", - "@rollup/rollup-darwin-arm64": "4.45.0", - "@rollup/rollup-darwin-x64": "4.45.0", - "@rollup/rollup-freebsd-arm64": "4.45.0", - "@rollup/rollup-freebsd-x64": "4.45.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.45.0", - "@rollup/rollup-linux-arm-musleabihf": "4.45.0", - "@rollup/rollup-linux-arm64-gnu": "4.45.0", - "@rollup/rollup-linux-arm64-musl": "4.45.0", - "@rollup/rollup-linux-loongarch64-gnu": "4.45.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.45.0", - "@rollup/rollup-linux-riscv64-gnu": "4.45.0", - "@rollup/rollup-linux-riscv64-musl": "4.45.0", - "@rollup/rollup-linux-s390x-gnu": "4.45.0", - "@rollup/rollup-linux-x64-gnu": "4.45.0", - "@rollup/rollup-linux-x64-musl": "4.45.0", - "@rollup/rollup-win32-arm64-msvc": "4.45.0", - "@rollup/rollup-win32-ia32-msvc": "4.45.0", - "@rollup/rollup-win32-x64-msvc": "4.45.0", - "fsevents": "~2.3.2" - } - }, "node_modules/vitest/node_modules/vite": { "version": "6.3.5", "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz", @@ -4416,6 +4480,25 @@ "node": ">= 14.6" } }, + "node_modules/webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, "node_modules/which": { "version": "2.0.2", "dev": true, diff --git a/package.json b/package.json index aac788c..d7975df 100644 --- a/package.json +++ b/package.json @@ -7,18 +7,33 @@ "email": "springcomp@users.noreply.github.com", "url": "https://jmespath.site" }, - "main": "dist/jmespath.umd.js", + "type": "module", "bin": { - "jp": "dist/lib/bin/jp.js" + "jp": "./dist/cli.mjs" }, - "module": "dist/jmespath.esm.js", - "typings": "dist/types/index.d.ts", - "types": "dist/types/index.d.ts", + "main": "./dist/index.cjs", + "module": "./dist/index.mjs", + "browser": "./dist/index.umd.js", + "types": "./dist/index.d.ts", "exports": { ".": { - "types": "./dist/types/index.d.ts", - "import": "./dist/jmespath.esm.js", - "require": "./dist/jmespath.umd.js" + "types": "./dist/index.d.ts", + "browser": { + "import": "./dist/index.esm.js", + "require": "./dist/index.umd.js", + "default": "./dist/index.umd.js" + }, + "node": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "./cli": { + "types": "./dist/cli.d.ts", + "import": "./dist/cli.mjs", + "require": "./dist/cli.cjs" } }, "files": [ @@ -51,9 +66,10 @@ "lint:fix": "biome check --write", "lint:ci": "biome check --diagnostic-level=error", "prebuild": "npx rimraf dist", - "build": "npx tsc --outDir dist/lib -d --module commonjs && npx tsc --project tsconfig.bin.json && npx rollup -c rollup.config.ts", + "build": "tsup", + "dev": "ts-node src/cli.ts", "perf": "node --expose-gc scripts/perf.js", - "start": "npx rollup -c rollup.config.ts -w", + "start": "tsup --watch", "test": "vitest --run", "test:watch": "vitest", "test:prod": "npm run lint && npm run test && npm test -- test/build-artifacts.spec.ts", @@ -66,21 +82,16 @@ }, "devDependencies": { "@biomejs/biome": "2.0.6", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": "^13.0.0", - "@rollup/plugin-terser": "^0.4.0", - "@rollup/plugin-typescript": "^8.2.1", "@vitest/coverage-v8": "^3.2.4", "clean-publish": "^3.4.5", "coveralls-next": "^4.2.0", "husky": "^6.0.0", "lint-staged": "^11.0.0", "rimraf": "^3.0.2", - "rollup": "^2.50.5", - "rollup-plugin-typescript2": "^0.36.0", "shelljs": "^0.8.4", "tinybench": "^2.5.1", "ts-node": "^10.9.2", + "tsup": "^8.5.0", "typescript": "^5.8.3", "vitest": "^3.2.4" } diff --git a/rollup.config.ts b/rollup.config.ts deleted file mode 100644 index 36f587b..0000000 --- a/rollup.config.ts +++ /dev/null @@ -1,49 +0,0 @@ -import json from '@rollup/plugin-json'; -import resolve from '@rollup/plugin-node-resolve'; -import terser from '@rollup/plugin-terser'; -import typescript from 'rollup-plugin-typescript2'; - -const pkg = require('./package.json'); - -const libraryName = 'jmespath'; - -export default { - input: `src/index.ts`, - output: [ - { file: pkg.main, name: libraryName, format: 'umd', exports: 'named', sourcemap: false }, - { - file: pkg.main.replace('umd.js', 'umd.min.js'), - name: libraryName, - format: 'umd', - exports: 'named', - sourcemap: true, - plugins: [terser()], - }, - { file: pkg.module, format: 'esm', exports: 'named', sourcemap: false }, - { - file: pkg.module.replace('esm.js', 'esm.min.js'), - format: 'esm', - exports: 'named', - sourcemap: true, - plugins: [terser()], - }, - ], - // Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash') - external: [], - watch: { - include: ['src/**'], - }, - plugins: [ - // Allow json resolution - json(), - // Compile TypeScript files - typescript({ - tsconfig: './tsconfig.json', - useTsconfigDeclarationDir: true, - }), - // Allow node_modules resolution, so you can use 'external' to control - // which external modules to include in the bundle - // https://github.com/rollup/rollup-plugin-node-resolve#usage - resolve(), - ], -}; diff --git a/bin/jp.ts b/src/cli.ts old mode 100755 new mode 100644 similarity index 97% rename from bin/jp.ts rename to src/cli.ts index 9a89358..c78a0c6 --- a/bin/jp.ts +++ b/src/cli.ts @@ -1,11 +1,9 @@ -#! /usr/bin/env node - 'use strict'; import { ParseArgsConfig, parseArgs } from 'node:util'; import * as fs from 'fs'; import pkg from '../package.json'; -import jmespath, { JSONValue } from '../src'; +import jmespath, { JSONValue } from './index'; const args = getArgs(); diff --git a/src/index.ts b/src/index.ts index 93443dd..16ab5c2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -124,4 +124,6 @@ export const jmespath = { TYPE_STRING, }; -export default jmespath; +// Export as default for backward compatibility +// Supports both: import jmespath from '...' and import { jmespath } from '...' +export { jmespath as default }; diff --git a/test/build-artifacts.spec.ts b/test/build-artifacts.spec.ts index c3e5b8f..6208a62 100644 --- a/test/build-artifacts.spec.ts +++ b/test/build-artifacts.spec.ts @@ -1,112 +1,152 @@ -import { existsSync, readFileSync, statSync } from 'fs'; +import { execSync } from 'child_process'; +import { existsSync, readFileSync } from 'fs'; import { join } from 'path'; import { describe, expect, it } from 'vitest'; const DIST_DIR = join(process.cwd(), 'dist'); -const TYPES_DIR = join(DIST_DIR, 'types'); -const LIB_DIR = join(DIST_DIR, 'lib'); describe('Build Artifacts', () => { describe('TypeScript Declarations', () => { it('should generate main index.d.ts file', () => { - const indexDtsPath = join(TYPES_DIR, 'index.d.ts'); + const indexDtsPath = join(DIST_DIR, 'index.d.ts'); expect(existsSync(indexDtsPath), `Expected ${indexDtsPath} to exist`).toBe(true); const content = readFileSync(indexDtsPath, 'utf-8'); - expect(content).toContain('export declare function search'); - expect(content).toContain('export declare function compile'); - expect(content).toContain('export declare const registerFunction'); - }); - - it('should generate all required type declaration files', () => { - const requiredFiles = [ - 'AST.type.d.ts', - 'JSON.type.d.ts', - 'Lexer.d.ts', - 'Lexer.type.d.ts', - 'Parser.d.ts', - 'Parser.type.d.ts', - 'Runtime.d.ts', - 'Scope.d.ts', - 'TreeInterpreter.d.ts', - 'utils/index.d.ts', - 'utils/strings.d.ts', - 'utils/text.d.ts', - ]; - - for (const file of requiredFiles) { - const filePath = join(TYPES_DIR, file); - expect(existsSync(filePath), `Expected ${filePath} to exist`).toBe(true); - } + expect(content).toContain('declare function search'); + expect(content).toContain('declare function compile'); + expect(content).toContain('declare const registerFunction'); + }); + + it('should generate CLI type declarations', () => { + const cliDtsPath = join(DIST_DIR, 'cli.d.ts'); + expect(existsSync(cliDtsPath), `Expected ${cliDtsPath} to exist`).toBe(true); }); it('should export all main types and functions', () => { - const indexDtsPath = join(TYPES_DIR, 'index.d.ts'); + const indexDtsPath = join(DIST_DIR, 'index.d.ts'); const content = readFileSync(indexDtsPath, 'utf-8'); // Check for main function exports - expect(content).toContain('export declare function search'); - expect(content).toContain('export declare function compile'); - expect(content).toContain('export declare function tokenize'); + expect(content).toContain('declare function search'); + expect(content).toContain('declare function compile'); + expect(content).toContain('declare function tokenize'); // Check for type exports - expect(content).toContain('export type { JSONArray, JSONObject, JSONPrimitive, JSONValue }'); - expect(content).toContain('export type { Options }'); - expect(content).toContain('export type { BuiltInFunctionNames'); + expect(content).toContain('type JSONArray'); + expect(content).toContain('type JSONObject'); + expect(content).toContain('type JSONPrimitive'); + expect(content).toContain('type JSONValue'); // Check for constant exports - expect(content).toContain('export declare const TYPE_ANY'); - expect(content).toContain('export declare const TYPE_STRING'); - expect(content).toContain('export declare const TYPE_NUMBER'); + expect(content).toContain('declare const TYPE_ANY'); + expect(content).toContain('declare const TYPE_STRING'); + expect(content).toContain('declare const TYPE_NUMBER'); }); }); - describe('UMD and ESM Bundles', () => { + describe('Node.js Bundles', () => { + it('should generate CommonJS bundle', () => { + const cjsPath = join(DIST_DIR, 'index.cjs'); + expect(existsSync(cjsPath), `Expected ${cjsPath} to exist`).toBe(true); + + const content = readFileSync(cjsPath, 'utf-8'); + expect(content).toContain('exports'); + }); + + it('should generate ESM bundle', () => { + const esmPath = join(DIST_DIR, 'index.mjs'); + expect(existsSync(esmPath), `Expected ${esmPath} to exist`).toBe(true); + + const content = readFileSync(esmPath, 'utf-8'); + expect(content).toContain('export'); + }); + + it('should generate source maps', () => { + const cjsMapPath = join(DIST_DIR, 'index.cjs.map'); + const esmMapPath = join(DIST_DIR, 'index.mjs.map'); + + expect(existsSync(cjsMapPath), `Expected ${cjsMapPath} to exist`).toBe(true); + expect(existsSync(esmMapPath), `Expected ${esmMapPath} to exist`).toBe(true); + }); + }); + + describe('Browser Bundles', () => { it('should generate UMD bundle', () => { - const umdPath = join(DIST_DIR, 'jmespath.umd.js'); + const umdPath = join(DIST_DIR, 'index.umd.js'); expect(existsSync(umdPath), `Expected ${umdPath} to exist`).toBe(true); const content = readFileSync(umdPath, 'utf-8'); - expect(content).toContain('(function (global, factory)'); + // tsup generates IIFE format with global variable + expect(content).toContain('var jmespath = (function (exports)'); }); it('should generate minified UMD bundle', () => { - const umdMinPath = join(DIST_DIR, 'jmespath.umd.min.js'); + const umdMinPath = join(DIST_DIR, 'index.umd.min.js'); expect(existsSync(umdMinPath), `Expected ${umdMinPath} to exist`).toBe(true); - - const stat = statSync(umdMinPath); - expect(stat.size).toBeGreaterThan(0); }); - it('should generate ESM bundle', () => { - const esmPath = join(DIST_DIR, 'jmespath.esm.js'); + it('should generate browser ESM bundle', () => { + const esmPath = join(DIST_DIR, 'index.esm.js'); expect(existsSync(esmPath), `Expected ${esmPath} to exist`).toBe(true); const content = readFileSync(esmPath, 'utf-8'); - expect(content).toContain('export {'); + expect(content).toContain('export'); }); - it('should generate minified ESM bundle', () => { - const esmMinPath = join(DIST_DIR, 'jmespath.esm.min.js'); + it('should generate minified browser ESM bundle', () => { + const esmMinPath = join(DIST_DIR, 'index.esm.min.js'); expect(existsSync(esmMinPath), `Expected ${esmMinPath} to exist`).toBe(true); + }); - const stat = statSync(esmMinPath); - expect(stat.size).toBeGreaterThan(0); + it('should generate source maps for all browser bundles', () => { + const requiredMaps = ['index.umd.js.map', 'index.umd.min.js.map', 'index.esm.js.map', 'index.esm.min.js.map']; + + for (const mapFile of requiredMaps) { + const mapPath = join(DIST_DIR, mapFile); + expect(existsSync(mapPath), `Expected ${mapPath} to exist`).toBe(true); + } }); }); describe('CLI Binary', () => { - it('should generate CLI binary', () => { - const binPath = join(LIB_DIR, 'bin', 'jp.js'); + it('should generate CLI binary (ESM only)', () => { + const binPath = join(DIST_DIR, 'cli.mjs'); expect(existsSync(binPath), `Expected ${binPath} to exist`).toBe(true); const content = readFileSync(binPath, 'utf-8'); - expect(content).toContain('#! /usr/bin/env node'); + expect(content).toContain('#!/usr/bin/env node'); }); it('should generate source maps for CLI binary', () => { - const mapPath = join(LIB_DIR, 'bin', 'jp.js.map'); - expect(existsSync(mapPath), `Expected ${mapPath} to exist`).toBe(true); + const mjsMapPath = join(DIST_DIR, 'cli.mjs.map'); + expect(existsSync(mjsMapPath), `Expected ${mjsMapPath} to exist`).toBe(true); + }); + + it('should have functional CLI that can execute JMESPath queries', () => { + const binPath = join(DIST_DIR, 'cli.mjs'); + const testData = '{"foo": {"bar": "baz"}}'; + const query = 'foo.bar'; + + // Test basic functionality + const result = execSync(`echo '${testData}' | node ${binPath} '${query}'`, { + encoding: 'utf-8', + cwd: process.cwd(), + }); + + expect(result.trim()).toBe('"baz"'); + }); + + it('should show help when --help flag is used', () => { + const binPath = join(DIST_DIR, 'cli.mjs'); + + const result = execSync(`node ${binPath} --help`, { + encoding: 'utf-8', + cwd: process.cwd(), + }); + + expect(result).toContain('NAME:'); + expect(result).toContain('jp - jp [] '); + expect(result).toContain('OPTIONS:'); }); }); @@ -115,17 +155,18 @@ describe('Build Artifacts', () => { const pkgPath = join(process.cwd(), 'package.json'); const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8')); - expect(pkg.main).toBe('dist/jmespath.umd.js'); - expect(pkg.module).toBe('dist/jmespath.esm.js'); - expect(pkg.types).toBe('dist/types/index.d.ts'); - expect(pkg.typings).toBe('dist/types/index.d.ts'); + expect(pkg.main).toBe('./dist/index.cjs'); + expect(pkg.module).toBe('./dist/index.mjs'); + expect(pkg.browser).toBe('./dist/index.umd.js'); + expect(pkg.types).toBe('./dist/index.d.ts'); + expect(pkg.type).toBe('module'); }); it('should have correct bin configuration', () => { const pkgPath = join(process.cwd(), 'package.json'); const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8')); - expect(pkg.bin).toEqual({ jp: 'dist/lib/bin/jp.js' }); + expect(pkg.bin).toEqual({ jp: './dist/cli.mjs' }); }); it('should include dist directory in files', () => { @@ -141,9 +182,26 @@ describe('Build Artifacts', () => { expect(pkg.exports).toBeDefined(); expect(pkg.exports['.']).toBeDefined(); - expect(pkg.exports['.'].types).toBe('./dist/types/index.d.ts'); - expect(pkg.exports['.'].import).toBe('./dist/jmespath.esm.js'); - expect(pkg.exports['.'].require).toBe('./dist/jmespath.umd.js'); + expect(pkg.exports['.'].types).toBe('./dist/index.d.ts'); + expect(pkg.exports['.'].import).toBe('./dist/index.mjs'); + expect(pkg.exports['.'].require).toBe('./dist/index.cjs'); + + // Check browser exports + expect(pkg.exports['.'].browser).toBeDefined(); + expect(pkg.exports['.'].browser.import).toBe('./dist/index.esm.js'); + expect(pkg.exports['.'].browser.require).toBe('./dist/index.umd.js'); + expect(pkg.exports['.'].browser.default).toBe('./dist/index.umd.js'); + + // Check Node.js specific exports + expect(pkg.exports['.'].node).toBeDefined(); + expect(pkg.exports['.'].node.import).toBe('./dist/index.mjs'); + expect(pkg.exports['.'].node.require).toBe('./dist/index.cjs'); + + // Check CLI export + expect(pkg.exports['./cli']).toBeDefined(); + expect(pkg.exports['./cli'].types).toBe('./dist/cli.d.ts'); + expect(pkg.exports['./cli'].import).toBe('./dist/cli.mjs'); + expect(pkg.exports['./cli'].require).toBe('./dist/cli.cjs'); }); }); }); diff --git a/tsconfig.bin.json b/tsconfig.bin.json deleted file mode 100644 index 36eb74c..0000000 --- a/tsconfig.bin.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "compilerOptions": { - "allowJs": true, - "allowSyntheticDefaultImports": true, - "allowUnreachableCode": false, - "declaration": false, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "lib": ["es2020", "dom"], - "moduleResolution": "node", - "module": "commonjs", - "isolatedModules": true, - "esModuleInterop": true, - "target": "es6", - "rootDir": ".", - "outDir": "dist/lib", - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "sourceMap": true, - "strict": true, - "strictNullChecks": true, - "typeRoots": ["node_modules/@types"] - }, - "include": ["bin/**/*"], - "exclude": ["node_modules", "dist", "test", "src"] -} diff --git a/tsconfig.json b/tsconfig.json index 8cb1257..f558846 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,31 +1,27 @@ { "compilerOptions": { - "allowJs": true, - "allowSyntheticDefaultImports": true, - "allowUnreachableCode": false, + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "bundler", + "lib": ["ES2022"], + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "outDir": "./dist", + "rootDir": "./src", "declaration": true, - "declarationDir": "dist/types", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "lib": ["es2020", "dom"], - "moduleResolution": "node", - "module": "esnext", + "sourceMap": true, "isolatedModules": true, - "esModuleInterop": true, - "target": "es6", - "rootDir": "src", + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, "noUnusedLocals": true, "noUnusedParameters": true, "noImplicitAny": true, "noImplicitReturns": true, "noImplicitThis": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "sourceMap": true, - "strict": true, - "strictNullChecks": true, - "typeRoots": ["node_modules/@types"] + "strictNullChecks": true }, - "exclude": ["node_modules", "dist", "test"], - "include": ["src"] + "include": ["src/**/*.ts"], + "exclude": ["node_modules", "dist", "src/**/*.test.ts"] } diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 0000000..36bdabb --- /dev/null +++ b/tsup.config.ts @@ -0,0 +1,116 @@ +import { defineConfig } from 'tsup'; + +export default defineConfig([ + // Library build - Node.js + { + entry: ['src/index.ts'], + format: ['cjs', 'esm'], + dts: true, + sourcemap: true, + clean: true, + outDir: 'dist', + outExtension({ format }) { + return { + js: format === 'cjs' ? '.cjs' : '.mjs', + }; + }, + target: 'es2022', + platform: 'node', + splitting: false, + treeshake: true, + }, + // Library build - Browser UMD + { + entry: ['src/index.ts'], + format: ['iife'], + dts: false, // Types already generated above + sourcemap: true, + outDir: 'dist', + outExtension() { + return { + js: '.umd.js', + }; + }, + target: 'es2020', // Broader browser compatibility + platform: 'browser', + globalName: 'jmespath', + splitting: false, + treeshake: true, + minify: false, + }, + // Library build - Browser UMD Minified + { + entry: ['src/index.ts'], + format: ['iife'], + dts: false, + sourcemap: true, + outDir: 'dist', + outExtension() { + return { + js: '.umd.min.js', + }; + }, + target: 'es2020', + platform: 'browser', + globalName: 'jmespath', + splitting: false, + treeshake: true, + minify: true, + }, + // Library build - Browser ESM + { + entry: ['src/index.ts'], + format: ['esm'], + dts: false, + sourcemap: true, + outDir: 'dist', + outExtension() { + return { + js: '.esm.js', + }; + }, + target: 'es2020', + platform: 'browser', + splitting: false, + treeshake: true, + minify: false, + }, + // Library build - Browser ESM Minified + { + entry: ['src/index.ts'], + format: ['esm'], + dts: false, + sourcemap: true, + outDir: 'dist', + outExtension() { + return { + js: '.esm.min.js', + }; + }, + target: 'es2020', + platform: 'browser', + splitting: false, + treeshake: true, + minify: true, + }, + // CLI build - ESM only (since package.json points to .mjs) + { + entry: ['src/cli.ts'], + format: ['esm'], + dts: true, + sourcemap: true, + outDir: 'dist', + outExtension() { + return { + js: '.mjs', + }; + }, + target: 'es2022', + platform: 'node', + splitting: false, + treeshake: true, + banner: { + js: '#!/usr/bin/env node', + }, + }, +]);