Commit ffb0413f authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

deps: remove patch-package (#8963)

* deps: remove patch-package

Removes the patch-package dep as well as the `patches` directory
from the repo.

Closes https://github.com/ethereum-optimism/client-pod/issues/455

Based on conversation in https://github.com/ethereum-optimism/optimism/pull/8731#discussion_r1447689073

* scripts: remove postinstall
parent ccf1057a
......@@ -7,5 +7,6 @@
"access": "public",
"baseBranch": "develop",
"updateInternalDependencies": "patch",
"privatePackages": { "version": true, "tag": true },
"ignore": []
}
......@@ -14,8 +14,8 @@
"build": "npx nx run-many --target=build",
"test": "npx nx run-many --target=test",
"issues": "./ops/scripts/todo-checker.sh",
"install:ci": "pnpm install --ignore-scripts --frozen-lockfile && pnpm postinstall && pnpm rebuild nx",
"install:ci:offline": "pnpm install --ignore-scripts --offline --frozen-lockfile && pnpm postinstall && pnpm rebuild nx",
"install:ci": "pnpm install --ignore-scripts --frozen-lockfile && pnpm rebuild nx",
"install:ci:offline": "pnpm install --ignore-scripts --offline --frozen-lockfile && pnpm rebuild nx",
"lint": "npx nx run-many --target=lint",
"test:coverage": "npx nx run-many --target=test:coverage",
"lint:ts:check": "npx nx run-many --target=lint:ts:check",
......@@ -25,7 +25,6 @@
"lint:specs:check": "npx markdownlint-cli2 \"./specs/**/*.md\"",
"lint:specs:toc": "npx doctoc '--title=**Table of Contents**' ./specs",
"preinstall": "npx only-allow pnpm",
"postinstall": "patch-package",
"ready": "pnpm lint && pnpm test",
"prepare": "husky install",
"release": "npx nx run-many --target=build --skip-nx-cache && pnpm changeset publish",
......@@ -73,7 +72,6 @@
"mocha": "^10.2.0",
"nx": "17.2.4",
"nyc": "^15.1.0",
"patch-package": "^8.0.0",
"prettier": "^2.8.0",
"rimraf": "^5.0.5",
"ts-mocha": "^10.0.0",
......@@ -81,6 +79,6 @@
"nx-cloud": "latest"
},
"dependencies": {
"@changesets/cli": "^2.26.0"
"@changesets/cli": "^2.27.1"
}
}
diff --git a/node_modules/@changesets/cli/dist/cli.cjs.dev.js b/node_modules/@changesets/cli/dist/cli.cjs.dev.js
index b158219..6fdfb6e 100644
--- a/node_modules/@changesets/cli/dist/cli.cjs.dev.js
+++ b/node_modules/@changesets/cli/dist/cli.cjs.dev.js
@@ -937,7 +937,7 @@ async function publishPackages({
}) {
const packagesByName = new Map(packages.map(x => [x.packageJson.name, x]));
const publicPackages = packages.filter(pkg => !pkg.packageJson.private);
- const unpublishedPackagesInfo = await getUnpublishedPackages(publicPackages, preState);
+ const unpublishedPackagesInfo = await getUnpublishedPackages(packages, preState);
if (unpublishedPackagesInfo.length === 0) {
return [];
@@ -957,20 +957,27 @@ async function publishAPackage(pkg, access, twoFactorState, tag) {
const {
name,
version,
- publishConfig
+ publishConfig,
+ private: isPrivate
} = pkg.packageJson;
const localAccess = publishConfig === null || publishConfig === void 0 ? void 0 : publishConfig.access;
- logger.info(`Publishing ${chalk__default['default'].cyan(`"${name}"`)} at ${chalk__default['default'].green(`"${version}"`)}`);
- const publishDir = publishConfig !== null && publishConfig !== void 0 && publishConfig.directory ? path.join(pkg.dir, publishConfig.directory) : pkg.dir;
- const publishConfirmation = await publish(name, {
- cwd: publishDir,
- access: localAccess || access,
- tag
- }, twoFactorState);
+ let published;
+ if (!isPrivate) {
+ logger.info(`Publishing ${chalk__default['default'].cyan(`"${name}"`)} at ${chalk__default['default'].green(`"${version}"`)}`);
+ const publishDir = publishConfig !== null && publishConfig !== void 0 && publishConfig.directory ? path.join(pkg.dir, publishConfig.directory) : pkg.dir;
+ const publishConfirmation = await publish(name, {
+ cwd: publishDir,
+ access: localAccess || access,
+ tag
+ }, twoFactorState);
+ published = publishConfirmation.published;
+ } else {
+ published = true;
+ }
return {
name,
newVersion: version,
- published: publishConfirmation.published
+ published
};
}
@@ -1140,8 +1147,13 @@ async function tagPublish(tool, packageReleases, cwd) {
if (tool !== "root") {
for (const pkg of packageReleases) {
const tag = `${pkg.name}@${pkg.newVersion}`;
- logger.log("New tag: ", tag);
- await git.tag(tag, cwd);
+ const allTags = await git.getAllTags(cwd);
+ if (allTags.has(tag)) {
+ logger.log("Skipping existing tag: ", tag);
+ } else {
+ logger.log("New tag: ", tag);
+ await git.tag(tag, cwd);
+ }
}
} else {
const tag = `v${packageReleases[0].newVersion}`;
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment