diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/PackageJsonGenerator.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/PackageJsonGenerator.java index d59ba5d8513..0bcf9cb40f4 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/PackageJsonGenerator.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/PackageJsonGenerator.java @@ -73,7 +73,7 @@ static void writePackageJson( template = template.replace("${package}", settings.getPackageName()); template = template.replace("${packageDescription}", settings.getPackageDescription()); template = template.replace("${packageVersion}", settings.getPackageVersion()); - template = template.replace("${packageManager}", settings.getPackageManager().getCommand()); + template = template.replace("${packageManager}", settings.getPackageManager().toString()); manifest.writeFile("package.json", template); } } diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptSettings.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptSettings.java index dec4dd11df0..ca3e5258a14 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptSettings.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptSettings.java @@ -395,7 +395,7 @@ public SymbolProvider createSymbolProvider(Model model, TypeScriptSettings setti public enum PackageManager { YARN("yarn"), - NPM("npm run-script"); + NPM("npm"); private final String command; diff --git a/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/base-package.json b/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/base-package.json index c09d6272488..26952c02da3 100644 --- a/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/base-package.json +++ b/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/base-package.json @@ -10,7 +10,7 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "prepack": "${packageManager} clean && ${packageManager} build" + "prepack": "${packageManager} run clean && ${packageManager} run build" }, "main": "./dist-cjs/index.js", "types": "./dist-types/index.d.ts",