jscutlery / semver

Nx plugin to automate semantic versioning and CHANGELOG generation.
MIT License
731 stars 86 forks source link

Workspace Options not being honored & git push leaves behind files #506

Closed mbulfair closed 2 years ago

mbulfair commented 2 years ago

I am not sure if I am doing something wrong, however I am setting defaults in my workspace.json, however when I run the version even if there are no changes, it runs, ignores workspace config, and runs what its in the library project.json.

NX Report Log

   Node : 14.18.1
   OS   : darwin x64
   npm  : 6.14.15

   nx : 14.0.5
   @nrwl/angular : Not Found
   @nrwl/cypress : 14.0.5
   @nrwl/detox : Not Found
   @nrwl/devkit : 13.10.2
   @nrwl/eslint-plugin-nx : 14.0.5
   @nrwl/express : Not Found
   @nrwl/jest : 14.0.5
   @nrwl/js : 14.0.5
   @nrwl/linter : 14.0.5
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 14.0.5
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.0.5
   @nrwl/web : 14.0.5
   @nrwl/workspace : 14.0.5
   typescript : 4.6.3
   rxjs : 7.5.5
   ---------------------------------------
   Community plugins:
         @jscutlery/semver: 2.22.0
         ngx-deploy-npm: 3.1.7
         nx-stylelint: 13.3.0

workspace.json

  "executor": "@jscutlery/semver:version",
  "options": {
    "baseBranch": "main",
    "preset": "angular",
    "changelogHeader": "Our Change Log",
    "trackDeps": true,
    "skipProjectChangelog": true,
    "tagPrefix": "${projectName}@",
    "dryRun": true
  }

Ideally I want to run nx affected and be similar to lerna, read commits or file changes in each library and bump up things based on the commit log.

Also I am noticing with push:true the changelog is not being pushed, and when there are multiple libraries it will fail since there's a lingering project changelog.

Any guidance would be helpful and appreciated.

edbzn commented 2 years ago

Hi, if you have a project.json file you should put the semver configuration here, not in the workspace.json. I think that's why options are not taken into account.

mbulfair commented 2 years ago

@edbzn that would go against this documentation, also my workspace project doesn't have a root level project.json image

edbzn commented 2 years ago

It's because Nx has several ways to define the configuration but it should be transparent for you as long as you use the installation generator that we provide.

mbulfair commented 2 years ago

Alright, well this is my first NX workspace, and all I did was nx g @jscutlery/semver:install which adds it to all my libraries, but theres things that are repeated, so forgive me if something is not 'transparent' that there's no global project automatically generated. I just added to workspace.json which has the executor which I would guess be a global spot to read the shared commands.

edbzn commented 2 years ago

but theres things that are repeated

I guess you are using the independent mode in this case it means configuration is repeated for each project.

I just added to workspace.json which has the executor which I would guess be a global spot to read the shared commands.

Forgive me but I'm not sure to understand your problem. If by shared commands you mean shared executors, it doesn't exist. Each project defines its own targets wich are executors and you can't share anything between projects.

edbzn commented 2 years ago

@mbulfair I'm going to close this, feel free to open a new discussion if you need support.