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

Fix post-install hook when publishing DS packages #1558

Closed
dev-rana-publicis opened this issue Feb 27, 2024 · 1 comment · Fixed by #1561
Closed

Fix post-install hook when publishing DS packages #1558

dev-rana-publicis opened this issue Feb 27, 2024 · 1 comment · Fixed by #1561
Assignees

Comments

@dev-rana-publicis
Copy link
Contributor

dev-rana-publicis commented Feb 27, 2024

Issue description

When trying to install/update the DS package on the platform with the command npm install --save @nciocpl/ncids-css@XXX @nciocpl/ncids-js@XXX, we get the following error from the log: error sh: 1: scripts/sync-uswds-packages.js: not found. Currently, it is running the post install hook from our package.json.

This was a bug introduced in #360

@bryanpizzillo
Copy link
Member

@dev-rana-publicis I think you can take this ticket on. The problem is in packages/ncids-css/package.json. You need to change postinstall to prepare.

Well, I think that will fix it. So npm has a set of scripts that are called when you run npm commands. Most package managers honor this convention and mostly do the same.

With yarn we had a little bit of redirection -- basically we had a postinstall at the root, which called ncids:postinstall in ncids-css. Basically postinstall runs on everyones computers; however, since there is no @nciocpl/ncids package, the root file does not matter. With the move to npm things had to change because it worked differently -- I dunno if pnpm can handle the root postinstall, but we can try prepare first.

prepare only fires under certain conditions, most of which are local.

Basically you will need to test the following:

  1. If you freshly clone and do a pnpm install can you still build storybook, run gatsby, or develop on the example site?
  2. Does it build in CI/CD?
  3. Can you publish?
  4. Can you install it on the platform?

If you run into any issues, stop and shout. (i.e. maybe we need to rethink prepare if it does not work)

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.

2 participants