Skip to content

[bug] semantic-release-monorepo ignores pkgRoot #121

@its-dibo

Description

@its-dibo

I created a minimal reproduction which is a monorepo that contains only one workspace in `./package' dir

both root and package (the workspace) have exactly the same release.config.js file except that package extends semantic-release-monorepo.

both of them uses the default configurations and only two plugins

module.exports = {
  plugins: [
    "@semantic-release/commit-analyzer",
    ["@semantic-release/npm", { pkgRoot: "dist" }],
  ],
  // extends: ["semantic-release-monorepo"],
};

the important part here is that @semantic-release/npm uses { pkgRoot: "dist" }

package contents are typically the same as the root including dist folder, except the package name.

if I run semantic-release from the root, i.e without semantic-release-monorepo it packs the package as expected, and puts the contents of pkgRoot dir in the top-level of the published package.

in contrast, when I run the same command from package, i.e with semantic-release-monorepo, it ignores the option pkgRoot and the packed packages contain the folder dist instead of its contents.

steps for reproduction
1- clone the repo and install dependencies
2- remove all local and remote tags if exist
3- switch to the branch next
4- modify root's and package's files and create feat/fix commits
5- run the script release from the root and package and see the tarball's contents in both cases

you will see different behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions