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

@bscotch/config

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bscotch/config - npm Package Compare versions

Comparing version 0.5.1 to 1.0.0

2

dist/lib/dependencyVersion.js

@@ -58,3 +58,3 @@ import { Pathy } from '@bscotch/pathy';

static inferType(version) {
if (version.startsWith('file:')) {
if (version.match(/^(file|workspace):/)) {
return 'local';

@@ -61,0 +61,0 @@ }

import { Pathy, PathyOrString } from '@bscotch/pathy';
import { ReleaseType } from 'semver';
import type { PackageJson as PackageJsonData } from 'type-fest';
import type { PackageJson as _PackageJsonData } from 'type-fest';
import { ConfigFile } from './configFile.js';
import { DependencyVersion } from './dependencyVersion.js';
import type { PackageJsonAddDependencyOptions, PackageJsonDependency, PackageJsonDependencyType, PackageJsonFindOptions, PackageJsonPruneDependencyOptions } from './packageJson.types.js';
import type { PackageJsonAddDependencyOptions, PackageJsonDependency, PackageJsonDependencyType, PackageJsonFindOptions, PackageJsonPruneDependencyOptions, PackageManager } from './packageJson.types.js';
import type { PackageNameConstructable } from './packageName.js';
import { PackageName } from './packageName.js';
export type { PackageJson as PackageJsonData } from 'type-fest';
export { PackageJsonAddDependencyOptions, PackageJsonDependency, PackageJsonDependencyType, PackageJsonFindOptions, PackageJsonPruneDependencyOptions, } from './packageJson.types.js';
export { PackageJsonAddDependencyOptions, PackageJsonDependency, PackageJsonDependencyType, PackageJsonFindOptions, PackageJsonPruneDependencyOptions, PackageManager, } from './packageJson.types.js';
export declare type PackageJsonData = _PackageJsonData & {
packageManager?: `${PackageManager}@${string}`;
};
export declare type PackageJsonExtended<Extension = undefined> = Extension extends undefined ? PackageJsonData : {

@@ -52,2 +54,7 @@ [Key in keyof PackageJsonData | keyof Extension]?: Key extends keyof PackageJsonData ? PackageJsonData[Key] : Key extends keyof Extension ? Extension[Key] : never;

});
/**
* The name of the packageManager listed in
* that field, if any. Defaults to 'pnpm'.
*/
get packageManager(): PackageManager;
get type(): 'module' | 'commonjs' | undefined;

@@ -126,3 +133,2 @@ set type(moduleType: 'module' | 'commonjs' | undefined);

get files(): string[];
build(args?: string[]): Promise<void>;
test(args?: string[]): Promise<void>;

@@ -230,4 +236,4 @@ publish(options?: {

};
contributors: PackageJsonData.Person[];
maintainers: PackageJsonData.Person[];
contributors: _PackageJsonData.Person[];
maintainers: _PackageJsonData.Person[];
files: string[];

@@ -237,19 +243,19 @@ type: "module" | "commonjs";

exports: string | string[] | {
[x: string & Record<never, never>]: PackageJsonData.Exports;
browser: PackageJsonData.Exports;
import: PackageJsonData.Exports;
require: PackageJsonData.Exports;
node: PackageJsonData.Exports;
"node-addons": PackageJsonData.Exports;
deno: PackageJsonData.Exports;
electron: PackageJsonData.Exports;
"react-native": PackageJsonData.Exports;
default: PackageJsonData.Exports;
[x: string & Record<never, never>]: _PackageJsonData.Exports;
browser: _PackageJsonData.Exports;
import: _PackageJsonData.Exports;
require: _PackageJsonData.Exports;
node: _PackageJsonData.Exports;
"node-addons": _PackageJsonData.Exports;
deno: _PackageJsonData.Exports;
electron: _PackageJsonData.Exports;
"react-native": _PackageJsonData.Exports;
default: _PackageJsonData.Exports;
} | {
[key: string]: PackageJsonData.Exports;
[key: string]: _PackageJsonData.Exports;
} | null;
imports: PackageJsonData.Imports;
imports: _PackageJsonData.Imports;
bin: string | Partial<Record<string, string>>;
man: string | string[];
directories: PackageJsonData.DirectoryLocations;
directories: _PackageJsonData.DirectoryLocations;
repository: string | {

@@ -260,3 +266,3 @@ type: string;

};
scripts: PackageJsonData.Scripts;
scripts: _PackageJsonData.Scripts;
config: Record<string, unknown>;

@@ -280,3 +286,3 @@ dependencies: Partial<Record<string, string>>;

private: boolean;
publishConfig: PackageJsonData.PublishConfig;
publishConfig: _PackageJsonData.PublishConfig;
funding: string | {

@@ -297,6 +303,7 @@ type?: import("type-fest").LiteralUnion<"github" | "opencollective" | "patreon" | "individual" | "foundation" | "corporation", string> | undefined;

typings: string;
workspaces: string[] | PackageJsonData.WorkspaceConfig;
workspaces: string[] | _PackageJsonData.WorkspaceConfig;
flat: boolean;
resolutions: Partial<Record<string, string>>;
jspm: PackageJsonData;
jspm: _PackageJsonData;
packageManager: `npm@${string}` | `yarn@${string}` | `pnpm@${string}`;
}>>;

@@ -303,0 +310,0 @@ /**

@@ -35,2 +35,10 @@ import { __decorate, __metadata } from "tslib";

}
/**
* The name of the packageManager listed in
* that field, if any. Defaults to 'pnpm'.
*/
get packageManager() {
const pm = this.data.packageManager?.match(/^(p?npm|yarn)/)?.[1];
return pm || 'pnpm';
}
get type() {

@@ -129,10 +137,4 @@ return this.data.type;

}
async build(args = []) {
await exec('npm', ['run', 'build', '--', ...args], {
cwd: this.dir.absolute,
shell: true,
});
}
async test(args = []) {
await exec('npm', ['run', 'test', '--', ...args], {
await exec(this.packageManager, ['run', 'test', ...args], {
cwd: this.dir.absolute,

@@ -152,3 +154,6 @@ shell: true,

}
await exec('npm', publishOptions, { cwd: this.dir.absolute, shell: true });
await exec(this.packageManager, publishOptions, {
cwd: this.dir.absolute,
shell: true,
});
}

@@ -307,4 +312,4 @@ /**

const opts = { cwd: this.dir.absolute };
this.trace(`running %o: npm ${args.join(' ')}`, opts);
await exec('npm', args, opts);
this.trace(`running %o: ${this.packageManager} ${args.join(' ')}`, opts);
await exec(this.packageManager, args, opts);
}

@@ -311,0 +316,0 @@ /**

@@ -7,2 +7,3 @@ import type { Promisable } from 'type-fest';

export declare type PackageJsonDependencies = Pick<PackageJsonData, PackageJsonDependencyType>;
export declare type PackageManager = 'npm' | 'yarn' | 'pnpm';
/**

@@ -9,0 +10,0 @@ * Search options for finding a `package.json`

{
"name": "@bscotch/config",
"version": "0.5.1",
"version": "1.0.0",
"type": "module",

@@ -19,5 +19,5 @@ "exports": {

"dependencies": {
"@bscotch/pathy": "^2.1.0",
"@bscotch/utility": "^6.1.1",
"@bscotch/validation": "^0.2.0",
"@bscotch/pathy": "workspace:^",
"@bscotch/utility": "workspace:^",
"@bscotch/validation": "workspace:^",
"chai": "^4.3.6",

@@ -33,2 +33,4 @@ "globby": "^13.1.2",

"devDependencies": {
"@types/npm-packlist": "^3.0.0",
"@types/semver": "^7.3.10",
"typescript": "^4.8.0-beta"

@@ -35,0 +37,0 @@ },

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