diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml new file mode 100644 index 0000000..a87beb3 --- /dev/null +++ b/.github/workflows/publish-package.yml @@ -0,0 +1,21 @@ +# from https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-nodejs-packages +name: Publish Package to npmjs +on: + release: + types: [published] +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + - run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..6a8d80f --- /dev/null +++ b/index.js @@ -0,0 +1,3 @@ +import ppeg from "./pPEG.mjs" + +export { ppeg } \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..f1a3ca9 --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "ppegjs", + "version": "0.1.1", + "description": "A portable Parser Expression Grammar.", + "main": "index.js", + "directories": { + "example": "examples", + "test": "tests" + }, + "scripts": { + "test": "node peg-play.mjs tests" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/crummy/pPEGjs.git" + }, + "keywords": [ + "ppeg", + "parser", + "expression", + "grammar" + ], + "author": "Peter Cashin", + "license": "MIT", + "bugs": { + "url": "https://github.com/pcanz/pPEGjs/issues" + }, + "homepage": "https://github.com/pcanz/pPEGjs#readme" +}