Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
2abac29dff | |||
293da8859d | |||
111ef1fe44 | |||
97b285be5c |
@ -7,10 +7,10 @@
|
|||||||
"projectType": "npm",
|
"projectType": "npm",
|
||||||
"module": {
|
"module": {
|
||||||
"githost": "gitlab.com",
|
"githost": "gitlab.com",
|
||||||
"gitscope": "pushrocks",
|
"gitscope": "push.rocks",
|
||||||
"gitrepo": "smartupdate",
|
"gitrepo": "smartupdate",
|
||||||
"description": "update your tools in a smart way",
|
"description": "update your tools in a smart way",
|
||||||
"npmPackagename": "@pushrocks/smartupdate",
|
"npmPackagename": "@push.rocks/smartupdate",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
9374
package-lock.json
generated
9374
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartupdate",
|
"name": "@push.rocks/smartupdate",
|
||||||
"version": "2.0.3",
|
"version": "2.0.5",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "update your tools in a smart way",
|
"description": "update your tools in a smart way",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@ -13,21 +13,19 @@
|
|||||||
"build": "(tsbuild --web --allowimplicitany)"
|
"build": "(tsbuild --web --allowimplicitany)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.61",
|
"@gitzone/tsbuild": "^2.1.66",
|
||||||
"@gitzone/tsrun": "^1.2.32",
|
"@gitzone/tsrun": "^1.2.44",
|
||||||
"@gitzone/tstest": "^1.0.70",
|
"@gitzone/tstest": "^1.0.77",
|
||||||
"@pushrocks/tapbundle": "^5.0.3",
|
"@push.rocks/tapbundle": "^5.0.12",
|
||||||
"@types/node": "^17.0.23",
|
"@types/node": "^20.4.5"
|
||||||
"tslint": "^6.1.3",
|
|
||||||
"tslint-config-prettier": "^1.18.0"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/consolecolor": "^2.0.1",
|
"@push.rocks/consolecolor": "^2.0.1",
|
||||||
"@pushrocks/npmextra": "^3.0.9",
|
"@push.rocks/npmextra": "^3.0.9",
|
||||||
"@pushrocks/smartnpm": "^2.0.0",
|
"@push.rocks/smartnpm": "^2.0.4",
|
||||||
"@pushrocks/smartopen": "^2.0.0",
|
"@push.rocks/smartopen": "^2.0.0",
|
||||||
"@pushrocks/smarttime": "^3.0.45",
|
"@push.rocks/smarttime": "^4.0.4",
|
||||||
"@pushrocks/smartversion": "^2.0.7"
|
"@push.rocks/smartversion": "^3.0.2"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
|
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';
|
import * as smartupdate from '../ts/index.js';
|
||||||
|
|
||||||
let testSmartUpdate: smartupdate.SmartUpdate;
|
let testSmartUpdate: smartupdate.SmartUpdate;
|
||||||
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* autocreated commitinfo by @pushrocks/commitinfo
|
||||||
|
*/
|
||||||
|
export const commitinfo = {
|
||||||
|
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 * as plugins from './smartupdate.plugins.js';
|
||||||
|
|
||||||
import { TimeStamp } from '@pushrocks/smarttime';
|
|
||||||
|
|
||||||
interface ICacheStatus {
|
interface ICacheStatus {
|
||||||
lastCheck: number;
|
lastCheck: number;
|
||||||
latestVersion: string;
|
latestVersion: string;
|
||||||
performedUpgrade: boolean;
|
performedUpgrade: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
import { KeyValueStore } from '@pushrocks/npmextra';
|
|
||||||
|
|
||||||
export class SmartUpdate {
|
export class SmartUpdate {
|
||||||
public npmRegistry: plugins.smartnpm.NpmRegistry;
|
public npmRegistry: plugins.smartnpm.NpmRegistry;
|
||||||
public kvStore = new plugins.npmextra.KeyValueStore('custom', 'global_smartupdate');
|
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) {
|
public async checkForCli(npmnameArg: string, compareVersion: string, changelogUrlArg?: string) {
|
||||||
// the newData to write
|
// the newData to write
|
||||||
const timeStamp = new TimeStamp();
|
const timeStamp = new plugins.smarttime.TimeStamp();
|
||||||
const newCacheData: ICacheStatus = {
|
const newCacheData: ICacheStatus = {
|
||||||
lastCheck: timeStamp.milliSeconds,
|
lastCheck: timeStamp.milliSeconds,
|
||||||
latestVersion: 'x.x.x',
|
latestVersion: 'x.x.x',
|
||||||
@ -31,7 +27,7 @@ export class SmartUpdate {
|
|||||||
const retrievedCacheData: ICacheStatus = await this.kvStore.readKey(npmnameArg);
|
const retrievedCacheData: ICacheStatus = await this.kvStore.readKey(npmnameArg);
|
||||||
|
|
||||||
if (retrievedCacheData) {
|
if (retrievedCacheData) {
|
||||||
const lastCheckTimeStamp = TimeStamp.fromMilliSeconds(retrievedCacheData.lastCheck);
|
const lastCheckTimeStamp = plugins.smarttime.TimeStamp.fromMilliSeconds(retrievedCacheData.lastCheck);
|
||||||
const tresholdTime = plugins.smarttime.getMilliSecondsFromUnits({ hours: 1 });
|
const tresholdTime = plugins.smarttime.getMilliSecondsFromUnits({ hours: 1 });
|
||||||
if (!lastCheckTimeStamp.isOlderThan(timeStamp, tresholdTime)) {
|
if (!lastCheckTimeStamp.isOlderThan(timeStamp, tresholdTime)) {
|
||||||
newCacheData.lastCheck = lastCheckTimeStamp.milliSeconds;
|
newCacheData.lastCheck = lastCheckTimeStamp.milliSeconds;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import * as consolecolor from '@pushrocks/consolecolor';
|
import * as consolecolor from '@push.rocks/consolecolor';
|
||||||
import * as npmextra from '@pushrocks/npmextra';
|
import * as npmextra from '@push.rocks/npmextra';
|
||||||
import * as smartnpm from '@pushrocks/smartnpm';
|
import * as smartnpm from '@push.rocks/smartnpm';
|
||||||
import * as smartopen from '@pushrocks/smartopen';
|
import * as smartopen from '@push.rocks/smartopen';
|
||||||
import * as smarttime from '@pushrocks/smarttime';
|
import * as smarttime from '@push.rocks/smarttime';
|
||||||
import * as smartversion from '@pushrocks/smartversion';
|
import * as smartversion from '@push.rocks/smartversion';
|
||||||
|
|
||||||
export { consolecolor, npmextra, smartnpm, smartopen, smarttime, smartversion };
|
export { consolecolor, npmextra, smartnpm, smartopen, smarttime, smartversion };
|
||||||
|
9
tsconfig.json
Normal file
9
tsconfig.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"useDefineForClassFields": false,
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "ES2022",
|
||||||
|
"moduleResolution": "nodenext"
|
||||||
|
}
|
||||||
|
}
|
17
tslint.json
17
tslint.json
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": ["tslint:latest", "tslint-config-prettier"],
|
|
||||||
"rules": {
|
|
||||||
"semicolon": [true, "always"],
|
|
||||||
"no-console": false,
|
|
||||||
"ordered-imports": false,
|
|
||||||
"object-literal-sort-keys": false,
|
|
||||||
"member-ordering": {
|
|
||||||
"options":{
|
|
||||||
"order": [
|
|
||||||
"static-method"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"defaultSeverity": "warning"
|
|
||||||
}
|
|
Reference in New Issue
Block a user