Compare commits

8 Commits

Author SHA1 Message Date
2abac29dff 2.0.5 2023-07-26 20:51:12 +02:00
293da8859d fix(core): update 2023-07-26 20:51:11 +02:00
111ef1fe44 2.0.4 2022-06-01 20:29:14 +02:00
97b285be5c fix(core): update 2022-06-01 20:29:13 +02:00
cc659a57f7 2.0.3 2022-04-13 16:54:41 +02:00
f5cb86b53e fix(core): update 2022-04-13 16:54:40 +02:00
207f1e9d51 2.0.2 2022-04-13 16:20:55 +02:00
750b029ef8 update 2022-04-13 16:20:51 +02:00
13 changed files with 5811 additions and 9100 deletions

View File

@ -12,6 +12,9 @@ stages:
- release
- metadata
before_script:
- npm install -g @shipzone/npmci
# ====================
# security stage
# ====================
@ -19,23 +22,35 @@ mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
audit:
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
allow_failure: true
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high
- npmci command npm audit --audit-level=high --only=dev
tags:
- lossless
- docker
- notpriv
allow_failure: true
# ====================
@ -51,9 +66,7 @@ testStable:
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- lossless
- docker
- priv
testBuild:
stage: test
@ -64,9 +77,7 @@ testBuild:
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- lossless
- docker
- notpriv
release:
stage: release
@ -86,11 +97,12 @@ release:
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g tslint typescript
- npmci command npm install -g typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- lossless
- docker

24
.vscode/launch.json vendored
View File

@ -2,28 +2,10 @@
"version": "0.2.0",
"configurations": [
{
"name": "current file",
"type": "node",
"command": "npm test",
"name": "Run npm test",
"request": "launch",
"args": [
"${relativeFile}"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "test.ts",
"type": "node",
"request": "launch",
"args": [
"test/test.ts"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
"type": "node-terminal"
}
]
}

View File

@ -15,7 +15,7 @@
"properties": {
"projectType": {
"type": "string",
"enum": ["website", "element", "service", "npm"]
"enum": ["website", "element", "service", "npm", "wcc"]
}
}
}

View File

@ -7,10 +7,10 @@
"projectType": "npm",
"module": {
"githost": "gitlab.com",
"gitscope": "pushrocks",
"gitscope": "push.rocks",
"gitrepo": "smartupdate",
"shortDescription": "update your tools in a smart way",
"npmPackagename": "@pushrocks/smartupdate",
"description": "update your tools in a smart way",
"npmPackagename": "@push.rocks/smartupdate",
"license": "MIT"
}
}

9374
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartupdate",
"version": "2.0.1",
"name": "@push.rocks/smartupdate",
"version": "2.0.5",
"private": false,
"description": "update your tools in a smart way",
"main": "dist_ts/index.js",
@ -10,24 +10,22 @@
"license": "MIT",
"scripts": {
"test": "(tstest test/)",
"build": "(tsbuild --web)"
"build": "(tsbuild --web --allowimplicitany)"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.61",
"@gitzone/tsrun": "^1.2.32",
"@gitzone/tstest": "^1.0.70",
"@pushrocks/tapbundle": "^5.0.3",
"@types/node": "^17.0.23",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0"
"@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": "^2.0.7"
"@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/**/*",
@ -40,5 +38,8 @@
"cli.js",
"npmextra.json",
"readme.md"
],
"browserslist": [
"last 1 chrome versions"
]
}

5382
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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;

8
ts/00_commitinfo_data.ts Normal file
View 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'
}

View File

@ -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,18 +16,18 @@ 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',
performedUpgrade: false
performedUpgrade: false,
};
// the comparison data from the keyValue store
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;

View File

@ -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 };

9
tsconfig.json Normal file
View File

@ -0,0 +1,9 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext"
}
}

View File

@ -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"
}