Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1,061 changes: 572 additions & 489 deletions package-lock.json

Large diffs are not rendered by default.

43 changes: 27 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,33 @@
"email": "[email protected]",
"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": [
Expand Down Expand Up @@ -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",
Expand All @@ -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"
}
Expand Down
49 changes: 0 additions & 49 deletions rollup.config.ts

This file was deleted.

4 changes: 1 addition & 3 deletions bin/jp.ts → src/cli.ts
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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();

Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Loading