{"id":50334515,"url":"https://github.com/komed3/package-verify","last_synced_at":"2026-05-29T12:31:01.189Z","repository":{"id":333265149,"uuid":"1136600688","full_name":"komed3/package-verify","owner":"komed3","description":"Verify published package contents against an explicit manifest","archived":false,"fork":false,"pushed_at":"2026-05-17T21:25:56.000Z","size":159,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-17T23:39:53.257Z","etag":null,"topics":["ci","integrity","manifest","npm","package","publish","validation","verify"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package-verify","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/komed3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-18T01:32:31.000Z","updated_at":"2026-05-17T21:25:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/komed3/package-verify","commit_stats":null,"previous_names":["komed3/package-verify"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/komed3/package-verify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komed3%2Fpackage-verify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komed3%2Fpackage-verify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komed3%2Fpackage-verify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komed3%2Fpackage-verify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/komed3","download_url":"https://codeload.github.com/komed3/package-verify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komed3%2Fpackage-verify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33652977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","integrity","manifest","npm","package","publish","validation","verify"],"created_at":"2026-05-29T12:31:00.814Z","updated_at":"2026-05-29T12:31:01.184Z","avatar_url":"https://github.com/komed3.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# package-verify\n\nVerify published package contents against an explicit manifest.\n\n`package-verify` is a **read-only verification tool** that checks whether the contents of a package directory match an explicitly defined manifest.\nIt is intended to be used **before publishing** (locally or in CI) to ensure that only the expected build outputs are included.\n\nThe tool never modifies files and never generates content.\n\n## Installation\n\n```bash\nnpm install --save-dev package-verify\n```\n\n## Basic Usage\n\n```bash\nnpx verify-pkg\n```\n\nWith no arguments, the CLI looks for a manifest file named `verify.manifest.json` in the current working directory.\n\n## CLI Options\n\n```bash\nverify-pkg [options]\n```\n\n| Option | Description |\n| ------ | ----------- |\n| `--version`, `-v` | Print version and exit |\n| `--manifest=path` | Path to the manifest file (default: `verify.manifest.json`) |\n| `--cwd=path` | Working directory to verify (default: `process cwd`) |\n| `--verbose` | Print some logging information during verification |\n| `--dry-run` | Run checks without setting a non-zero exit code |\n| `--fail-on-warn` | Treat warnings as errors |\n| `--report=path` | Write the full verification result as JSON |\n\nExample:\n\n```bash\nverify-pkg --verbose --fail-on-warn --report=verify-report.json\n```\n\n## Exit Codes\n\n| Condition | Exit code |\n| --------- | --------- |\n| No errors (and no warnings if `--fail-on-warn` is set) | `0` |\n| Errors found | `1` |\n| Warnings found with `--fail-on-warn` | `1` |\n\nThis behavior makes the tool CI-friendly by default.\n\n## Manifest File\n\nThe manifest describes what the package is expected to contain after build.\n\nDefault filename:\n\n```bash\nverify.manifest.json\n```\n\nThe file is validated against the official JSON schema:\n\n```bash\nschema/package-verify.schema.json\n```\n\nMinimal Manifest Example:\n\n```json\n{\n  \"meta\": {\n    \"manifestVersion\": 1\n  },\n  \"context\": {\n    \"packageRoot\": \".\"\n  },\n  \"policy\": {\n    \"defaultSeverity\": \"error\",\n    \"unexpectedFiles\": \"warn\",\n    \"on\": {\n      \"missingExpected\": \"error\",\n      \"emptyPattern\": \"warn\"\n    }\n  },\n  \"expect\": {\n    \"files\": [\n      \"dist/index.js\",\n      \"dist/index.d.ts\",\n      \"package.json\",\n      \"README.md\"\n    ]\n  }\n}\n```\n\n### `policy`\n\nControls how violations are classified.\n\n```json\n\"policy\": {\n  \"defaultSeverity\": \"error\",\n  \"unexpectedFiles\": \"warn\",\n  \"on\": {\n    \"missingExpected\": \"error\",\n    \"emptyPattern\": \"warn\",\n    \"deriveFailure\": \"warn\"\n  }\n}\n```\n\n| Field | Meaning |\n| ----- | ------- |\n| `defaultSeverity` | Fallback severity |\n| `unexpectedFiles` | Severity for files not covered by expect |\n| `on.missingExpected` | Missing file from `expect.files` |\n| `on.emptyPattern` | Pattern matched nothing |\n| `on.deriveFailure` | Derivation errors |\n\nValid severities: `error`, `warn` and `ignore`.\n\n### `expect`\n\nDefines what must exist in the package.\n\n#### `files`\n\nExplicit file paths (relative to `packageRoot`) that must exist.\n\n```json\n\"files\": [\n  \"dist/index.js\",\n  \"dist/index.d.ts\"\n]\n```\n\n#### `patterns`\n\nGlob patterns that must match at least one file.\n\n```json\n\"patterns\": [\n  \"dist/**/*.js\",\n  \"dist/**/*.d.ts\"\n]\n```\n\n#### `atLeastOne`\n\nGroups of alternative files where at least one per group must exist.\n\n```json\n\"atLeastOne\": [\n  [ \"README.md\", \"README.txt\" ],\n  [ \"LICENSE\", \"LICENSE.md\" ]\n]\n```\n\n### `derive` (optional)\n\nAllows deriving expected targets from source files.\n\n**Typical use case:**  \nverify that build outputs exist for a given source structure.\n\n```json\n\"derive\": {\n  \"sources\": {\n    \"root\": \"src\",\n    \"include\": \"*.ts\",\n    \"exclude\": [ \"**/*.test.ts\" ]\n  },\n  \"rules\": [\n    {\n      \"match\": [ \"**/*.ts\" ],\n      \"mode\": \"esm\"\n    }\n  ],\n  \"targets\": {\n    \"esm\": [\n      \"dist/**/*.js\",\n      \"dist/**/*.d.ts\"\n    ]\n  }\n}\n```\n\nSource files are identified under `derive.sources.root` according to the specified `include` and `exclude` patterns.\nRules are applied to map source files to target groups.\nTargets, used as templates, define what files must exist for each target group.\n\nIf derivation fails, `policy.on.deriveFailure` is applied.\n\n## CI Example (GitHub Actions)\n\n```yaml\n- name: Verify package contents\n  run: npx verify-pkg --fail-on-warn\n```\n\n## JSON Report\n\n```bash\nverify-pkg --report=verify-report.json\n```\n\nWrites the full verification result (files, patterns, derive checks, summary) as JSON.\n\n## License\n\nMIT © 2026 komed3 (Paul Köhler)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomed3%2Fpackage-verify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkomed3%2Fpackage-verify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomed3%2Fpackage-verify/lists"}