Support the `prepublishOnly` hook
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 40
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
Have you checked for existing feature requests?
- Completed
Summary
I wrote a TypeScript package as a way of dogfooding the IDE experience with my pulsar-ide-typescript-alpha package. By and large it's a smooth process, but the hardest part has been automatically transpiling to JavaScript before publish.
My understanding is that most NPM packages that are written in TypeScript use the prepublishOnly script hook for this task. prepublishOnly is called after the user runs npm publish, but before anything else happens.
Inspecting the artifacts of other high-profile Atom packages that were written in TypeScript implies that this might’ve worked for ppm at some point in the past, but I can’t imagine how that would be true.
My goal for my own project is (a) never to have to care about built files until publish time, and (b) never to run the risk of forgetting to transpile (and commit the transpilation) before publishing.
This is not a major priority, but I think it’s worth visiting at some point.
What benefits does this feature provide?
Feature parity with npm. Makes it much easier to do something that might be a common need for new package contributors.
Any alternatives?
I can't think of a good alternative to this. In my case, I've managed to build a system out of duct tape and twine that forces me to build code before I run ppm publish patch, but that's not a proper solution.
Other examples:
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the entry point behind ppm publish patch and compare its lifecycle handling with npm's prepublishOnly behavior. Read the linked npm lifecycle documentation and the referenced package.json example to establish when the hook should run. Done means TypeScript packages can transpile automatically before publishing without requiring committed build artifacts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- cli, release
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100