Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,15 @@
"changelogFile": "CHANGELOG.md"
}
],
"@semantic-release/npm",
[
"@semantic-release/npm",
{
"npmPublish": true,
"tarballDir": false,
"pkgRoot": ".",
"provenance": true
}
],
"@semantic-release/github"
]
}
Expand Down
10 changes: 9 additions & 1 deletion scripts/build-mjml-react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ function moveFilesToDist() {
const destination = `dist/${fileToCopy}`;
if (fileToCopy === "package.json") {
const file = fs.readFileSync(fileToCopy);
fs.writeFileSync(destination, file.toString().replace(/dist\//g, ""));
const packageJson = JSON.parse(file.toString().replace(/dist\//g, ""));

// Remove fields that shouldn't be in the published package

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will trust you that we should really be deleting all these...

For my understanding though, what's the goal here? Trying to put out a new release and the old release method is out of date so need to update?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we used to use an NPM token but NPM deprecated using those for releases. Trying to move to the new method, but finding some issues with our original setup that is blocking. E.g. I think we should have always been removing these fields from the dist version of the package.json so they are not relevant to the final build

delete packageJson.devDependencies;
delete packageJson.scripts;
delete packageJson.release; // Remove semantic-release config!
delete packageJson.packageManager;

fs.writeFileSync(destination, JSON.stringify(packageJson, null, 2));
} else {
fs.copyFileSync(fileToCopy, destination);
}
Expand Down