Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tapjs/config

Package Overview
Dependencies
Maintainers
2
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tapjs/config - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

1

dist/commonjs/index.d.ts

@@ -309,2 +309,3 @@ /**

readPackageJsonConfig(pj: string): Promise<OptionsResults<C> | undefined>;
resolvePathOptions(conf: OptionsResults<C> | undefined, file: string): OptionsResults<C> | undefined;
/**

@@ -311,0 +312,0 @@ * Read the configuration from a dependency

29

dist/commonjs/index.js

@@ -173,3 +173,4 @@ "use strict";

try {
return (0, tap_yaml_1.parse)(await (0, promises_1.readFile)(rc, 'utf8'));
const p = (0, tap_yaml_1.parse)(await (0, promises_1.readFile)(rc, 'utf8'));
return this.resolvePathOptions(typeof p === 'string' ? { extends: p } : p, rc);
}

@@ -189,3 +190,6 @@ catch (er) {

if (res && typeof res === 'object' && !Array.isArray(res)) {
return res;
const r = res;
if (typeof r.tap === 'string')
r.tap = { extends: r.tap };
return r;
}

@@ -203,4 +207,15 @@ }

async readPackageJsonConfig(pj) {
return (await this.readPackageJson(pj))?.tap;
return this.resolvePathOptions((await this.readPackageJson(pj))?.tap, pj);
}
resolvePathOptions(conf, file) {
if (conf) {
for (const p of pathOptions) {
const pc = conf[p];
if (typeof pc === 'string') {
Object.assign(conf, { [p]: (0, path_1.resolve)((0, path_1.dirname)(file), pc) });
}
}
}
return conf;
}
/**

@@ -288,10 +303,2 @@ * Read the configuration from a dependency

const { extends: ext, ...rest } = data;
// root the glob and path type options
// if we pick up one of them, lose any others from other root dirs
const dir = (0, path_1.dirname)(resolved);
for (const k of pathOptions) {
if (typeof rest[k] === 'string') {
rest[k] = (0, path_1.resolve)(dir, rest[k]);
}
}
try {

@@ -298,0 +305,0 @@ this.jack.setConfigValues(rest, resolved);

@@ -38,2 +38,9 @@ /**

}> & import("jackspeak").ConfigSetFromMetaSet<"boolean", false, {
browser: {
description: string;
default: true;
};
'no-browser': {
description: string;
};
'show-full-coverage': {

@@ -78,2 +85,5 @@ description: string;

};
'fail-only': {
description: string;
};
color: {

@@ -80,0 +90,0 @@ short: string;

@@ -317,2 +317,15 @@ "use strict";

.flag({
browser: {
description: `Open the coverage report in the system's web browser when
an html report is generated (ie, when \`--coverage-report\`
is either \`lcov\` or \`html\`).
If set to false, then the html files will be generated, but
not opened in a web browser automatically.`,
default: true,
},
'no-browser': {
description: `Do not automatically open html coverage reports in the
system default web browser`,
},
'show-full-coverage': {

@@ -438,2 +451,9 @@ description: `Show the \`100\` lines in the default \`text\` coverage

},
'fail-only': {
description: `Fail any tests marked with \`{only: true }\`, for CI and
other environments where you want to ensure that tests are
not being skipped.
Only relevant when the @tapjs/filter plugin is enabled.`,
},
color: {

@@ -440,0 +460,0 @@ short: 'c',

@@ -309,2 +309,3 @@ /**

readPackageJsonConfig(pj: string): Promise<OptionsResults<C> | undefined>;
resolvePathOptions(conf: OptionsResults<C> | undefined, file: string): OptionsResults<C> | undefined;
/**

@@ -311,0 +312,0 @@ * Read the configuration from a dependency

@@ -167,3 +167,4 @@ /**

try {
return yamlParse(await readFile(rc, 'utf8'));
const p = yamlParse(await readFile(rc, 'utf8'));
return this.resolvePathOptions(typeof p === 'string' ? { extends: p } : p, rc);
}

@@ -183,3 +184,6 @@ catch (er) {

if (res && typeof res === 'object' && !Array.isArray(res)) {
return res;
const r = res;
if (typeof r.tap === 'string')
r.tap = { extends: r.tap };
return r;
}

@@ -197,4 +201,15 @@ }

async readPackageJsonConfig(pj) {
return (await this.readPackageJson(pj))?.tap;
return this.resolvePathOptions((await this.readPackageJson(pj))?.tap, pj);
}
resolvePathOptions(conf, file) {
if (conf) {
for (const p of pathOptions) {
const pc = conf[p];
if (typeof pc === 'string') {
Object.assign(conf, { [p]: resolve(dirname(file), pc) });
}
}
}
return conf;
}
/**

@@ -282,10 +297,2 @@ * Read the configuration from a dependency

const { extends: ext, ...rest } = data;
// root the glob and path type options
// if we pick up one of them, lose any others from other root dirs
const dir = dirname(resolved);
for (const k of pathOptions) {
if (typeof rest[k] === 'string') {
rest[k] = resolve(dir, rest[k]);
}
}
try {

@@ -292,0 +299,0 @@ this.jack.setConfigValues(rest, resolved);

@@ -38,2 +38,9 @@ /**

}> & import("jackspeak").ConfigSetFromMetaSet<"boolean", false, {
browser: {
description: string;
default: true;
};
'no-browser': {
description: string;
};
'show-full-coverage': {

@@ -78,2 +85,5 @@ description: string;

};
'fail-only': {
description: string;
};
color: {

@@ -80,0 +90,0 @@ short: string;

@@ -315,2 +315,15 @@ /**

.flag({
browser: {
description: `Open the coverage report in the system's web browser when
an html report is generated (ie, when \`--coverage-report\`
is either \`lcov\` or \`html\`).
If set to false, then the html files will be generated, but
not opened in a web browser automatically.`,
default: true,
},
'no-browser': {
description: `Do not automatically open html coverage reports in the
system default web browser`,
},
'show-full-coverage': {

@@ -436,2 +449,9 @@ description: `Show the \`100\` lines in the default \`text\` coverage

},
'fail-only': {
description: `Fail any tests marked with \`{only: true }\`, for CI and
other environments where you want to ensure that tests are
not being skipped.
Only relevant when the @tapjs/filter plugin is enabled.`,
},
color: {

@@ -438,0 +458,0 @@ short: 'c',

{
"name": "@tapjs/config",
"version": "3.0.1",
"version": "3.1.0",
"description": "Utility loading and managing tap configuration",

@@ -43,4 +43,4 @@ "tshy": {

"dependencies": {
"@tapjs/core": "2.0.1",
"@tapjs/test": "2.0.1",
"@tapjs/core": "2.1.0",
"@tapjs/test": "2.1.0",
"chalk": "^5.2.0",

@@ -53,4 +53,4 @@ "jackspeak": "^3.1.2",

"peerDependencies": {
"@tapjs/core": "2.0.1",
"@tapjs/test": "2.0.1"
"@tapjs/core": "2.1.0",
"@tapjs/test": "2.1.0"
},

@@ -57,0 +57,0 @@ "tap": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc