Skip to content

Commit

Permalink
chore: patch verdaccio executor to properly resolve on correct `dis…
Browse files Browse the repository at this point in the history
…connect` instead of rejecting
  • Loading branch information
tinesoft committed Dec 1, 2024
1 parent b22a869 commit cd9442b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
28 changes: 20 additions & 8 deletions patches/@[email protected]
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
diff --git a/src/executors/verdaccio/verdaccio.impl.js b/src/executors/verdaccio/verdaccio.impl.js
index f2bed83199618799a70c2252e0195497154f006e..edfb9610d6a5f2d860b7cbc0b0e6b4e5807ee184 100644
--- a/src/executors/verdaccio/verdaccio.impl.js
+++ b/src/executors/verdaccio/verdaccio.impl.js
@@ -83,7 +83,12 @@ function startVerdaccio(options, workspaceRoot) {
reject(err);
});
childProcess.on('disconnect', (err) => {
- reject(err);
+ if (err !== null) {
+ resolve(0);
+ }
+ else {
+ reject(err);
+ }
});
childProcess.on('exit', (code) => {
if (code === 0) {
diff --git a/src/plugins/jest/start-local-registry.d.ts b/src/plugins/jest/start-local-registry.d.ts
index 46e1a3f09e6828e03ece78b0a0534bc77ce693c1..544e1d9d3d8775a7375d98897dd145a3d51216e7 100644
--- a/src/plugins/jest/start-local-registry.d.ts
Expand All @@ -18,7 +36,7 @@ index 46e1a3f09e6828e03ece78b0a0534bc77ce693c1..544e1d9d3d8775a7375d98897dd145a3
}): Promise<() => void>;
export default startLocalRegistry;
diff --git a/src/plugins/jest/start-local-registry.js b/src/plugins/jest/start-local-registry.js
index e5d04ad4f1f54752e2493eed672c1567bfb301d8..94c4d731d7cf4a19944d369992222f0454790286 100644
index e5d04ad4f1f54752e2493eed672c1567bfb301d8..072900af3cc6aca4716dc8b6226c9324fd946a18 100644
--- a/src/plugins/jest/start-local-registry.js
+++ b/src/plugins/jest/start-local-registry.js
@@ -8,8 +8,9 @@ const child_process_1 = require("child_process");
Expand All @@ -32,13 +50,7 @@ index e5d04ad4f1f54752e2493eed672c1567bfb301d8..94c4d731d7cf4a19944d369992222f04
if (!localRegistryTarget) {
throw new Error(`localRegistryTarget is required`);
}
@@ -17,28 +18,28 @@ function startLocalRegistry({ localRegistryTarget, storage, verbose, clearStorag
const childProcess = (0, child_process_1.fork)(require.resolve('nx'), [
...`run ${localRegistryTarget} --location none --clear ${clearStorage ?? true}`.split(' '),
...(storage ? [`--storage`, storage] : []),
- ], { stdio: 'pipe' });
+ ], { stdio: verbose ? 'inherit' : 'pipe' });
const listener = (data) => {
@@ -22,23 +23,23 @@ function startLocalRegistry({ localRegistryTarget, storage, verbose, clearStorag
if (verbose) {
process.stdout.write(data);
}
Expand Down
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cd9442b

Please sign in to comment.