bahmutov / dont-break Goto Github PK
View Code? Open in Web Editor NEWChecks if the current version of your package would break dependent projects
Checks if the current version of your package would break dependent projects
To avoid problems overwriting the folder when installing again
export API
https://github.com/bahmutov/dont-break#test-command
is there a way to config like this:
// .dont-break.json
[
{
"url": "https://github.com/bahmutov/dont-break", // or similar field
"test": "npm test"
}
]
I need to add a dependant by Git URL, because the tests in it are added to .npmignore
(see #15).
I have tried adding a dependant by Git URL using git+ssh
syntax from package.json
(git+ssh://[email protected]:example.git#master
), but it tried to install git+ssh
instead:
testing dependents [ 'git+ssh:' ]
testing git+ssh:
installing git+ssh:
npm returned 1
errors:
I have tried adding a dependant by Git URL ([email protected]:example.git
), but it prepended github.com
:
testing dependents [ '[email protected]:example.git' ]
testing [email protected]:example.git
installing [email protected]:example.git
npm returned 1
errors:
npm ERR! git clone [email protected]:example.com:example.git Cloning into bare repository '/home/<snip>'...
Is there any way to do it manually? Perhaps it should be considered to add one?
Checkout package into a temp folder, then run tests. Probably should use
https://github.com/bahmutov/boggle and check its dependencies
Allow specifying a github public repo url as dependency to test
npm-registry
depends on mana
which depends on back
which has old Node engine
npm ERR! notsup Unsupported engine for [email protected]: wanted: {"node":"0.12.x || 0.10.x || 0.8.x"} (current: {"node":"6.8.1","npm":"3.10.8"})
To speed things up and to create a report for each dependency
[email protected]: working
[email protected]: breaking
[email protected]: working
Pretty major enhancement
For example I setup Circle CI build https://circleci.com/gh/bahmutov/boggle
for project https://circleci.com/gh/bahmutov/boggle to run against its dependencies. Need to describe in a blog post / README section
Use local install
Otherwise the copy / tests can fail and give invalid answer
NPM update-notifier
Seem I have https://github.com/bahmutov/boggle and https://github.com/bahmutov/boggle-connect that can be used as testing projects
To allow commenting out dependent projects
// foo
bar
console output with an error https://gist.github.com/anonymous/77eb308564e2bcdbeb2da3ee6ea22c02
seems something about copying - maybe @ sign?
installing dev dependencies /tmp/[email protected]/lib/node_modules/hoodie-app-tracker
NPM install in current folder
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN deprecated @bahmutov/[email protected]: All features were merged back into original parse-github-repo-url
npm WARN deprecated [email protected]: Please update conventional-changelog to >1.0.0. If you are running the cli, use conventional-changelog-cli
npm ERR! Darwin 15.4.0
npm ERR! argv "/Users/gregor/.nvm/versions/node/v4.2.2/bin/node" "/Users/gregor/.nvm/versions/node/v4.2.2/bin/npm" "install"
npm ERR! node v4.2.2
npm ERR! npm v3.8.6
npm ERR! path /private/tmp/[email protected]/lib/node_modules/hoodie-app-tracker/node_modules/.staging/hoodie-app-tracker-4790a197
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/private/tmp/[email protected]/lib/node_modules/hoodie-app-tracker/node_modules/.staging/hoodie-app-tracker-4790a197' -> '/private/tmp/[email protected]/lib/node_modules/hoodie-app-tracker'
npm ERR! enoent ENOENT: no such file or directory, rename '/private/tmp/[email protected]/lib/node_modules/hoodie-app-tracker/node_modules/.staging/hoodie-app-tracker-4790a197' -> '/private/tmp/[email protected]/lib/node_modules/hoodie-app-tracker'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
Trying to test https://github.com/hoodiehq/hoodie against https://github.com/hoodiehq/hoodie-app-tracker
Relevant tweet https://twitter.com/gr2m/status/721117553406435329
Skip loading .dont-break
file and just test given module name
pouchdb
takes a long time to npm install
due to a leveldown dependency. If any install takes more than 10 seconds, dont-break
will throw an error.
I really want to use this module, because we have a huge problem in pouchdb with testing dependencies (lots of npm link
and ln -s
; it's ugly). But maybe there should be some way to increase the timeout?
Here's the log:
[email protected] - Checks if the current version of your package would break dependent projects
in folder /home/nolan/workspace/pouchdb-server
testing dependents
pouchdb: test-node
testing "pouchdb: test-node"
testing folder "/tmp/[email protected]"
installing pouchdb
npm WARN peerDependencies The peer dependency bn.js@^0.15.0 included from miller-rabin will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
FAIL: Current version breaks dependents
REPORTED ERROR: install timed out for pouchdb
Error: install timed out for pouchdb
at Promise_timeout_task [as _onTimeout] (/home/nolan/workspace/pouchdb-server/node_modules/dont-break/node_modules/q/q.js:1070:25)
at Timer.listOnTimeout (timers.js:89:15)
restored folder /home/nolan/workspace/pouchdb-server
finishing with success? false
Because assumes there is an object when fetching current version of dependency
var currentVersion = installedPackage.dependencies[pkg.name] ||
installedPackage.devDependencies[pkg.name]
Especially with custom / private registries
Away from index.js
Refactor and use https://github.com/bahmutov/top-dependents
I was trying to see if this would work in react-bootstrap against our downstream dependent react-router-bootstrap. I added react-router-bootstrap to the .dont-break
file in the root of the react-bootstrap repo and ran ./node_modules/.bin/dont-break
I get the following output and it has been hanging for an hour:
➜ react-bootstrap git:(dont-break) ✗ ./node_modules/.bin/dont-break
[email protected] - Checks if the current version of your package would break dependent projects
in folder /Users/smithm/dev/react-bootstrap
testing dependents [ 'react-router-bootstrap' ]
testing react-router-bootstrap
installing react-router-bootstrap
installed into /tmp/[email protected]
installing dev dependencies /tmp/[email protected]/lib/node_modules/react-router-bootstrap
NPM install in current folder
restoring current directory /Users/smithm/dev/react-bootstrap
npm test
Am I missing something?
Setup semantic release and commit pre-git check
jshint + eslint + jscs
I have a use case where I have a project that uses my module that runs basic unit tests for npm test
and then a full suite for npm run test:all
. I'd rather run the full suite of tests in my dont-break
.
Docker-based tester https://github.com/VictorBjelkholm/autochecker
Using https://gist.github.com/bahmutov/a15d49b3fe503fb546fb as a guide
Do not wait for the project finishes (what if it times out)? Blocks #22
Currently puts current version into the path, needs both (really-need-test is the project checked)
testing dependents [ 'really-need-test' ]
testing really-need-test
installing really-need-test
installed into /tmp/[email protected]
especially for windows compat
For better promise returning current directory stack
Similar to --top-downloads
option but fetch top starred dependents.
It's popular to add tests to .npmignore
. dont-break
tries to run tests after installing the dependant, but that does not work. Instead, dont-break
should consider automatically installing the dependant by Git URL.
If user has option --top 5
find 5 most popular NPM projects that depend on your package instead of .dont-break file
Post to npm/npm#6510 when done
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.