@catladder/cli 0.0.0-main-fdec7ec6 → 0.0.0-main-ecee5eea
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundles/catenv/index.js +1 -1
- package/dist/bundles/cli/index.js +2 -264
- package/dist/cli.js +0 -5
- package/dist/cli.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -4
- package/src/cli.ts +0 -5
- package/dist/bundles/cli/check.js +0 -28
|
@@ -39822,7 +39822,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
39822
39822
|
|
|
39823
39823
|
exports.__esModule = true;
|
|
39824
39824
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
39825
|
-
exports.PIPELINE_IMAGE_TAG = "main-
|
|
39825
|
+
exports.PIPELINE_IMAGE_TAG = "main-ecee5eea" || 0;
|
|
39826
39826
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
39827
39827
|
|
|
39828
39828
|
/***/ }),
|
|
@@ -5681,12 +5681,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5681
5681
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5682
5682
|
};
|
|
5683
5683
|
exports.__esModule = true;
|
|
5684
|
-
var update_notifier_1 = __importDefault(__nccwpck_require__(94651));
|
|
5685
5684
|
var cli_1 = __importDefault(__nccwpck_require__(93340));
|
|
5686
|
-
var packageInfos_1 = __importDefault(__nccwpck_require__(71628));
|
|
5687
|
-
(0, update_notifier_1["default"])({
|
|
5688
|
-
pkg: packageInfos_1["default"]
|
|
5689
|
-
}).notify();
|
|
5690
5685
|
(0, cli_1["default"])();
|
|
5691
5686
|
//# sourceMappingURL=cli.js.map
|
|
5692
5687
|
|
|
@@ -162913,67 +162908,6 @@ module.exports = function(stream_module) {
|
|
|
162913
162908
|
};
|
|
162914
162909
|
|
|
162915
162910
|
|
|
162916
|
-
/***/ }),
|
|
162917
|
-
|
|
162918
|
-
/***/ 74698:
|
|
162919
|
-
/***/ ((module) => {
|
|
162920
|
-
|
|
162921
|
-
"use strict";
|
|
162922
|
-
|
|
162923
|
-
const lazy = (mod, fn, id) => mod === undefined ? fn(id) : mod;
|
|
162924
|
-
|
|
162925
|
-
module.exports = fn => {
|
|
162926
|
-
return id => {
|
|
162927
|
-
let mod;
|
|
162928
|
-
|
|
162929
|
-
return function () {
|
|
162930
|
-
if (arguments.length === 0) {
|
|
162931
|
-
mod = lazy(mod, fn, id);
|
|
162932
|
-
return mod;
|
|
162933
|
-
}
|
|
162934
|
-
|
|
162935
|
-
const ret = {};
|
|
162936
|
-
|
|
162937
|
-
[].forEach.call(arguments, prop => {
|
|
162938
|
-
Object.defineProperty(ret, prop, {
|
|
162939
|
-
get: () => {
|
|
162940
|
-
mod = lazy(mod, fn, id);
|
|
162941
|
-
if (typeof mod[prop] === 'function') {
|
|
162942
|
-
return function () {
|
|
162943
|
-
return mod[prop].apply(mod, arguments);
|
|
162944
|
-
};
|
|
162945
|
-
}
|
|
162946
|
-
|
|
162947
|
-
return mod[prop];
|
|
162948
|
-
}
|
|
162949
|
-
});
|
|
162950
|
-
});
|
|
162951
|
-
|
|
162952
|
-
return ret;
|
|
162953
|
-
};
|
|
162954
|
-
};
|
|
162955
|
-
};
|
|
162956
|
-
|
|
162957
|
-
module.exports.proxy = fn => {
|
|
162958
|
-
return id => {
|
|
162959
|
-
let mod;
|
|
162960
|
-
|
|
162961
|
-
const handler = {
|
|
162962
|
-
get: (target, property) => {
|
|
162963
|
-
mod = lazy(mod, fn, id);
|
|
162964
|
-
return Reflect.get(mod, property);
|
|
162965
|
-
},
|
|
162966
|
-
apply: (target, thisArg, argumentsList) => {
|
|
162967
|
-
mod = lazy(mod, fn, id);
|
|
162968
|
-
return Reflect.apply(mod, thisArg, argumentsList);
|
|
162969
|
-
}
|
|
162970
|
-
};
|
|
162971
|
-
|
|
162972
|
-
return new Proxy(() => {}, handler);
|
|
162973
|
-
};
|
|
162974
|
-
};
|
|
162975
|
-
|
|
162976
|
-
|
|
162977
162911
|
/***/ }),
|
|
162978
162912
|
|
|
162979
162913
|
/***/ 39083:
|
|
@@ -337420,202 +337354,6 @@ exports.p = function (fn) {
|
|
|
337420
337354
|
}
|
|
337421
337355
|
|
|
337422
337356
|
|
|
337423
|
-
/***/ }),
|
|
337424
|
-
|
|
337425
|
-
/***/ 94651:
|
|
337426
|
-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
337427
|
-
|
|
337428
|
-
"use strict";
|
|
337429
|
-
|
|
337430
|
-
const {spawn} = __nccwpck_require__(32081);
|
|
337431
|
-
const path = __nccwpck_require__(71017);
|
|
337432
|
-
const {format} = __nccwpck_require__(73837);
|
|
337433
|
-
const importLazy = __nccwpck_require__(74698)(require);
|
|
337434
|
-
|
|
337435
|
-
const configstore = importLazy('configstore');
|
|
337436
|
-
const chalk = importLazy('chalk');
|
|
337437
|
-
const semver = importLazy('semver');
|
|
337438
|
-
const semverDiff = importLazy('semver-diff');
|
|
337439
|
-
const latestVersion = importLazy('latest-version');
|
|
337440
|
-
const isNpm = importLazy('is-npm');
|
|
337441
|
-
const isInstalledGlobally = importLazy('is-installed-globally');
|
|
337442
|
-
const isYarnGlobal = importLazy('is-yarn-global');
|
|
337443
|
-
const hasYarn = importLazy('has-yarn');
|
|
337444
|
-
const boxen = importLazy('boxen');
|
|
337445
|
-
const xdgBasedir = importLazy('xdg-basedir');
|
|
337446
|
-
const isCi = importLazy('is-ci');
|
|
337447
|
-
const pupa = importLazy('pupa');
|
|
337448
|
-
|
|
337449
|
-
const ONE_DAY = 1000 * 60 * 60 * 24;
|
|
337450
|
-
|
|
337451
|
-
class UpdateNotifier {
|
|
337452
|
-
constructor(options = {}) {
|
|
337453
|
-
this.options = options;
|
|
337454
|
-
options.pkg = options.pkg || {};
|
|
337455
|
-
options.distTag = options.distTag || 'latest';
|
|
337456
|
-
|
|
337457
|
-
// Reduce pkg to the essential keys. with fallback to deprecated options
|
|
337458
|
-
// TODO: Remove deprecated options at some point far into the future
|
|
337459
|
-
options.pkg = {
|
|
337460
|
-
name: options.pkg.name || options.packageName,
|
|
337461
|
-
version: options.pkg.version || options.packageVersion
|
|
337462
|
-
};
|
|
337463
|
-
|
|
337464
|
-
if (!options.pkg.name || !options.pkg.version) {
|
|
337465
|
-
throw new Error('pkg.name and pkg.version required');
|
|
337466
|
-
}
|
|
337467
|
-
|
|
337468
|
-
this.packageName = options.pkg.name;
|
|
337469
|
-
this.packageVersion = options.pkg.version;
|
|
337470
|
-
this.updateCheckInterval = typeof options.updateCheckInterval === 'number' ? options.updateCheckInterval : ONE_DAY;
|
|
337471
|
-
this.disabled = 'NO_UPDATE_NOTIFIER' in process.env ||
|
|
337472
|
-
process.env.NODE_ENV === 'test' ||
|
|
337473
|
-
process.argv.includes('--no-update-notifier') ||
|
|
337474
|
-
isCi();
|
|
337475
|
-
this.shouldNotifyInNpmScript = options.shouldNotifyInNpmScript;
|
|
337476
|
-
|
|
337477
|
-
if (!this.disabled) {
|
|
337478
|
-
try {
|
|
337479
|
-
const ConfigStore = configstore();
|
|
337480
|
-
this.config = new ConfigStore(`update-notifier-${this.packageName}`, {
|
|
337481
|
-
optOut: false,
|
|
337482
|
-
// Init with the current time so the first check is only
|
|
337483
|
-
// after the set interval, so not to bother users right away
|
|
337484
|
-
lastUpdateCheck: Date.now()
|
|
337485
|
-
});
|
|
337486
|
-
} catch {
|
|
337487
|
-
// Expecting error code EACCES or EPERM
|
|
337488
|
-
const message =
|
|
337489
|
-
chalk().yellow(format(' %s update check failed ', options.pkg.name)) +
|
|
337490
|
-
format('\n Try running with %s or get access ', chalk().cyan('sudo')) +
|
|
337491
|
-
'\n to the local update config store via \n' +
|
|
337492
|
-
chalk().cyan(format(' sudo chown -R $USER:$(id -gn $USER) %s ', xdgBasedir().config));
|
|
337493
|
-
|
|
337494
|
-
process.on('exit', () => {
|
|
337495
|
-
console.error(boxen()(message, {align: 'center'}));
|
|
337496
|
-
});
|
|
337497
|
-
}
|
|
337498
|
-
}
|
|
337499
|
-
}
|
|
337500
|
-
|
|
337501
|
-
check() {
|
|
337502
|
-
if (
|
|
337503
|
-
!this.config ||
|
|
337504
|
-
this.config.get('optOut') ||
|
|
337505
|
-
this.disabled
|
|
337506
|
-
) {
|
|
337507
|
-
return;
|
|
337508
|
-
}
|
|
337509
|
-
|
|
337510
|
-
this.update = this.config.get('update');
|
|
337511
|
-
|
|
337512
|
-
if (this.update) {
|
|
337513
|
-
// Use the real latest version instead of the cached one
|
|
337514
|
-
this.update.current = this.packageVersion;
|
|
337515
|
-
|
|
337516
|
-
// Clear cached information
|
|
337517
|
-
this.config.delete('update');
|
|
337518
|
-
}
|
|
337519
|
-
|
|
337520
|
-
// Only check for updates on a set interval
|
|
337521
|
-
if (Date.now() - this.config.get('lastUpdateCheck') < this.updateCheckInterval) {
|
|
337522
|
-
return;
|
|
337523
|
-
}
|
|
337524
|
-
|
|
337525
|
-
// Spawn a detached process, passing the options as an environment property
|
|
337526
|
-
spawn(process.execPath, [__nccwpck_require__.ab + "check.js", JSON.stringify(this.options)], {
|
|
337527
|
-
detached: true,
|
|
337528
|
-
stdio: 'ignore'
|
|
337529
|
-
}).unref();
|
|
337530
|
-
}
|
|
337531
|
-
|
|
337532
|
-
async fetchInfo() {
|
|
337533
|
-
const {distTag} = this.options;
|
|
337534
|
-
const latest = await latestVersion()(this.packageName, {version: distTag});
|
|
337535
|
-
|
|
337536
|
-
return {
|
|
337537
|
-
latest,
|
|
337538
|
-
current: this.packageVersion,
|
|
337539
|
-
type: semverDiff()(this.packageVersion, latest) || distTag,
|
|
337540
|
-
name: this.packageName
|
|
337541
|
-
};
|
|
337542
|
-
}
|
|
337543
|
-
|
|
337544
|
-
notify(options) {
|
|
337545
|
-
const suppressForNpm = !this.shouldNotifyInNpmScript && isNpm().isNpmOrYarn;
|
|
337546
|
-
if (!process.stdout.isTTY || suppressForNpm || !this.update || !semver().gt(this.update.latest, this.update.current)) {
|
|
337547
|
-
return this;
|
|
337548
|
-
}
|
|
337549
|
-
|
|
337550
|
-
options = {
|
|
337551
|
-
isGlobal: isInstalledGlobally(),
|
|
337552
|
-
isYarnGlobal: isYarnGlobal()(),
|
|
337553
|
-
...options
|
|
337554
|
-
};
|
|
337555
|
-
|
|
337556
|
-
let installCommand;
|
|
337557
|
-
if (options.isYarnGlobal) {
|
|
337558
|
-
installCommand = `yarn global add ${this.packageName}`;
|
|
337559
|
-
} else if (options.isGlobal) {
|
|
337560
|
-
installCommand = `npm i -g ${this.packageName}`;
|
|
337561
|
-
} else if (hasYarn()()) {
|
|
337562
|
-
installCommand = `yarn add ${this.packageName}`;
|
|
337563
|
-
} else {
|
|
337564
|
-
installCommand = `npm i ${this.packageName}`;
|
|
337565
|
-
}
|
|
337566
|
-
|
|
337567
|
-
const defaultTemplate = 'Update available ' +
|
|
337568
|
-
chalk().dim('{currentVersion}') +
|
|
337569
|
-
chalk().reset(' → ') +
|
|
337570
|
-
chalk().green('{latestVersion}') +
|
|
337571
|
-
' \nRun ' + chalk().cyan('{updateCommand}') + ' to update';
|
|
337572
|
-
|
|
337573
|
-
const template = options.message || defaultTemplate;
|
|
337574
|
-
|
|
337575
|
-
options.boxenOptions = options.boxenOptions || {
|
|
337576
|
-
padding: 1,
|
|
337577
|
-
margin: 1,
|
|
337578
|
-
align: 'center',
|
|
337579
|
-
borderColor: 'yellow',
|
|
337580
|
-
borderStyle: 'round'
|
|
337581
|
-
};
|
|
337582
|
-
|
|
337583
|
-
const message = boxen()(
|
|
337584
|
-
pupa()(template, {
|
|
337585
|
-
packageName: this.packageName,
|
|
337586
|
-
currentVersion: this.update.current,
|
|
337587
|
-
latestVersion: this.update.latest,
|
|
337588
|
-
updateCommand: installCommand
|
|
337589
|
-
}),
|
|
337590
|
-
options.boxenOptions
|
|
337591
|
-
);
|
|
337592
|
-
|
|
337593
|
-
if (options.defer === false) {
|
|
337594
|
-
console.error(message);
|
|
337595
|
-
} else {
|
|
337596
|
-
process.on('exit', () => {
|
|
337597
|
-
console.error(message);
|
|
337598
|
-
});
|
|
337599
|
-
|
|
337600
|
-
process.on('SIGINT', () => {
|
|
337601
|
-
console.error('');
|
|
337602
|
-
process.exit();
|
|
337603
|
-
});
|
|
337604
|
-
}
|
|
337605
|
-
|
|
337606
|
-
return this;
|
|
337607
|
-
}
|
|
337608
|
-
}
|
|
337609
|
-
|
|
337610
|
-
module.exports = options => {
|
|
337611
|
-
const updateNotifier = new UpdateNotifier(options);
|
|
337612
|
-
updateNotifier.check();
|
|
337613
|
-
return updateNotifier;
|
|
337614
|
-
};
|
|
337615
|
-
|
|
337616
|
-
module.exports.UpdateNotifier = UpdateNotifier;
|
|
337617
|
-
|
|
337618
|
-
|
|
337619
337357
|
/***/ }),
|
|
337620
337358
|
|
|
337621
337359
|
/***/ 75264:
|
|
@@ -350854,7 +350592,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
350854
350592
|
|
|
350855
350593
|
exports.__esModule = true;
|
|
350856
350594
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
350857
|
-
exports.PIPELINE_IMAGE_TAG = "main-
|
|
350595
|
+
exports.PIPELINE_IMAGE_TAG = "main-ecee5eea" || 0;
|
|
350858
350596
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
350859
350597
|
|
|
350860
350598
|
/***/ }),
|
|
@@ -357094,7 +356832,7 @@ module.exports = underscoreNodeF._;
|
|
|
357094
356832
|
/***/ ((module) => {
|
|
357095
356833
|
|
|
357096
356834
|
"use strict";
|
|
357097
|
-
module.exports = JSON.parse('{"name":"@catladder/cli","author":"Marco Wettstein <maw@panter.ch>","homepage":"https://git.panter.ch/catladder/catladder/#readme","bugs":"https://git.panter.ch/catladder/catladder/issues","license":"MIT","scripts":{"lint":"eslint \\"src/**/*.ts\\"","lint:fix":"eslint \\"src/**/*.ts\\" --fix","test":"yarn run lint","build":"yarn build:compile && yarn build:bundle","build:bundle":"./scripts/bundle","build:compile":"yarn tsc","build:watch":"yarn tsc -w"},"bin":{"catenv":"./bin/catenv","catladder":"./bin/catladder"},"dependencies":{"ts-node":"^10.9.1"},"engines":{"node":">=12.0.0"},"devDependencies":{"@catladder/pipeline":"0.0.0","@kubernetes/client-node":"^0.16.2","@tsconfig/node14":"^1.0.1","@types/common-tags":"^1.8.0","@types/fs-extra":"^5.0.4","@types/js-yaml":"^4.0.5","@types/lodash":"^4.14.185","@types/memoizee":"^0.4.2","@types/node-fetch":"^2.1.4","@types/request":"^2.48.1","@types/tmp":"^0.2.3","@types/update-notifier":"^2.5.0","@types/vorpal":"^1.12.0","@types/websocket":"^0.0.40","@types/yargs":"^13.0.0","child-process-promise":"^2.2.1","clipboardy":"^2.0.0","command-exists-promise":"^2.0.2","common-tags":"^1.8.0","dayjs":"^1.10.4","eslint":"^8.7.0","fs-extra":"^7.0.1","gitlab":"^4.4.1","
|
|
356835
|
+
module.exports = JSON.parse('{"name":"@catladder/cli","author":"Marco Wettstein <maw@panter.ch>","homepage":"https://git.panter.ch/catladder/catladder/#readme","bugs":"https://git.panter.ch/catladder/catladder/issues","license":"MIT","scripts":{"lint":"eslint \\"src/**/*.ts\\"","lint:fix":"eslint \\"src/**/*.ts\\" --fix","test":"yarn run lint","build":"yarn build:compile && yarn build:bundle","build:bundle":"./scripts/bundle","build:compile":"yarn tsc","build:watch":"yarn tsc -w"},"bin":{"catenv":"./bin/catenv","catladder":"./bin/catladder"},"dependencies":{"ts-node":"^10.9.1"},"engines":{"node":">=12.0.0"},"devDependencies":{"@catladder/pipeline":"0.0.0","@kubernetes/client-node":"^0.16.2","@tsconfig/node14":"^1.0.1","@types/common-tags":"^1.8.0","@types/fs-extra":"^5.0.4","@types/js-yaml":"^4.0.5","@types/lodash":"^4.14.185","@types/memoizee":"^0.4.2","@types/node-fetch":"^2.1.4","@types/request":"^2.48.1","@types/tmp":"^0.2.3","@types/update-notifier":"^2.5.0","@types/vorpal":"^1.12.0","@types/websocket":"^0.0.40","@types/yargs":"^13.0.0","child-process-promise":"^2.2.1","clipboardy":"^2.0.0","command-exists-promise":"^2.0.2","common-tags":"^1.8.0","dayjs":"^1.10.4","eslint":"^8.7.0","fs-extra":"^7.0.1","gitlab":"^4.4.1","js-yaml":"^4.1.0","lodash":"^4.17.21","memoizee":"^0.4.14","node-fetch":"^2.3.0","open":"^8.4.0","prettier":"^2.5.1","tmp-promise":"^2.0.2","typescript":"^4.5.4","vorpal":"^1.12.0"},"version":"0.0.0"}');
|
|
357098
356836
|
|
|
357099
356837
|
/***/ }),
|
|
357100
356838
|
|
package/dist/cli.js
CHANGED
|
@@ -3,11 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
var update_notifier_1 = __importDefault(require("update-notifier"));
|
|
7
6
|
var cli_1 = __importDefault(require("./apps/cli/cli"));
|
|
8
|
-
var packageInfos_1 = __importDefault(require("./packageInfos"));
|
|
9
|
-
(0, update_notifier_1["default"])({
|
|
10
|
-
pkg: packageInfos_1["default"]
|
|
11
|
-
}).notify();
|
|
12
7
|
(0, cli_1["default"])();
|
|
13
8
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;AAAA,uDAAiC;AAEjC,IAAA,gBAAG,GAAE,CAAC"}
|