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

feature(create-neon): namespaced libraries #1083

Merged
merged 10 commits into from
Nov 20, 2024
Merged

Conversation

dherman
Copy link
Collaborator

@dherman dherman commented Nov 15, 2024

This PR adds support for namespaced libraries with optionally prefixed binary prebuild packages.

Details:

  • optionally generate prefix field when generating package.json
  • bump generated CLI dependency number to 0.1.82
  • allow both quux and @foobar/quux style names in cmdline arg
  • allow naming scheme to be given explicitly via --bins npm[:org[/prefix]]

Full case analysis of command-line options:

Command-line args Main package Binaries org Binaries prefix Example binary
--app logos-r-us logos-r-us N/A N/A N/A
--lib logo-generator logo-generator @logo-generator "" @logo-generator/darwin-arm64
--lib --bins=npm:acme logo-generator logo-generator @acme "logo-generator-" @acme/logo-generator-darwin-arm64
--lib --bins=npm:acme/libs-logo-generator- logo-generator logo-generator @acme "libs-logo-generator-" @acme/libs-logo-generator-darwin-arm64
--lib @acme/logo-generator @acme/logo-generator @acme "logo-generator-" @acme/logo-generator-darwin-arm64
--lib --bins=npm:acme-libs @acme/logo-generator @acme/logo-generator @acme-libs "logo-generator-" @acme-libs/logo-generator-darwin-arm64

…ges.

Details:
- optionally generate prefix field when generating package.json
- bump generated CLI dependency number to 0.1.82
- allow both `quux` and `@foobar/quux` style names in cmdline arg
- allow naming scheme to be given explicitly via `--cache npm[:org[/prefix]]`
@dherman dherman changed the title feature: namespaced binary packages feature(create-neon): namespaced binary packages Nov 15, 2024
…r the org, when we're asking for the base name of the package, and when we're asking for the fully qualified package name

also, bump the manifest version in create-neon so it recognizes prefixes
@dherman dherman changed the title feature(create-neon): namespaced binary packages feature(create-neon): namespaced libraries Nov 16, 2024
… changed)

- bugfix: fix double-@ in interactive dialog
- tests: add test of interactive dialog when package is namespaced
@dherman dherman marked this pull request as ready for review November 16, 2024 20:12
Copy link
Member

@kjvalencik kjvalencik left a comment

Choose a reason for hiding this comment

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

Awesome! I love all the comments on the different use cases.

❓ I see the version bump is a breaking change. Do existing users need to change anything to upgrade? Perhaps add the prefix field to package.json?

pkgs/create-neon/src/bin/create-neon.ts Outdated Show resolved Hide resolved
pkgs/create-neon/src/bin/create-neon.ts Outdated Show resolved Hide resolved
@dherman
Copy link
Collaborator Author

dherman commented Nov 19, 2024

❓ I see the version bump is a breaking change. Do existing users need to change anything to upgrade? Perhaps add the prefix field to package.json?

No, it's fully backwards-compatible for users of the CLI. It's only an incompatible change to the programmatic API (createNeon() exported by index.cts takes a ProjectOptions as its argument, and that type changed incompatibly).

@dherman dherman merged commit 7780a2f into main Nov 20, 2024
9 checks passed
@dherman dherman deleted the create-namespaced-lib branch November 20, 2024 17:57
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 this pull request may close these issues.

2 participants