Skip to content

Commit

Permalink
chore(deps): update dependency tsbb to v4 #26
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Apr 5, 2023
1 parent 92d27f0 commit 7f07818
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 18 deletions.
23 changes: 17 additions & 6 deletions dist/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -2446,6 +2446,10 @@ function checkBypass(reqUrl) {
if (!reqUrl.hostname) {
return false;
}
var reqHost = reqUrl.hostname;
if (isLoopbackAddress(reqHost)) {
return true;
}
var noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
if (!noProxy) {
return false;
Expand Down Expand Up @@ -2474,8 +2478,8 @@ function checkBypass(reqUrl) {
try {
var _loop = function _loop() {
var upperNoProxyItem = _step.value;
if (upperReqHosts.some(function (x) {
return x === upperNoProxyItem;
if (upperNoProxyItem === '*' || upperReqHosts.some(function (x) {
return x === upperNoProxyItem || x.endsWith(".".concat(upperNoProxyItem)) || upperNoProxyItem.startsWith('.') && x.endsWith("".concat(upperNoProxyItem));
})) {
return {
v: true
Expand All @@ -2494,6 +2498,10 @@ function checkBypass(reqUrl) {
return false;
}
exports.checkBypass = checkBypass;
function isLoopbackAddress(host) {
var hostLower = host.toLowerCase();
return hostLower === 'localhost' || hostLower.startsWith('127.') || hostLower.startsWith('[::1]') || hostLower.startsWith('[0:0:0:0:0:0:0:1]');
}

/***/ }),

Expand Down Expand Up @@ -3839,7 +3847,8 @@ function rename(src, dest, overwrite) {
function moveAcrossDevice(src, dest, overwrite) {
var opts = {
overwrite: overwrite,
errorOnExist: true
errorOnExist: true,
preserveTimestamps: true
};
copySync(src, dest, opts);
return removeSync(src);
Expand Down Expand Up @@ -3912,7 +3921,8 @@ function rename(src, dest, overwrite, cb) {
function moveAcrossDevice(src, dest, overwrite, cb) {
var opts = {
overwrite: overwrite,
errorOnExist: true
errorOnExist: true,
preserveTimestamps: true
};
copy(src, dest, opts, function (err) {
if (err) return cb(err);
Expand Down Expand Up @@ -4813,7 +4823,7 @@ function patch(fs) {
var start = Date.now();
var backoff = 0;
fs$rename(from, to, function CB(er) {
if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 60000) {
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 60000) {
setTimeout(function () {
fs.stat(to, function (stater, st) {
if (stater && stater.code === "ENOENT") fs$rename(from, to, CB);else cb(er);
Expand Down Expand Up @@ -6882,7 +6892,7 @@ module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.expo
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"name":"coverage-badges-cli","version":"1.0.12","description":"Create coverage badges from coverage reports. Using GitHub Actions and GitHub Workflow CPU time (no 3rd parties servers).","homepage":"https://jaywcjlove.github.io/coverage-badges-cli/","license":"MIT","bin":{"coverage-badges":"bin/cli","coverage-badges-cli":"bin/cli"},"scripts":{"prepare":"husky install && npm run package","package":"ncc build src/action.ts","make-badges":"node bin/cli","watch":"tsbb watch --disable-babel","build":"tsbb build --disable-babel","test":"tsbb test","coverage":"tsbb test --coverage"},"files":["bin","lib","src"],"repository":{"type":"git","url":"https://github.com/jaywcjlove/coverage-badges-cli"},"keywords":["coverage","coverage-badges","coverage-badges-cli","badges"],"jest":{"coverageReporters":["lcov","json-summary"]},"lint-staged":{"*.ts?(x)":["npm run package"]},"dependencies":{"@types/fs-extra":"~11.0.0","@types/minimist":"~1.2.2","badgen":"~3.2.2","fs-extra":"~11.1.0","mini-svg-data-uri":"^1.4.4","minimist":"~1.2.5"},"devDependencies":{"@actions/core":"~1.10.0","@kkt/ncc":"~1.0.9","husky":"~8.0.0","lint-staged":"~13.1.0","tsbb":"~3.7.0"}}');
module.exports = JSON.parse('{"name":"coverage-badges-cli","version":"1.1.0","description":"Create coverage badges from coverage reports. Using GitHub Actions and GitHub Workflow CPU time (no 3rd parties servers).","homepage":"https://jaywcjlove.github.io/coverage-badges-cli/","license":"MIT","bin":{"coverage-badges":"bin/cli","coverage-badges-cli":"bin/cli"},"scripts":{"prepare":"husky install && npm run package","package":"ncc build src/action.ts","make-badges":"node bin/cli","watch":"tsbb watch","build":"tsbb build","test":"tsbb test","coverage":"tsbb test --coverage"},"files":["bin","lib","src"],"repository":{"type":"git","url":"https://github.com/jaywcjlove/coverage-badges-cli"},"keywords":["coverage","coverage-badges","coverage-badges-cli","badges"],"jest":{"coverageReporters":["lcov","json-summary"]},"lint-staged":{"*.ts?(x)":["npm run package"]},"dependencies":{"@types/fs-extra":"~11.0.0","@types/minimist":"~1.2.2","badgen":"~3.2.2","fs-extra":"~11.1.0","mini-svg-data-uri":"^1.4.4","minimist":"~1.2.5"},"devDependencies":{"@actions/core":"^1.10.0","@kkt/ncc":"^1.0.15","husky":"^8.0.3","lint-staged":"^13.2.0","tsbb":"^4.1.3"}}');

/***/ })

Expand Down Expand Up @@ -7322,6 +7332,7 @@ var external_fs_ = __webpack_require__(7147);
var mini_svg_data_uri = __webpack_require__(5827);
var mini_svg_data_uri_default = /*#__PURE__*/__webpack_require__.n(mini_svg_data_uri);
;// CONCATENATED MODULE: ./src/badges.ts
// Copied from `badgen` because it's not exported
var getIconString=function getIconString(path){return (0,external_fs_.readFileSync)(path,'utf8');};function badge(option,summary){var _ref=option||{},_ref$label=_ref.label,label=_ref$label===void 0?'coverage':_ref$label,_ref$style=_ref.style,style=_ref$style===void 0?'classic':_ref$style,_ref$type=_ref.type,type=_ref$type===void 0?'statements':_ref$type;var total=summary.total;if(typeof total[type].pct!=='number'){total[type].pct=-1;}var pct=total[type].pct;var colorData={'#49c31a':[100],'#97c40f':[99.99,90],'#a0a127':[89.99,80],'#cba317':[79.99,60],'#ce0000':[59.99,0]};var color=Object.keys(colorData).find(function(value,idx){if(colorData[value].length===1&&pct>=colorData[value][0]){return true;}if(colorData[value].length===2&&pct<=colorData[value][0]&&pct>=colorData[value][1]){return true;}return false;});var badgenArgs={style:style,label:label,status:"".concat(pct<0?'Unknown':"".concat(pct,"%")),color:(color||'e5e5e5').replace(/^#/,'')};if(option.icon){var svgString=getIconString(option.icon);var svgDataUri=mini_svg_data_uri_default()(svgString);badgenArgs.icon=svgDataUri;}return (0,dist.badgen)(badgenArgs);}
;// CONCATENATED MODULE: ./src/action.ts
;_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _require,version,output,source,label,style,sourceData,svgStr;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;_require=__webpack_require__(4147),version=_require.version;(0,core.info)("coverage-badges-cli v\x1B[32;1m".concat(version,"\x1B[0m"));output=external_path_default().resolve(process.cwd(),(0,core.getInput)('output')||'coverage/badges.svg');source=external_path_default().resolve(process.cwd(),(0,core.getInput)('source')||'coverage/coverage-summary.json');label=(0,core.getInput)('label')||'coverage';style=(0,core.getInput)('style')||'classic';lib_default().ensureDirSync(external_path_default().dirname(output));if(lib_default().existsSync(source)){_context.next=11;break;}(0,core.setFailed)("File \x1B[31m".concat(source,"\x1B[0m does not exist.\n please specify the file directory\n\x1B[35mnpm\x1B[0m coverage-badges-cli \x1B[33m--source\x1B[0m coverage/coverage-summary.json"));return _context.abrupt("return");case 11:(0,core.info)("Source Path: \x1B[32;1m".concat(source,"\x1B[0m"));(0,core.info)("Output Path: \x1B[32;1m".concat(output,"\x1B[0m"));sourceData=lib_default().readJSONSync(source);(0,core.startGroup)("Source Path: \x1B[32;1m".concat(source,"\x1B[0m"));(0,core.info)("".concat(JSON.stringify(sourceData,null,2)));(0,core.endGroup)();svgStr=badge({label:label,style:style},sourceData);(0,core.setOutput)('svg',svgStr);(0,core.startGroup)("SVG String: \x1B[32;1m".concat(output,"\x1B[0m"));(0,core.info)("".concat(svgStr));(0,core.endGroup)();lib_default().writeFileSync(output,svgStr);(0,core.info)("\nCreate Coverage Badges: \x1B[32;1m".concat(external_path_default().relative(process.cwd(),output),"\x1B[0m\n"));_context.next=29;break;case 26:_context.prev=26;_context.t0=_context["catch"](0);(0,core.setFailed)(_context.t0.message);case 29:case"end":return _context.stop();}},_callee,null,[[0,26]]);}))();
Expand Down
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "coverage-badges-cli",
"version": "1.1.0",
"version": "1.1.1",
"description": "Create coverage badges from coverage reports. Using GitHub Actions and GitHub Workflow CPU time (no 3rd parties servers).",
"homepage": "https://jaywcjlove.github.io/coverage-badges-cli/",
"license": "MIT",
Expand All @@ -12,8 +12,8 @@
"prepare": "husky install && npm run package",
"package": "ncc build src/action.ts",
"make-badges": "node bin/cli",
"watch": "tsbb watch --disable-babel",
"build": "tsbb build --disable-babel",
"watch": "tsbb watch",
"build": "tsbb build",
"test": "tsbb test",
"coverage": "tsbb test --coverage"
},
Expand All @@ -38,6 +38,9 @@
"json-summary"
]
},
"engines": {
"node": ">=16.0.0"
},
"lint-staged": {
"*.ts?(x)": [
"npm run package"
Expand All @@ -52,10 +55,10 @@
"minimist": "~1.2.5"
},
"devDependencies": {
"@actions/core": "~1.10.0",
"@kkt/ncc": "~1.0.9",
"husky": "~8.0.0",
"lint-staged": "~13.1.0",
"tsbb": "~3.7.0"
"@actions/core": "^1.10.0",
"@kkt/ncc": "^1.0.15",
"husky": "^8.0.3",
"lint-staged": "^13.2.0",
"tsbb": "^4.1.3"
}
}
2 changes: 1 addition & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { Summary } from './create';
info(`${JSON.stringify(sourceData, null, 2)}`);
endGroup();

const svgStr = badge({ label, style }, sourceData);
const svgStr = badge({ label, style } as BadgeOption, sourceData);

setOutput('svg', svgStr);

Expand Down
4 changes: 2 additions & 2 deletions src/create.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs-extra';
import path from 'path';
import { RunArgvs } from '.';
import { badge } from './badges';
import { badge, BadgenOptions } from './badges';

export type SummaryTotal = {
total: number;
Expand Down Expand Up @@ -33,7 +33,7 @@ export function create(argvs: RunArgvs) {
return;
}
const source: Summary = require(sourcePath);
const svgStr = badge(argvs, source);
const svgStr = badge(argvs as BadgenOptions, source);
fs.ensureDirSync(path.dirname(svgPath));
fs.writeFileSync(svgPath, svgStr);
console.log(`\nCoverage Badges: \x1b[32;1m${path.relative(process.cwd(), svgPath)}\x1b[0m\n`);
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import minimist, { ParsedArgs } from 'minimist';
import { create } from './create';
import { BadgeOption } from './badges';

export interface RunArgvs extends ParsedArgs, BadgeOption {
export interface RunArgvs extends ParsedArgs, Partial<BadgeOption> {
source?: string;
version?: string;
output?: string;
Expand Down

0 comments on commit 7f07818

Please sign in to comment.