PureScript is currently in a transitional period with regards to how new packages are published. As such, the process of publishing a package is rather arduous. You will need: spago, pulp, and bower.
- Make sure your package name is unique by searching for it in bower-packages.json and new-packages.json. Alternatively you can search Pursuit as well, but those two files are the sources of truth.
- Make sure the module names in your package are globally unique by searching for them on Pursuit. Unfortunately this is a requirement with the current technology. However, finding a module with the same name on Pursuit doesn't mean all hope is lost. Module names only have to be unique in the package set. So you can use the information in step 6 to see if your module name is actually taken. There is a good number of packages published on Pursuit that have not been added to the package set.
- Submit a PR adding your package to new-packages.json.
- If you only care about adding a package to the package set so it can be used with
spago, and don't care to publish its documentation to pursuit. Skip to step 6. - Publishing a package to Pursuit
- Add a
licensefield to yourspago.dhallcontaining a valid SPXD license. - Add a
repositoryfield to yourspago.dhallwith the link to the Git repository. - If you package only depends on packages already in the Bower registry (i.e. in
bower-packages.json) go to step 5.v. If not, we have a bit of manual work to do. - Your package depends on packages that aren't in the bower registry (Update: it seems that in newer version of spago this is fixed. Try going to step 5.v and come back here if that doesn't work.)
- Make sure your
spago.dhallfile is commited and create a new branch in your package repo. - Remove the packages that aren't in the Bower registry from the dependencies in your
spago.dhalland commit it. - Use
spago bump-versionto generate abower.jsonfile that contains everything but the non-bower dependencies. Delete the tag if it was created. - In the
dependenciesfield of your newly generatedbower.json, manually add back in your non-bower dependencies with the syntax"<repo name>": "<github username>/<repo name>#<version>". - Switch to your master branch and commit the
bower.json. You can delete the branch we used to generate it if you like. - Run
bower iinstall the dependencies with Bower. - Use
pulp versionto create/bump your package version. - Go to step 5.vi.
- Make sure your
- Your package only depends on packages that are in the bower registry
- Use
spago bump-versionto generate abower.jsonfile and create/bump your package version.
- Use
- Use
pulp publishto publish your documentation to Pursuit.
- Add a
- Adding a package to the package set
- Fork and clone the package set repo.
- cd to
src/groups, This is where you will add your package. Have a look around at the other package sets to see how to format things. - Once you add your package, run
maketo updatepackages.json. - Commit your changes and put in a PR.
- In order to use your package with the
packages.dhallthat spago generates for you, you need to ask for a new package to be released after your PR is accepted. You can do this in the PR itself or in a separate issue.
I want to publish a package
B, which depends on packageA. And since Bower does not accept new package,Ais not in bower. And then as I follow the steps, I got:is there any solution?
maybe caused by PR not merged in package-sets? purescript/package-sets#883