From 74fe46ab2595b3ff8177e8289851935b8fb6204a Mon Sep 17 00:00:00 2001 From: David Herman Date: Wed, 27 Mar 2024 19:03:18 -0700 Subject: [PATCH] bugfix: PackageSpec needs version (default is "0.1.0") and manifest template references packageSpec not package --- .../data/templates/manifest/base/default.json.hbs | 6 +++--- .../data/templates/manifest/base/library.json.hbs | 4 ++-- pkgs/create-neon/src/index.ts | 1 + pkgs/create-neon/src/package.ts | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/create-neon/data/templates/manifest/base/default.json.hbs b/pkgs/create-neon/data/templates/manifest/base/default.json.hbs index 291c547d0..1da7e61da 100644 --- a/pkgs/create-neon/data/templates/manifest/base/default.json.hbs +++ b/pkgs/create-neon/data/templates/manifest/base/default.json.hbs @@ -1,11 +1,11 @@ { - "name": "{{package.name}}", - "version": "{{package.version}}", + "name": "{{packageSpec.name}}", + "version": "{{packageSpec.version}}", "main": "index.node", "scripts": {}, "devDependencies": { - "@neon-rs/cli": "{{versions.neonCLI}}"{{#eq package.library.lang compare="ts"}}, + "@neon-rs/cli": "{{versions.neonCLI}}"{{#eq packageSpec.library.lang compare="ts"}}, "@tsconfig/node{{versions.tsconfigNode.major}}": "^{{versions.tsconfigNode.semver}}", "@types/node": "^{{versions.typesNode}}", "typescript": "^{{versions.typescript}}"{{/eq}} diff --git a/pkgs/create-neon/data/templates/manifest/base/library.json.hbs b/pkgs/create-neon/data/templates/manifest/base/library.json.hbs index 701a2e71c..1a35fb4f1 100644 --- a/pkgs/create-neon/data/templates/manifest/base/library.json.hbs +++ b/pkgs/create-neon/data/templates/manifest/base/library.json.hbs @@ -1,7 +1,7 @@ { - "name": "{{package.name}}", - "version": "{{package.version}}", + "name": "{{packageSpec.name}}", + "version": "{{packageSpec.version}}", {{#eq packageSpec.library.module compare="esm"}} "exports": { ".": { diff --git a/pkgs/create-neon/src/index.ts b/pkgs/create-neon/src/index.ts index e246996be..fa28321cc 100644 --- a/pkgs/create-neon/src/index.ts +++ b/pkgs/create-neon/src/index.ts @@ -22,6 +22,7 @@ export type CreateNeonOptions = { export async function createNeon(name: string, options: CreateNeonOptions) { const packageSpec: PackageSpec = { name, + version: "0.1.0", library: options.library, yes: options.yes, }; diff --git a/pkgs/create-neon/src/package.ts b/pkgs/create-neon/src/package.ts index 726b7b983..1ff9fce68 100644 --- a/pkgs/create-neon/src/package.ts +++ b/pkgs/create-neon/src/package.ts @@ -39,6 +39,7 @@ export type LibrarySpec = { export type PackageSpec = { name: string; + version: string; library: LibrarySpec | null; cache?: Cache | undefined; ci?: CI | undefined;