fix(core): update
This commit is contained in:
parent
111ef1fe44
commit
293da8859d
@ -7,10 +7,10 @@
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "pushrocks",
|
||||
"gitscope": "push.rocks",
|
||||
"gitrepo": "smartupdate",
|
||||
"description": "update your tools in a smart way",
|
||||
"npmPackagename": "@pushrocks/smartupdate",
|
||||
"npmPackagename": "@push.rocks/smartupdate",
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
|
26
package.json
26
package.json
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@pushrocks/smartupdate",
|
||||
"name": "@push.rocks/smartupdate",
|
||||
"version": "2.0.4",
|
||||
"private": false,
|
||||
"description": "update your tools in a smart way",
|
||||
@ -13,19 +13,19 @@
|
||||
"build": "(tsbuild --web --allowimplicitany)"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.63",
|
||||
"@gitzone/tsrun": "^1.2.34",
|
||||
"@gitzone/tstest": "^1.0.71",
|
||||
"@pushrocks/tapbundle": "^5.0.3",
|
||||
"@types/node": "^17.0.38"
|
||||
"@gitzone/tsbuild": "^2.1.66",
|
||||
"@gitzone/tsrun": "^1.2.44",
|
||||
"@gitzone/tstest": "^1.0.77",
|
||||
"@push.rocks/tapbundle": "^5.0.12",
|
||||
"@types/node": "^20.4.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/consolecolor": "^2.0.1",
|
||||
"@pushrocks/npmextra": "^3.0.9",
|
||||
"@pushrocks/smartnpm": "^2.0.0",
|
||||
"@pushrocks/smartopen": "^2.0.0",
|
||||
"@pushrocks/smarttime": "^3.0.45",
|
||||
"@pushrocks/smartversion": "^3.0.2"
|
||||
"@push.rocks/consolecolor": "^2.0.1",
|
||||
"@push.rocks/npmextra": "^3.0.9",
|
||||
"@push.rocks/smartnpm": "^2.0.4",
|
||||
"@push.rocks/smartopen": "^2.0.0",
|
||||
"@push.rocks/smarttime": "^4.0.4",
|
||||
"@push.rocks/smartversion": "^3.0.2"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
@ -42,4 +42,4 @@
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
]
|
||||
}
|
||||
}
|
5382
pnpm-lock.yaml
generated
Normal file
5382
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import { expect, tap } from '@push.rocks/tapbundle';
|
||||
import * as smartupdate from '../ts/index.js';
|
||||
|
||||
let testSmartUpdate: smartupdate.SmartUpdate;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/smartupdate',
|
||||
version: '2.0.4',
|
||||
name: '@push.rocks/smartupdate',
|
||||
version: '2.0.5',
|
||||
description: 'update your tools in a smart way'
|
||||
}
|
||||
|
@ -1,15 +1,11 @@
|
||||
import * as plugins from './smartupdate.plugins.js';
|
||||
|
||||
import { TimeStamp } from '@pushrocks/smarttime';
|
||||
|
||||
interface ICacheStatus {
|
||||
lastCheck: number;
|
||||
latestVersion: string;
|
||||
performedUpgrade: boolean;
|
||||
}
|
||||
|
||||
import { KeyValueStore } from '@pushrocks/npmextra';
|
||||
|
||||
export class SmartUpdate {
|
||||
public npmRegistry: plugins.smartnpm.NpmRegistry;
|
||||
public kvStore = new plugins.npmextra.KeyValueStore('custom', 'global_smartupdate');
|
||||
@ -20,7 +16,7 @@ export class SmartUpdate {
|
||||
|
||||
public async checkForCli(npmnameArg: string, compareVersion: string, changelogUrlArg?: string) {
|
||||
// the newData to write
|
||||
const timeStamp = new TimeStamp();
|
||||
const timeStamp = new plugins.smarttime.TimeStamp();
|
||||
const newCacheData: ICacheStatus = {
|
||||
lastCheck: timeStamp.milliSeconds,
|
||||
latestVersion: 'x.x.x',
|
||||
@ -31,7 +27,7 @@ export class SmartUpdate {
|
||||
const retrievedCacheData: ICacheStatus = await this.kvStore.readKey(npmnameArg);
|
||||
|
||||
if (retrievedCacheData) {
|
||||
const lastCheckTimeStamp = TimeStamp.fromMilliSeconds(retrievedCacheData.lastCheck);
|
||||
const lastCheckTimeStamp = plugins.smarttime.TimeStamp.fromMilliSeconds(retrievedCacheData.lastCheck);
|
||||
const tresholdTime = plugins.smarttime.getMilliSecondsFromUnits({ hours: 1 });
|
||||
if (!lastCheckTimeStamp.isOlderThan(timeStamp, tresholdTime)) {
|
||||
newCacheData.lastCheck = lastCheckTimeStamp.milliSeconds;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import * as consolecolor from '@pushrocks/consolecolor';
|
||||
import * as npmextra from '@pushrocks/npmextra';
|
||||
import * as smartnpm from '@pushrocks/smartnpm';
|
||||
import * as smartopen from '@pushrocks/smartopen';
|
||||
import * as smarttime from '@pushrocks/smarttime';
|
||||
import * as smartversion from '@pushrocks/smartversion';
|
||||
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 smarttime from '@push.rocks/smarttime';
|
||||
import * as smartversion from '@push.rocks/smartversion';
|
||||
|
||||
export { consolecolor, npmextra, smartnpm, smartopen, smarttime, smartversion };
|
||||
|
Loading…
Reference in New Issue
Block a user