shashkovdanil / clean-publish

Removing configuration files and fields in package.json before publishing to npm

Home Page:https://www.npmjs.com/package/clean-publish

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scripts aren't ignore, which causes an endless loop

kytta opened this issue · comments

I want to use clean-publish, so I add the publish script to my package.json:

"scripts": {
    "publish": "clean-publish",
    "postversion": "some postversion script",
    "test": "some test script"
}

If I now run clean-publish --dry-run (to see what gets exported), but the process gets caught in an endless loop.

I tried to investigate; when I look into the cleaned package.json, I notice the following:

"scripts": {
    "publish": "clean-publish",
    "postversion": "some postversion script"
}

The publish script isn't deleted and is thus being called over and over. Inside the temporary directory, I notice an endless tree of temporary directories.

You should use clean-publish by replacing npm publish command with npx clean-publish.

Adding it to publish is not the right way.

Oh, okay; this is nowhere in the usage docs 🤷‍♂️

Hm. Can you send PR which will clean package.publish only if it is equal to clean-publish?

Hm. Can you send PR which will clean package.publish only if it is equal to clean-publish?

I can attempt to later today 👌