Skip to content

Add NPM package.json with build scripts and update instructions. #25 #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,36 @@ PureScript bindings for the [[https://www.npmjs.org/package/pg][pg library]] ([[

* Installation

I'll assume you have [[http://www.purescript.org/][PureScript]] and [[http://www.postgresql.org/][PostgreSQL]] installed. You'll also need [[https://github.com/bodil/pulp][purescript-pulp]] and [[https://www.npmjs.org/package/pg][pg]]:
Clone the project and install its dependencies:

#+begin_src bash
npm install pg
npm install -g pulp
git clone https://github.com/epost/purescript-node-postgres
cd purescript-node-postgres
npm install
#+end_src

Clone the project:
* Building

Build:

#+begin_src bash
git clone https://github.com/epost/purescript-node-postgres
cd purescript-node-postgres
npm run build
#+end_src

Create a Postgres database and run the tests:
* Testing

Assuming you have [[http://www.postgresql.org/][PostgreSQL]] installed, create a database with some test data:

#+begin_src bash
psql --command="create database test"
psql --command="create user testuser"
cat schema.sql | psql --username=testuser test
psql --username=testuser test -f schema.sql
#+end_src

* Building and running

Let's run some tests:
Then run the tests:

#+begin_src bash
bower install
npm install
pulp test
npm run test
#+end_src

* Documentation
Expand Down
37 changes: 37 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "purescript-node-postgres",
"version": "5.0.0",
"description": "PureScript bindings for the pg PostgreSQL library",
"main": "index.js",
"directories": {
"test": "test"
},
"scripts": {
"postinstall": "PATH=node_modules/.bin:$PATH bower install",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm automatically adds node_modules/.bin to the PATH.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks @anttih. Hmm, I think I must have something misconfigured because that didn't work for me. In particular, pulp couldn't find purs. Still, I've addressed your comment in #27, does that work for you?

"build": "PATH=node_modules/.bin:$PATH pulp build",
"test": "PATH=node_modules/.bin:$PATH pulp test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/epost/purescript-node-postgres.git"
},
"keywords": [
"postgres",
"database",
"sql"
],
"author": "Erik Post",
"license": "MIT",
"bugs": {
"url": "https://github.com/epost/purescript-node-postgres/issues"
},
"homepage": "https://github.com/epost/purescript-node-postgres#readme",
"dependencies": {
"pg": "^7.10.0"
},
"devDependencies": {
"bower": "^1.8.8",
"pulp": "^12.4.2",
"purescript": "^0.12.5"
}
}