From d2436b261463d8a81a1f6c8521ac46e0c3b435a4 Mon Sep 17 00:00:00 2001 From: Nan Wu Date: Mon, 12 Dec 2022 00:08:07 +1300 Subject: [PATCH] bump node version, fix npm scripts, add docker:test script for testing in a clean environment --- .gitignore | 1 + .node-version | 2 +- node_modules/sh-semver/package.json | 49 +++++++---------------------- package-lock.json | 44 ++++++++++++++++++++++++-- package.json | 11 ++++--- 5 files changed, 62 insertions(+), 45 deletions(-) diff --git a/.gitignore b/.gitignore index c5239ee..d1e5f36 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +test node_modules/ !node_modules/sh-semver/ \ No newline at end of file diff --git a/.node-version b/.node-version index d2d8914..19c7bdb 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -12.18.2 \ No newline at end of file +16 \ No newline at end of file diff --git a/node_modules/sh-semver/package.json b/node_modules/sh-semver/package.json index 276481d..6efb2f3 100644 --- a/node_modules/sh-semver/package.json +++ b/node_modules/sh-semver/package.json @@ -1,55 +1,30 @@ { - "_from": "sh-semver@1.0.0", - "_id": "sh-semver@1.0.0", - "_inBundle": false, - "_integrity": "sha1-aIBsvAKjJEXkLsC0y3E8FP05ynk=", - "_location": "/sh-semver", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "sh-semver@1.0.0", - "name": "sh-semver", - "escapedName": "sh-semver", - "rawSpec": "1.0.0", - "saveSpec": null, - "fetchSpec": "1.0.0" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/sh-semver/-/sh-semver-1.0.0.tgz", - "_shasum": "68806cbc02a32445e42ec0b4cb713c14fd39ca79", - "_spec": "sh-semver@1.0.0", - "_where": "/Users/lukas/Dev/nodenv-nvmrc", + "name": "sh-semver", + "version": "1.0.0", + "description": "The semantic versioner for bash", + "homepage": "https://github.com/qzb/sh-semver#readme", "author": { "name": "Józef Sokołowski", "url": "http://qzb.me" }, + "license": "MIT", "bin": { "sh-semver": "./semver.sh" }, + "repository": { + "type": "git", + "url": "git+https://github.com/qzb/sh-semver.git" + }, "bugs": { "url": "https://github.com/qzb/sh-semver/issues" }, - "bundleDependencies": false, - "deprecated": false, - "description": "The semantic versioner for bash", - "directories": { - "test": "tests" - }, "files": [ "semver.sh" ], - "homepage": "https://github.com/qzb/sh-semver#readme", - "license": "MIT", - "name": "sh-semver", - "repository": { - "type": "git", - "url": "git+https://github.com/qzb/sh-semver.git" + "directories": { + "test": "tests" }, "scripts": { "test": "tests/run.sh" - }, - "version": "1.0.0" + } } diff --git a/package-lock.json b/package-lock.json index 2454848..038e481 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8 +1,48 @@ { "name": "nodenv-nvmrc", - "version": "1.0.5", - "lockfileVersion": 1, + "version": "1.0.6", + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "nodenv-nvmrc", + "version": "1.0.6", + "license": "MIT", + "dependencies": { + "sh-semver": "^1.0.0" + }, + "devDependencies": { + "bats": "^1.1.0", + "brew-publish": "^2.0.0" + } + }, + "node_modules/bats": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/bats/-/bats-1.1.0.tgz", + "integrity": "sha512-1pA29OhDByrUtAXX+nmqZxgRgx2y8PvuZzbLJVjd2dpEDVDvz0MjcBMdmIPNq5lC+tG53G+RbeRsbIlv3vw7tg==", + "dev": true, + "bin": { + "bats": "bin/bats" + } + }, + "node_modules/brew-publish": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/brew-publish/-/brew-publish-2.3.1.tgz", + "integrity": "sha512-JtitWM9jtnQk2gerUbvpiYJqUPYrvU43Wet1FDm9w81nJJO4BLAeVLUTFWQTQkV7QtE3AVO203R/67NeTMxzVw==", + "dev": true, + "bin": { + "brew-publish": "bin/brew-publish" + } + }, + "node_modules/sh-semver": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/sh-semver/-/sh-semver-1.0.0.tgz", + "integrity": "sha1-aIBsvAKjJEXkLsC0y3E8FP05ynk=", + "bin": { + "sh-semver": "semver.sh" + } + } + }, "dependencies": { "bats": { "version": "1.1.0", diff --git a/package.json b/package.json index 6d5d53d..5e27029 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nodenv-nvmrc", - "version": "1.0.5", + "version": "1.0.6", "private": true, "description": "Activate a nodenv node version from .nvmrc", "homepage": "https://github.com/ouchxp/nodenv-nvmrc#readme", @@ -14,17 +14,18 @@ "bugs": { "url": "https://github.com/nodenv/nodenv-nvmrc/issues" }, - "directories": { + "config": { "bin": "bin", "testnodenv": "test/nodenv", "test": "test" }, "scripts": { - "pretest": "[ -d $npm_package_directories_testnodenv ] || git clone --quiet --depth 1 https://github.com/nodenv/nodenv $npm_package_directories_testnodenv", - "test": "PATH=$PWD/$npm_package_directories_testnodenv/bin:$PATH bats ${CI:+--tap} test", + "pretest": "[ -d $npm_package_config_testnodenv ] || git clone --quiet --depth 1 https://github.com/nodenv/nodenv $npm_package_config_testnodenv", + "test": "PATH=$PWD/$npm_package_config_testnodenv/bin:$PATH bats ${CI:+--tap} test", "update:deps": "curl 'https://raw.githubusercontent.com/qzb/sh-semver/master/semver.sh' > deps/semver.sh", "publish:brew": "brew-publish $npm_package_name v$npm_package_version", - "postversion": "git push --follow-tags && npm run publish:brew" + "postversion": "git push --follow-tags && npm run publish:brew", + "docker:test": "docker run -it --rm -v $PWD:/nodenv-nvmrc node:16 /bin/sh -c 'cd nodenv-nvmrc; npm install; npm run pretest; npm run test'" }, "devDependencies": { "bats": "^1.1.0",