Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 450b3ba379 | |||
| 0daae0bd07 | |||
| 826f3a6c63 | |||
| c1a4671ce1 | |||
| 73a6d5bc31 | |||
| e15a569391 | |||
| 74809bd8d4 | |||
| 5b852d9602 | |||
| f68254eea7 | |||
| 5935c67f2e | |||
| 98f5353744 | |||
| 1372a2bb7e | |||
| fa16aaa2c1 | |||
| c3892096b6 | |||
| 4e6646b133 | |||
| da6739be6a | |||
| f72217250d | |||
| 4c36174b0d |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -15,8 +15,6 @@ node_modules/
|
||||
|
||||
# builds
|
||||
dist/
|
||||
dist_web/
|
||||
dist_serve/
|
||||
dist_ts_web/
|
||||
dist_*/
|
||||
|
||||
# custom
|
||||
108
.gitlab-ci.yml
108
.gitlab-ci.yml
@@ -1,18 +1,16 @@
|
||||
# gitzone ci_default
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
variables:
|
||||
GIT_STRATEGY: clone
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .npmci_cache/
|
||||
key: "$CI_BUILD_STAGE"
|
||||
- .npmci_cache/
|
||||
key: '$CI_BUILD_STAGE'
|
||||
|
||||
stages:
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
|
||||
# ====================
|
||||
# security stage
|
||||
@@ -20,60 +18,74 @@ stages:
|
||||
mirror:
|
||||
stage: security
|
||||
script:
|
||||
- npmci git mirror
|
||||
- npmci git mirror
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
snyk:
|
||||
auditProductionDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install -g snyk
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command snyk test
|
||||
- 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
|
||||
- notpriv
|
||||
- docker
|
||||
|
||||
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
|
||||
# ====================
|
||||
|
||||
testLTS:
|
||||
testStable:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install lts
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- priv
|
||||
- docker
|
||||
|
||||
testBuild:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install lts
|
||||
- npmci npm install
|
||||
- npmci command npm run build
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci command npm run build
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
- docker
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci node install lts
|
||||
- npmci npm publish
|
||||
- npmci node install stable
|
||||
- npmci npm publish
|
||||
only:
|
||||
- tags
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# metadata stage
|
||||
@@ -81,35 +93,39 @@ release:
|
||||
codequality:
|
||||
stage: metadata
|
||||
allow_failure: true
|
||||
only:
|
||||
- tags
|
||||
script:
|
||||
- npmci command npm install -g tslint typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||
tags:
|
||||
- docker
|
||||
- priv
|
||||
- lossless
|
||||
- docker
|
||||
- priv
|
||||
|
||||
trigger:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci trigger
|
||||
- npmci trigger
|
||||
only:
|
||||
- tags
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
pages:
|
||||
image: hosttoday/ht-docker-dbase:npmci
|
||||
services:
|
||||
- docker:18-dind
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci command npm install -g @gitzone/tsdoc
|
||||
- npmci node install lts
|
||||
- npmci command npm install -g @git.zone/tsdoc
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command tsdoc
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
only:
|
||||
@@ -117,5 +133,5 @@ pages:
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
||||
- public
|
||||
allow_failure: true
|
||||
|
||||
29
.vscode/launch.json
vendored
Normal file
29
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "current file",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"${relativeFile}"
|
||||
],
|
||||
"runtimeArgs": ["-r", "@git.zone/tsrun"],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"protocol": "inspector",
|
||||
"internalConsoleOptions": "openOnSessionStart"
|
||||
},
|
||||
{
|
||||
"name": "test.ts",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"test/test.ts"
|
||||
],
|
||||
"runtimeArgs": ["-r", "@git.zone/tsrun"],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"protocol": "inspector",
|
||||
"internalConsoleOptions": "openOnSessionStart"
|
||||
}
|
||||
]
|
||||
}
|
||||
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"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
28
README.md
28
README.md
@@ -1,28 +0,0 @@
|
||||
# @gitzone/tools
|
||||
setup your environment with the most important tools and update them easily.
|
||||
|
||||
## Availabililty and Links
|
||||
* [npmjs.org (npm package)](https://www.npmjs.com/package/@gitzone/tools)
|
||||
* [gitlab.com (source)](https://gitlab.com/gitzone/tools)
|
||||
* [github.com (source mirror)](https://github.com/gitzone/tools)
|
||||
* [docs (typedoc)](https://gitzone.gitlab.io/tools/)
|
||||
|
||||
## Status for master
|
||||
[](https://gitlab.com/gitzone/tools/commits/master)
|
||||
[](https://gitlab.com/gitzone/tools/commits/master)
|
||||
[](https://www.npmjs.com/package/@gitzone/tools)
|
||||
[](https://snyk.io/test/npm/@gitzone/tools)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://prettier.io/)
|
||||
|
||||
## Usage
|
||||
|
||||
Use TypeScript for best in class instellisense.
|
||||
|
||||
For further information read the linked docs at the top of this readme.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||
|
||||
[](https://maintainedby.lossless.com)
|
||||
13
assets/package_library.json
Normal file
13
assets/package_library.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"default": [
|
||||
"@bubblewrap/cli",
|
||||
"@losslessone_private/lole",
|
||||
"@gitzone_private/gitzone",
|
||||
"@git.zone/tsbuild",
|
||||
"@git.zone/tsdocker",
|
||||
"@git.zone/tsrun",
|
||||
"nativescript",
|
||||
"typescript",
|
||||
"npm-check"
|
||||
]
|
||||
}
|
||||
3
cli.js
3
cli.js
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env node
|
||||
process.env.CLI_CALL = 'true';
|
||||
require('./dist/index');
|
||||
const cliTool = require('./dist_ts/index');
|
||||
cliTool.runCli();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
process.env.CLI_CALL = 'true';
|
||||
require('@gitzone/tsrun');
|
||||
require('./ts/index');
|
||||
require('@git.zone/tsrun');
|
||||
const cliTool = require('./ts/index');
|
||||
cliTool.runCli();
|
||||
|
||||
@@ -9,12 +9,13 @@
|
||||
"npmAccessLevel": "public"
|
||||
},
|
||||
"gitzone": {
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "gitzone",
|
||||
"gitrepo": "tools",
|
||||
"shortDescription": "setup your environment with the most important tools and update them easily.",
|
||||
"npmPackagename": "@gitzone/tools",
|
||||
"npmPackagename": "@git.zone/tools",
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
|
||||
10850
package-lock.json
generated
10850
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
49
package.json
49
package.json
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"name": "@gitzone/tools",
|
||||
"version": "2.0.14",
|
||||
"name": "@git.zone/tools",
|
||||
"version": "2.0.23",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
"description": "setup your environment with the most important tools and update them easily.",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
"scripts": {
|
||||
"test": "tstest test/",
|
||||
"build": "tsbuild",
|
||||
"start": "node cli.ts.js"
|
||||
"test": "(tstest test/ --web)",
|
||||
"build": "(tsbuild --web)"
|
||||
},
|
||||
"bin": {
|
||||
"gtools": "cli.js"
|
||||
@@ -30,29 +30,30 @@
|
||||
},
|
||||
"homepage": "https://github.com/GitZoneTools/npmg#readme",
|
||||
"devDependencies": {
|
||||
"@gitzone/tstest": "^1.0.24",
|
||||
"@pushrocks/tapbundle": "^3.0.13",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
"@git.zone/tsbuild": "^4.1.2",
|
||||
"@git.zone/tstest": "^3.1.8"
|
||||
},
|
||||
"dependencies": {
|
||||
"@gitzone/tsrun": "^1.2.8",
|
||||
"@pushrocks/smartcli": "^3.0.7",
|
||||
"@pushrocks/smartfile": "^7.0.4",
|
||||
"@pushrocks/smartlog": "^2.0.19",
|
||||
"@pushrocks/smartlog-destination-local": "^8.0.2",
|
||||
"@pushrocks/smartshell": "^2.0.23",
|
||||
"@types/node": "^12.7.2"
|
||||
"@git.zone/tsrun": "^2.0.1",
|
||||
"@push.rocks/smartcli": "^4.0.20",
|
||||
"@push.rocks/smartlog": "^3.1.10",
|
||||
"@push.rocks/smartlog-destination-local": "^9.0.2",
|
||||
"@push.rocks/smartshell": "^3.3.0",
|
||||
"@types/node": "^25.2.0"
|
||||
},
|
||||
"files": [
|
||||
"ts/*",
|
||||
"ts_web/*",
|
||||
"dist/*",
|
||||
"dist_web/*",
|
||||
"dist_ts_web/*",
|
||||
"assets/*",
|
||||
"ts/**/*",
|
||||
"ts_web/**/*",
|
||||
"dist/**/*",
|
||||
"dist_*/**/*",
|
||||
"dist_ts/**/*",
|
||||
"dist_ts_web/**/*",
|
||||
"assets/**/*",
|
||||
"cli.js",
|
||||
"npmextra.json",
|
||||
"readme.md"
|
||||
],
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"default":[
|
||||
"@losslessone_private/lole",
|
||||
"@gitzone_private/gitzone",
|
||||
"@gitzone/tsbuild",
|
||||
"@gitzone/tsdocker",
|
||||
"@gitzone/tsrun",
|
||||
"typescript",
|
||||
"tslint",
|
||||
"snyk",
|
||||
"npm-check"
|
||||
]
|
||||
|
||||
}
|
||||
8380
pnpm-lock.yaml
generated
Normal file
8380
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
14
test/test.node.ts
Normal file
14
test/test.node.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { expect, tap } from '@git.zone/tstest/tapbundle';
|
||||
|
||||
import * as tools from '../ts/tools.install.js';
|
||||
|
||||
tap.test('should have install function exported', async () => {
|
||||
expect(typeof tools.install).toEqual('function');
|
||||
});
|
||||
|
||||
tap.test('should handle unknown package set', async () => {
|
||||
// This will just log a warning, not throw
|
||||
await tools.install('unknown');
|
||||
});
|
||||
|
||||
export default tap.start();
|
||||
@@ -1,9 +0,0 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
|
||||
import * as tools from '../ts/tools.install';
|
||||
|
||||
tap.test("should install default list globally when parsed 'default' as argument", async () => {
|
||||
await tools.install('default');
|
||||
});
|
||||
|
||||
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: '@git.zone/tools',
|
||||
version: '2.0.23',
|
||||
description: 'setup your environment with the most important tools and update them easily.'
|
||||
}
|
||||
12
ts/index.ts
12
ts/index.ts
@@ -1,3 +1,9 @@
|
||||
import plugins = require('./tools.plugins');
|
||||
import * as cli from './tools.cli';
|
||||
cli.run();
|
||||
import * as plugins from './tools.plugins.js';
|
||||
import * as cli from './tools.cli.js';
|
||||
|
||||
export const runCli = async () => {
|
||||
await cli.run();
|
||||
};
|
||||
|
||||
// Auto-run when called directly
|
||||
runCli();
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import * as plugins from './tools.plugins';
|
||||
import * as toolsInstall from './tools.install';
|
||||
import * as plugins from './tools.plugins.js';
|
||||
import * as toolsInstall from './tools.install.js';
|
||||
|
||||
export const run = async () => {
|
||||
const toolsCli = new plugins.smartcli.Smartcli();
|
||||
|
||||
toolsCli.addCommand('install').subscribe(async argvArg => {
|
||||
toolsCli.addCommand('install').subscribe(async (argvArg) => {
|
||||
toolsInstall.install('default');
|
||||
});
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import plugins = require('./tools.plugins');
|
||||
import paths = require('./tools.paths');
|
||||
import { logger } from './tools.logging';
|
||||
import * as plugins from './tools.plugins.js';
|
||||
import * as paths from './tools.paths.js';
|
||||
import { logger } from './tools.logging.js';
|
||||
|
||||
const installExec = async (packageNames: string[]) => {
|
||||
const smartshellInstance = new plugins.smartshell.Smartshell({
|
||||
executor: 'bash'
|
||||
executor: 'bash',
|
||||
});
|
||||
|
||||
let installString = '';
|
||||
@@ -22,8 +22,8 @@ const installExec = async (packageNames: string[]) => {
|
||||
logger.log('ok', `installed tools successfully!`);
|
||||
};
|
||||
|
||||
const packageLibrary = plugins.smartfile.fs.toObjectSync(
|
||||
plugins.path.join(paths.packageBase, 'package_library.json')
|
||||
const packageLibrary = JSON.parse(
|
||||
plugins.fs.readFileSync(plugins.path.join(paths.assetsDir, 'package_library.json'), 'utf8')
|
||||
);
|
||||
|
||||
export const install = async (packageSetArg: string) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as plugins from './tools.plugins';
|
||||
import * as plugins from './tools.plugins.js';
|
||||
|
||||
export const logger = new plugins.smartlog.Smartlog({
|
||||
logContext: {
|
||||
@@ -7,9 +7,9 @@ export const logger = new plugins.smartlog.Smartlog({
|
||||
containerName: 'Some Containername',
|
||||
environment: 'local',
|
||||
runtime: 'node',
|
||||
zone: 'gitzone'
|
||||
zone: 'gitzone',
|
||||
},
|
||||
minimumLogLevel: 'silly'
|
||||
minimumLogLevel: 'silly',
|
||||
});
|
||||
|
||||
logger.addLogDestination(new plugins.smartlogDestinationLocal.DestinationLocal());
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
import plugins = require('./tools.plugins');
|
||||
import * as plugins from './tools.plugins.js';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = plugins.path.dirname(__filename);
|
||||
|
||||
export const packageBase = plugins.path.join(__dirname, '../');
|
||||
export const assetsDir = plugins.path.join(packageBase, './assets');
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// node native
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
|
||||
// pushrocks scope
|
||||
import * as smartlog from '@pushrocks/smartlog';
|
||||
import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local';
|
||||
import * as smartcli from '@pushrocks/smartcli';
|
||||
import * as smartfile from '@pushrocks/smartfile';
|
||||
import * as smartshell from '@pushrocks/smartshell';
|
||||
// push.rocks scope
|
||||
import * as smartlog from '@push.rocks/smartlog';
|
||||
import * as smartlogDestinationLocal from '@push.rocks/smartlog-destination-local';
|
||||
import * as smartcli from '@push.rocks/smartcli';
|
||||
import * as smartshell from '@push.rocks/smartshell';
|
||||
|
||||
export { smartlog, smartlogDestinationLocal, path, smartcli, smartfile, smartshell };
|
||||
export { smartlog, smartlogDestinationLocal, path, fs, smartcli, smartshell };
|
||||
|
||||
Reference in New Issue
Block a user