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

npm.publishPath not having any effect #1067

Open
Memphis335 opened this issue Dec 1, 2023 · 1 comment
Open

npm.publishPath not having any effect #1067

Memphis335 opened this issue Dec 1, 2023 · 1 comment

Comments

@Memphis335
Copy link

Memphis335 commented Dec 1, 2023

Hi All,

I am trying to publish an Angular library to a private npm repo. This is my package.json of the ng library:

{
	"name": "@dwl/common",
	"version": "0.0.121",
	"scripts": {
		"build": "ng build",
		"release": "release-it"
	},
	"files": [
		"./dist"
	],
	"publishConfig": {
		"registry": "http://localhost:4873"
	},
	"release-it": {
		"hooks": {
			"after:bump": "npm run build"
		},
		"scripts": {
			"changelog": "git log --pretty=format:\"* %s (%h)\" [REV_RANGE]"
		},
		"git": {
			"requireCleanWorkingDir": false,
			"requireUpstream": false,
			"addUntrackedFiles": false,
			"commit": false,
			"commitMessage": "Release ${version} [release-it:git]",
			"commitArgs": "--no-verify",
			"tag": false,
			"tagName": "${version}",
			"tagAnnotation": "Release ${version}",
			"tagArgs": "",
			"push": false
		},
		"npm": {
			"publish": true,
			"publishPath": "./dist",
			"tag": "latest",
			"private": false,
			"access": null,
			"otp": null
		}
	},
	"peerDependencies": {
		"@angular/common": "^16.2.0",
		"@angular/core": "^16.2.0"
	},
	"dependencies": {
		"tslib": "^2.3.0"
	},
	"sideEffects": false
}

I am following the recipe for the mono repo since I have two libraries in this repo. I am starting the release by running

foo@bar:~$ npm run release-it

from the parent package.json.

That script is

"release-it": "npm run release --workspaces"

I would like to only publish the contents of the dist folder but I am unable to achieve that. What am I doing wrong here?

@webpro
Copy link
Collaborator

webpro commented Dec 8, 2023

What is the output? What errors do you see?

Maybe it's because files: ['dist'] does not match after "publishPath": "./dist"?

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

No branches or pull requests

2 participants