Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 2.07 KB

README.md

File metadata and controls

51 lines (35 loc) · 2.07 KB

purescript-npm

Traditionally, the PureScript ecosystem has used the Bower package manager to manage packages. Harry Garrood explained the reasons why in a great blog post. This tool came from the JavaScript community as an alternative to npm, which was typically used only for backend Node packages at the time and used nested dependencies, which psc can't handle.

In the broader JavaScript community, however, Bower has fallen out of favor. The community has begun to coalesce on npm, with tools like Yarn and Lerna springing up to help manage larger or more complex packaging workflows. The --flat option for Yarn avoids the PureScript community's issue with nested dependencies by preventing them altogether.

This project is an attempt to pull the PureScript ecosystem effectively into npm, publishing mirrors of common PureScript packages through the @purescript organization on npm. If you'd like to help maintain packages, let @bkonkle know!

Usage

To use these packages, you'll need to include node_modules in your build sources. Examples are below.

purs-loader

Add 'node_modules/@purescript/*/src/**/*.purs' and 'node_modules/purescript-*/src/**/*.purs'to the src loader option:

{
  test: /\.purs$/,
  loader: 'purs-loader',
  query: {
    psc: 'psa',
    src: [
      'node_modules/@purescript/*/src/**/*.purs',
      'node_modules/purescript-*/src/**/*.purs',
      'src/**/*.purs'
    ]
  }
}

psc

Include the node_modules dependencies on your psc command line.

$ psc src/Main.purs 'node_modules/@purescript/*/src/**/*.purs' 'node_modules/purescript-*/src/**/*.purs'

Available Packages

The full list of available packages!

Development

Adding a package:

$ git submodule add https://github.com/$GHUSER/purescript-$PROJECT.git packages/$PROJECT
$ scripts/refresh.js $PROJECT