UNPKG

legal-markdown-js

Version:

Node.js implementation of LegalMarkdown for processing legal documents with markdown and YAML - Complete feature parity with Ruby version

235 lines (234 loc) 10.9 kB
{ "name": "legal-markdown-js", "version": "4.3.0", "description": "Node.js implementation of LegalMarkdown for processing legal documents with markdown and YAML - Complete feature parity with Ruby version", "type": "module", "main": "./dist/index.js", "module": "./dist/index.js", "types": "./dist/index.d.ts", "exports": { ".": { "import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }, "require": { "types": "./dist/index.d.cts", "default": "./dist/index.cjs" }, "default": "./dist/index.js" }, "./package.json": "./package.json" }, "sideEffects": false, "scripts": { "postinstall": "node scripts/postinstall.cjs || true", "prepare": "husky", "prepublishOnly": "npm run build", "prerelease": "npm run clean && npm run build && npm run test", "build": "npm run build:llms-module && npm run build:ts && npm run build:chmod && npm run build:styles && npm run build:assets && npm run build:llms && npm run build:examples && npm run build:vite && npm run build:web && npm run build:copy-browser && npm run build:docs", "build:chmod": "chmod +x dist/cli/index.js dist/cli/interactive/index.js", "build:assets": "mkdir -p dist/assets && cp -r $(node scripts/build-paths.js images)/* dist/assets/ 2>/dev/null || true", "build:llms": "mkdir -p dist && cp llms.txt dist/llms.txt", "build:llms-module": "node scripts/generate-llms-module.cjs", "build:cjs": "tsc --project tsconfig.cjs.json && tsc-alias --project tsconfig.cjs.json", "build:copy-browser": "cp dist/legal-markdown-browser.js dist/web/ 2>/dev/null || true", "build:esm": "tsc --project tsconfig.esm.json && tsc-alias --project tsconfig.esm.json && node scripts/fix-esm-imports.js", "build:examples": "mkdir -p dist/examples && cp -r examples/* dist/examples/ 2>/dev/null || true", "build:fix-extensions": "node scripts/fix-build-extensions.js", "build:packages": "node scripts/build-packages.cjs", "build:styles": "mkdir -p dist/styles && cp -r $(node scripts/build-paths.js styles)/* dist/styles/ 2>/dev/null || true", "build:ts": "npm run build:esm && npm run build:cjs && npm run build:fix-extensions && npm run build:esm", "build:vite": "vite build", "build:watch": "tsc --watch", "build:binary": "npm run build:llms-module && npm run build:web && npm run build:embed-web && mkdir -p dist/bin && bun build --compile --target=bun-darwin-arm64 src/cli/main.ts --outfile dist/bin/legal-md && git checkout src/cli/playground/embedded-assets.ts && npm run build:llms", "build:binary:macos-arm64": "npm run build:llms-module && npm run build:web && npm run build:embed-web && mkdir -p dist/bin && bun build --compile --target=bun-darwin-arm64 src/cli/main.ts --outfile dist/bin/legal-md-macos-arm64 && git checkout src/cli/playground/embedded-assets.ts && npm run build:llms", "build:binary:macos-x64": "npm run build:llms-module && npm run build:web && npm run build:embed-web && mkdir -p dist/bin && bun build --compile --target=bun-darwin-x64 src/cli/main.ts --outfile dist/bin/legal-md-macos-x64 && git checkout src/cli/playground/embedded-assets.ts && npm run build:llms", "build:binary:all": "npm run build:binary:macos-arm64 && npm run build:binary:macos-x64", "build:embed-web": "bun scripts/embed-web-assets.ts", "build:web": "node scripts/copy-web-bundle.js && vite build --config src/web/vite.config.ts", "clean": "rm -rf dist coverage .turbo && tsc --build --clean", "cli": "tsx src/cli/index.ts", "cli:ui": "tsx src/cli/interactive/index.ts", "commit": "cz", "dev": "tsx watch src/cli/index.ts", "dev:web": "node scripts/copy-web-bundle.js && vite --config src/web/vite.config.ts --open", "dev:web:server": "node scripts/copy-web-bundle.js && vite --config src/web/vite.config.ts --port 5174", "build:docs": "typedoc --options typedoc.json", "docs": "typedoc --options typedoc.json", "format": "prettier --write \"src/**/*.ts\"", "format:check": "prettier --check \"src/**/*.ts\"", "generate:readmes": "node scripts/generate-readmes.cjs", "generate:run-scripts": "node scripts/generate-run-scripts.cjs", "gremlin:check": "git ls-files '*.ts' '*.tsx' '*.js' '*.jsx' '*.cjs' '*.mjs' '*.json' '*.md' | xargs node scripts/check-confusable-symbols.cjs", "gremlin:fix": "git ls-files '*.ts' '*.tsx' '*.js' '*.jsx' '*.cjs' '*.mjs' '*.json' '*.md' | xargs node scripts/check-confusable-symbols.cjs --fix", "lint": "eslint \"src/**/*.ts\"", "lint:fix": "eslint \"src/**/*.ts\" --fix", "release:dry": "semantic-release --dry-run", "test": "vitest", "test:changed": "vitest --changed", "test:ci": "npm run test:pdf:backends && vitest run --reporter=json --reporter=default", "test:coverage": "vitest run --coverage", "test:settings": "npm run typecheck:test-settings && node scripts/check-test-settings.cjs", "test:e2e": "npm run test:pdf:backends && E2E_TESTS=1 vitest run tests/e2e", "test:e2e:cli": "npm run test:pdf:backends && E2E_TESTS=1 vitest run tests/e2e/cli.e2e.test.ts tests/e2e/cli-params.e2e.test.ts", "test:e2e:coverage": "E2E_TESTS=1 vitest run tests/e2e/cli-flag-coverage.e2e.test.ts", "test:e2e:all": "npm run test:e2e:ticket && npm run test:e2e:contract", "test:e2e:contract": "node scripts/visual-tests/generate-contract.cjs", "test:e2e:ticket": "node scripts/visual-tests/generate-ticket.cjs", "test:integration": "vitest run tests/integration", "test:pdf:backends": "node scripts/check-pdf-backends.cjs", "test:pdf": "vitest run tests/integration/pdf-generation.integration.test.ts tests/integration/no-reprocessing.integration.test.ts tests/integration/field-tracking-highlighting.integration.test.ts tests/integration/pdf-content-verification.integration.test.ts", "test:pdf-setup": "node scripts/test-pdf-setup.cjs", "test:playground:ui": "playwright test tests/playground/", "test:staged": "bash -c 'FILES=$(git diff --cached --name-only --diff-filter=ACMR | grep -E \"\\.(ts|js)$\" | head -20); if [ -n \"$FILES\" ]; then vitest run --exclude \"**/e2e/**\" --exclude \"**/pdf-generation*.test.ts\" --exclude \"**/pdf-content-verification*.test.ts\" --exclude \"**/no-reprocessing*.test.ts\" --exclude \"**/field-tracking-highlighting*.test.ts\" --bail=1; else echo \"No staged TypeScript/JavaScript files to test\"; fi'", "test:ui": "vitest --ui", "test:unit": "vitest run tests/unit", "test:watch": "vitest --watch", "typecheck:test-settings": "tsc --noEmit --project tsconfig.test-settings.json", "typecheck": "tsc --noEmit", "validate": "npm run typecheck && npm run test:settings && npm run lint && npm run publint && npm run test && npm run build", "web:serve": "node scripts/web-serve.cjs", "knip": "knip", "publint": "publint", "attw": "attw --pack .", "validate:package": "npm run publint && npm run attw" }, "keywords": [ "legal", "markdown", "document", "contract", "yaml", "parser", "legal-markdown", "typescript", "nodejs", "legal-tech" ], "author": { "name": "petalo", "url": "https://github.com/petalo" }, "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/petalo/legal-markdown-js.git" }, "bugs": { "url": "https://github.com/petalo/legal-markdown-js/issues" }, "homepage": "https://github.com/petalo/legal-markdown-js#readme", "jsdelivr": "dist/legal-markdown-browser.js", "unpkg": "dist/legal-markdown-browser.js", "dependencies": { "@inquirer/prompts": "^8.3.0", "@types/js-beautify": "^1.14.3", "chalk": "^5.6.2", "cheerio": "^1.2.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "commander": "^14.0.3", "cosmiconfig": "^9.0.1", "docx": "^9.6.0", "handlebars": "^4.7.8", "js-beautify": "^1.15.4", "js-yaml": "^4.1.1", "jszip": "^3.10.1", "lucide-react": "^0.576.0", "marked": "^17.0.3", "mdast-util-to-string": "^4.0.0", "next-themes": "^0.4.6", "radix-ui": "^1.4.3", "react": "^19.2.4", "react-dom": "^19.2.4", "react-resizable-panels": "^4.7.0", "remark-gfm": "^4.0.1", "remark-parse": "^11.0.0", "remark-stringify": "^11.0.0", "sonner": "^2.0.7", "tailwind-merge": "^3.5.0", "tsx": "^4.21.0", "unified": "^11.0.5", "unist-util-visit": "^5.1.0" }, "devDependencies": { "@arethetypeswrong/cli": "^0.18.2", "@commitlint/cli": "^20.4.2", "@commitlint/config-conventional": "^20.4.2", "@eslint/js": "^10.0.1", "@playwright/test": "^1.58.2", "@semantic-release/changelog": "^6.0.3", "@semantic-release/git": "^10.0.1", "@tailwindcss/vite": "^4.2.1", "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^16.3.2", "@types/cheerio": "^1.0.0", "@types/eslint": "^9.6.1", "@types/handlebars": "^4.1.0", "@types/js-yaml": "^4.0.9", "@types/marked": "^6.0.0", "@types/mdast": "^4.0.4", "@types/node": "^25.3.3", "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", "@types/unist": "^3.0.3", "@typescript-eslint/eslint-plugin": "^8.56.1", "@typescript-eslint/parser": "^8.56.1", "@vitejs/plugin-react": "^5.1.4", "@vitest/coverage-v8": "^4.0.18", "@vitest/ui": "^4.0.18", "buffer": "^6.0.3", "eslint": "^10.0.2", "eslint-config-prettier": "^10.1.8", "glob": "^11.1.0", "globals": "^17.4.0", "husky": "^9.1.7", "jsdom": "^28.1.0", "knip": "^5.85.0", "lint-staged": "^16.3.1", "path-browserify": "^1.0.1", "prettier": "^3.8.1", "publint": "^0.3.18", "rehype-stringify": "^10.0.1", "remark-rehype": "^11.1.2", "semantic-release": "^25.0.3", "tailwindcss": "^4.2.1", "tailwindcss-animate": "^1.0.7", "tsc-alias": "^1.8.16", "typedoc": "^0.28.17", "typescript": "^5.9.3", "vite": "^7.3.1", "vitest": "^4.0.18" }, "bin": { "legal-md": "dist/cli/index.js", "legal-md-ui": "dist/cli/interactive/index.js", "legal-md-playground": "scripts/web-serve.cjs" }, "files": ["dist", "scripts", "README.md", "LICENSE", "CHANGELOG.md"], "engines": { "node": ">=18.0.0" }, "lint-staged": { "src/**/*.{ts,tsx,js,jsx}": [ "node scripts/check-confusable-symbols.cjs", "prettier --write", "eslint --fix", "npm run test:staged" ], "*.{md,json,yaml,yml}": ["node scripts/check-confusable-symbols.cjs", "prettier --write"] }, "optionalDependencies": { "@puppeteer/browsers": "^2.13.0", "puppeteer": "^24.37.5" }, "puppeteer": { "skipDownload": true, "cacheDirectory": "~/.cache/puppeteer-global" }, "overrides": { "serialize-javascript": "^7.0.3", "minimatch": "^10.2.4" } }