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: robustness improvements for shell hook #544

Closed
wants to merge 2 commits into from

Conversation

brprice
Copy link
Contributor

@brprice brprice commented Oct 6, 2022

We now bail out early with a helpful message if pnpm is not available (i.e. because bootstrapping has not been done), and always return to the root directory even if pnpm generate fails.

@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: ffaf563
Status: ✅  Deploy successful!
Preview URL: https://31b38337.primer-app.pages.dev
Branch Preview URL: https://brprice-robust-shell-hook.primer-app.pages.dev

View logs

@brprice brprice requested a review from dhess October 6, 2022 10:26
README.md Outdated

After the initial bootstrap, you'll be able to run just `nix develop` and then all the standard `pnpm` command should work.
Then you'll be able to run just `nix develop` and then all the standard `pnpm` command should work.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, this sentence reads slightly awkwardly with the repetition of "then".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Removed the second "then".

@brprice brprice force-pushed the brprice/robust-shell-hook branch from ffaf563 to cb49712 Compare October 6, 2022 10:40
@@ -35,9 +35,10 @@ Note that, in this project, we do *not* use Nix in any significant capacity. Nix

## Interactive development

To develop interactively, enter the Nix shell via `nix develop`. Note that due to https://github.com/NixOS/nixpkgs/issues/132456, we cannot use Nix to install `pnpm` with any version of Node.js > 14, so the first time you check out the `primer-app` repo, you'll need to run `npx pnpm install` to bootstrap a new repo.
To develop interactively, enter the Nix shell via `nix develop`. Note that due to https://github.com/NixOS/nixpkgs/issues/132456, we cannot use Nix to install `pnpm` with any version of Node.js > 14, so the first time you check out the `primer-app` repo, you'll need to run `npx pnpm install` (in a `nix develop` shell) to bootstrap a new repo.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might as well drop the notice about NixOS/nixpkgs#132456. My reasons for wanting to avoid using Nix to get pnpm stand, but that issue is not actually a blocker anymore. So we could instead say something like, "The first time you check out the primer-app repo, you'll need to run npx pnpm install (in a nix develop shell) to bootstrap."

ln -s ${spec} ${local-spec}
cd packages/primer-app && pnpm generate && cd -
if ! type -P pnpm ; then
echo "'pnpm' not found: there is some one-time setup required, see README.md"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just run npx pnpm install here and then tell the user to exit and re-enter the nix develop shell?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assumed you intentionally had not done that previously. I'll change (in fact, I think we can avoid having to exit and re-enter in that case)

@dhess dhess added the Do not merge Do not merge label Oct 10, 2022
@dhess
Copy link
Member

dhess commented Oct 10, 2022

Let's hold off on merging this until the project refactoring work is done.

@dhess
Copy link
Member

dhess commented Oct 26, 2022

Closing in favor of #590.

@dhess dhess closed this Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Do not merge Do not merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants