Skip to content

Commit

Permalink
Build tweaks and update DEVELOP.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jawj committed Jan 28, 2025
1 parent 67931d2 commit 2457211
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

The code is at https://github.com/neondatabase/serverless.

To ensure code passes format checks and build output is up to date before commit, please copy `pre-commit` to `.git/hooks`.

## Test

To run the tests:
To run tests:

- Install Node + npm, Bun and Deno
- Install Node LTS + npm, Bun and Deno

- Copy `.env.template` to `.env.test` and fill in the blanks.

Expand All @@ -16,10 +18,10 @@ To run the tests:

## `npm install` a specific branch or commit

`npm install @neondatabase/serverless@github:neondatabase/serverless#${BRANCH_OR_COMMIT}`

## Publish
```bash
npm install @neondatabase/serverless@github:neondatabase/serverless#BRANCH_OR_COMMIT
```

Tests must be passing. To update and publish the npm & JSR packages:
## Publish on npm and JSR

- `npm version [patch|minor|major]`
Tests must be passing locally, you must be on branch `main`, the repo must be clean, and `CHANGELOG.md` must include notes for the new version. Then simply run `npm version` with `patch`, `minor` or `major`.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
},
"scripts": {
"build": "./build.sh",
"preversion": "([[ $(git branch --show-current) = 'main' ]] || echo 'Must be on main') && npm run format && npm run test && npm run build && git add index.js index.d.ts index.mjs index.d.mts",
"version": "(grep \"^## $(jq -r .version package.json)\" CHANGELOG.md || 'Needs CHANGELOG.md') && jq --arg v \"$(jq -r .version package.json)\" '.version = $v' jsr.json > build/jsr.json && mv build/jsr.json jsr.json && git add jsr.json",
"preversion": "([[ $(git branch --show-current) = 'main' ]] || echo 'Must be on main') && npm run format && npm run test && git add index.js index.d.ts index.mjs index.d.mts",
"version": "(grep \"^## $(jq -r .version package.json)\" CHANGELOG.md || 'Update CHANGELOG.md') && jq --arg v \"$(jq -r .version package.json)\" '.version = $v' jsr.json > build/jsr.json && mv build/jsr.json jsr.json && git add jsr.json",
"postversion": "git push && git push --tags && npm publish && jsr publish",
"format": "prettier -c .",
"format:fix": "prettier -w .",
Expand Down

0 comments on commit 2457211

Please sign in to comment.