Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
111ef1fe44 | |||
97b285be5c | |||
cc659a57f7 | |||
f5cb86b53e | |||
207f1e9d51 | |||
750b029ef8 | |||
710fd5ec2e | |||
d1315392a1 | |||
cf894d9e82 | |||
1da4e08ed2 | |||
66546a8b17 | |||
3c3275ece5 | |||
d43fbe6de6 | |||
16fd8be8be | |||
297e65ebe5 | |||
a5c019419b |
4
.gitignore
vendored
4
.gitignore
vendored
@ -15,8 +15,6 @@ node_modules/
|
|||||||
|
|
||||||
# builds
|
# builds
|
||||||
dist/
|
dist/
|
||||||
dist_web/
|
dist_*/
|
||||||
dist_serve/
|
|
||||||
dist_ts_web/
|
|
||||||
|
|
||||||
# custom
|
# custom
|
109
.gitlab-ci.yml
109
.gitlab-ci.yml
@ -3,14 +3,17 @@ image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
|||||||
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- .npmci_cache/
|
- .npmci_cache/
|
||||||
key: "$CI_BUILD_STAGE"
|
key: '$CI_BUILD_STAGE'
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- security
|
- security
|
||||||
- test
|
- test
|
||||||
- release
|
- release
|
||||||
- metadata
|
- metadata
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- npm install -g @shipzone/npmci
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# security stage
|
# security stage
|
||||||
@ -18,21 +21,37 @@ stages:
|
|||||||
mirror:
|
mirror:
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci git mirror
|
- npmci git mirror
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
snyk:
|
auditProductionDependencies:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci command npm install -g snyk
|
- npmci command npm install --production --ignore-scripts
|
||||||
- npmci command npm install --ignore-scripts
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
- npmci command snyk test
|
- npmci command npm audit --audit-level=high --only=prod --production
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
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 --only=dev
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# test stage
|
# test stage
|
||||||
@ -41,37 +60,36 @@ snyk:
|
|||||||
testStable:
|
testStable:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci node install stable
|
- npmci node install stable
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci npm test
|
- npmci npm test
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- priv
|
|
||||||
|
|
||||||
testBuild:
|
testBuild:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci node install lts
|
- npmci node install stable
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command npm run build
|
- npmci command npm run build
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
script:
|
script:
|
||||||
- npmci node install lts
|
- npmci node install stable
|
||||||
- npmci npm publish
|
- npmci npm publish
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# metadata stage
|
# metadata stage
|
||||||
@ -79,35 +97,38 @@ release:
|
|||||||
codequality:
|
codequality:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g tslint typescript
|
- npmci command npm install -g typescript
|
||||||
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- priv
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci trigger
|
- npmci trigger
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
image: hosttoday/ht-docker-dbase:npmci
|
|
||||||
services:
|
|
||||||
- docker:stable-dind
|
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
|
- npmci node install lts
|
||||||
- npmci command npm install -g @gitzone/tsdoc
|
- npmci command npm install -g @gitzone/tsdoc
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command tsdoc
|
- npmci command tsdoc
|
||||||
tags:
|
tags:
|
||||||
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
only:
|
only:
|
||||||
@ -115,5 +136,5 @@ pages:
|
|||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
11
.vscode/launch.json
vendored
Normal file
11
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"command": "npm test",
|
||||||
|
"name": "Run npm test",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "node-terminal"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
26
.vscode/settings.json
vendored
Normal file
26
.vscode/settings.json
vendored
Normal 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"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -3,15 +3,13 @@
|
|||||||
"npmGlobalTools": [],
|
"npmGlobalTools": [],
|
||||||
"npmAccessLevel": "public"
|
"npmAccessLevel": "public"
|
||||||
},
|
},
|
||||||
"npmts": {
|
|
||||||
"coverageTreshold": 50
|
|
||||||
},
|
|
||||||
"gitzone": {
|
"gitzone": {
|
||||||
|
"projectType": "npm",
|
||||||
"module": {
|
"module": {
|
||||||
"githost": "gitlab.com",
|
"githost": "gitlab.com",
|
||||||
"gitscope": "pushrocks",
|
"gitscope": "pushrocks",
|
||||||
"gitrepo": "smartupdate",
|
"gitrepo": "smartupdate",
|
||||||
"shortDescription": "update your tools in a smart way",
|
"description": "update your tools in a smart way",
|
||||||
"npmPackagename": "@pushrocks/smartupdate",
|
"npmPackagename": "@pushrocks/smartupdate",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
|
13882
package-lock.json
generated
13882
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
48
package.json
48
package.json
@ -1,43 +1,45 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartupdate",
|
"name": "@pushrocks/smartupdate",
|
||||||
"version": "1.0.28",
|
"version": "2.0.4",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "update your tools in a smart way",
|
"description": "update your tools in a smart way",
|
||||||
"main": "dist/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
|
"type": "module",
|
||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "(tstest test/)",
|
||||||
"build": "(tsbuild)"
|
"build": "(tsbuild --web --allowimplicitany)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.17",
|
"@gitzone/tsbuild": "^2.1.63",
|
||||||
"@gitzone/tsrun": "^1.2.8",
|
"@gitzone/tsrun": "^1.2.34",
|
||||||
"@gitzone/tstest": "^1.0.24",
|
"@gitzone/tstest": "^1.0.71",
|
||||||
"@pushrocks/tapbundle": "^3.0.13",
|
"@pushrocks/tapbundle": "^5.0.3",
|
||||||
"@types/node": "^12.7.5",
|
"@types/node": "^17.0.38"
|
||||||
"tslint": "^5.20.0",
|
|
||||||
"tslint-config-prettier": "^1.18.0"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/consolecolor": "^2.0.1",
|
"@pushrocks/consolecolor": "^2.0.1",
|
||||||
"@pushrocks/npmextra": "^3.0.7",
|
"@pushrocks/npmextra": "^3.0.9",
|
||||||
"@pushrocks/smartlog": "^2.0.19",
|
"@pushrocks/smartnpm": "^2.0.0",
|
||||||
"@pushrocks/smartnpm": "^1.0.13",
|
"@pushrocks/smartopen": "^2.0.0",
|
||||||
"@pushrocks/smartopen": "^1.0.22",
|
"@pushrocks/smarttime": "^3.0.45",
|
||||||
"@pushrocks/smarttime": "^3.0.12",
|
"@pushrocks/smartversion": "^3.0.2"
|
||||||
"@pushrocks/smartversion": "^2.0.4"
|
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/*",
|
"ts/**/*",
|
||||||
"ts_web/*",
|
"ts_web/**/*",
|
||||||
"dist/*",
|
"dist/**/*",
|
||||||
"dist_web/*",
|
"dist_*/**/*",
|
||||||
"dist_ts_web/*",
|
"dist_ts/**/*",
|
||||||
"assets/*",
|
"dist_ts_web/**/*",
|
||||||
|
"assets/**/*",
|
||||||
"cli.js",
|
"cli.js",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
|
],
|
||||||
|
"browserslist": [
|
||||||
|
"last 1 chrome versions"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
28
readme.md
28
readme.md
@ -8,13 +8,20 @@ update your tools in a smart way
|
|||||||
* [docs (typedoc)](https://pushrocks.gitlab.io/smartupdate/)
|
* [docs (typedoc)](https://pushrocks.gitlab.io/smartupdate/)
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
[](https://gitlab.com/pushrocks/smartupdate/commits/master)
|
|
||||||
[](https://gitlab.com/pushrocks/smartupdate/commits/master)
|
Status Category | Status Badge
|
||||||
[](https://www.npmjs.com/package/@pushrocks/smartupdate)
|
-- | --
|
||||||
[](https://snyk.io/test/npm/@pushrocks/smartupdate)
|
GitLab Pipelines | [](https://lossless.cloud)
|
||||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
npm | [](https://lossless.cloud)
|
||||||
[](https://prettier.io/)
|
Snyk | [](https://lossless.cloud)
|
||||||
|
TypeScript Support | [](https://lossless.cloud)
|
||||||
|
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
Code Style | [](https://lossless.cloud)
|
||||||
|
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||||
|
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||||
|
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||||
|
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@ -34,12 +41,9 @@ await smartupdate.standardHandler.check(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
For further information read the linked docs at the top of this README.
|
## Contribution
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||||
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
|
||||||
|
|
||||||
[](https://push.rocks)
|
|
||||||
|
|
||||||
For further information read the linked docs at the top of this readme.
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { expect, tap } from '@pushrocks/tapbundle';
|
import { expect, tap } from '@pushrocks/tapbundle';
|
||||||
import * as smartupdate from '../ts/index';
|
import * as smartupdate from '../ts/index.js';
|
||||||
|
|
||||||
let testSmartUpdate: smartupdate.SmartUpdate;
|
let testSmartUpdate: smartupdate.SmartUpdate;
|
||||||
|
|
||||||
@ -8,7 +8,8 @@ tap.test('should create an instance of SmartUpdate', async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should check for a npm module', async () => {
|
tap.test('should check for a npm module', async () => {
|
||||||
await testSmartUpdate.check('lodash', '1.0.5');
|
const result = await testSmartUpdate.check('lodash', '1.0.5');
|
||||||
|
expect(result).toBeTrue();
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
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: '@pushrocks/smartupdate',
|
||||||
|
version: '2.0.4',
|
||||||
|
description: 'update your tools in a smart way'
|
||||||
|
}
|
@ -1 +1 @@
|
|||||||
export { SmartUpdate } from './smartupdate.classes.smartupdate';
|
export { SmartUpdate } from './smartupdate.classes.smartupdate.js';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import * as plugins from './smartupdate.plugins';
|
import * as plugins from './smartupdate.plugins.js';
|
||||||
|
|
||||||
import { TimeStamp } from '@pushrocks/smarttime';
|
import { TimeStamp } from '@pushrocks/smarttime';
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ export class SmartUpdate {
|
|||||||
const newCacheData: ICacheStatus = {
|
const newCacheData: ICacheStatus = {
|
||||||
lastCheck: timeStamp.milliSeconds,
|
lastCheck: timeStamp.milliSeconds,
|
||||||
latestVersion: 'x.x.x',
|
latestVersion: 'x.x.x',
|
||||||
performedUpgrade: false
|
performedUpgrade: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
// the comparison data from the keyValue store
|
// the comparison data from the keyValue store
|
||||||
@ -54,7 +54,7 @@ export class SmartUpdate {
|
|||||||
newCacheData.latestVersion = npmPackage.version;
|
newCacheData.latestVersion = npmPackage.version;
|
||||||
this.kvStore.writeKey(npmnameArg, newCacheData);
|
this.kvStore.writeKey(npmnameArg, newCacheData);
|
||||||
}
|
}
|
||||||
|
|
||||||
return upgradeBool;
|
return upgradeBool;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,8 +76,8 @@ export class SmartUpdate {
|
|||||||
) {
|
) {
|
||||||
const npmPackage = await this.getNpmPackageFromRegistry(npmPackageName);
|
const npmPackage = await this.getNpmPackageFromRegistry(npmPackageName);
|
||||||
if (!npmPackage) {
|
if (!npmPackage) {
|
||||||
plugins.smartlog.defaultLogger.log('warn', 'failed to retrieve package information...');
|
console.log('warn: failed to retrieve package information...');
|
||||||
plugins.smartlog.defaultLogger.log('info', 'is the registry down?');
|
console.log('info: is the registry down?');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,13 +93,9 @@ export class SmartUpdate {
|
|||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
plugins.smartlog.defaultLogger.log(
|
console.log(`warn: There is a newer version of ${npmPackage.name} available on npm.`);
|
||||||
'warn',
|
console.log(
|
||||||
`There is a newer version of ${npmPackage.name} available on npm.`
|
`warn: Your version: ${versionLocal.versionString} | version on npm: ${versionNpm.versionString}`
|
||||||
);
|
|
||||||
plugins.smartlog.defaultLogger.log(
|
|
||||||
'warn',
|
|
||||||
`Your version: ${versionLocal.versionString} | version on npm: ${versionNpm.versionString}`
|
|
||||||
);
|
);
|
||||||
if (!process.env.CI && changelogUrlArg) {
|
if (!process.env.CI && changelogUrlArg) {
|
||||||
console.log('trying to open changelog...');
|
console.log('trying to open changelog...');
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import * as smartlog from '@pushrocks/smartlog';
|
|
||||||
smartlog.defaultLogger.enableConsole();
|
|
||||||
import * as consolecolor from '@pushrocks/consolecolor';
|
import * as consolecolor from '@pushrocks/consolecolor';
|
||||||
import * as npmextra from '@pushrocks/npmextra';
|
import * as npmextra from '@pushrocks/npmextra';
|
||||||
import * as smartnpm from '@pushrocks/smartnpm';
|
import * as smartnpm from '@pushrocks/smartnpm';
|
||||||
@ -7,4 +5,4 @@ import * as smartopen from '@pushrocks/smartopen';
|
|||||||
import * as smarttime from '@pushrocks/smarttime';
|
import * as smarttime from '@pushrocks/smarttime';
|
||||||
import * as smartversion from '@pushrocks/smartversion';
|
import * as smartversion from '@pushrocks/smartversion';
|
||||||
|
|
||||||
export { smartlog, 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