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
Prev Previous commit
Next Next commit
bugfix: askProjectType needs to create an NPM cache correctly
  • Loading branch information
dherman committed Nov 15, 2024
commit 34e7bbd8f9952363d31f8f3289ad8982ad84a68d
15 changes: 13 additions & 2 deletions pkgs/create-neon/src/index.ts
Original file line number Diff line number Diff line change
@@ -61,10 +61,21 @@ async function askProjectType(options: ProjectOptions) {
? await dialog.ask({
prompt: "cache org",
parse: (v: string): string => v,
default: NPM.inferOrg(options.name),
default: `@${options.org ?? options.name}`,
})
: null;

const prefix =
cache === "npm" && org === `@${options.name}`
? ""
: cache === "npm"
? await dialog.ask({
prompt: "cache prefix",
parse: (v: string): string => v,
default: `${options.name}-`,
})
: null;

const ci = await dialog.ask({
prompt: "ci provider",
parse: oneOf({ npm: "github" as const, none: undefined }),
@@ -76,7 +87,7 @@ async function askProjectType(options: ProjectOptions) {
options.library = {
lang: Lang.TS,
module: ModuleType.ESM,
cache: cache === "npm" ? new NPM(options.name, org!) : undefined,
cache: cache === "npm" ? new NPM(org!, prefix!) : undefined,
ci: ci === "github" ? new GitHub() : undefined,
platforms: platforms.length === 1 ? platforms[0] : platforms,
};
Loading