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

nx release doesn't push with "latest" tag anymore #27913

Open
1 of 4 tasks
DuncanMcPherson opened this issue Sep 13, 2024 · 2 comments
Open
1 of 4 tasks

nx release doesn't push with "latest" tag anymore #27913

DuncanMcPherson opened this issue Sep 13, 2024 · 2 comments

Comments

@DuncanMcPherson
Copy link

Current Behavior

Whenever I run nx release on my workspace I notice that the end result is that my package is published with tag "undefined".

Expected Behavior

I expected that it would continue to release with the "latest" tag.

GitHub Repo

https://github.com/DuncanMcPherson/nx-tools

Steps to Reproduce

Just a note: This is an active repo with live packages. The behavior is the same regardless of publishing to Verdaccio or npm

  1. Start Verdaccio
  2. run nx release with any version number
  3. check the Verdaccio instance and notice that under versions it shows the current tags as "undefined" and "latest" with different version numbers

image

Nx Report

NX   Report complete - copy this into the issue template

Node           : 22.4.1
OS             : win32-x64
Native Target  : x86_64-windows
npm            : 10.8.2

nx (global)        : 19.5.1
nx                 : 19.7.2
@nx/js             : 19.7.2
@nx/jest           : 19.7.2
@nx/linter         : 19.7.2
@nx/eslint         : 19.7.2
@nx/workspace      : 19.7.2
@nx/cypress        : 19.7.2
@nx/devkit         : 19.7.2
@nx/eslint-plugin  : 19.7.2
@nx/plugin         : 19.7.2
@nrwl/tao          : 19.7.2
@nx/web            : 19.7.2
typescript         : 5.5.4
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
---------------------------------------
Local workspace plugins:
         @nxextensions/firebase-cypress
         @nxextensions/firebase

Failure Logs

=== Tarball Details ===
name:          @nxextensions/firebase
version:       1.3.1
filename:      nxextensions-firebase-1.3.1.tgz
package size:  13.5 kB
unpacked size: 50.3 kB
shasum:        ba88b8764df5448238a26236a39e1d2ace95c79a
integrity:     sha512-6bkvvGh0GKv3W[...]MwTJ36Ehg5Dvg==
total files:   43

Published to undefined with tag "undefined"

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

At first thought I thought I had maybe deleted something from my nx.json file (noted below). But I can't seem to find anything that could cause this.

{
  "$schema": "./node_modules/nx/schemas/nx-schema.json",
  "defaultBase": "master",
  "namedInputs": {
    "default": ["{projectRoot}/**/*", "sharedGlobals"],
    "production": [
      "default",
      "!{projectRoot}/.eslintrc.json",
      "!{projectRoot}/eslint.config.js",
      "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
      "!{projectRoot}/tsconfig.spec.json",
      "!{projectRoot}/jest.config.[jt]s",
      "!{projectRoot}/src/test-setup.[jt]s",
      "!{projectRoot}/test-setup.[jt]s",
      "!{projectRoot}/cypress/**/*",
      "!{projectRoot}/**/*.cy.[jt]s?(x)",
      "!{projectRoot}/cypress.config.[jt]s"
    ],
    "sharedGlobals": ["{workspaceRoot}/.github/workflows/ci.yml"]
  },
  "targetDefaults": {
    "@nx/js:tsc": {
      "cache": true,
      "dependsOn": ["^build"],
      "inputs": ["production", "^production"]
    },
    "@nx/eslint:lint": {
      "cache": true,
      "inputs": [
        "default",
        "{workspaceRoot}/.eslintrc.json",
        "{workspaceRoot}/.eslintignore",
        "{workspaceRoot}/eslint.config.js"
      ]
    },
    "@nx/jest:jest": {
      "cache": true,
      "inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
      "options": {
        "passWithNoTests": true
      },
      "configurations": {
        "ci": {
          "ci": true,
          "codeCoverage": true
        }
      }
    },
    "@angular-devkit/build-angular:application": {
      "cache": true,
      "dependsOn": ["^build"],
      "inputs": ["production", "^production"]
    }
  },
  "plugins": [
    {
      "plugin": "@nx/eslint/plugin",
      "options": {
        "targetName": "eslint:lint"
      }
    }
  ],
  "generators": {
    "@nx/angular:application": {
      "e2eTestRunner": "cypress",
      "linter": "eslint",
      "style": "scss",
      "unitTestRunner": "jest"
    }
  },
  "release": {
    "projectsRelationship": "independent",
    "releaseTagPattern": "{projectName}@{version}",
    "changelog": {
      "workspaceChangelog": false,
      "projectChangelogs": true
    },
    "conventionalCommits": {
      "types": {
        "fix": {
          "semverBump": "patch",
          "changelog": {
            "title": "Bug fixes"
          }
        },
        "docs": {
          "semverBump": "none",
          "changelog": {
            "title": "Documentation"
          }
        },
        "perf": {
          "semverBump": "patch",
          "changelog": {
            "title": "Performance Enhancements"
          }
        },
        "chore": {
          "semverBump": "none",
          "changelog": false
        },
        "break": {
          "semverBump": "major",
          "changelog": {
            "title": "Breaking Changes"
          }
        }
      }
    },
    "version": {
      "preVersionCommand": "npx nx buildVersion && npx nx run-many -t build",
      "conventionalCommits": true,
      "generatorOptions": {
        "fallbackCurrentVersionResolver": "disk"
      }
    },
    "projects": ["packages/*", "!packages/deprecated", "!packages/*-e2e"]
  }
}

I did notice this starting to happen shortly after a verdaccio bug was fixed that had been causing verdaccio to fail to start due to npm config set registry being called improperly

@DuncanMcPherson
Copy link
Author

I do have a workaround that I am currently using where I run like this:

nx release
nx release version --tag latest

@ThePlenkov
Copy link

Not sure if it's related - I cannot publish any version too. I am able to release locally, git tags are issued, tag pipeline starts, but npm publish is skipped because it tries to release with version from dist package.json which is always 0.0.1 in my files. Do you know how to fix it? thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants