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

Generators strip away '/' and '-' from project names when creating go.mod #118

Closed
phillipCouto opened this issue May 3, 2024 · 0 comments · Fixed by #121
Closed

Generators strip away '/' and '-' from project names when creating go.mod #118

phillipCouto opened this issue May 3, 2024 · 0 comments · Fixed by #121
Labels
type: bug Something isn't working

Comments

@phillipCouto
Copy link
Contributor

phillipCouto commented May 3, 2024

Current Behavior

If you create an application or library using the following command:

nx g @nx-go/nx-go:application apps/backend-info

The go.mod file will be initialized as follows:

module workspace/appsbackendinfo

go 1.22

Expected Behavior

If you create an application or library using the following command:

nx g @nx-go/nx-go:application apps/backend-info

The go.mod file should be initialized as follows:

module workspace/apps/backend-info

go 1.22

Github Repo

No response

Steps to Reproduce

  1. Run nx g @nx-go/nx-go:application apps/backend-info
  2. Observe the module property in the created go.mod file

Nx Report

Node   : 20.12.2
OS     : darwin-arm64
pnpm   : 9.0.6

nx                 : 18.3.4
@nx/js             : 18.3.4
@nx/jest           : 18.3.4
@nx/linter         : 18.3.4
@nx/eslint         : 18.3.4
@nx/workspace      : 18.3.4
@nx/angular        : 18.3.4
@nx/devkit         : 18.3.4
@nx/esbuild        : 18.3.4
@nx/eslint-plugin  : 18.3.4
@nx/plugin         : 18.3.4
@nrwl/tao          : 18.3.4
@nx/web            : 18.3.4
@nx/webpack        : 18.3.4
nx-cloud           : 18.0.1
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx-go/nx-go
---------------------------------------
Community plugins:
@fortawesome/angular-fontawesome : 0.14.1
@nx-go/nx-go                     : 3.0.0

nx.json

{
  "$schema": "./node_modules/nx/schemas/nx-schema.json",
  "targetDefaults": {
    "build": {
      "dependsOn": ["^build"],
      "inputs": ["production", "^production"],
      "cache": true
    },
    "@nx-go/nx-go:lint": {
      "cache": true
    },
    "@nx-go/nx-go:test": {
      "cache": true
    },
    "@nx-go/nx-go:build": {
      "inputs": [
        "production",
        "^production",
        {
          "runtime": "go version"
        }
      ],
      "cache": true
    },
    "@nx/eslint:lint": {
      "inputs": [
        "default",
        "{workspaceRoot}/.eslintrc.json",
        "{workspaceRoot}/.eslintignore",
        "{workspaceRoot}/eslint.config.js"
      ],
      "cache": true
    },
    "@nx/jest:jest": {
      "inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
      "cache": true,
      "options": {
        "passWithNoTests": true
      },
      "configurations": {
        "ci": {
          "ci": true,
          "codeCoverage": true
        }
      }
    },
    "@nx/js:tsc": {
      "cache": true,
      "dependsOn": ["^build"],
      "inputs": ["production", "^production"]
    },
    "@nx/esbuild:esbuild": {
      "cache": true,
      "dependsOn": ["^build"],
      "inputs": ["production", "^production"]
    }
  },
  "namedInputs": {
    "default": ["{projectRoot}/**/*", "sharedGlobals"],
    "production": [
      "default",
      "!{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}/.eslintrc.json",
      "!{projectRoot}/eslint.config.js"
    ],
    "sharedGlobals": ["{workspaceRoot}/go.work"]
  },
  "generators": {
    "@nx/angular:application": {
      "style": "scss",
      "linter": "eslint",
      "unitTestRunner": "jest",
      "e2eTestRunner": "none"
    },
    "@nx/angular:library": {
      "linter": "eslint",
      "unitTestRunner": "jest"
    },
    "@nx/angular:component": {
      "style": "scss"
    }
  },
  "useInferencePlugins": false,
  "defaultBase": "master",
  "plugins": ["@nx-go/nx-go"]
}

Failure Logs

No response

Go Version

1.22

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant