Skip to content

Convert repo into consumable npm package#44

Draft
fntn wants to merge 1 commit intomainfrom
eng-10905-convert-rego-recipes-repository-to-a-consumable-package
Draft

Convert repo into consumable npm package#44
fntn wants to merge 1 commit intomainfrom
eng-10905-convert-rego-recipes-repository-to-a-consumable-package

Conversation

@fntn
Copy link
Copy Markdown
Contributor

@fntn fntn commented Mar 13, 2026

This pull request introduces npm packaging support for the repository, enabling seamless integration with JavaScript/TypeScript applications. It adds a build system to auto-generate distributable modules, documentation for npm usage, and updates the repository metadata to reflect its new capabilities.

NPM Packaging Enablement:

  • Added a package.json file to define the npm package, including entry points, exports, included files, build scripts, and metadata for publishing as @cloudsmith/rego-recipes.
  • Introduced a build script (scripts/build.js) that scans all .rego policy files, extracts metadata, and generates both dist/index.js (JavaScript module) and dist/index.d.ts (TypeScript definitions) for consumption as an npm package.

Documentation Updates:

  • Added a new NPM.md file with detailed installation instructions, usage examples, available exports, and TypeScript type definitions for consumers of the npm package.
  • Updated the README.md to reference npm usage and the new documentation, making it clear how to consume the repository as an npm package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant