# Test mod npm with existing package.json.

# See https://github.com/gohugoio/hugo/issues/13465
[windows] skip

hugo mod npm pack
cmp packages/hugoautogen/package.json golden/packages/hugoautogen/package.json
cmp package.json golden/package.json
exists packages/hugoautogen/hugo_packagemeta.json

-- hugo.toml --
baseURL = "https://example.org/"
[module]
[[module.imports]]
path="github.com/gohugoio/hugoTestModule2"
-- package.json --
{
  "comments": {
    "foo": {
      "a": "b"
    }
  },
  "devDependencies": {
    "tailwindcss": "2.2.0"
  },
  "name": "mypackage",
  "version": "1.1.0"
}
-- golden/packages/hugoautogen/package.json --
{
  "dependencies": {
    "react-dom": "^16.13.1"
  },
  "devDependencies": {
    "@babel/cli": "7.8.4",
    "@babel/core": "7.9.0",
    "@babel/preset-env": "7.9.5",
    "postcss-cli": "7.1.0"
  },
  "name": "script-mod_npm_withexisting",
  "version": "0.1.0"
}
-- golden/package.json --
{
  "comments": {
    "foo": {
      "a": "b"
    }
  },
  "devDependencies": {
    "tailwindcss": "2.2.0"
  },
  "name": "mypackage",
  "version": "1.1.0",
  "workspaces": [
    "packages/hugoautogen"
  ]
}
-- go.mod --
module github.com/gohugoio/hugoTestModule
go 1.20
