fix(update to latest standards): update
This commit is contained in:
parent
9c56942739
commit
f21df13b7c
3
cli.js
Normal file
3
cli.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
process.env.CLI_CALL = 'true';
|
||||||
|
require('./dist/index');
|
4
cli.ts.js
Normal file
4
cli.ts.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
process.env.CLI_CALL = 'true';
|
||||||
|
require('@gitzone/tsrun');
|
||||||
|
require('./ts/index');
|
3
dist/cli.js
vendored
3
dist/cli.js
vendored
@ -1,3 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
process.env.CLI_CALL = 'true'
|
|
||||||
var index = require("../dist/index.js");
|
|
1
dist/index.d.ts
vendored
1
dist/index.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export {};
|
|
5
dist/index.js
vendored
5
dist/index.js
vendored
@ -1,5 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const cli = require("./npmdocker.cli");
|
|
||||||
cli.run();
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUNBLHVDQUF1QztBQUV2QyxHQUFHLENBQUMsR0FBRyxFQUFFLENBQUMifQ==
|
|
1
dist/npmdocker.cli.d.ts
vendored
1
dist/npmdocker.cli.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export declare let run: () => void;
|
|
83
dist/npmdocker.cli.js
vendored
83
dist/npmdocker.cli.js
vendored
@ -1,83 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const plugins = require("./npmdocker.plugins");
|
|
||||||
// modules
|
|
||||||
const ConfigModule = require("./npmdocker.config");
|
|
||||||
const DockerModule = require("./npmdocker.docker");
|
|
||||||
/**
|
|
||||||
* smartanalytics
|
|
||||||
* this data is fully anonymized (no Ips or any other personal information is tracked).
|
|
||||||
* It just keeps track which of our tools are really used...
|
|
||||||
* ... so we know where to spend our limited resources for improving them.
|
|
||||||
* Since yarn is out and there is heavy caching going on,
|
|
||||||
* pure download stats are just not reliable enough for us anymore
|
|
||||||
* Feel free to dig into the smartanalytics package, if you are interested in how it works.
|
|
||||||
* Our privacy policy can be found here: https://lossless.gmbh/privacy.html
|
|
||||||
*/
|
|
||||||
let npmdockerAnalytics = new plugins.smartanalytics.Analytics({
|
|
||||||
apiEndPoint: 'https://pubapi.lossless.one',
|
|
||||||
appName: 'npmdocker',
|
|
||||||
projectId: 'gitzone'
|
|
||||||
});
|
|
||||||
npmdockerAnalytics.recordEvent('npmtoolexecution', {
|
|
||||||
somedata: 'somedata'
|
|
||||||
});
|
|
||||||
let npmdockerCli = new plugins.smartcli.Smartcli();
|
|
||||||
exports.run = () => {
|
|
||||||
npmdockerCli.standardTask().subscribe((argvArg) => __awaiter(this, void 0, void 0, function* () {
|
|
||||||
plugins.beautylog.figletSync('npmdocker');
|
|
||||||
let configArg = yield ConfigModule.run().then(DockerModule.run);
|
|
||||||
if (configArg.exitCode === 0) {
|
|
||||||
plugins.beautylog.success('container ended all right!');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
plugins.beautylog.error(`container ended with error! Exit Code is ${configArg.exitCode}`);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
/**
|
|
||||||
* this command is executed inside docker and meant for use from outside docker
|
|
||||||
*/
|
|
||||||
npmdockerCli.addCommand('runinside').subscribe((argvArg) => __awaiter(this, void 0, void 0, function* () {
|
|
||||||
plugins.beautylog.ok('Allright. We are now in Docker!');
|
|
||||||
plugins.beautylog.log('now trying to run your specified command');
|
|
||||||
let configArg = yield ConfigModule.run();
|
|
||||||
yield plugins.smartshell.exec(configArg.command).then(response => {
|
|
||||||
if (response.exitCode !== 0) {
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}));
|
|
||||||
npmdockerCli.addCommand('clean').subscribe((argvArg) => __awaiter(this, void 0, void 0, function* () {
|
|
||||||
plugins.beautylog.ora.start();
|
|
||||||
plugins.beautylog.ora.text('cleaning up docker env...');
|
|
||||||
if (argvArg.all) {
|
|
||||||
plugins.beautylog.ora.text('killing any running docker containers...');
|
|
||||||
yield plugins.smartshell.exec(`docker kill $(docker ps -q)`);
|
|
||||||
plugins.beautylog.ora.text('removing stopped containers...');
|
|
||||||
yield plugins.smartshell.exec(`docker rm $(docker ps -a -q)`);
|
|
||||||
plugins.beautylog.ora.text('removing images...');
|
|
||||||
yield plugins.smartshell.exec(`docker rmi $(docker images -q -f dangling=true)`);
|
|
||||||
plugins.beautylog.ora.text('removing all other images...');
|
|
||||||
yield plugins.smartshell.exec(`docker rmi $(docker images -a -q)`);
|
|
||||||
plugins.beautylog.ora.text('removing all volumes...');
|
|
||||||
yield plugins.smartshell.exec(`docker volume rm $(docker volume ls -f dangling=true -q)`);
|
|
||||||
}
|
|
||||||
plugins.beautylog.ora.endOk('docker environment now is clean!');
|
|
||||||
}));
|
|
||||||
npmdockerCli.addCommand('speedtest').subscribe((argvArg) => __awaiter(this, void 0, void 0, function* () {
|
|
||||||
plugins.beautylog.figletSync('npmdocker');
|
|
||||||
plugins.beautylog.ok('Starting speedtest');
|
|
||||||
yield plugins.smartshell.exec(`docker pull tianon/speedtest && docker run --rm tianon/speedtest`);
|
|
||||||
}));
|
|
||||||
npmdockerCli.startParse();
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZG9ja2VyLmNsaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWRvY2tlci5jbGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLCtDQUErQztBQUcvQyxVQUFVO0FBQ1YsbURBQW1EO0FBQ25ELG1EQUFtRDtBQUVuRDs7Ozs7Ozs7O0dBU0c7QUFDSCxJQUFJLGtCQUFrQixHQUFHLElBQUksT0FBTyxDQUFDLGNBQWMsQ0FBQyxTQUFTLENBQUM7SUFDNUQsV0FBVyxFQUFFLDZCQUE2QjtJQUMxQyxPQUFPLEVBQUUsV0FBVztJQUNwQixTQUFTLEVBQUUsU0FBUztDQUNyQixDQUFDLENBQUM7QUFDSCxrQkFBa0IsQ0FBQyxXQUFXLENBQUMsa0JBQWtCLEVBQUU7SUFDakQsUUFBUSxFQUFFLFVBQVU7Q0FDckIsQ0FBQyxDQUFDO0FBRUgsSUFBSSxZQUFZLEdBQUcsSUFBSSxPQUFPLENBQUMsUUFBUSxDQUFDLFFBQVEsRUFBRSxDQUFDO0FBRXhDLFFBQUEsR0FBRyxHQUFHLEdBQUcsRUFBRTtJQUNwQixZQUFZLENBQUMsWUFBWSxFQUFFLENBQUMsU0FBUyxDQUFDLENBQU0sT0FBTyxFQUFDLEVBQUU7UUFDcEQsT0FBTyxDQUFDLFNBQVMsQ0FBQyxVQUFVLENBQUMsV0FBVyxDQUFDLENBQUM7UUFDMUMsSUFBSSxTQUFTLEdBQUcsTUFBTSxZQUFZLENBQUMsR0FBRyxFQUFFLENBQUMsSUFBSSxDQUFDLFlBQVksQ0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UFDRCxPQUFPLENBQUMsU0FBUyxDQUFDLEdBQUcsQ0FBQyxLQUFLLENBQUMsa0NBQWtDLENBQUMsQ0FBQztJQUNsRSxDQUFDLENBQUEsQ0FBQyxDQUFDO0lBRUgsWUFBWSxDQUFDLFVBQVUsQ0FBQyxXQUFXLENBQUMsQ0FBQyxTQUFTLENBQUMsQ0FBTSxPQUFPLEVBQUMsRUFBRTtRQUM3RCxPQUFPLENBQUMsU0FBUyxDQUFDLFVBQVUsQ0FBQyxXQUFXLENBQUMsQ0FBQztRQUMxQyxPQUFPLENBQUMsU0FBUyxDQUFDLEVBQUUsQ0FBQyxvQkFBb0IsQ0FBQyxDQUFDO1FBQzNDLE1BQU0sT0FBTyxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQzNCLGtFQUFrRSxDQUNuRSxDQUFDO0lBQ0osQ0FBQyxDQUFBLENBQUMsQ0FBQztJQUVILFlBQVksQ0FBQyxVQUFVLEVBQUUsQ0FBQztBQUM1QixDQUFDLENBQUMifQ==
|
|
9
dist/npmdocker.config.d.ts
vendored
9
dist/npmdocker.config.d.ts
vendored
@ -1,9 +0,0 @@
|
|||||||
import { IKeyValueObject } from 'qenv';
|
|
||||||
export interface IConfig {
|
|
||||||
baseImage: string;
|
|
||||||
command: string;
|
|
||||||
dockerSock: boolean;
|
|
||||||
exitCode?: number;
|
|
||||||
keyValueObjectArray: IKeyValueObject[];
|
|
||||||
}
|
|
||||||
export declare let run: () => Promise<IConfig>;
|
|
38
dist/npmdocker.config.js
vendored
38
dist/npmdocker.config.js
vendored
@ -1,38 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const plugins = require("./npmdocker.plugins");
|
|
||||||
const paths = require("./npmdocker.paths");
|
|
||||||
let getQenvKeyValueObject = () => __awaiter(this, void 0, void 0, function* () {
|
|
||||||
let qenvKeyValueObjectArray;
|
|
||||||
if (plugins.smartfile.fs.fileExistsSync(plugins.path.join(paths.cwd, 'qenv.yml'))) {
|
|
||||||
qenvKeyValueObjectArray = new plugins.qenv.Qenv(paths.cwd, '.nogit/').keyValueObjectArray;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
qenvKeyValueObjectArray = [];
|
|
||||||
}
|
|
||||||
return qenvKeyValueObjectArray;
|
|
||||||
});
|
|
||||||
let buildConfig = (qenvKeyValueObjectArrayArg) => __awaiter(this, void 0, void 0, function* () {
|
|
||||||
let npmextra = new plugins.npmextra.Npmextra(paths.cwd);
|
|
||||||
let config = npmextra.dataFor('npmdocker', {
|
|
||||||
baseImage: 'hosttoday/ht-docker-node:npmdocker',
|
|
||||||
init: 'rm -rf node_nodules/ && yarn install',
|
|
||||||
command: 'npmci npm test',
|
|
||||||
dockerSock: false,
|
|
||||||
keyValueObjectArray: qenvKeyValueObjectArrayArg
|
|
||||||
});
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
exports.run = () => __awaiter(this, void 0, void 0, function* () {
|
|
||||||
let config = yield getQenvKeyValueObject().then(buildConfig);
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZG9ja2VyLmNvbmZpZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWRvY2tlci5jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7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SUFBSSxNQUFNLEdBQUcsTUFBTSxxQkFBcUIsRUFBRSxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsQ0FBQztJQUM3RCxPQUFPLE1BQU0sQ0FBQztBQUNoQixDQUFDLENBQUEsQ0FBQyJ9
|
|
2
dist/npmdocker.docker.d.ts
vendored
2
dist/npmdocker.docker.d.ts
vendored
@ -1,2 +0,0 @@
|
|||||||
import { IConfig } from './npmdocker.config';
|
|
||||||
export declare let run: (configArg: IConfig) => Promise<IConfig>;
|
|
152
dist/npmdocker.docker.js
vendored
152
dist/npmdocker.docker.js
vendored
File diff suppressed because one or more lines are too long
4
dist/npmdocker.paths.d.ts
vendored
4
dist/npmdocker.paths.d.ts
vendored
@ -1,4 +0,0 @@
|
|||||||
export declare let cwd: string;
|
|
||||||
export declare let packageBase: string;
|
|
||||||
export declare let assets: string;
|
|
||||||
export declare let npmdockerFile: string;
|
|
10
dist/npmdocker.paths.js
vendored
10
dist/npmdocker.paths.js
vendored
@ -1,10 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const plugins = require("./npmdocker.plugins");
|
|
||||||
// directories
|
|
||||||
exports.cwd = process.cwd();
|
|
||||||
exports.packageBase = plugins.path.join(__dirname, '../');
|
|
||||||
exports.assets = plugins.path.join(exports.packageBase, 'assets/');
|
|
||||||
plugins.smartfile.fs.ensureDirSync(exports.assets);
|
|
||||||
exports.npmdockerFile = plugins.path.join(exports.cwd, 'npmdocker');
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZG9ja2VyLnBhdGhzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnBtZG9ja2VyLnBhdGhzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsK0NBQStDO0FBRS9DLGNBQWM7QUFDSCxRQUFBLEdBQUcsR0FBRyxPQUFPLENBQUMsR0FBRyxFQUFFLENBQUM7QUFDcEIsUUFBQSxXQUFXLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLEtBQUssQ0FBQyxDQUFDO0FBQ2xELFFBQUEsTUFBTSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLG1CQUFXLEVBQUUsU0FBUyxDQUFDLENBQUM7QUFDOUQsT0FBTyxDQUFDLFNBQVMsQ0FBQyxFQUFFLENBQUMsYUFBYSxDQUFDLGNBQU0sQ0FBQyxDQUFDO0FBQ2hDLFFBQUEsYUFBYSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFdBQUcsRUFBRSxXQUFXLENBQUMsQ0FBQyJ9
|
|
12
dist/npmdocker.plugins.d.ts
vendored
12
dist/npmdocker.plugins.d.ts
vendored
@ -1,12 +0,0 @@
|
|||||||
import * as beautylog from 'beautylog';
|
|
||||||
import * as npmextra from 'npmextra';
|
|
||||||
import * as path from 'path';
|
|
||||||
import * as projectinfo from 'projectinfo';
|
|
||||||
import * as q from 'smartq';
|
|
||||||
import * as qenv from 'qenv';
|
|
||||||
import * as smartanalytics from 'smartanalytics';
|
|
||||||
import * as smartcli from '@pushrocks/smartcli';
|
|
||||||
import * as smartfile from 'smartfile';
|
|
||||||
import * as smartshell from 'smartshell';
|
|
||||||
import * as smartstring from 'smartstring';
|
|
||||||
export { beautylog, npmextra, path, projectinfo, q, qenv, smartanalytics, smartcli, smartfile, smartshell, smartstring };
|
|
25
dist/npmdocker.plugins.js
vendored
25
dist/npmdocker.plugins.js
vendored
@ -1,25 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const beautylog = require("beautylog");
|
|
||||||
exports.beautylog = beautylog;
|
|
||||||
const npmextra = require("npmextra");
|
|
||||||
exports.npmextra = npmextra;
|
|
||||||
const path = require("path");
|
|
||||||
exports.path = path;
|
|
||||||
const projectinfo = require("projectinfo");
|
|
||||||
exports.projectinfo = projectinfo;
|
|
||||||
const q = require("smartq");
|
|
||||||
exports.q = q;
|
|
||||||
const qenv = require("qenv");
|
|
||||||
exports.qenv = qenv;
|
|
||||||
const smartanalytics = require("smartanalytics");
|
|
||||||
exports.smartanalytics = smartanalytics;
|
|
||||||
const smartcli = require("@pushrocks/smartcli");
|
|
||||||
exports.smartcli = smartcli;
|
|
||||||
const smartfile = require("smartfile");
|
|
||||||
exports.smartfile = smartfile;
|
|
||||||
const smartshell = require("smartshell");
|
|
||||||
exports.smartshell = smartshell;
|
|
||||||
const smartstring = require("smartstring");
|
|
||||||
exports.smartstring = smartstring;
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZG9ja2VyLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9ucG1kb2NrZXIucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLHVDQUF1QztBQWFyQyw4QkFBUztBQVpYLHFDQUFxQztBQWFuQyw0QkFBUTtBQVpWLDZCQUE2QjtBQWEzQixvQkFBSTtBQVpOLDJDQUEyQztBQWF6QyxrQ0FBVztBQVpiLDRCQUE0QjtBQWExQixjQUFDO0FBWkgsNkJBQTZCO0FBYTNCLG9CQUFJO0FBWk4saURBQWlEO0FBYS9DLHdDQUFjO0FBWmhCLGdEQUFnRDtBQWE5Qyw0QkFBUTtBQVpWLHVDQUF1QztBQWFyQyw4QkFBUztBQVpYLHlDQUF5QztBQWF2QyxnQ0FBVTtBQVpaLDJDQUEyQztBQWF6QyxrQ0FBVyJ9
|
|
5
dist/npmdocker.snippets.d.ts
vendored
5
dist/npmdocker.snippets.d.ts
vendored
@ -1,5 +0,0 @@
|
|||||||
export interface IDockerfileSnippet {
|
|
||||||
baseImage: string;
|
|
||||||
command: string;
|
|
||||||
}
|
|
||||||
export declare let dockerfileSnippet: (optionsArg: IDockerfileSnippet) => string;
|
|
32
dist/npmdocker.snippets.js
vendored
32
dist/npmdocker.snippets.js
vendored
@ -1,32 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const plugins = require("./npmdocker.plugins");
|
|
||||||
let getMountSolutionString = (optionsArg) => {
|
|
||||||
if (process.env.CI) {
|
|
||||||
return 'COPY ./ /workspace';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return '# not copying workspcae since not in CI';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
let getGlobalPreparationString = (optionsArg) => {
|
|
||||||
if (optionsArg.baseImage !== 'hosttoday/ht-docker-node:npmdocker') {
|
|
||||||
return 'RUN yarn global add npmdocker';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return '# not installing npmdocker since it is included in the base image';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
exports.dockerfileSnippet = (optionsArg) => {
|
|
||||||
return plugins.smartstring.indent.normalize(`
|
|
||||||
FROM ${optionsArg.baseImage}
|
|
||||||
# For info about what npmdocker does read the docs at https://gitzone.github.io/npmdocker
|
|
||||||
${getGlobalPreparationString(optionsArg)}
|
|
||||||
${getMountSolutionString(optionsArg)}
|
|
||||||
WORKDIR /workspace
|
|
||||||
ENV CI=true
|
|
||||||
ENTRYPOINT ["npmdocker"]
|
|
||||||
CMD ["runinside"]
|
|
||||||
`);
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZG9ja2VyLnNuaXBwZXRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnBtZG9ja2VyLnNuaXBwZXRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsK0NBQStDO0FBTy9DLElBQUksc0JBQXNCLEdBQUcsQ0FBQyxVQUE4QixFQUFFLEVBQUU7SUFDOUQsSUFBSSxPQUFPLENBQUMsR0FBRyxDQUFDLEVBQUUsRUFBRTtRQUNsQixPQUFPLG9CQUFvQixDQUFDO0tBQzdCO1NBQU07UUFDTCxPQUFPLHlDQUF5QyxDQUFDO0tBQ2xEO0FBQ0gsQ0FBQyxDQUFDO0FBRUYsSUFBSSwwQkFBMEIsR0FBRyxDQUFDLFVBQThCLEVBQUUsRUFBRTtJQUNsRSxJQUFJLFVBQVUsQ0FBQyxTQUFTLEtBQUssb0NBQW9DLEVBQUU7UUFDakUsT0FBTywrQkFBK0IsQ0FBQztLQUN4QztTQUFNO1FBQ0wsT0FBTyxtRUFBbUUsQ0FBQztLQUM1RTtBQUNILENBQUMsQ0FBQztBQUVTLFFBQUEsaUJBQWlCLEdBQUcsQ0FBQyxVQUE4QixFQUFVLEVBQUU7SUFDeEUsT0FBTyxPQUFPLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxTQUFTLENBQ3pDO09BQ0csVUFBVSxDQUFDLFNBQVM7O0VBRXpCLDBCQUEwQixDQUFDLFVBQVUsQ0FBQztFQUN0QyxzQkFBc0IsQ0FBQyxVQUFVLENBQUM7Ozs7O0NBS25DLENBQ0UsQ0FBQztBQUNKLENBQUMsQ0FBQyJ9
|
|
1660
package-lock.json
generated
Normal file
1660
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
26
package.json
26
package.json
@ -5,17 +5,17 @@
|
|||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
"bin": {
|
"bin": {
|
||||||
"npmdocker": "dist/cli.js"
|
"npmdocker": "cli.js"
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
"test": "test"
|
"test": "test"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(npm run clean && npm run compile && npm run setupCheck && npm run testStandard && npm run testSpeed)",
|
"test": "(npm run clean && npm run setupCheck && npm run testStandard && npm run testSpeed)",
|
||||||
"build": "echo \"no build script required for now\"",
|
"build": "echo \"no build script required for now\"",
|
||||||
"testStandard": "(cd test/ && node ../dist/index.js)",
|
"testStandard": "(cd test/ && node ../cli.ts.js)",
|
||||||
"testSpeed": "(cd test/ && node ../dist/index.js speedtest)",
|
"testSpeed": "(cd test/ && node ../cli.ts.js speedtest)",
|
||||||
"testClean": "(cd test/ && node ../dist/index.js clean --all)",
|
"testClean": "(cd test/ && node ../cli.ts.js clean --all)",
|
||||||
"clean": "(rm -rf test/)",
|
"clean": "(rm -rf test/)",
|
||||||
"compile": "(npmts --notest)",
|
"compile": "(npmts --notest)",
|
||||||
"setupCheck": "(git clone https://gitlab.com/sandboxzone/sandbox-npmts.git test/)"
|
"setupCheck": "(git clone https://gitlab.com/sandboxzone/sandbox-npmts.git test/)"
|
||||||
@ -33,18 +33,20 @@
|
|||||||
"url": "https://gitlab.com/gitzone/npmdocker/issues"
|
"url": "https://gitlab.com/gitzone/npmdocker/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/gitzone/npmdocker#README",
|
"homepage": "https://gitlab.com/gitzone/npmdocker#README",
|
||||||
"devDependencies": {},
|
"devDependencies": {
|
||||||
|
"@gitzone/tsrun": "^1.1.9"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartcli": "^3.0.1",
|
"@pushrocks/smartcli": "^3.0.2",
|
||||||
"@types/shelljs": "0.x.x",
|
"@pushrocks/smartfile": "^6.0.3",
|
||||||
|
"@pushrocks/smartpromise": "^2.0.5",
|
||||||
|
"@pushrocks/smartshell": "^1.0.21",
|
||||||
|
"@types/shelljs": "^0.8.0",
|
||||||
"beautylog": "^6.1.10",
|
"beautylog": "^6.1.10",
|
||||||
"npmextra": "^2.0.9",
|
"npmextra": "^2.0.9",
|
||||||
"projectinfo": "^3.0.4",
|
"projectinfo": "^3.0.4",
|
||||||
"qenv": "^1.1.7",
|
"qenv": "^1.1.7",
|
||||||
"smartanalytics": "^2.0.9",
|
"smartanalytics": "^2.0.9",
|
||||||
"smartfile": "^4.2.26",
|
"smartstring": "^2.0.28"
|
||||||
"smartq": "^1.1.6",
|
|
||||||
"smartshell": "^1.0.18",
|
|
||||||
"smartstring": "^2.0.24"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
20
ts/analytics.ts
Normal file
20
ts/analytics.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* smartanalytics:
|
||||||
|
* We count executions of this tool to keep track which of our tools are really used.
|
||||||
|
* This insight is used to plan spending our limited resources for improving them.
|
||||||
|
* Any submitted analytics data is fully anonymized (no Ips or any other personal information is tracked).
|
||||||
|
* Feel free to dig into the smartanalytics package, if you are interested in how it works.
|
||||||
|
* Our privacy policy can be found here: https://lossless.gmbh/privacy.html
|
||||||
|
* The privacy policy is also linked in the readme, so we hope this behaviour does not come as a surprise to you.
|
||||||
|
* Have a nice day and regards
|
||||||
|
* Your Open Source team at Lossless GmbH :)
|
||||||
|
*/
|
||||||
|
import * as smartanalytics from 'smartanalytics';
|
||||||
|
let npmdockerAnalytics = new smartanalytics.Analytics({
|
||||||
|
apiEndPoint: 'https://pubapi.lossless.one',
|
||||||
|
appName: 'npmdocker',
|
||||||
|
projectId: 'gitzone'
|
||||||
|
});
|
||||||
|
npmdockerAnalytics.recordEvent('npmtoolexecution', {
|
||||||
|
somedata: 'somedata'
|
||||||
|
});
|
@ -1,3 +1,4 @@
|
|||||||
|
import './analytics';
|
||||||
import * as plugins from './npmdocker.plugins';
|
import * as plugins from './npmdocker.plugins';
|
||||||
import * as cli from './npmdocker.cli';
|
import * as cli from './npmdocker.cli';
|
||||||
|
|
||||||
|
@ -5,25 +5,6 @@ import * as paths from './npmdocker.paths';
|
|||||||
import * as ConfigModule from './npmdocker.config';
|
import * as ConfigModule from './npmdocker.config';
|
||||||
import * as DockerModule from './npmdocker.docker';
|
import * as DockerModule from './npmdocker.docker';
|
||||||
|
|
||||||
/**
|
|
||||||
* smartanalytics
|
|
||||||
* this data is fully anonymized (no Ips or any other personal information is tracked).
|
|
||||||
* It just keeps track which of our tools are really used...
|
|
||||||
* ... so we know where to spend our limited resources for improving them.
|
|
||||||
* Since yarn is out and there is heavy caching going on,
|
|
||||||
* pure download stats are just not reliable enough for us anymore
|
|
||||||
* Feel free to dig into the smartanalytics package, if you are interested in how it works.
|
|
||||||
* Our privacy policy can be found here: https://lossless.gmbh/privacy.html
|
|
||||||
*/
|
|
||||||
let npmdockerAnalytics = new plugins.smartanalytics.Analytics({
|
|
||||||
apiEndPoint: 'https://pubapi.lossless.one',
|
|
||||||
appName: 'npmdocker',
|
|
||||||
projectId: 'gitzone'
|
|
||||||
});
|
|
||||||
npmdockerAnalytics.recordEvent('npmtoolexecution', {
|
|
||||||
somedata: 'somedata'
|
|
||||||
});
|
|
||||||
|
|
||||||
let npmdockerCli = new plugins.smartcli.Smartcli();
|
let npmdockerCli = new plugins.smartcli.Smartcli();
|
||||||
|
|
||||||
export let run = () => {
|
export let run = () => {
|
||||||
|
@ -2,12 +2,11 @@ import * as beautylog from 'beautylog';
|
|||||||
import * as npmextra from 'npmextra';
|
import * as npmextra from 'npmextra';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as projectinfo from 'projectinfo';
|
import * as projectinfo from 'projectinfo';
|
||||||
import * as q from 'smartq';
|
import * as q from '@pushrocks/smartpromise';
|
||||||
import * as qenv from 'qenv';
|
import * as qenv from 'qenv';
|
||||||
import * as smartanalytics from 'smartanalytics';
|
|
||||||
import * as smartcli from '@pushrocks/smartcli';
|
import * as smartcli from '@pushrocks/smartcli';
|
||||||
import * as smartfile from 'smartfile';
|
import * as smartfile from '@pushrocks/smartfile';
|
||||||
import * as smartshell from 'smartshell';
|
import * as smartshell from '@pushrocks/smartshell';
|
||||||
import * as smartstring from 'smartstring';
|
import * as smartstring from 'smartstring';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
@ -17,7 +16,6 @@ export {
|
|||||||
projectinfo,
|
projectinfo,
|
||||||
q,
|
q,
|
||||||
qenv,
|
qenv,
|
||||||
smartanalytics,
|
|
||||||
smartcli,
|
smartcli,
|
||||||
smartfile,
|
smartfile,
|
||||||
smartshell,
|
smartshell,
|
||||||
|
@ -15,7 +15,7 @@ let getMountSolutionString = (optionsArg: IDockerfileSnippet) => {
|
|||||||
|
|
||||||
let getGlobalPreparationString = (optionsArg: IDockerfileSnippet) => {
|
let getGlobalPreparationString = (optionsArg: IDockerfileSnippet) => {
|
||||||
if (optionsArg.baseImage !== 'hosttoday/ht-docker-node:npmdocker') {
|
if (optionsArg.baseImage !== 'hosttoday/ht-docker-node:npmdocker') {
|
||||||
return 'RUN yarn global add npmdocker';
|
return 'RUN npm install -g npmdocker';
|
||||||
} else {
|
} else {
|
||||||
return '# not installing npmdocker since it is included in the base image';
|
return '# not installing npmdocker since it is included in the base image';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user