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

packageJson configuration is not deeply merged #1125

Open
everett1992 opened this issue Dec 23, 2023 · 1 comment
Open

packageJson configuration is not deeply merged #1125

everett1992 opened this issue Dec 23, 2023 · 1 comment

Comments

@everett1992
Copy link

I tried to add a npm lifecycle script vai typescript-codegen's packageJson in smithy-build.json but instead of the "prepare" script being merging into the scripts block the whole block is replaced.

smithy-build.json

"packageJson": {
  "scripts-2": {
    "prepare": "npm pkg set --json version=$(npm pkg get 'dependencies.@aws-sdk/core')"
  }
}

Before

    "scripts": {
        "build": "concurrently 'npm:build:cjs' 'npm:build:es' 'npm:build:types'",
        "build:cjs": "tsc -p tsconfig.cjs.json",
        "build:docs": "typedoc",
        "build:es": "tsc -p tsconfig.es.json",
        "build:types": "tsc -p tsconfig.types.json",
        "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
        "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
        "prepack": "npm run clean && npm run build"
    },

After

    "scripts": {
        "prepare": "npm pkg set --json version=$(npm pkg get 'dependencies.@aws-sdk/core')"
    },
@everett1992
Copy link
Author

In case the X Y problem is more interesting, I want the generated package version to match the @aws-sdk/core version, so its easier to align custom client dependencies with the sdks.

If I could run this after code gen and before publishing the pacakge the version would always match.

npm pkg set --json version=$(npm pkg get 'dependencies.@aws-sdk/core')

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

No branches or pull requests

1 participant