Skip to content
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

[Spike] Investigate publish lifecycle scripts #267

Closed
1 task done
darcyclarke opened this issue Feb 8, 2021 · 3 comments · Fixed by npm/cli#2690
Closed
1 task done

[Spike] Investigate publish lifecycle scripts #267

darcyclarke opened this issue Feb 8, 2021 · 3 comments · Fixed by npm/cli#2690
Assignees

Comments

@darcyclarke
Copy link
Contributor

darcyclarke commented Feb 8, 2021

Problem statement

Looks like these are improperly document &/or implemented today...

Exit criteria

  • understanding of & improved documentation of npm publish lifecycle scripts
@wraithgar
Copy link
Member

wraithgar commented Feb 10, 2021

Still need to note which events only run on 'directory' spec type and what that means.

npm event lifecycle

cache add
  - prepare
ci
  - preinstall
  - install
  - postinstall
  - prepublish
  - preprepare
  - prepare
  - postprepare
diff
  - prepare
env
  - env (which is overwritten during env to a custom script)
exec
  - npx
explore
  - _explore (which is overwritten during explore to a custom script)
install (and install <pkg-name> -g)
  - preinstall
  - install
  - postinstall
  - prepublish
  - preprepare
  - prepare
  - postprepare
pack
  - prepack
  - prepare
  - postpack
publish
  - prepublishOnly
  - prepack
  - prepare (not during dry-run)
  - postpack
  - publish
  - postpublish
rebuild (all are run in background unless --foreground-scripts is set)
  - preinstall
  - install
  - postinstall
  - prepare (links only)
restart
  - restart (if there is no restart, stop is run if it is present, then start is run no matter what)
run <user defined>
  - pre<user defined>
  - <user defined>
  - post<user defined>
stop
  - stop
start
  - start
test
  - test
version
  - preversion
  - version
  - postversion


prepare is also potentially run during:
  - update
  - link
  - uninstall <package-name>
  - prune
  - install <package-name>

@wraithgar
Copy link
Member

Looks like rebuild got missed here somehow.

@CMCDragonkai
Copy link

Is the purpose of rebuild just a lesser version of the install command? In other words, what's the rationale for having those lifecycle scripts assigned to rebuild?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants