Compare commits

...

81 Commits

Author SHA1 Message Date
jkunz 7f5abc95ad v2.0.8
Default (tags) / security (push) Failing after 1s
Default (tags) / test (push) Failing after 1s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2026-05-10 15:05:55 +00:00
jkunz 3d1a73cf9e fix(smartupdate): improve update check caching, validation, and error handling 2026-05-10 15:05:00 +00:00
jkunz d049d1a1e9 v2.0.7 2026-05-01 10:55:45 +00:00
jkunz 8b22c004ba fix(build): modernize build configuration and tighten TypeScript typings 2026-05-01 10:55:45 +00:00
jkunz 1f2937b387 update 2025-11-03 16:02:12 +00:00
jkunz 4823eb9082 update 2025-11-03 16:01:58 +00:00
philkunz 39eda12a39 update description 2024-05-29 14:16:58 +02:00
philkunz f56c9bc371 update tsconfig 2024-04-14 18:30:39 +02:00
philkunz 586db93aa3 update tsconfig 2024-04-01 21:42:02 +02:00
philkunz ff10fbd0b5 update npmextra.json: githost 2024-04-01 19:59:59 +02:00
philkunz 756c6fd26b update npmextra.json: githost 2024-03-30 21:48:59 +01:00
philkunz 16e58bbbc2 2.0.6 2023-07-26 20:51:48 +02:00
philkunz 8ffdf58d68 fix(core): update 2023-07-26 20:51:47 +02:00
philkunz 2abac29dff 2.0.5 2023-07-26 20:51:12 +02:00
philkunz 293da8859d fix(core): update 2023-07-26 20:51:11 +02:00
philkunz 111ef1fe44 2.0.4 2022-06-01 20:29:14 +02:00
philkunz 97b285be5c fix(core): update 2022-06-01 20:29:13 +02:00
philkunz cc659a57f7 2.0.3 2022-04-13 16:54:41 +02:00
philkunz f5cb86b53e fix(core): update 2022-04-13 16:54:40 +02:00
philkunz 207f1e9d51 2.0.2 2022-04-13 16:20:55 +02:00
philkunz 750b029ef8 update 2022-04-13 16:20:51 +02:00
philkunz 710fd5ec2e 2.0.1 2022-04-13 16:15:26 +02:00
philkunz d1315392a1 update 2022-04-13 16:15:23 +02:00
philkunz cf894d9e82 2.0.0 2022-04-13 16:02:33 +02:00
philkunz 1da4e08ed2 BREAKING CHANGE(core): switch to esm 2022-04-13 16:02:29 +02:00
philkunz 66546a8b17 1.0.31 2020-06-25 21:14:08 +00:00
philkunz 3c3275ece5 fix(core): update 2020-06-25 21:14:07 +00:00
philkunz d43fbe6de6 1.0.30 2020-06-25 20:10:43 +00:00
philkunz 16fd8be8be fix(core): update 2020-06-25 20:10:43 +00:00
philkunz 297e65ebe5 1.0.29 2020-06-25 20:08:47 +00:00
philkunz a5c019419b fix(core): update 2020-06-25 20:08:47 +00:00
philkunz 815694dd8b 1.0.28 2019-09-16 14:52:59 +02:00
philkunz 083786795e fix(core): update 2019-09-16 14:52:59 +02:00
philkunz 284f4753e0 1.0.27 2019-09-06 13:58:18 +02:00
philkunz 335e9160a6 fix(core): update 2019-09-06 13:58:17 +02:00
philkunz 94c22b65e5 1.0.26 2019-09-06 13:39:40 +02:00
philkunz f1d07f968d fix(core): update 2019-09-06 13:39:39 +02:00
philkunz ac53d801a6 1.0.25 2019-09-05 17:40:41 +02:00
philkunz a75bb09d3f fix(core): update 2019-09-05 17:40:41 +02:00
philkunz 01f70cf1a4 1.0.24 2019-09-04 16:38:06 +02:00
philkunz f9fccd2dff fix(core): update 2019-09-04 16:38:06 +02:00
philkunz 3fb0203bae 1.0.23 2019-09-04 16:27:43 +02:00
philkunz 5e7a5f26d4 fix(core): update 2019-09-04 16:27:42 +02:00
philkunz 51c0cdcd13 1.0.22 2018-11-08 09:54:09 +01:00
philkunz 1622a30e05 update 2018-11-08 09:54:06 +01:00
philkunz 429a8d1098 1.0.21 2018-09-02 12:41:06 +02:00
philkunz 7bfdb8db5e fix(dependencies): update to latest versions 2018-09-02 12:41:06 +02:00
philkunz bff9bafee4 1.0.20 2018-09-02 12:21:55 +02:00
philkunz 7b3afa9d5a fix(ci): update 2018-09-02 12:21:55 +02:00
philkunz c0088699b8 1.0.19 2018-09-02 12:00:53 +02:00
philkunz 6d5a463867 fix(dependencies): update to latest versions 2018-09-02 12:00:52 +02:00
philkunz b54c13009d 1.0.18 2018-05-22 17:15:04 +02:00
philkunz 1f262b728e 1.0.17 2018-05-22 16:24:33 +02:00
philkunz 88de9912e4 fix(pacakge name): switch to @pushrocks scope 2018-05-22 16:24:33 +02:00
philkunz 5f02c93fa1 1.0.16 2018-05-22 15:49:27 +02:00
philkunz bf3815c74d fix(package): update smartopen to @pushrocks/smartopen 2018-05-22 15:49:26 +02:00
philkunz 56d2c3f33f 1.0.15 2018-02-15 00:06:24 +01:00
philkunz a114e3f43a update to be resilient against network failures 2018-02-15 00:06:20 +01:00
philkunz cfb593daf3 update ci 2018-02-14 23:35:00 +01:00
philkunz 2d594f86a8 1.0.14 2018-02-14 23:19:39 +01:00
philkunz 8e0dba7bf8 remove typings-global 2018-02-14 23:19:36 +01:00
philkunz 271e968ddc 1.0.13 2017-10-07 13:34:39 +02:00
philkunz dce227d71c update npmextra name 2017-10-07 13:34:36 +02:00
philkunz ed44f68e78 1.0.12 2017-09-13 17:42:23 +02:00
philkunz 2a62e7b83e update to work without npms.io availablilty 2017-09-13 17:42:19 +02:00
philkunz e3eadeb378 1.0.11 2017-09-11 14:14:27 +02:00
philkunz 1f5b780b59 update ci 2017-09-11 14:14:23 +02:00
philkunz 1c5c2e9481 make smartupdate resilient 2017-09-11 14:13:37 +02:00
philkunz 0f15afbb60 1.0.10 2017-08-20 11:28:14 +02:00
philkunz a6255855a0 update the wording 2017-08-20 11:28:11 +02:00
philkunz 251999c3d5 1.0.9 2017-08-20 00:45:48 +02:00
philkunz 8a34731e8c update dependencies 2017-08-20 00:45:45 +02:00
philkunz 186179d132 1.0.8 2017-08-20 00:09:30 +02:00
philkunz 9666658a77 update dependencies 2017-08-20 00:09:26 +02:00
philkunz 61f2ed9ef7 1.0.7 2017-08-19 12:32:27 +02:00
philkunz 2224a22f0c fix bug that resets timer 2017-08-19 12:32:24 +02:00
philkunz c3c35c9b3e 1.0.6 2017-08-18 12:52:28 +02:00
philkunz d9f75c236f compile 2017-08-18 12:52:24 +02:00
philkunz 61d7ac981b update to reflect more accurate update information 2017-08-18 12:52:11 +02:00
philkunz 4501469365 1.0.5 2017-08-17 11:56:41 +02:00
philkunz c1df1f0db5 add smartopen 2017-08-17 11:56:38 +02:00
36 changed files with 16637 additions and 1167 deletions
+66
View File
@@ -0,0 +1,66 @@
name: Default (not tags)
on:
push:
tags-ignore:
- '**'
env:
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs:
security:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Install pnpm and npmci
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
- name: Run npm prepare
run: npmci npm prepare
- name: Audit production dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit development dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev
continue-on-error: true
test:
if: ${{ always() }}
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Test stable
run: |
npmci node install stable
npmci npm install
npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build
+124
View File
@@ -0,0 +1,124 @@
name: Default (tags)
on:
push:
tags:
- '*'
env:
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs:
security:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Audit production dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit development dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev
continue-on-error: true
test:
if: ${{ always() }}
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Test stable
run: |
npmci node install stable
npmci npm install
npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build
release:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Release
run: |
npmci node install stable
npmci npm publish
metadata:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Code quality
run: |
npmci command npm install -g typescript
npmci npm install
- name: Trigger
run: npmci trigger
- name: Build docs and upload artifacts
run: |
npmci node install stable
npmci npm install
pnpm install -g @gitzone/tsdoc
npmci command tsdoc
continue-on-error: true
+16 -1
View File
@@ -1,5 +1,20 @@
.nogit/ .nogit/
node_modules/
# artifacts
coverage/ coverage/
public/ public/
pages/ pages/
# installs
node_modules/
# caches
.yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_*/
# custom
-71
View File
@@ -1,71 +0,0 @@
# gitzone standard
image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
key: "$CI_BUILD_STAGE"
stages:
- test
- release
- trigger
- pages
testLEGACY:
stage: test
script:
- npmci test legacy
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
allow_failure: true
testLTS:
stage: test
script:
- npmci test lts
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
testSTABLE:
stage: test
script:
- npmci test stable
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release:
stage: release
script:
- npmci publish
only:
- tags
tags:
- docker
trigger:
stage: trigger
script:
- npmci trigger
only:
- tags
tags:
- docker
pages:
image: hosttoday/ht-docker-node:npmci
stage: pages
script:
- npmci command yarn global add npmpage
- npmci command npmpage
tags:
- docker
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
+41
View File
@@ -0,0 +1,41 @@
{
"@git.zone/cli": {
"schemaVersion": 2,
"projectType": "npm",
"module": {
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "smartupdate",
"description": "A library designed to facilitate smarter update notifications and checking for Node.js projects.",
"npmPackagename": "@push.rocks/smartupdate",
"license": "MIT",
"projectDomain": "push.rocks"
},
"release": {
"targets": {
"git": {
"enabled": true,
"remote": "origin"
},
"npm": {
"enabled": false,
"registries": [
"https://verdaccio.lossless.digital",
"https://registry.npmjs.org"
],
"accessLevel": "public"
},
"docker": {
"enabled": false
}
}
}
},
"@git.zone/tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
},
"@ship.zone/szci": {
"npmGlobalTools": [],
"npmRegistryUrl": "registry.npmjs.org"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "npm test",
"name": "Run npm test",
"request": "launch",
"type": "node-terminal"
}
]
}
+26
View File
@@ -0,0 +1,26 @@
{
"json.schemas": [
{
"fileMatch": ["/npmextra.json"],
"schema": {
"type": "object",
"properties": {
"npmci": {
"type": "object",
"description": "settings for npmci"
},
"gitzone": {
"type": "object",
"description": "settings for gitzone",
"properties": {
"projectType": {
"type": "string",
"enum": ["website", "element", "service", "npm", "wcc"]
}
}
}
}
}
}
]
}
+105
View File
@@ -0,0 +1,105 @@
# Changelog
## Pending
## 2026-05-10 - 2.0.8
### Fixes
- improve update check caching, validation, and error handling (smartupdate)
- cache both update-available and up-to-date results with package version and registry context to avoid stale or incorrect cache reuse
- return cached CLI update results correctly for time-based checks and handle changelog opening failures without unhandled rejections
- validate package names and versions before registry access, preserve specific error types, and add deterministic cache-focused tests
- add configurable cache store options and remove the unused smarttime dependency
## 2026-05-01 - 2.0.7 - fix(build)
modernize build configuration and tighten TypeScript typings
- updates build and test tooling dependencies and simplifies package scripts
- adds strict TypeScript settings and replaces any-based access with typed APIs in cache manager and notifier
- adds project metadata files to the published package and aligns npmextra configuration with namespaced tool settings
## 2025-11-03 - 2.0.6 - maintenance
Summarized maintenance updates across the 2.0.6 release line.
- Refined project description
- Updated TypeScript configuration
- Updated npmextra git host metadata
- Included additional minor maintenance-only updates with no user-facing impact
## 2023-07-26 - 2.0.5 - core
Delivered a small core fix release.
- Updated core behavior with a minor fix
## 2022-06-01 - 2.0.4 - core
Delivered a small core fix release covering versions 2.0.3 to 2.0.4.
- Applied minor core update fixes across the release line
## 2022-04-13 - 2.0.2 - core
Delivered a small core fix release.
- Updated core behavior with a minor fix
## 2022-04-13 - 2.0.0 - release line
Published the initial 2.x release line with follow-up maintenance updates through 2.0.1.
- Released version 2.0.0
- Included minor non-descriptive maintenance updates in 2.0.1
## 2022-04-13 - 1.0.31 - core
Introduced a breaking change in the core module.
- BREAKING CHANGE: switched the package to ESM
## 2020-06-25 - 1.0.28 - core
Summarized a sequence of patch releases from 1.0.28 to 1.0.30.
- Applied repeated minor core fixes across patch releases 1.0.28 through 1.0.30
## 2019-09-16 - 1.0.22 - core
Summarized patch activity from 1.0.22 to 1.0.28.
- Applied repeated minor core fixes across versions 1.0.22 through 1.0.28
- Included an unspecified maintenance update in 1.0.21
## 2018-09-02 - 1.0.18 - dependencies
Delivered maintenance improvements across versions 1.0.18 to 1.0.20.
- Updated dependencies to their latest compatible versions
- Refreshed CI-related configuration
- Included a general maintenance update in 1.0.21
## 2018-05-22 - 1.0.16 - package
Updated package naming and scoped dependencies across versions 1.0.15 to 1.0.16.
- Switched package naming to the `@pushrocks` scope
- Updated `smartopen` dependency to `@pushrocks/smartopen`
## 2018-02-14 - 1.0.13 - resilience
Improved runtime resilience and project maintenance through versions 1.0.13 to 1.0.14.
- Improved resilience against network failures
- Updated CI configuration
- Removed `typings-global`
## 2017-10-07 - 1.0.12 - maintenance
Applied maintenance updates across versions 1.0.10 to 1.0.12.
- Renamed npmextra metadata
- Improved operation when `npms.io` is unavailable
- Updated CI configuration
- Improved smartupdate resilience
## 2017-08-20 - 1.0.6 - features
Delivered multiple early improvements across versions 1.0.1 to 1.0.10.
- Added initial working version and project documentation
- Improved console logs and wording
- Added `smartopen`
- Improved update information output
- Fixed a bug that reset the timer
- Updated dependencies
- Included compile and maintenance-related updates
-4
View File
@@ -1,4 +0,0 @@
module.name: smartmodule
module.description: a smart description
module.author: Lossless GmbH
module.license: MIT
Generated
+6750
View File
File diff suppressed because it is too large Load Diff
-8
View File
@@ -1,8 +0,0 @@
import { KeyValueStore } from 'npmextra';
export declare class SmartUpdate {
kvStore: KeyValueStore;
check(npmnameArg: string, compareVersion: string): Promise<void>;
private getNpmPackageFromRegistry(npmnameArg);
private checkIfUpgrade(npmPackage, versionArg);
}
export declare let standardHandler: SmartUpdate;
-68
View File
@@ -1,68 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./smartupdate.plugins");
const smarttime_1 = require("smarttime");
class SmartUpdate {
constructor() {
this.kvStore = new plugins.npmextra.KeyValueStore('custom', 'global:smartupdate');
}
check(npmnameArg, compareVersion) {
return __awaiter(this, void 0, void 0, function* () {
let result = yield this.kvStore.readKey(npmnameArg);
let timeStamp = new smarttime_1.TimeStamp();
// the newData to write
let newData = {
lastCheck: timeStamp.milliSeconds,
latestVersion: 'x.x.x',
performedUpgrade: false
};
if (result) {
let lastCheckTimeStamp = smarttime_1.TimeStamp.fromMilliSeconds(result.lastCheck);
let compareTime = plugins.smarttime.getMilliSecondsFromUnits({ days: 1 });
if (!lastCheckTimeStamp.isOlderThan(timeStamp, compareTime)) {
plugins.beautylog.log(`smartupdate: next check tomorrow: ${plugins.beautycolor.coloredString(`${npmnameArg} has already been checked for today.`, 'pink')}`);
return;
}
}
let npmPackage = yield this.getNpmPackageFromRegistry(npmnameArg);
newData.latestVersion = npmPackage.version;
let upgradeBool = yield this.checkIfUpgrade(npmPackage, compareVersion);
if (upgradeBool) {
}
this.kvStore.writeKey(npmnameArg, newData);
});
}
getNpmPackageFromRegistry(npmnameArg) {
return __awaiter(this, void 0, void 0, function* () {
plugins.beautylog.log(`smartupdate: checking for newer version of ${plugins.beautycolor.coloredString(npmnameArg, 'pink')}...`);
let npmRegistry = new plugins.smartnpm.NpmRegistry();
let npmPackage = (yield npmRegistry.search({ name: npmnameArg, boostExact: true }))[0];
return npmPackage;
});
}
checkIfUpgrade(npmPackage, versionArg) {
return __awaiter(this, void 0, void 0, function* () {
if (npmPackage.version === versionArg) {
plugins.beautylog.ok(`smartupdate: You are running the latest version of ${plugins.beautycolor.coloredString(npmPackage.name, 'pink')}`);
return false;
}
else {
plugins.beautylog.warn(`There is a newer version of ${npmPackage.name} available on npm.`);
plugins.beautylog.info(`Your version: ${versionArg} | version on npm: ${npmPackage.version}`);
plugins.beautylog.warn(`!!! You should upgrade!!!`);
return true;
}
});
}
}
exports.SmartUpdate = SmartUpdate;
exports.standardHandler = new SmartUpdate();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsaURBQWdEO0FBRWhELHlDQUFxQztBQVVyQztJQUFBO1FBQ0UsWUFBTyxHQUFHLElBQUksT0FBTyxDQUFDLFFBQVEsQ0FBQyxhQUFhLENBQUMsUUFBUSxFQUFFLG9CQUFvQixDQUFDLENBQUE7SUErQzlFLENBQUM7SUE3Q08sS0FBSyxDQUFFLFVBQWtCLEVBQUUsY0FBc0I7O1lBQ3JELElBQUksTUFBTSxHQUFpQixNQUFNLElBQUksQ0FBQyxPQUFPLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFBO1lBQ2pFLElBQUksU0FBUyxHQUFHLElBQUkscUJBQVMsRUFBRSxDQUFBO1lBRS9CLHVCQUF1QjtZQUN2QixJQUFJLE9BQU8sR0FBRztnQkFDWixTQUFTLEVBQUUsU0FBUyxDQUFDLFlBQVk7Z0JBQ2pDLGFBQWEsRUFBRSxPQUFPO2dCQUN0QixnQkFBZ0IsRUFBRSxLQUFLO2FBQ3hCLENBQUE7WUFDRCxFQUFFLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDO2dCQUNYLElBQUksa0JBQWtCLEdBQUcscUJBQVMsQ0FBQyxnQkFBZ0IsQ0FBQyxNQUFNLENBQUMsU0FBUyxDQUFDLENBQUE7Z0JBQ3JFLElBQUksV0FBVyxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUMsd0JBQXdCLENBQUMsRUFBRSxJQUFJLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQTtnQkFDekUsRUFBRSxDQUFDLENBQUMsQ0FBQyxrQkFBa0IsQ0FBQyxXQUFXLENBQUMsU0FBUyxFQUFFLFdBQVcsQ0FBQyxDQUFDLENBQUMsQ0FBQztvQkFDNUQsT0FBTyxDQUFDLFNBQVMsQ0FBQyxHQUFHLENBQUMscUNBQXFDLE9BQU8sQ0FBQyxXQUFXLENBQUMsYUFBYSxDQUFDLEdBQUcsVUFBVSxzQ0FBc0MsRUFBRSxNQUFNLENBQUMsRUFBRSxDQUFDLENBQUE7b0JBQzVKLE1BQU0sQ0FBQTtnQkFDUixDQUFDO1lBQ0gsQ0FBQztZQUNELElBQUksVUFBVSxHQUFHLE1BQU0sSUFBSSxDQUFDLHlCQUF5QixDQUFDLFVBQVUsQ0FBQyxDQUFBO1lBQ2pFLE9BQU8sQ0FBQyxhQUFhLEdBQUcsVUFBVSxDQUFDLE9BQU8sQ0FBQTtZQUMxQyxJQUFJLFdBQVcsR0FBRyxNQUFNLElBQUksQ0FBQyxjQUFjLENBQUMsVUFBVSxFQUFFLGNBQWMsQ0FBQyxDQUFBO1lBQ3ZFLEVBQUUsQ0FBQSxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUM7WUFFakIsQ0FBQztZQUNELElBQUksQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDLFVBQVUsRUFBRSxPQUFPLENBQUMsQ0FBQTtRQUM1QyxDQUFDO0tBQUE7SUFFYSx5QkFBeUIsQ0FBRSxVQUFVOztZQUNqRCxPQUFPLENBQUMsU0FBUyxDQUFDLEdBQUcsQ0FBQyw4Q0FBOEMsT0FBTyxDQUFDLFdBQVcsQ0FBQyxhQUFhLENBQUMsVUFBVSxFQUFFLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQTtZQUMvSCxJQUFJLFdBQVcsR0FBRyxJQUFJLE9BQU8sQ0FBQyxRQUFRLENBQUMsV0FBVyxFQUFFLENBQUE7WUFDcEQsSUFBSSxVQUFVLEdBQUcsQ0FBQyxNQUFNLFdBQVcsQ0FBQyxNQUFNLENBQUMsRUFBRSxJQUFJLEVBQUUsVUFBVSxFQUFFLFVBQVUsRUFBRSxJQUFJLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUE7WUFDdEYsTUFBTSxDQUFDLFVBQVUsQ0FBQTtRQUNuQixDQUFDO0tBQUE7SUFFYSxjQUFjLENBQUUsVUFBdUMsRUFBRSxVQUFrQjs7WUFDdkYsRUFBRSxDQUFDLENBQUMsVUFBVSxDQUFDLE9BQU8sS0FBSyxVQUFVLENBQUMsQ0FBQyxDQUFDO2dCQUN0QyxPQUFPLENBQUMsU0FBUyxDQUFDLEVBQUUsQ0FBQyxzREFBc0QsT0FBTyxDQUFDLFdBQVcsQ0FBQyxhQUFhLENBQUMsVUFBVSxDQUFDLElBQUksRUFBRSxNQUFNLENBQUMsRUFBRSxDQUFDLENBQUE7Z0JBQ3hJLE1BQU0sQ0FBQyxLQUFLLENBQUE7WUFDZCxDQUFDO1lBQUMsSUFBSSxDQUFDLENBQUM7Z0JBQ04sT0FBTyxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsK0JBQStCLFVBQVUsQ0FBQyxJQUFJLG9CQUFvQixDQUFDLENBQUE7Z0JBQzFGLE9BQU8sQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLGlCQUFpQixVQUFVLHNCQUFzQixVQUFVLENBQUMsT0FBTyxFQUFFLENBQUMsQ0FBQTtnQkFDN0YsT0FBTyxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsMkJBQTJCLENBQUMsQ0FBQTtnQkFDbkQsTUFBTSxDQUFDLElBQUksQ0FBQTtZQUNiLENBQUM7UUFDSCxDQUFDO0tBQUE7Q0FDRjtBQWhERCxrQ0FnREM7QUFDVSxRQUFBLGVBQWUsR0FBRyxJQUFJLFdBQVcsRUFBRSxDQUFBIn0=
-7
View File
@@ -1,7 +0,0 @@
import 'typings-global';
import * as beautylog from 'beautylog';
import * as beautycolor from 'beautycolor';
import * as npmextra from 'npmextra';
import * as smartnpm from 'smartnpm';
import * as smarttime from 'smarttime';
export { beautylog, beautycolor, npmextra, smartnpm, smarttime };
-14
View File
@@ -1,14 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("typings-global");
const beautylog = require("beautylog");
exports.beautylog = beautylog;
const beautycolor = require("beautycolor");
exports.beautycolor = beautycolor;
const npmextra = require("npmextra");
exports.npmextra = npmextra;
const smartnpm = require("smartnpm");
exports.smartnpm = smartnpm;
const smarttime = require("smarttime");
exports.smarttime = smarttime;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR1cGRhdGUucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0dXBkYXRlLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSwwQkFBdUI7QUFFdkIsdUNBQXNDO0FBT3BDLDhCQUFTO0FBTlgsMkNBQTBDO0FBT3hDLGtDQUFXO0FBTmIscUNBQW9DO0FBT2xDLDRCQUFRO0FBTlYscUNBQW9DO0FBT2xDLDRCQUFRO0FBTlYsdUNBQXNDO0FBT3BDLDhCQUFTIn0=
-29
View File
@@ -1,29 +0,0 @@
# smartupdate
update your tools in a smart way
## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartupdate)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartupdate)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartupdate)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartupdate/)
## Status for master
[![build status](https://GitLab.com/pushrocks/smartupdate/badges/master/build.svg)](https://GitLab.com/pushrocks/smartupdate/commits/master)
[![coverage report](https://GitLab.com/pushrocks/smartupdate/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartupdate/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smartupdate.svg)](https://www.npmjs.com/package/smartupdate)
[![Dependency Status](https://david-dm.org/pushrocks/smartupdate.svg)](https://david-dm.org/pushrocks/smartupdate)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartupdate/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartupdate/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartupdate/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartupdate)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for best in class instellisense.
For further information read the linked docs at the top of this README.
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2026 Task Venture Capital GmbH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+35 -5
View File
@@ -1,10 +1,40 @@
{ {
"npmci": { "@git.zone/cli": {
"globalNpmTools": [ "projectType": "npm",
"npmts" "module": {
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "smartupdate",
"description": "A library designed to facilitate smarter update notifications and checking for Node.js projects.",
"npmPackagename": "@push.rocks/smartupdate",
"license": "MIT",
"projectDomain": "push.rocks",
"keywords": [
"update notifications",
"version checking",
"npm package updates",
"version comparison",
"CLI tool updates",
"dependency management",
"npm registry",
"typescript utilities",
"software maintenance",
"open-source contribution"
] ]
}, },
"npmts": { "release": {
"coverageTreshold": 50 "registries": [
"https://verdaccio.lossless.digital",
"https://registry.npmjs.org"
],
"accessLevel": "public"
}
},
"@git.zone/tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
},
"@ship.zone/szci": {
"npmGlobalTools": [],
"npmRegistryUrl": "registry.npmjs.org"
} }
} }
+56 -14
View File
@@ -1,23 +1,65 @@
{ {
"name": "smartupdate", "name": "@push.rocks/smartupdate",
"version": "1.0.4", "version": "2.0.8",
"description": "update your tools in a smart way", "private": false,
"main": "dist/index.js", "description": "A library designed to facilitate smarter update notifications and checking for Node.js projects.",
"typings": "dist/index.d.ts", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"test": "(npmts)" "test": "tstest test/ --verbose",
"build": "tsbuild --web",
"buildDocs": "tsdoc"
}, },
"devDependencies": { "devDependencies": {
"tapbundle": "^1.1.1" "@git.zone/tsbuild": "^4.4.0",
"@git.zone/tsrun": "^2.0.3",
"@git.zone/tstest": "^3.6.3",
"@types/lodash.clonedeep": "^4.5.9",
"@types/node": "^25.6.0"
}, },
"dependencies": { "dependencies": {
"beautycolor": "^1.0.10", "@push.rocks/consolecolor": "^2.0.3",
"beautylog": "^6.1.10", "@push.rocks/npmextra": "^5.3.3",
"npmextra": "^2.0.9", "@push.rocks/smartnpm": "^2.0.6",
"smartnpm": "^1.0.4", "@push.rocks/smartopen": "^2.0.0",
"smarttime": "^1.0.6", "@push.rocks/smartversion": "^3.1.0"
"typings-global": "^1.0.20" },
} "files": [
"ts/**/*",
"ts_web/**/*",
"dist/**/*",
"dist_*/**/*",
"dist_ts/**/*",
"dist_ts_web/**/*",
"assets/**/*",
"cli.js",
".smartconfig.json",
"license",
"npmextra.json",
"readme.md"
],
"browserslist": [
"last 1 chrome versions"
],
"keywords": [
"update notifications",
"version checking",
"npm package updates",
"version comparison",
"CLI tool updates",
"dependency management",
"npm registry",
"typescript utilities",
"software maintenance",
"open-source contribution"
],
"homepage": "https://code.foss.global/push.rocks/smartupdate",
"repository": {
"type": "git",
"url": "https://code.foss.global/push.rocks/smartupdate.git"
},
"packageManager": "pnpm@10.28.2"
} }
+8033
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
+91 -21
View File
@@ -1,29 +1,99 @@
# smartupdate # @push.rocks/smartupdate
update your tools in a smart way update your tools in a smart way
## Availabililty ## Install
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartupdate) To get started with `@push.rocks/smartupdate`, you need to install it via npm. Run the following command in your terminal:
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartupdate)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartupdate)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartupdate/)
## Status for master ```bash
[![build status](https://GitLab.com/pushrocks/smartupdate/badges/master/build.svg)](https://GitLab.com/pushrocks/smartupdate/commits/master) npm install @push.rocks/smartupdate --save
[![coverage report](https://GitLab.com/pushrocks/smartupdate/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartupdate/commits/master) ```
[![npm downloads per month](https://img.shields.io/npm/dm/smartupdate.svg)](https://www.npmjs.com/package/smartupdate)
[![Dependency Status](https://david-dm.org/pushrocks/smartupdate.svg)](https://david-dm.org/pushrocks/smartupdate) This will add `@push.rocks/smartupdate` as a dependency to your project and download it to your `node_modules` folder.
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartupdate/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartupdate/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartupdate/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartupdate)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage ## Usage
Use TypeScript for best in class instellisense.
For further information read the linked docs at the top of this README. The `@push.rocks/smartupdate` module offers a smart way to notify users of your CLI tools or libraries about new versions available on npm. Let's take a closer look at how you can utilize it in your project using TypeScript.
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh) ### Importing and Instantiating `SmartUpdate`
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks) First, you need to import the `SmartUpdate` class from the `@push.rocks/smartupdate` package and create an instance of it. You can optionally pass settings to the constructor to customize its behavior:
```typescript
import { SmartUpdate } from '@push.rocks/smartupdate';
const smartUpdate = new SmartUpdate();
```
### Checking for Updates
To check for an update for a specific npm package, you can use the `check` method. This method requires the npm package name, the current local version of the package you are checking against, and optionally, a URL to the changelog. If a newer version is found, it will log a message to the console and, if a changelog URL is provided and not running in a CI environment, attempt to open the changelog in the default web browser.
Heres an example:
```typescript
// Async function to demonstrate usage
async function checkForUpdates() {
const npmPackageName = 'some-npm-package';
const currentVersion = '1.0.0';
const changelogUrl = 'https://example.com/changelog';
// Check for an update for 'some-npm-package'
const hasNewerVersion = await smartUpdate.check(npmPackageName, currentVersion, changelogUrl);
if (hasNewerVersion) {
console.log('A newer version is available. Please consider updating.');
} else {
console.log('You are using the latest version.');
}
}
// Execute the function
checkForUpdates().catch(console.error);
```
### Checking for CLI Updates
For CLI applications, `@push.rocks/smartupdate` offers a more tailored method called `checkForCli`. This method works similarly to `check` but is optimized for CLI tools, taking into account factors like avoiding frequent checks (e.g., not more than once per hour).
Example usage:
```typescript
// Async function to demonstrate CLI update checks
async function checkCliUpdates() {
const cliPackageName = 'your-cli-tool';
const currentCliVersion = '0.1.0';
const changelogUrl = 'https://example.com/cli-changelog';
const needsUpdate = await smartUpdate.checkForCli(cliPackageName, currentCliVersion, changelogUrl);
if (needsUpdate) {
console.log(`A newer version of ${cliPackageName} is available. Visit ${changelogUrl} for more information.`);
} else {
console.log(`You are using the latest version of ${cliPackageName}.`);
}
}
// Run the CLI update check
checkCliUpdates().catch(console.error);
```
By integrating `@push.rocks/smartupdate` into your project, you ensure users are always informed about the latest updates, encouraging them to keep their installations current and benefiting from new features, performance improvements, and bug fixes.
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
+22
View File
@@ -0,0 +1,22 @@
# smartupdate improvement plan
Status: implemented.
## Goal
Make update checks predictable, cache-safe, and testable without changing the core public API shape.
## Implementation
- Fix CLI cache behavior so cached update information still reports an available update and time-based cache entries expire.
- Cache both `update-available` and `up-to-date` results so normal repeated CLI runs do not keep hitting the registry.
- Store cache context with each entry and only reuse cache entries for the same package, current version, and registry.
- Preserve more useful error types for invalid package names, invalid versions, package lookup failures, and registry failures.
- Await and catch changelog opening so browser failures do not become unhandled promise rejections.
- Replace live npm tests with deterministic registry stubs and ephemeral cache storage.
- Remove unused dependency surface.
## Verification
- Run `pnpm test`.
- Run `pnpm run build`.
+214
View File
@@ -0,0 +1,214 @@
import { expect, tap } from '@git.zone/tstest/tapbundle';
import type * as smartnpm from '@push.rocks/smartnpm';
import * as smartupdate from '../ts/index.js';
const createMockedSmartUpdate = (versionsArg: Record<string, string>) => {
const checkedPackages: string[] = [];
const testSmartUpdate = new smartupdate.SmartUpdate({
logLevel: 'SILENT',
noColor: true,
cacheDuration: { minutes: 30 },
cacheStore: { storeType: 'ephemeral' },
});
testSmartUpdate.npmRegistry.getPackageInfo = async (packageNameArg: string) => {
checkedPackages.push(packageNameArg);
const version = versionsArg[packageNameArg];
if (!version) {
throw new Error(`Package not found: ${packageNameArg}`);
}
return {
name: packageNameArg,
version,
} as unknown as smartnpm.NpmPackage;
};
return { testSmartUpdate, checkedPackages };
};
tap.test('backward compatibility: should create an instance of SmartUpdate', async () => {
const { testSmartUpdate } = createMockedSmartUpdate({ lodash: '4.17.21' });
expect(testSmartUpdate).toBeInstanceOf(smartupdate.SmartUpdate);
});
tap.test('backward compatibility: should check for a npm module using old API', async () => {
const { testSmartUpdate } = createMockedSmartUpdate({ lodash: '4.17.21' });
const result = await testSmartUpdate.check('lodash', '1.0.5');
expect(result).toBeTrue();
});
tap.test('modern API: checkForUpdate should return rich result object', async () => {
const { testSmartUpdate } = createMockedSmartUpdate({ lodash: '4.17.21' });
const result = await testSmartUpdate.checkForUpdate({
packageName: 'lodash',
currentVersion: '1.0.0',
cacheStrategy: 'never',
});
expect(result).toBeTypeOf('object');
expect(result.status).toEqual('update-available');
expect(result.packageName).toEqual('lodash');
expect(result.currentVersion).toEqual('1.0.0');
expect(result.latestVersion).toEqual('4.17.21');
expect(result.checkTime).toBeInstanceOf(Date);
expect(result.cacheHit).toBeFalse();
});
tap.test('modern API: checkForUpdate with up-to-date version', async () => {
const { testSmartUpdate } = createMockedSmartUpdate({ '@push.rocks/smartversion': '3.1.0' });
const result = await testSmartUpdate.checkForUpdate({
packageName: '@push.rocks/smartversion',
currentVersion: '999.999.999',
cacheStrategy: 'never',
});
expect(result.status).toEqual('up-to-date');
expect(result.latestVersion).toEqual('3.1.0');
});
tap.test('modern API: getLatestVersion utility method', async () => {
const { testSmartUpdate } = createMockedSmartUpdate({ lodash: '4.17.21' });
const latestVersion = await testSmartUpdate.getLatestVersion('lodash');
expect(latestVersion).toEqual('4.17.21');
});
tap.test('modern API: error handling for non-existent package', async () => {
const { testSmartUpdate } = createMockedSmartUpdate({});
const result = await testSmartUpdate.checkForUpdate({
packageName: 'this-package-definitely-does-not-exist-12345',
currentVersion: '1.0.0',
cacheStrategy: 'never',
});
expect(result.status).toEqual('error');
expect(result.error).toBeInstanceOf(smartupdate.PackageNotFoundError);
});
tap.test('modern API: invalid versions are reported before registry access', async () => {
const { testSmartUpdate, checkedPackages } = createMockedSmartUpdate({ lodash: '4.17.21' });
const result = await testSmartUpdate.checkForUpdate({
packageName: 'lodash',
currentVersion: 'not-a-version',
cacheStrategy: 'never',
});
expect(result.status).toEqual('error');
expect(result.error).toBeInstanceOf(smartupdate.InvalidVersionError);
expect(checkedPackages).toHaveLength(0);
});
tap.test('modern API: invalid package names are reported before registry access', async () => {
const { testSmartUpdate, checkedPackages } = createMockedSmartUpdate({ lodash: '4.17.21' });
const result = await testSmartUpdate.checkForUpdate({
packageName: 'invalid package name',
currentVersion: '1.0.0',
cacheStrategy: 'never',
});
expect(result.status).toEqual('error');
expect(result.error).toBeInstanceOf(smartupdate.InvalidPackageNameError);
expect(checkedPackages).toHaveLength(0);
});
tap.test('modern API: caches update-available results for time-based checks', async () => {
const { testSmartUpdate, checkedPackages } = createMockedSmartUpdate({ express: '5.0.0' });
const result1 = await testSmartUpdate.checkForUpdate({
packageName: 'express',
currentVersion: '1.0.0',
cacheStrategy: 'time-based',
});
const result2 = await testSmartUpdate.checkForUpdate({
packageName: 'express',
currentVersion: '1.0.0',
cacheStrategy: 'time-based',
});
expect(result1.status).toEqual('update-available');
expect(result2.status).toEqual('check-skipped');
expect(result2.cacheHit).toBeTrue();
expect(result2.latestVersion).toEqual('5.0.0');
expect(checkedPackages).toHaveLength(1);
});
tap.test('modern API: caches up-to-date results for time-based checks', async () => {
const { testSmartUpdate, checkedPackages } = createMockedSmartUpdate({ express: '5.0.0' });
const result1 = await testSmartUpdate.checkForUpdate({
packageName: 'express',
currentVersion: '5.0.0',
cacheStrategy: 'time-based',
});
const result2 = await testSmartUpdate.checkForUpdate({
packageName: 'express',
currentVersion: '5.0.0',
cacheStrategy: 'time-based',
});
expect(result1.status).toEqual('up-to-date');
expect(result2.status).toEqual('check-skipped');
expect(result2.cacheHit).toBeTrue();
expect(result2.latestVersion).toEqual('5.0.0');
expect(checkedPackages).toHaveLength(1);
});
tap.test('modern API: cache entries are scoped to the checked current version', async () => {
const { testSmartUpdate, checkedPackages } = createMockedSmartUpdate({ express: '5.0.0' });
const result1 = await testSmartUpdate.checkForUpdate({
packageName: 'express',
currentVersion: '1.0.0',
cacheStrategy: 'time-based',
});
const result2 = await testSmartUpdate.checkForUpdate({
packageName: 'express',
currentVersion: '5.0.0',
cacheStrategy: 'time-based',
});
expect(result1.status).toEqual('update-available');
expect(result2.status).toEqual('up-to-date');
expect(result2.cacheHit).toBeFalse();
expect(checkedPackages).toHaveLength(2);
});
tap.test('modern API: checkForCli returns true for cached known updates', async () => {
const { testSmartUpdate, checkedPackages } = createMockedSmartUpdate({ 'my-cli': '2.0.0' });
const result1 = await testSmartUpdate.checkForCli('my-cli', '1.0.0');
const result2 = await testSmartUpdate.checkForCli('my-cli', '1.0.0');
expect(result1).toBeTrue();
expect(result2).toBeTrue();
expect(checkedPackages).toHaveLength(1);
});
tap.test('cache manager: clears package-specific and complete cache data', async () => {
const cacheManager = new smartupdate.UpdateCacheManager({
durationMs: 60_000,
storeType: 'ephemeral',
});
await cacheManager.setCached('one', cacheManager.createCacheStatus('1.0.0'));
await cacheManager.setCached('two', cacheManager.createCacheStatus('2.0.0'));
await cacheManager.clearCache('one');
expect(await cacheManager.getCached('one')).toBeNull();
expect(await cacheManager.getCached('two')).toBeTypeOf('object');
await cacheManager.clearCache();
expect(await cacheManager.getCached('two')).toBeNull();
});
tap.test('modern API: exports all runtime classes and constants', async () => {
expect(smartupdate.SmartUpdate).toBeTypeOf('function');
expect(smartupdate.UpdateCacheManager).toBeTypeOf('function');
expect(smartupdate.UpdateNotifier).toBeTypeOf('function');
expect(smartupdate.RegistryUnavailableError).toBeTypeOf('function');
expect(smartupdate.PackageNotFoundError).toBeTypeOf('function');
expect(smartupdate.InvalidVersionError).toBeTypeOf('function');
expect(smartupdate.InvalidPackageNameError).toBeTypeOf('function');
expect(smartupdate.LOG_LEVELS).toBeTypeOf('object');
});
export default tap.start();
-8
View File
@@ -1,8 +0,0 @@
import { expect, tap } from 'tapbundle'
import * as smartupdate from '../ts/index'
tap.test('should check for a npm module', async () => {
await smartupdate.standardHandler.check('npmts', '8.0.5')
})
tap.start()
+8
View File
@@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @push.rocks/commitinfo
*/
export const commitinfo = {
name: '@push.rocks/smartupdate',
version: '2.0.8',
description: 'A library designed to facilitate smarter update notifications and checking for Node.js projects.'
}
+28 -58
View File
@@ -1,62 +1,32 @@
import * as plugins from './smartupdate.plugins' // Main class
export { SmartUpdate } from './smartupdate.classes.smartupdate.js';
import { TimeStamp } from 'smarttime' // Supporting classes (for advanced use cases)
export { UpdateCacheManager } from './smartupdate.classes.cachemanager.js';
export { UpdateNotifier } from './smartupdate.classes.notifier.js';
interface ICacheStatus { // Interfaces and types
lastCheck: number export type {
latestVersion: string ISmartUpdateOptions,
performedUpgrade: boolean IUpdateCheckOptions,
} IUpdateCheckResult,
ICacheStatus,
ICacheOptions,
INotificationOptions,
TCacheStrategy,
TCacheStoreType,
TCachedUpdateStatus,
} from './smartupdate.interfaces.js';
import { KeyValueStore } from 'npmextra' // Error classes
export {
SmartUpdateError,
RegistryUnavailableError,
PackageNotFoundError,
InvalidVersionError,
InvalidPackageNameError,
} from './smartupdate.errors.js';
export class SmartUpdate { // Constants (for reference)
kvStore = new plugins.npmextra.KeyValueStore('custom', 'global:smartupdate') export type { TLogLevel } from './smartupdate.constants.js';
export { LOG_LEVELS, DEFAULT_MESSAGE_COLOR } from './smartupdate.constants.js';
async check (npmnameArg: string, compareVersion: string) {
let result: ICacheStatus = await this.kvStore.readKey(npmnameArg)
let timeStamp = new TimeStamp()
// the newData to write
let newData = {
lastCheck: timeStamp.milliSeconds,
latestVersion: 'x.x.x',
performedUpgrade: false
}
if (result) {
let lastCheckTimeStamp = TimeStamp.fromMilliSeconds(result.lastCheck)
let compareTime = plugins.smarttime.getMilliSecondsFromUnits({ days: 1 })
if (!lastCheckTimeStamp.isOlderThan(timeStamp, compareTime)) {
plugins.beautylog.log(`smartupdate: next check tomorrow: ${plugins.beautycolor.coloredString(`${npmnameArg} has already been checked for today.`, 'pink')}`)
return
}
}
let npmPackage = await this.getNpmPackageFromRegistry(npmnameArg)
newData.latestVersion = npmPackage.version
let upgradeBool = await this.checkIfUpgrade(npmPackage, compareVersion)
if(upgradeBool) {
}
this.kvStore.writeKey(npmnameArg, newData)
}
private async getNpmPackageFromRegistry (npmnameArg) {
plugins.beautylog.log(`smartupdate: checking for newer version of ${plugins.beautycolor.coloredString(npmnameArg, 'pink')}...`)
let npmRegistry = new plugins.smartnpm.NpmRegistry()
let npmPackage = (await npmRegistry.search({ name: npmnameArg, boostExact: true }))[0]
return npmPackage
}
private async checkIfUpgrade (npmPackage: plugins.smartnpm.NpmPackage, versionArg: string) {
if (npmPackage.version === versionArg) {
plugins.beautylog.ok(`smartupdate: You are running the latest version of ${plugins.beautycolor.coloredString(npmPackage.name, 'pink')}`)
return false
} else {
plugins.beautylog.warn(`There is a newer version of ${npmPackage.name} available on npm.`)
plugins.beautylog.info(`Your version: ${versionArg} | version on npm: ${npmPackage.version}`)
plugins.beautylog.warn(`!!! You should upgrade!!!`)
return true
}
}
}
export let standardHandler = new SmartUpdate()
+151
View File
@@ -0,0 +1,151 @@
import * as plugins from './smartupdate.plugins.js';
import type { ICacheStatus, ICacheOptions, TCacheStrategy, TCachedUpdateStatus } from './smartupdate.interfaces.js';
type TCacheStoreData = Record<string, ICacheStatus>;
/**
* Manages caching of update check results
*/
export class UpdateCacheManager {
public readonly kvStore: plugins.npmextra.KeyValueStore<TCacheStoreData>;
private cacheDurationMs: number;
constructor(options: ICacheOptions) {
this.cacheDurationMs = options.durationMs;
this.kvStore = new plugins.npmextra.KeyValueStore<TCacheStoreData>({
typeArg: options.storeType || 'userHomeDir',
identityArg: options.storeIdentifier || 'global_smartupdate',
customPath: options.customPath,
});
}
/**
* Get the cache duration in milliseconds
*/
public getCacheDuration(): number {
return this.cacheDurationMs;
}
/**
* Get cached status for a package
*/
public async getCached(packageName: string): Promise<ICacheStatus | null> {
return (await this.kvStore.readKey(packageName)) || null;
}
/**
* Set cache status for a package
*/
public async setCached(packageName: string, status: ICacheStatus): Promise<void> {
await this.kvStore.writeKey(packageName, status);
}
/**
* Clear cache for a specific package or all packages
*/
public async clearCache(packageName?: string): Promise<void> {
if (packageName) {
const cacheData = await this.kvStore.readAll();
delete cacheData[packageName];
await this.kvStore.wipe();
await this.kvStore.writeAll(cacheData);
} else {
await this.kvStore.wipe();
}
}
/**
* Check if we should check the registry or use cache
* @returns Object with shouldCheck flag and optional nextCheckTime
*/
public async shouldCheckRegistry(
packageName: string,
strategy: TCacheStrategy = 'time-based',
cacheContext: {
currentVersion?: string;
registryUrl?: string;
} = {}
): Promise<{
shouldCheck: boolean;
cacheStatus?: ICacheStatus;
nextCheckTime?: Date;
minutesUntilNextCheck?: number;
}> {
// Never use cache
if (strategy === 'never') {
return { shouldCheck: true };
}
// Get cached data
const cacheStatus = await this.getCached(packageName);
// No cache exists
if (!cacheStatus || !this.cacheMatchesContext(cacheStatus, cacheContext)) {
return { shouldCheck: true };
}
// Always use cache if available
if (strategy === 'always') {
return { shouldCheck: false, cacheStatus };
}
// Time-based strategy: check if cache is still valid
const now = Date.now();
const lastCheckTime = cacheStatus.lastCheck;
const timeSinceLastCheck = now - lastCheckTime;
// Cache is still valid
if (timeSinceLastCheck < this.cacheDurationMs) {
const nextCheckTime = new Date(lastCheckTime + this.cacheDurationMs);
const minutesUntilNextCheck = (this.cacheDurationMs - timeSinceLastCheck) / 60000;
return {
shouldCheck: false,
cacheStatus,
nextCheckTime,
minutesUntilNextCheck,
};
}
// Cache is expired
return { shouldCheck: true, cacheStatus };
}
/**
* Create a new cache status object
*/
public createCacheStatus(
latestVersion: string,
performedUpgrade: boolean = false,
metadata: {
currentVersion?: string;
registryUrl?: string;
status?: TCachedUpdateStatus;
} = {}
): ICacheStatus {
return {
lastCheck: Date.now(),
latestVersion,
currentVersion: metadata.currentVersion,
registryUrl: metadata.registryUrl,
status: metadata.status,
performedUpgrade,
};
}
private cacheMatchesContext(
cacheStatus: ICacheStatus,
cacheContext: {
currentVersion?: string;
registryUrl?: string;
}
): boolean {
if (cacheContext.currentVersion && cacheStatus.currentVersion !== cacheContext.currentVersion) {
return false;
}
if (cacheContext.registryUrl && cacheStatus.registryUrl !== cacheContext.registryUrl) {
return false;
}
return true;
}
}
+172
View File
@@ -0,0 +1,172 @@
import * as plugins from './smartupdate.plugins.js';
import {
LOG_LEVELS,
type TLogLevel,
DEFAULT_MESSAGE_COLOR,
MESSAGE_PREFIXES,
} from './smartupdate.constants.js';
import type { INotificationOptions, IUpdateCheckResult } from './smartupdate.interfaces.js';
/**
* Handles all user-facing notifications and console output
*/
export class UpdateNotifier {
private logLevel: TLogLevel;
private useColors: boolean;
private customLogger?: (level: TLogLevel, message: string) => void;
constructor(options: INotificationOptions) {
this.logLevel = options.logLevel;
this.useColors = options.useColors && !process.env.NO_COLOR;
this.customLogger = options.customLogger;
}
/**
* Check if a message at the given level should be logged
*/
private shouldLog(level: TLogLevel): boolean {
return LOG_LEVELS[level] <= LOG_LEVELS[this.logLevel];
}
/**
* Colorize a string if colors are enabled
*/
private colorize(
text: string,
color: plugins.consolecolor.TColorName = DEFAULT_MESSAGE_COLOR
): string {
if (!this.useColors) {
return text;
}
return plugins.consolecolor.coloredString(text, color);
}
/**
* Log a message at the specified level
*/
private log(level: TLogLevel, message: string): void {
if (!this.shouldLog(level)) {
return;
}
if (this.customLogger) {
this.customLogger(level, message);
} else {
console.log(message);
}
}
/**
* Log a debug message
*/
public debug(message: string): void {
this.log('DEBUG', `${MESSAGE_PREFIXES.INFO} ${message}`);
}
/**
* Log an info message
*/
public info(message: string): void {
this.log('INFO', `${MESSAGE_PREFIXES.SMARTUPDATE} ${message}`);
}
/**
* Log a warning message
*/
public warn(message: string): void {
this.log('WARN', `${MESSAGE_PREFIXES.WARN} ${message}`);
}
/**
* Log an error message
*/
public error(message: string): void {
this.log('ERROR', `${MESSAGE_PREFIXES.ERROR} ${message}`);
}
/**
* Notify about checking for updates
*/
public notifyCheckingForUpdate(packageName: string): void {
this.info(
`checking for newer version of ${this.colorize(packageName)}...`
);
}
/**
* Notify that the package is up to date
*/
public notifyUpToDate(packageName: string): void {
this.info(
`You are running the latest version of ${this.colorize(packageName)}`
);
}
/**
* Notify that an update is available
*/
public notifyUpdateAvailable(packageName: string, currentVersion: string, latestVersion: string): void {
this.warn(`There is a newer version of ${packageName} available on npm.`);
this.warn(`Your version: ${currentVersion} | version on npm: ${latestVersion}`);
}
/**
* Notify that a check was skipped due to rate limiting
*/
public notifyCheckSkipped(packageName: string, nextCheckMinutes: number): void {
const minutes = Math.floor(nextCheckMinutes) + 1;
this.info(
`Already checked recently. Next check available in ${minutes} minute${minutes !== 1 ? 's' : ''}: ` +
this.colorize(packageName)
);
}
/**
* Notify that the changelog is being opened
*/
public notifyOpeningChangelog(): void {
this.info('Opening changelog in browser...');
}
/**
* Notify about a registry error
*/
public notifyRegistryError(): void {
this.warn('Failed to retrieve package information.');
this.info('Is the registry down?');
}
/**
* Notify with a complete update check result
*/
public notifyUpdateCheckResult(result: IUpdateCheckResult): void {
switch (result.status) {
case 'up-to-date':
this.notifyUpToDate(result.packageName);
break;
case 'update-available':
if (result.latestVersion) {
this.notifyUpdateAvailable(
result.packageName,
result.currentVersion,
result.latestVersion
);
}
break;
case 'check-skipped':
if (result.nextCheckTime && result.reason) {
const minutesUntilNext = (result.nextCheckTime.getTime() - result.checkTime.getTime()) / 60000;
this.notifyCheckSkipped(result.packageName, minutesUntilNext);
}
break;
case 'error':
if (result.error) {
this.error(result.error.message);
}
break;
}
}
}
+351
View File
@@ -0,0 +1,351 @@
import * as plugins from './smartupdate.plugins.js';
import { UpdateCacheManager } from './smartupdate.classes.cachemanager.js';
import { UpdateNotifier } from './smartupdate.classes.notifier.js';
import { DEFAULT_CACHE_DURATION_HOURS, MILLISECONDS_PER_MINUTE, MINUTES_PER_HOUR } from './smartupdate.constants.js';
import type {
ICacheStatus,
ISmartUpdateOptions,
IUpdateCheckOptions,
IUpdateCheckResult,
TCachedUpdateStatus,
} from './smartupdate.interfaces.js';
import {
SmartUpdateError,
RegistryUnavailableError,
PackageNotFoundError,
InvalidPackageNameError,
InvalidVersionError,
} from './smartupdate.errors.js';
/**
* SmartUpdate - Elegant update checking for Node.js packages
*
* @example
* ```typescript
* const smartUpdate = new SmartUpdate();
* const result = await smartUpdate.checkForUpdate({
* packageName: 'lodash',
* currentVersion: '1.0.0',
* changelogUrl: 'https://example.com/changelog'
* });
*
* if (result.status === 'update-available') {
* console.log(`Update available: ${result.latestVersion}`);
* }
* ```
*/
export class SmartUpdate {
public readonly npmRegistry: plugins.smartnpm.NpmRegistry;
private cacheManager: UpdateCacheManager;
private notifier: UpdateNotifier;
private options: ISmartUpdateOptions;
/**
* @deprecated Use the options parameter instead of kvStore property
*/
public kvStore: plugins.npmextra.KeyValueStore<Record<string, ICacheStatus>>;
constructor(options: ISmartUpdateOptions = {}) {
this.options = options;
// Initialize npm registry
this.npmRegistry = new plugins.smartnpm.NpmRegistry(options.npmRegistryOptions || {});
// Calculate cache duration in milliseconds
const cacheDuration = options.cacheDuration || { hours: DEFAULT_CACHE_DURATION_HOURS };
const cacheDurationMs =
(cacheDuration.hours || 0) * MINUTES_PER_HOUR * MILLISECONDS_PER_MINUTE +
(cacheDuration.minutes || 0) * MILLISECONDS_PER_MINUTE +
(cacheDuration.seconds || 0) * 1000;
// Initialize cache manager
this.cacheManager = new UpdateCacheManager({
durationMs: cacheDurationMs || DEFAULT_CACHE_DURATION_HOURS * MINUTES_PER_HOUR * MILLISECONDS_PER_MINUTE,
storeIdentifier: options.cacheStore?.storeIdentifier,
storeType: options.cacheStore?.storeType,
customPath: options.cacheStore?.customPath,
});
// Initialize notifier
this.notifier = new UpdateNotifier({
logLevel: options.logLevel || 'INFO',
useColors: !options.noColor,
customLogger: options.customLogger,
});
// Backward compatibility: expose kvStore
this.kvStore = this.cacheManager.kvStore;
}
/**
* Check for updates with caching (primarily for CLI use)
*
* @deprecated Use checkForUpdate with cacheStrategy: 'time-based' instead
* @param packageName - The npm package name to check
* @param currentVersion - The current version to compare against
* @param changelogUrl - Optional URL to open if update is available
* @returns Promise resolving to true if update available, false otherwise
*
* @example
* ```typescript
* const hasUpdate = await smartUpdate.checkForCli('my-cli', '1.0.0', 'https://changelog.url');
* ```
*/
public async checkForCli(
packageName: string,
currentVersion: string,
changelogUrl?: string
): Promise<boolean> {
const result = await this.checkForUpdate({
packageName,
currentVersion,
changelogUrl,
cacheStrategy: 'time-based',
});
return (
result.status === 'update-available' ||
(result.status === 'check-skipped' &&
!!result.latestVersion &&
this.safeIsUpdateAvailable(result.latestVersion, currentVersion))
);
}
/**
* Check for updates (modern API)
*
* @param options - Update check options
* @returns Promise resolving to detailed update check result
*
* @example
* ```typescript
* const result = await smartUpdate.checkForUpdate({
* packageName: 'lodash',
* currentVersion: '1.0.0',
* changelogUrl: 'https://changelog.url',
* openChangelog: true,
* cacheStrategy: 'time-based'
* });
*
* console.log(result.status); // 'up-to-date' | 'update-available' | 'check-skipped' | 'error'
* ```
*/
public async checkForUpdate(options: IUpdateCheckOptions): Promise<IUpdateCheckResult> {
const {
packageName,
currentVersion,
changelogUrl,
openChangelog = true,
cacheStrategy = 'time-based',
} = options;
const checkTime = new Date();
try {
this.validatePackageName(packageName);
const versionLocal = this.createSmartVersion(currentVersion);
const registryUrl = this.getRegistryUrl();
// Check if we should use cache or check registry
const cacheCheck = await this.cacheManager.shouldCheckRegistry(packageName, cacheStrategy, {
currentVersion,
registryUrl,
});
// If we should skip the check due to cache
if (!cacheCheck.shouldCheck) {
const skippedResult: IUpdateCheckResult = {
status: 'check-skipped',
packageName,
currentVersion,
latestVersion: cacheCheck.cacheStatus?.latestVersion,
checkTime,
cacheHit: true,
nextCheckTime: cacheCheck.nextCheckTime,
reason:
cacheStrategy === 'always'
? 'Cached result reused'
: 'Rate limited - checked recently',
};
this.notifier.notifyUpdateCheckResult(skippedResult);
return skippedResult;
}
// Fetch package info from registry
const npmPackage = await this.getNpmPackageFromRegistry(packageName);
// Compare versions
const versionNpm = this.createSmartVersion(npmPackage.version);
const status: TCachedUpdateStatus = versionNpm.greaterThan(versionLocal)
? 'update-available'
: 'up-to-date';
const result: IUpdateCheckResult = {
status,
packageName: npmPackage.name,
currentVersion,
latestVersion: npmPackage.version,
checkTime,
cacheHit: false,
};
// Notify user
this.notifier.notifyUpdateCheckResult(result);
// If update is available, handle changelog
if (result.status === 'update-available' && changelogUrl && openChangelog && !process.env.CI) {
this.notifier.notifyOpeningChangelog();
await plugins.smartopen.openUrl(changelogUrl).catch((error) => {
this.notifier.warn(
`Could not open changelog: ${error instanceof Error ? error.message : String(error)}`
);
});
}
// Cache both positive and negative checks to avoid repeated registry hits.
const cacheStatus = this.cacheManager.createCacheStatus(npmPackage.version, false, {
currentVersion,
registryUrl,
status,
});
await this.cacheManager.setCached(packageName, cacheStatus);
return result;
} catch (error) {
if (error instanceof RegistryUnavailableError) {
this.notifier.notifyRegistryError();
} else {
this.notifier.error(error instanceof Error ? error.message : String(error));
}
return {
status: 'error',
packageName,
currentVersion,
checkTime,
cacheHit: false,
error: error instanceof Error ? error : new Error(String(error)),
};
}
}
/**
* Simple check for updates without caching
*
* @deprecated Use checkForUpdate with cacheStrategy: 'never' instead
* @param packageName - The npm package name to check
* @param currentVersion - The current version to compare against
* @param changelogUrl - Optional URL to open if update is available
* @returns Promise resolving to true if update available, false otherwise
*
* @example
* ```typescript
* const hasUpdate = await smartUpdate.check('lodash', '1.0.0');
* ```
*/
public async check(
packageName: string,
currentVersion: string,
changelogUrl?: string
): Promise<boolean> {
const result = await this.checkForUpdate({
packageName,
currentVersion,
changelogUrl,
cacheStrategy: 'never',
});
return result.status === 'update-available';
}
/**
* Get the latest version of a package
*
* @param packageName - The npm package name
* @returns Promise resolving to the latest version string
*
* @example
* ```typescript
* const latestVersion = await smartUpdate.getLatestVersion('lodash');
* console.log(latestVersion); // e.g., "4.17.21"
* ```
*/
public async getLatestVersion(packageName: string): Promise<string> {
this.validatePackageName(packageName);
const npmPackage = await this.getNpmPackageFromRegistry(packageName);
return npmPackage.version;
}
/**
* Clear the cache for a specific package
*
* @param packageName - The package name to clear cache for
*
* @example
* ```typescript
* await smartUpdate.clearCache('lodash');
* ```
*/
public async clearCache(packageName: string): Promise<void> {
await this.cacheManager.clearCache(packageName);
}
/**
* Fetch package information from the npm registry
* @private
*/
private async getNpmPackageFromRegistry(packageName: string): Promise<plugins.smartnpm.NpmPackage> {
this.notifier.notifyCheckingForUpdate(packageName);
try {
const npmPackage = await this.npmRegistry.getPackageInfo(packageName);
if (!npmPackage?.version) {
throw new PackageNotFoundError(packageName);
}
return npmPackage;
} catch (error) {
if (error instanceof SmartUpdateError) {
throw error;
}
const message = error instanceof Error ? error.message : String(error);
const lowerMessage = message.toLowerCase();
if (lowerMessage.includes('not found') || lowerMessage.includes('404')) {
throw new PackageNotFoundError(packageName);
}
throw new RegistryUnavailableError(message);
}
}
private validatePackageName(packageName: string): void {
if (!packageName || packageName.trim() !== packageName || /\s/.test(packageName)) {
throw new InvalidPackageNameError(packageName);
}
}
private createSmartVersion(version: string): plugins.smartversion.SmartVersion {
try {
return new plugins.smartversion.SmartVersion(version);
} catch (error) {
throw new InvalidVersionError(version, error instanceof Error ? error.message : String(error));
}
}
private isUpdateAvailable(latestVersion: string, currentVersion: string): boolean {
const versionNpm = this.createSmartVersion(latestVersion);
const versionLocal = this.createSmartVersion(currentVersion);
return versionNpm.greaterThan(versionLocal);
}
private safeIsUpdateAvailable(latestVersion: string, currentVersion: string): boolean {
try {
return this.isUpdateAvailable(latestVersion, currentVersion);
} catch {
return false;
}
}
private getRegistryUrl(): string {
return this.npmRegistry.options.npmRegistryUrl || 'https://registry.npmjs.org';
}
}
+30
View File
@@ -0,0 +1,30 @@
/**
* Constants used throughout the smartupdate library
*/
// Time constants
export const MILLISECONDS_PER_MINUTE = 60_000;
export const MINUTES_PER_HOUR = 60;
export const DEFAULT_CACHE_DURATION_HOURS = 1;
// Console output constants
export const DEFAULT_MESSAGE_COLOR = 'pink';
// Log level constants
export const LOG_LEVELS = {
SILENT: 0,
ERROR: 1,
WARN: 2,
INFO: 3,
DEBUG: 4,
} as const;
export type TLogLevel = keyof typeof LOG_LEVELS;
// Message prefixes
export const MESSAGE_PREFIXES = {
ERROR: 'error:',
WARN: 'warn:',
INFO: 'info:',
SMARTUPDATE: 'smartupdate:',
} as const;
+65
View File
@@ -0,0 +1,65 @@
/**
* Base error class for smartupdate errors
*/
export class SmartUpdateError extends Error {
constructor(message: string) {
super(message);
this.name = 'SmartUpdateError';
// Maintains proper stack trace for where our error was thrown (only available on V8)
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
}
}
/**
* Error thrown when the npm registry is unavailable
*/
export class RegistryUnavailableError extends SmartUpdateError {
constructor(message: string = 'Failed to retrieve package information from npm registry') {
super(message);
this.name = 'RegistryUnavailableError';
}
}
/**
* Error thrown when a package is not found in the registry
*/
export class PackageNotFoundError extends SmartUpdateError {
public readonly packageName: string;
constructor(packageName: string) {
super(`Package '${packageName}' not found in npm registry`);
this.name = 'PackageNotFoundError';
this.packageName = packageName;
}
}
/**
* Error thrown when a version string is invalid
*/
export class InvalidVersionError extends SmartUpdateError {
public readonly version: string;
constructor(version: string, reason?: string) {
const message = reason
? `Invalid version string '${version}': ${reason}`
: `Invalid version string '${version}'`;
super(message);
this.name = 'InvalidVersionError';
this.version = version;
}
}
/**
* Error thrown when package name validation fails
*/
export class InvalidPackageNameError extends SmartUpdateError {
public readonly packageName: string;
constructor(packageName: string) {
super(`Invalid package name '${packageName}'. Package names must follow npm naming conventions.`);
this.name = 'InvalidPackageNameError';
this.packageName = packageName;
}
}
+198
View File
@@ -0,0 +1,198 @@
import type { TLogLevel } from './smartupdate.constants.js';
import type * as smartnpm from '@push.rocks/smartnpm';
export type TCacheStrategy = 'always' | 'never' | 'time-based';
export type TCacheStoreType = 'custom' | 'userHomeDir' | 'ephemeral';
export type TCachedUpdateStatus = 'up-to-date' | 'update-available';
/**
* Cache status stored for each package
*/
export interface ICacheStatus {
lastCheck: number;
latestVersion: string;
currentVersion?: string;
registryUrl?: string;
status?: TCachedUpdateStatus;
performedUpgrade: boolean;
}
/**
* Options for configuring the SmartUpdate instance
*/
export interface ISmartUpdateOptions {
/**
* Options for the npm registry connection
*/
npmRegistryOptions?: smartnpm.INpmRegistryConstructorOptions;
/**
* Cache duration configuration
* @default { hours: 1 }
*/
cacheDuration?: {
hours?: number;
minutes?: number;
seconds?: number;
};
/**
* Logging level
* @default 'INFO'
*/
logLevel?: TLogLevel;
/**
* Custom logger function
* If provided, this will be used instead of console output
*/
customLogger?: (level: TLogLevel, message: string) => void;
/**
* Disable colored output
* @default false
*/
noColor?: boolean;
/**
* Cache storage configuration
* @default { storeType: 'userHomeDir', storeIdentifier: 'global_smartupdate' }
*/
cacheStore?: {
storeType?: TCacheStoreType;
storeIdentifier?: string;
customPath?: string;
};
}
/**
* Options for checking for updates
*/
export interface IUpdateCheckOptions {
/**
* The npm package name to check
*/
packageName: string;
/**
* The current version to compare against
*/
currentVersion: string;
/**
* Optional URL to the changelog
* If provided and an update is available, the changelog will be opened
*/
changelogUrl?: string;
/**
* Whether to open the changelog URL automatically
* Only applies if running in a non-CI environment
* @default true
*/
openChangelog?: boolean;
/**
* Cache strategy for this check
* - 'always': Always use an existing matching cache entry
* - 'never': Always check registry, bypass cache
* - 'time-based': Check based on cache duration
* @default 'time-based'
*/
cacheStrategy?: TCacheStrategy;
}
/**
* Result of an update check
*/
export interface IUpdateCheckResult {
/**
* Status of the update check
*/
status: 'up-to-date' | 'update-available' | 'check-skipped' | 'error';
/**
* The current version being checked
*/
currentVersion: string;
/**
* The latest version available (if found)
*/
latestVersion?: string;
/**
* The package name that was checked
*/
packageName: string;
/**
* Time when the check was performed
*/
checkTime: Date;
/**
* Whether this result came from cache
*/
cacheHit: boolean;
/**
* When the next check can be performed (if check was skipped due to rate limiting)
*/
nextCheckTime?: Date;
/**
* Error details if status is 'error'
*/
error?: Error;
/**
* Reason for the result (human-readable explanation)
*/
reason?: string;
}
/**
* Options for the cache manager
*/
export interface ICacheOptions {
/**
* Cache duration in milliseconds
*/
durationMs: number;
/**
* Identifier for the key-value store
*/
storeIdentifier?: string;
/**
* Key-value store backend
*/
storeType?: TCacheStoreType;
/**
* Custom path for custom key-value stores
*/
customPath?: string;
}
/**
* Options for the notifier
*/
export interface INotificationOptions {
/**
* Log level for notifications
*/
logLevel: TLogLevel;
/**
* Whether to use colors in output
*/
useColors: boolean;
/**
* Custom logger function
*/
customLogger?: (level: TLogLevel, message: string) => void;
}
+6 -14
View File
@@ -1,15 +1,7 @@
import 'typings-global' import * as consolecolor from '@push.rocks/consolecolor';
import * as npmextra from '@push.rocks/npmextra';
import * as smartnpm from '@push.rocks/smartnpm';
import * as smartopen from '@push.rocks/smartopen';
import * as smartversion from '@push.rocks/smartversion';
import * as beautylog from 'beautylog' export { consolecolor, npmextra, smartnpm, smartopen, smartversion };
import * as beautycolor from 'beautycolor'
import * as npmextra from 'npmextra'
import * as smartnpm from 'smartnpm'
import * as smarttime from 'smarttime'
export {
beautylog,
beautycolor,
npmextra,
smartnpm,
smarttime
}
+14
View File
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"noImplicitAny": true,
"esModuleInterop": true,
"verbatimModuleSyntax": true,
"types": ["node"]
},
"exclude": ["dist_*/**/*.d.ts"]
}
-3
View File
@@ -1,3 +0,0 @@
{
"extends": "tslint-config-standard"
}
-840
View File
@@ -1,840 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@types/chai-as-promised@0.0.29":
version "0.0.29"
resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-0.0.29.tgz#43d52892aa998e185a3de3e2477edb8573be1d77"
dependencies:
"@types/chai" "*"
"@types/promises-a-plus" "*"
"@types/chai-string@^1.1.30":
version "1.1.30"
resolved "https://registry.yarnpkg.com/@types/chai-string/-/chai-string-1.1.30.tgz#4d8744b31a5a2295fc01c981ed1e2d4c8a070f0a"
dependencies:
"@types/chai" "*"
"@types/chai@*":
version "4.0.3"
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.0.3.tgz#6c2264b195cd2bb4c95c108487e13df0c8567c3e"
"@types/chai@^3.4.35":
version "3.5.2"
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-3.5.2.tgz#c11cd2817d3a401b7ba0f5a420f35c56139b1c1e"
"@types/cron@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@types/cron/-/cron-1.2.1.tgz#95c1e432d6106ca34c92f0743638bc786c073faa"
"@types/fs-extra@4.x.x":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-4.0.0.tgz#1dd742ad5c9bce308f7a52d02ebc01421bc9102f"
dependencies:
"@types/node" "*"
"@types/glob@*":
version "5.0.31"
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-5.0.31.tgz#6cb8500bd170750c1948f785cc5828e9cff0c36a"
dependencies:
"@types/minimatch" "*"
"@types/node" "*"
"@types/lodash@4.x.x", "@types/lodash@^4.14.55", "@types/lodash@^4.14.67", "@types/lodash@^4.14.68":
version "4.14.73"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.73.tgz#9837e47db8643ba5bcef2c7921f37d90f9c24213"
"@types/minimatch@*":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.0.tgz#a8b68c324817169b6004b432a598478a5d8f025a"
"@types/minimatch@2.x.x":
version "2.0.29"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a"
"@types/node@*", "@types/node@^8.0.10":
version "8.0.22"
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.22.tgz#9c6bfee1f45f5e9952ff6b487e657ecca48c7777"
"@types/promises-a-plus@*":
version "0.0.27"
resolved "https://registry.yarnpkg.com/@types/promises-a-plus/-/promises-a-plus-0.0.27.tgz#c64651134614c84b8f5d7114ce8901d36a609780"
"@types/q@1.x.x":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.0.3.tgz#08e99d20f7abfc0fe202b6d5a0921bfafcdea8d0"
"@types/shelljs@^0.7.2":
version "0.7.4"
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.4.tgz#137b5f31306eaff4de120ffe5b9d74b297809cfc"
dependencies:
"@types/glob" "*"
"@types/node" "*"
"@types/vinyl@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@types/vinyl/-/vinyl-2.0.0.tgz#fd213bf7f4136dde21fe1895500b12c186f8c268"
dependencies:
"@types/node" "*"
"@types/which@^1.0.28":
version "1.0.28"
resolved "https://registry.yarnpkg.com/@types/which/-/which-1.0.28.tgz#016e387629b8817bed653fe32eab5d11279c8df6"
ansi-256-colors@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/ansi-256-colors/-/ansi-256-colors-1.1.0.tgz#910de50efcc7c09e3d82f2f87abd6b700c18818a"
ansi-regex@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
ansi-styles@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
argparse@^1.0.7:
version "1.0.9"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
dependencies:
sprintf-js "~1.0.2"
assertion-error@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c"
balanced-match@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
beautycolor@^1.0.10, beautycolor@^1.0.7, beautycolor@^1.0.9:
version "1.0.10"
resolved "https://registry.yarnpkg.com/beautycolor/-/beautycolor-1.0.10.tgz#4b50758e59115839b3bb2bfe8aaaec9e29c747dd"
dependencies:
ansi-256-colors "^1.1.0"
tapbundle "^1.1.1"
typings-global "^1.0.14"
beautylog@^6.1.10:
version "6.1.10"
resolved "https://registry.yarnpkg.com/beautylog/-/beautylog-6.1.10.tgz#9c27e566937684cb689f9372d98cfa5415d50b72"
dependencies:
"@types/lodash" "^4.14.55"
beautycolor "^1.0.7"
figlet "^1.2.0"
lodash "^4.17.4"
ora "^1.1.0"
smartenv "^2.0.0"
smartq "^1.1.1"
typings-global "^1.0.14"
bindings@^1.2.1:
version "1.3.0"
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7"
brace-expansion@^1.1.7:
version "1.1.8"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292"
dependencies:
balanced-match "^1.0.0"
concat-map "0.0.1"
chai-as-promised@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-6.0.0.tgz#1a02a433a6f24dafac63b9c96fa1684db1aa8da6"
dependencies:
check-error "^1.0.2"
chai-string@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/chai-string/-/chai-string-1.4.0.tgz#359140c051d36a4e4b1a5fc6b910152f438a8d49"
chai@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/chai/-/chai-3.5.0.tgz#4d02637b067fe958bdbfdd3a40ec56fef7373247"
dependencies:
assertion-error "^1.0.1"
deep-eql "^0.1.3"
type-detect "^1.0.0"
chalk@^1.0.0, chalk@^1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
dependencies:
ansi-styles "^2.2.1"
escape-string-regexp "^1.0.2"
has-ansi "^2.0.0"
strip-ansi "^3.0.0"
supports-color "^2.0.0"
check-error@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82"
cli-cursor@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
dependencies:
restore-cursor "^2.0.0"
cli-spinners@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.0.0.tgz#ef987ed3d48391ac3dab9180b406a742180d6e6a"
clone-buffer@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58"
clone-stats@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680"
clone@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.1.tgz#d217d1e961118e3ac9a4b8bba3285553bf647cdb"
cloneable-readable@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.0.0.tgz#a6290d413f217a61232f95e458ff38418cfb0117"
dependencies:
inherits "^2.0.1"
process-nextick-args "^1.0.6"
through2 "^2.0.1"
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
cron@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/cron/-/cron-1.2.1.tgz#3a86c09b41b8f261ac863a7cc85ea4735857eab2"
dependencies:
moment-timezone "^0.5.x"
deep-eql@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2"
dependencies:
type-detect "0.1.1"
define-properties@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94"
dependencies:
foreach "^2.0.5"
object-keys "^1.0.8"
early@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/early/-/early-2.1.1.tgz#841e23254ea5dc54d8afaeee82f5ab65c00ee23c"
dependencies:
beautycolor "^1.0.7"
smartq "^1.1.1"
typings-global "^1.0.16"
es-abstract@^1.5.1:
version "1.8.0"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.8.0.tgz#3b00385e85729932beffa9163bbea1234e932914"
dependencies:
es-to-primitive "^1.1.1"
function-bind "^1.1.0"
has "^1.0.1"
is-callable "^1.1.3"
is-regex "^1.0.4"
es-to-primitive@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d"
dependencies:
is-callable "^1.1.1"
is-date-object "^1.0.1"
is-symbol "^1.0.1"
es6-error@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.0.2.tgz#eec5c726eacef51b7f6b73c20db6e1b13b069c98"
escape-string-regexp@^1.0.2:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
esprima@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804"
figlet@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/figlet/-/figlet-1.2.0.tgz#6c46537378fab649146b5a6143dda019b430b410"
first-chunk-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz#1bdecdb8e083c0664b91945581577a43a9f31d70"
dependencies:
readable-stream "^2.0.2"
foreach@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
fs-extra@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.1.tgz#7fc0c6c8957f983f57f306a24e5b9ddd8d0dd880"
dependencies:
graceful-fs "^4.1.2"
jsonfile "^3.0.0"
universalify "^0.1.0"
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
function-bind@^1.0.2, function-bind@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771"
glob@^7.0.0, glob@^7.1.2:
version "7.1.2"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"
graceful-fs@^4.1.2, graceful-fs@^4.1.6:
version "4.1.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
has-ansi@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
dependencies:
ansi-regex "^2.0.0"
has@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28"
dependencies:
function-bind "^1.0.2"
home@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/home/-/home-1.0.1.tgz#96a423ceb49b98378ff5ef3ceae059a557f9dd35"
dependencies:
os-homedir "^1.0.1"
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
dependencies:
once "^1.3.0"
wrappy "1"
inherits@2, inherits@^2.0.1, inherits@~2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
interpret@^1.0.0:
version "1.0.3"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90"
is-callable@^1.1.1, is-callable@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2"
is-date-object@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
is-regex@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491"
dependencies:
has "^1.0.1"
is-symbol@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"
is-utf8@^0.2.0, is-utf8@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
isexe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
js-yaml@^3.9.1:
version "3.9.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.1.tgz#08775cebdfdd359209f0d2acd383c8f86a6904a0"
dependencies:
argparse "^1.0.7"
esprima "^4.0.0"
jsonfile@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.1.tgz#a5ecc6f65f53f662c4415c7675a0331d0992ec66"
optionalDependencies:
graceful-fs "^4.1.6"
leakage@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/leakage/-/leakage-0.3.0.tgz#15d698abdc76bbc6439601f4f3020e77e2d50c39"
dependencies:
es6-error "^4.0.2"
left-pad "^1.1.3"
memwatch-next "^0.3.0"
minimist "^1.2.0"
pretty-bytes "^4.0.2"
left-pad@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.1.3.tgz#612f61c033f3a9e08e939f1caebeea41b6f3199a"
lik@^1.0.38:
version "1.0.38"
resolved "https://registry.yarnpkg.com/lik/-/lik-1.0.38.tgz#ccff0abd3d9236a5e4b7d80d514c5c210f18469b"
dependencies:
"@types/lodash" "^4.14.67"
"@types/minimatch" "2.x.x"
"@types/q" "1.x.x"
lodash "^4.17.4"
minimatch "^3.0.4"
q "^1.5.0"
rxjs "^5.4.1"
smartq "^1.1.1"
typings-global "^1.0.19"
lodash@^4.17.4:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
log-symbols@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18"
dependencies:
chalk "^1.0.0"
memwatch-next@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/memwatch-next/-/memwatch-next-0.3.0.tgz#2111050f9a906e0aa2d72a4ec0f0089c78726f8f"
dependencies:
bindings "^1.2.1"
nan "^2.3.2"
mimic-fn@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18"
minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
dependencies:
brace-expansion "^1.1.7"
minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
moment-timezone@^0.5.x:
version "0.5.13"
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.13.tgz#99ce5c7d827262eb0f1f702044177f60745d7b90"
dependencies:
moment ">= 2.9.0"
"moment@>= 2.9.0":
version "2.18.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.18.1.tgz#c36193dd3ce1c2eed2adb7c802dbbc77a81b1c0f"
nan@^2.3.2:
version "2.6.2"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45"
npmextra@^2.0.9:
version "2.0.9"
resolved "https://registry.yarnpkg.com/npmextra/-/npmextra-2.0.9.tgz#bd32b91590a8b3e2eabdfed26c324a1952758c2c"
dependencies:
beautylog "^6.1.10"
smartfile "^4.2.20"
smartlodash "^1.0.1"
smartpath "^3.2.8"
smartq "^1.1.6"
taskbuffer "^1.0.22"
typings-global "^1.0.20"
object-keys@^1.0.8:
version "1.0.11"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
object.getownpropertydescriptors@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
dependencies:
define-properties "^1.1.2"
es-abstract "^1.5.1"
once@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
dependencies:
wrappy "1"
onetime@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4"
dependencies:
mimic-fn "^1.0.0"
ora@^1.1.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/ora/-/ora-1.3.0.tgz#80078dd2b92a934af66a3ad72a5b910694ede51a"
dependencies:
chalk "^1.1.1"
cli-cursor "^2.1.0"
cli-spinners "^1.0.0"
log-symbols "^1.0.2"
os-homedir@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
path-parse@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
pify@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
pretty-bytes@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9"
process-nextick-args@^1.0.6, process-nextick-args@~1.0.6:
version "1.0.7"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
q@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/q/-/q-1.5.0.tgz#dd01bac9d06d30e6f219aecb8253ee9ebdc308f1"
readable-stream@^2.0.2, readable-stream@^2.1.5:
version "2.3.3"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c"
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.3"
isarray "~1.0.0"
process-nextick-args "~1.0.6"
safe-buffer "~5.1.1"
string_decoder "~1.0.3"
util-deprecate "~1.0.1"
rechoir@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
dependencies:
resolve "^1.1.6"
remove-trailing-separator@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef"
replace-ext@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb"
require-reload@0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/require-reload/-/require-reload-0.2.2.tgz#29a7591846caf91b6e8a3cda991683f95f8d7d42"
resolve@^1.1.6:
version "1.4.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86"
dependencies:
path-parse "^1.0.5"
restore-cursor@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
dependencies:
onetime "^2.0.0"
signal-exit "^3.0.2"
rxjs@^5.4.1, rxjs@^5.4.2:
version "5.4.3"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.3.tgz#0758cddee6033d68e0fd53676f0f3596ce3d483f"
dependencies:
symbol-observable "^1.0.1"
safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
semver@^5.3.0:
version "5.4.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e"
shelljs@^0.7.8:
version "0.7.8"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3"
dependencies:
glob "^7.0.0"
interpret "^1.0.0"
rechoir "^0.6.2"
signal-exit@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
smartchai@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/smartchai/-/smartchai-1.0.3.tgz#de6d010bb8b5aef24cb70b31a5f5334e8c41b72f"
dependencies:
"@types/chai" "^3.4.35"
"@types/chai-as-promised" "0.0.29"
"@types/chai-string" "^1.1.30"
chai "^3.5.0"
chai-as-promised "^6.0.0"
chai-string "^1.3.0"
smartdelay@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/smartdelay/-/smartdelay-1.0.3.tgz#5fd44dad77262d110702f0293efa80c072cfb579"
dependencies:
smartq "^1.1.1"
typings-global "^1.0.16"
smartenv@^2.0.0:
version "2.0.6"
resolved "https://registry.yarnpkg.com/smartenv/-/smartenv-2.0.6.tgz#b38c679b0c151b9af548f68c3a072c29d1417e8d"
dependencies:
lodash "^4.17.4"
smartq "^1.1.1"
typings-global "^1.0.14"
smartfile@^4.2.20:
version "4.2.20"
resolved "https://registry.yarnpkg.com/smartfile/-/smartfile-4.2.20.tgz#abc37c04fb7b3afea68fa295dfb80083361a8028"
dependencies:
"@types/fs-extra" "4.x.x"
"@types/vinyl" "^2.0.0"
fs-extra "^4.0.0"
glob "^7.1.2"
js-yaml "^3.9.1"
require-reload "0.2.2"
smartpath "^3.2.8"
smartq "^1.1.6"
smartrequest "^1.0.6"
typings-global "^1.0.20"
vinyl-file "^3.0.0"
smartlodash@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/smartlodash/-/smartlodash-1.0.1.tgz#8ddb41f3247d6d9856c63d1ea1ffccb78415a9c6"
dependencies:
"@types/lodash" "^4.14.68"
"@types/node" "^8.0.10"
lodash "^4.17.4"
smartnpm@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/smartnpm/-/smartnpm-1.0.4.tgz#026ce3b3f3b46ec546de51908a0d408848466c0d"
dependencies:
beautycolor "^1.0.9"
beautylog "^6.1.10"
smartrequest "^1.0.6"
typings-global "^1.0.16"
smartpath@^3.2.8:
version "3.2.8"
resolved "https://registry.yarnpkg.com/smartpath/-/smartpath-3.2.8.tgz#4834bd3a8bae2295baacadba23c87a501952f940"
dependencies:
home "^1.0.1"
typings-global "^1.0.14"
smartq@^1.1.1, smartq@^1.1.6:
version "1.1.6"
resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.6.tgz#0c1ff4336d95e95b4f1fdd8ccd7e2c5a323b8412"
dependencies:
typings-global "^1.0.19"
util.promisify "^1.0.0"
smartrequest@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/smartrequest/-/smartrequest-1.0.6.tgz#a006454332453b0a70d38a003a29963d039a7783"
dependencies:
smartq "^1.1.1"
typings-global "^1.0.17"
smartshell@^1.0.6:
version "1.0.13"
resolved "https://registry.yarnpkg.com/smartshell/-/smartshell-1.0.13.tgz#277b34e6624df70003e0e3a6c900cd5ebab7eb92"
dependencies:
"@types/shelljs" "^0.7.2"
"@types/which" "^1.0.28"
shelljs "^0.7.8"
smartq "^1.1.6"
typings-global "^1.0.19"
which "^1.2.14"
smarttime@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/smarttime/-/smarttime-1.0.6.tgz#0412a021cff88e8e41b766103a2d9e42fe816ddc"
dependencies:
typings-global "^1.0.16"
sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
string_decoder@~1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab"
dependencies:
safe-buffer "~5.1.0"
strip-ansi@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
dependencies:
ansi-regex "^2.0.0"
strip-bom-buf@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/strip-bom-buf/-/strip-bom-buf-1.0.0.tgz#1cb45aaf57530f4caf86c7f75179d2c9a51dd572"
dependencies:
is-utf8 "^0.2.1"
strip-bom-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz#f87db5ef2613f6968aa545abfe1ec728b6a829ca"
dependencies:
first-chunk-stream "^2.0.0"
strip-bom "^2.0.0"
strip-bom@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e"
dependencies:
is-utf8 "^0.2.0"
supports-color@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
symbol-observable@^1.0.1:
version "1.0.4"
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d"
tapbundle@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/tapbundle/-/tapbundle-1.1.1.tgz#ec4172c0e82a77b1f6133fef2606311ede28a62d"
dependencies:
early "^2.1.1"
leakage "^0.3.0"
smartchai "^1.0.3"
smartdelay "^1.0.3"
smartq "^1.1.1"
typings-global "^1.0.19"
taskbuffer@^1.0.22:
version "1.0.22"
resolved "https://registry.yarnpkg.com/taskbuffer/-/taskbuffer-1.0.22.tgz#05d498d157d79dd897e11e6225fd447ba2f2fa3e"
dependencies:
"@types/cron" "^1.2.1"
"@types/lodash" "4.x.x"
beautylog "^6.1.10"
cron "^1.2.1"
lik "^1.0.38"
lodash "^4.17.4"
rxjs "^5.4.2"
smartdelay "^1.0.3"
smartq "^1.1.6"
typings-global "^1.0.19"
through2@^2.0.1:
version "2.0.3"
resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be"
dependencies:
readable-stream "^2.1.5"
xtend "~4.0.1"
type-detect@0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822"
type-detect@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2"
typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.17, typings-global@^1.0.19, typings-global@^1.0.20:
version "1.0.20"
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.20.tgz#3da769c54db538247c5d877d1d9e97eb2ec981ff"
dependencies:
semver "^5.3.0"
smartshell "^1.0.6"
universalify@^0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7"
util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
util.promisify@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030"
dependencies:
define-properties "^1.1.2"
object.getownpropertydescriptors "^2.0.3"
vinyl-file@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/vinyl-file/-/vinyl-file-3.0.0.tgz#b104d9e4409ffa325faadd520642d0a3b488b365"
dependencies:
graceful-fs "^4.1.2"
pify "^2.3.0"
strip-bom-buf "^1.0.0"
strip-bom-stream "^2.0.0"
vinyl "^2.0.1"
vinyl@^2.0.1:
version "2.1.0"
resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.1.0.tgz#021f9c2cf951d6b939943c89eb5ee5add4fd924c"
dependencies:
clone "^2.1.1"
clone-buffer "^1.0.0"
clone-stats "^1.0.0"
cloneable-readable "^1.0.0"
remove-trailing-separator "^1.0.1"
replace-ext "^1.0.0"
which@^1.2.14:
version "1.3.0"
resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a"
dependencies:
isexe "^2.0.0"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
xtend@~4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"