forked from gatsbyjs/gatsby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gatsby-dev-cli): add verdaccio support (gatsbyjs#11525)
* feat(gatsby-dev-cli): add verdaccio support [wip] * yuck - don't look * just to verify verdaccio * fix gitignore and add htpasswd with dummy gatsby-dev user * some logging to understand why it tries to handle all the packages * just temporarily so it hopefully at least works * moar data * don't copy all the packages right now * don't rely on package name starting with "gatsby" heuristic * tmp commit * tmp * fs change * tmp * a * updates * remove random files that shouldn't be here * tmp * revert dep changes * ignore changes to package.json created during publishing * testing of dep change in gatsby-cli is picked up by gatsby-dev-cli * let's see if gatsby-dev will handle case of no node_modules * sanity check * adjust console message * add missing devDeps * more missing devDeps * grab package.json from unpkg if package is not yet installed locally * correctly ignore package.json changes during publishing * cleaning things up * htpasswd loc * restore gatsby package.json * adjust ignore files * gatsby-dev-cli: ignore tests * remove extra ln * less console output * turns out you don't need htpasswd after all * use exact when installing local packages - timestamp is used in version * why it failed? * use yarn for publishing - see verdaccio/verdaccio#997 * v0.1.1 * add temporary .npmrc file to allow anonymous publishes * add some jsdocs * update yarn.lock * oops * debug why still can't publish anon * adjust npmrc content * doh * Revert "debug why still can't publish anon" This reverts commit fc1045a. * handle package installation of deps didn't change * skip version changes for packages in gatsby mono-repo, queue copying instead of doing it immediately * fix tests * packages stored in verdaccio storage seems to be picked up by jest and causing trouble, so let's ignore verdaccio storage directory * bye "wat", you will be missed * bail early to avoid conditional bracket hell * more bailing early * more concise * new line * use exaca to simplify running yarn * clean up www/.gitignore * handle not existing packages * remove unused (was needed for basic auth) * cleanup temp file changes when process exit in middle of publishing * ops * Apply suggestions from code review Co-Authored-By: pieh <[email protected]> * cleanup unpkg response handler * move stuff around * remove tmp comment * document traversePackageDocs fn * restrcuture files * add basic tests for traversingPackageDeps * add basic tests for generating packages to publish (based on dep graph) * fix tests on windows * handle circular dependencies when constructing list of packages to publish * remove cat ;( * restore original e2e-test script * update gitignore
- Loading branch information
1 parent
25a93de
commit a4f7e77
Showing
19 changed files
with
3,874 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,6 @@ node_modules | |
|
||
decls | ||
dist | ||
|
||
# verdaccio local storage | ||
verdaccio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
src | ||
flow-typed | ||
verdaccio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/gatsby-dev-cli/src/local-npm-registry/cleanup-tasks.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const signalExit = require(`signal-exit`) | ||
|
||
const cleanupTasks = new Set() | ||
|
||
exports.registerCleanupTask = taskFn => { | ||
cleanupTasks.add(taskFn) | ||
return () => { | ||
const result = taskFn() | ||
cleanupTasks.delete(taskFn) | ||
return result | ||
} | ||
} | ||
|
||
signalExit(() => { | ||
if (cleanupTasks.size) { | ||
console.log(`Process exitted in middle of publishing - cleaning up`) | ||
cleanupTasks.forEach(taskFn => taskFn()) | ||
} | ||
}) |
Oops, something went wrong.