Skip to content

Resolve all semver range versions from NPM in package.json in a specify date.

License

Notifications You must be signed in to change notification settings

DanielVenturini/vigilant-lamp

Repository files navigation

vigilant-lamp

Resolve all semver range versions from NPM in package.json in a specify date.

Use

add the key date in package.json:

{
	"date": "2019-01-07"
}

but, the follow is better:

{
	"date": "2019-01-07T18:14:39.683Z"
}

because this is an NPM time standard.

Then, type

lamp package.json

or

lamp path/to/package.json

Then, all dependencies will be downgraded - or upgrade - to best satisfies range in specify date.

Install

To install, clone this repo and type:

make
make install    # try with super

this download all dependencies and install. Be happy.

Example

If package.json is:

{
  "date": "2015-06-30",
  "dependencies": {
    "express": "^4.10.6",
    "lodash": "~3.9.0",
    "karma": "^0.13.0-rc.1"
  },
  "devDependencies": {
    "mongoose": "^4.5.9",
    "mocha": "2.2.0"
  }
}

the command lamp package.json results in:

{
  "date": "2015-06-30",
  "dependencies": {
    "express": "4.13.0",
    "lodash": "3.9.3",
    "karma": "0.13.0-rc.6"
  },
  "devDependencies": {
    "mocha": "2.2.0",
    "mongoose": "^4.5.9"
  }
}
  • express, lodash and karma were changed;
  • mocha wasn't range; and
  • in specify date, mongoose@^4.5.9 didn't exist.

also works to peerDependencies, optionalDependencies and globalDependencies.

Support any types of range:

  • "package": "^1.2.3"
  • "package": "~1.2.3"
  • "package": ^1.2.3-alpha.1"
  • "package": "^1.x"
  • "package": "4.x"
  • "package": "*"
  • "package": "latest"
  • "package": ">=10"
  • "package": "^2.x < 2.9"
  • "package": "0.x || 10.0.x"
  • ...

Tests

To execute the tests

make test -B

Dependencies

All dependencies are installed when make executable.

pip3 install requests
pip3 install semantic_version
pip3 install parsimonious
pip3 install pyinstaller
pip3 install colorama
pip3 install semver

Build on Python 3.6.