| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | | 2 | |
| 3 | import * as NodeRuntime from "@effect/platform-node/NodeRuntime"; | 3 | import * as NodeRuntime from "@effect/platform-node/NodeRuntime"; |
| 4 | import * as NodeServices from "@effect/platform-node/NodeServices"; | 4 | import * as NodeServices from "@effect/platform-node/NodeServices"; |
| 5 | import { Data, Effect, FileSystem, Logger, Path } from "effect"; | 5 | import { Data, Effect, FileSystem, Logger, Option, Path } from "effect"; |
| 6 | import { Command, Flag } from "effect/unstable/cli"; | 6 | import { Command, Flag } from "effect/unstable/cli"; |
| 7 | import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; | 7 | import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; |
| 8 | | 8 | |
| ... | @@ -77,6 +77,7 @@ const publishCmd = Command.make( | ... | @@ -77,6 +77,7 @@ const publishCmd = Command.make( |
| 77 | { | 77 | { |
| 78 | tag: Flag.string("tag").pipe(Flag.withDefault("latest")), | 78 | tag: Flag.string("tag").pipe(Flag.withDefault("latest")), |
| 79 | access: Flag.string("access").pipe(Flag.withDefault("public")), | 79 | access: Flag.string("access").pipe(Flag.withDefault("public")), |
| | 80 | appVersion: Flag.string("app-version").pipe(Flag.optional), |
| 80 | provenance: Flag.boolean("provenance").pipe(Flag.withDefault(false)), | 81 | provenance: Flag.boolean("provenance").pipe(Flag.withDefault(false)), |
| 81 | dryRun: Flag.boolean("dry-run").pipe(Flag.withDefault(false)), | 82 | dryRun: Flag.boolean("dry-run").pipe(Flag.withDefault(false)), |
| 82 | verbose: Flag.boolean("verbose").pipe(Flag.withDefault(false)), | 83 | verbose: Flag.boolean("verbose").pipe(Flag.withDefault(false)), |
| ... | @@ -107,10 +108,11 @@ const publishCmd = Command.make( | ... | @@ -107,10 +108,11 @@ const publishCmd = Command.make( |
| 107 | yield* fs.writeFileString(backupPath, original); | 108 | yield* fs.writeFileString(backupPath, original); |
| 108 | | 109 | |
| 109 | // Build package.json for publish | 110 | // Build package.json for publish |
| | 111 | const version = Option.getOrElse(config.appVersion, () => serverPackageJson.version); |
| 110 | const pkg = { | 112 | const pkg = { |
| 111 | name: serverPackageJson.name, | 113 | name: serverPackageJson.name, |
| 112 | type: serverPackageJson.type, | 114 | type: serverPackageJson.type, |
| 113 | version: serverPackageJson.version, | 115 | version, |
| 114 | engines: serverPackageJson.engines, | 116 | engines: serverPackageJson.engines, |
| 115 | files: serverPackageJson.files, | 117 | files: serverPackageJson.files, |
| 116 | dependencies: serverPackageJson.dependencies as Record<string, unknown>, | 118 | dependencies: serverPackageJson.dependencies as Record<string, unknown>, |