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

@changesets/config

Package Overview
Dependencies
Maintainers
3
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@changesets/config - npm Package Compare versions

Comparing version 1.6.3 to 1.7.0-temp.0

dist/declarations/package.json.d.ts

12

CHANGELOG.md
# @changesets/config
## 1.7.0-temp.0
### Minor Changes
- [#696](https://github.com/changesets/changesets/pull/696) [`636c7d7`](https://github.com/changesets/changesets/commit/636c7d7c9333664c91cd4d0ff678d5acb17256ad) Thanks [@Andarist](https://github.com/Andarist)! - Fixed mode and publish refactor
### Patch Changes
- Updated dependencies [[`636c7d7`](https://github.com/changesets/changesets/commit/636c7d7c9333664c91cd4d0ff678d5acb17256ad)]:
- @changesets/types@4.1.0-temp.0
- @changesets/get-dependents-graph@1.2.5-temp.0
## 1.6.3

@@ -4,0 +16,0 @@

98

dist/config.cjs.dev.js

@@ -19,3 +19,3 @@ 'use strict';

name: "@changesets/config",
version: "1.6.3",
version: "1.7.0-temp.0",
description: "Utilities for reading and parsing Changeset's config",

@@ -32,5 +32,5 @@ main: "dist/config.cjs.js",

"@changesets/errors": "^0.1.4",
"@changesets/get-dependents-graph": "^1.2.4",
"@changesets/get-dependents-graph": "^1.2.5-temp.0",
"@changesets/logger": "^0.0.5",
"@changesets/types": "^4.0.2",
"@changesets/types": "^4.1.0-temp.0",
"@manypkg/get-packages": "^1.1.3",

@@ -51,2 +51,3 @@ "fs-extra": "^7.0.1",

commit: false,
fixed: [],
linked: [],

@@ -59,2 +60,6 @@ access: "restricted",

function flatten(arr) {
return [].concat(...arr);
}
function getNormalisedChangelogOption(thing) {

@@ -72,15 +77,12 @@ if (thing === false) {

function normalizePackageNames(listOfPackageNamesOrGlob, pkgNames) {
const matchingPackages = micromatch__default['default'](pkgNames, listOfPackageNamesOrGlob); // Go through the list of given package globs (again) in order to find out
// which packages didn't match so that we can show a validation message.
function getUnmatchedPatterns(listOfPackageNamesOrGlob, pkgNames) {
return listOfPackageNamesOrGlob.filter(pkgNameOrGlob => !pkgNames.some(pkgName => micromatch__default['default'].isMatch(pkgName, pkgNameOrGlob)));
}
const nonExistingPackages = listOfPackageNamesOrGlob.filter(pkgNameOrGlob => !pkgNames.some(pkgName => micromatch__default['default'].isMatch(pkgName, pkgNameOrGlob))); // Since the validation happens in subsequent steps, we need to return a tuple
// with the list of non-existing packages.
// TODO: refactor the validation logic to exit early when something is not valid.
const havePackageGroupsCorrectShape = pkgGroups => {
return isArray(pkgGroups) && pkgGroups.every(arr => isArray(arr) && arr.every(pkgName => typeof pkgName === "string"));
}; // TODO: it might be possible to remove this if improvements to `Array.isArray` ever land
// related thread: github.com/microsoft/TypeScript/issues/36554
return [matchingPackages, nonExistingPackages];
} // TODO: replace usage with Array.isArray when TS 4.1 gets released
// source: https://github.com/microsoft/TypeScript/pull/39258/files#diff-a6b488d9bd802977827b535a3011c1f3R1379
function isArray(arg) {

@@ -125,4 +127,37 @@ return Array.isArray(arg);

let fixed = [];
if (json.fixed !== undefined) {
if (!havePackageGroupsCorrectShape(json.fixed)) {
messages.push(`The \`fixed\` option is set as ${JSON.stringify(json.fixed, null, 2)} when the only valid values are undefined or an array of arrays of package names`);
} else {
let foundPkgNames = new Set();
let duplicatedPkgNames = new Set();
for (let fixedGroup of json.fixed) {
messages.push(...getUnmatchedPatterns(fixedGroup, pkgNames).map(pkgOrGlob => `The package or glob expression "${pkgOrGlob}" specified in the \`fixed\` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.`));
let expandedFixedGroup = micromatch__default['default'](pkgNames, fixedGroup);
fixed.push(expandedFixedGroup);
for (let fixedPkgName of expandedFixedGroup) {
if (foundPkgNames.has(fixedPkgName)) {
duplicatedPkgNames.add(fixedPkgName);
}
foundPkgNames.add(fixedPkgName);
}
}
if (duplicatedPkgNames.size) {
duplicatedPkgNames.forEach(pkgName => {
messages.push(`The package "${pkgName}" is defined in multiple sets of fixed packages. Packages can only be defined in a single set of fixed packages. If you are using glob expressions, make sure that they are valid according to https://www.npmjs.com/package/micromatch.`);
});
}
}
}
let linked = [];
if (json.linked !== undefined) {
if (!(isArray(json.linked) && json.linked.every(arr => Array.isArray(arr) && arr.every(pkgName => typeof pkgName === "string")))) {
if (!havePackageGroupsCorrectShape(json.linked)) {
messages.push(`The \`linked\` option is set as ${JSON.stringify(json.linked, null, 2)} when the only valid values are undefined or an array of arrays of package names`);

@@ -134,5 +169,7 @@ } else {

for (let linkedGroup of json.linked) {
let [normalizedLinkedGroup, nonExistingPackages] = normalizePackageNames(linkedGroup, pkgNames);
messages.push(...getUnmatchedPatterns(linkedGroup, pkgNames).map(pkgOrGlob => `The package or glob expression "${pkgOrGlob}" specified in the \`linked\` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.`));
let expandedLinkedGroup = micromatch__default['default'](pkgNames, linkedGroup);
linked.push(expandedLinkedGroup);
for (let linkedPkgName of normalizedLinkedGroup) {
for (let linkedPkgName of expandedLinkedGroup) {
if (foundPkgNames.has(linkedPkgName)) {

@@ -143,9 +180,2 @@ duplicatedPkgNames.add(linkedPkgName);

foundPkgNames.add(linkedPkgName);
} // Show validation message for each non-existing package
if (nonExistingPackages.length > 0) {
nonExistingPackages.forEach(nonExistingPkgName => {
messages.push(`The package or glob expression "${nonExistingPkgName}" specified in the \`linked\` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.`);
});
}

@@ -162,2 +192,10 @@ }

const allFixedPackages = new Set(flatten(fixed));
const allLinkedPackages = new Set(flatten(linked));
allFixedPackages.forEach(pkgName => {
if (allLinkedPackages.has(pkgName)) {
messages.push(`The package "${pkgName}" can be found in both fixed and linked groups. A package can only be either fixed or linked.`);
}
});
if (json.updateInternalDependencies !== undefined && !["patch", "minor"].includes(json.updateInternalDependencies)) {

@@ -171,11 +209,4 @@ messages.push(`The \`updateInternalDependencies\` option is set as ${JSON.stringify(json.updateInternalDependencies, null, 2)} but can only be 'patch' or 'minor'`);

} else {
let [, nonExistingPackages] = normalizePackageNames(json.ignore, pkgNames);
messages.push(...getUnmatchedPatterns(json.ignore, pkgNames).map(pkgOrGlob => `The package or glob expression "${pkgOrGlob}" is specified in the \`ignore\` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.`)); // Validate that all dependents of ignored packages are listed in the ignore list
if (nonExistingPackages.length > 0) {
nonExistingPackages.forEach(nonExistingPkgName => {
messages.push(`The package or glob expression "${nonExistingPkgName}" is specified in the \`ignore\` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.`);
});
} // Validate that all dependents of ignored packages are listed in the ignore list
const dependentsGraph = getDependentsGraph.getDependentsGraph(packages);

@@ -223,6 +254,7 @@

commit: json.commit === undefined ? defaultWrittenConfig.commit : json.commit,
linked: json.linked === undefined ? defaultWrittenConfig.linked : json.linked.map(linkedGroup => normalizePackageNames(linkedGroup, pkgNames)[0]),
fixed,
linked,
baseBranch: json.baseBranch === undefined ? defaultWrittenConfig.baseBranch : json.baseBranch,
updateInternalDependencies: json.updateInternalDependencies === undefined ? defaultWrittenConfig.updateInternalDependencies : json.updateInternalDependencies,
ignore: json.ignore === undefined ? defaultWrittenConfig.ignore : normalizePackageNames(json.ignore, pkgNames)[0],
ignore: json.ignore === undefined ? defaultWrittenConfig.ignore : micromatch__default['default'](pkgNames, json.ignore),
bumpVersionsWithWorkspaceProtocolOnly: json.bumpVersionsWithWorkspaceProtocolOnly === true,

@@ -229,0 +261,0 @@ ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {

@@ -17,3 +17,3 @@ "use strict";

name: "@changesets/config",
version: "1.6.3",
version: "1.7.0-temp.0",
description: "Utilities for reading and parsing Changeset's config",

@@ -27,5 +27,5 @@ main: "dist/config.cjs.js",

"@changesets/errors": "^0.1.4",
"@changesets/get-dependents-graph": "^1.2.4",
"@changesets/get-dependents-graph": "^1.2.5-temp.0",
"@changesets/logger": "^0.0.5",
"@changesets/types": "^4.0.2",
"@changesets/types": "^4.1.0-temp.0",
"@manypkg/get-packages": "^1.1.3",

@@ -46,2 +46,3 @@ "fs-extra": "^7.0.1",

commit: !1,
fixed: [],
linked: [],

@@ -54,2 +55,6 @@ access: "restricted",

function flatten(arr) {
return [].concat(...arr);
}
function getNormalisedChangelogOption(thing) {

@@ -59,6 +64,8 @@ return !1 !== thing && ("string" == typeof thing ? [ thing, null ] : thing);

function normalizePackageNames(listOfPackageNamesOrGlob, pkgNames) {
return [ micromatch__default.default(pkgNames, listOfPackageNamesOrGlob), listOfPackageNamesOrGlob.filter((pkgNameOrGlob => !pkgNames.some((pkgName => micromatch__default.default.isMatch(pkgName, pkgNameOrGlob))))) ];
function getUnmatchedPatterns(listOfPackageNamesOrGlob, pkgNames) {
return listOfPackageNamesOrGlob.filter((pkgNameOrGlob => !pkgNames.some((pkgName => micromatch__default.default.isMatch(pkgName, pkgNameOrGlob)))));
}
const havePackageGroupsCorrectShape = pkgGroups => isArray(pkgGroups) && pkgGroups.every((arr => isArray(arr) && arr.every((pkgName => "string" == typeof pkgName))));
function isArray(arg) {

@@ -76,15 +83,29 @@ return Array.isArray(arg);

let normalizedAccess = json.access;
if ("private" === json.access && (normalizedAccess = "restricted", logger.warn('The `access` option is set as "private", but this is actually not a valid value - the correct form is "restricted".')),
"private" === json.access && (normalizedAccess = "restricted", logger.warn('The `access` option is set as "private", but this is actually not a valid value - the correct form is "restricted".')),
void 0 !== normalizedAccess && "restricted" !== normalizedAccess && "public" !== normalizedAccess && messages.push(`The \`access\` option is set as ${JSON.stringify(normalizedAccess, null, 2)} when the only valid values are undefined, "public" or "restricted"`),
void 0 !== json.commit && "boolean" != typeof json.commit && messages.push(`The \`commit\` option is set as ${JSON.stringify(json.commit, null, 2)} when the only valid values are undefined or a boolean`),
void 0 !== json.baseBranch && "string" != typeof json.baseBranch && messages.push(`The \`baseBranch\` option is set as ${JSON.stringify(json.baseBranch, null, 2)} but the \`baseBranch\` option can only be set as a string`),
void 0 !== json.linked) if (isArray(json.linked) && json.linked.every((arr => Array.isArray(arr) && arr.every((pkgName => "string" == typeof pkgName))))) {
void 0 !== json.baseBranch && "string" != typeof json.baseBranch && messages.push(`The \`baseBranch\` option is set as ${JSON.stringify(json.baseBranch, null, 2)} but the \`baseBranch\` option can only be set as a string`);
let fixed = [];
if (void 0 !== json.fixed) if (havePackageGroupsCorrectShape(json.fixed)) {
let foundPkgNames = new Set, duplicatedPkgNames = new Set;
for (let fixedGroup of json.fixed) {
messages.push(...getUnmatchedPatterns(fixedGroup, pkgNames).map((pkgOrGlob => `The package or glob expression "${pkgOrGlob}" specified in the \`fixed\` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.`)));
let expandedFixedGroup = micromatch__default.default(pkgNames, fixedGroup);
fixed.push(expandedFixedGroup);
for (let fixedPkgName of expandedFixedGroup) foundPkgNames.has(fixedPkgName) && duplicatedPkgNames.add(fixedPkgName),
foundPkgNames.add(fixedPkgName);
}
duplicatedPkgNames.size && duplicatedPkgNames.forEach((pkgName => {
messages.push(`The package "${pkgName}" is defined in multiple sets of fixed packages. Packages can only be defined in a single set of fixed packages. If you are using glob expressions, make sure that they are valid according to https://www.npmjs.com/package/micromatch.`);
}));
} else messages.push(`The \`fixed\` option is set as ${JSON.stringify(json.fixed, null, 2)} when the only valid values are undefined or an array of arrays of package names`);
let linked = [];
if (void 0 !== json.linked) if (havePackageGroupsCorrectShape(json.linked)) {
let foundPkgNames = new Set, duplicatedPkgNames = new Set;
for (let linkedGroup of json.linked) {
let [normalizedLinkedGroup, nonExistingPackages] = normalizePackageNames(linkedGroup, pkgNames);
for (let linkedPkgName of normalizedLinkedGroup) foundPkgNames.has(linkedPkgName) && duplicatedPkgNames.add(linkedPkgName),
messages.push(...getUnmatchedPatterns(linkedGroup, pkgNames).map((pkgOrGlob => `The package or glob expression "${pkgOrGlob}" specified in the \`linked\` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.`)));
let expandedLinkedGroup = micromatch__default.default(pkgNames, linkedGroup);
linked.push(expandedLinkedGroup);
for (let linkedPkgName of expandedLinkedGroup) foundPkgNames.has(linkedPkgName) && duplicatedPkgNames.add(linkedPkgName),
foundPkgNames.add(linkedPkgName);
nonExistingPackages.length > 0 && nonExistingPackages.forEach((nonExistingPkgName => {
messages.push(`The package or glob expression "${nonExistingPkgName}" specified in the \`linked\` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.`);
}));
}

@@ -95,8 +116,8 @@ duplicatedPkgNames.size && duplicatedPkgNames.forEach((pkgName => {

} else messages.push(`The \`linked\` option is set as ${JSON.stringify(json.linked, null, 2)} when the only valid values are undefined or an array of arrays of package names`);
if (void 0 === json.updateInternalDependencies || [ "patch", "minor" ].includes(json.updateInternalDependencies) || messages.push(`The \`updateInternalDependencies\` option is set as ${JSON.stringify(json.updateInternalDependencies, null, 2)} but can only be 'patch' or 'minor'`),
const allFixedPackages = new Set(flatten(fixed)), allLinkedPackages = new Set(flatten(linked));
if (allFixedPackages.forEach((pkgName => {
allLinkedPackages.has(pkgName) && messages.push(`The package "${pkgName}" can be found in both fixed and linked groups. A package can only be either fixed or linked.`);
})), void 0 === json.updateInternalDependencies || [ "patch", "minor" ].includes(json.updateInternalDependencies) || messages.push(`The \`updateInternalDependencies\` option is set as ${JSON.stringify(json.updateInternalDependencies, null, 2)} but can only be 'patch' or 'minor'`),
json.ignore) if (isArray(json.ignore) && json.ignore.every((pkgName => "string" == typeof pkgName))) {
let [, nonExistingPackages] = normalizePackageNames(json.ignore, pkgNames);
nonExistingPackages.length > 0 && nonExistingPackages.forEach((nonExistingPkgName => {
messages.push(`The package or glob expression "${nonExistingPkgName}" is specified in the \`ignore\` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.`);
}));
messages.push(...getUnmatchedPatterns(json.ignore, pkgNames).map((pkgOrGlob => `The package or glob expression "${pkgOrGlob}" is specified in the \`ignore\` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.`)));
const dependentsGraph = getDependentsGraph.getDependentsGraph(packages);

@@ -119,6 +140,7 @@ for (const ignoredPackage of json.ignore) {

commit: void 0 === json.commit ? defaultWrittenConfig.commit : json.commit,
linked: void 0 === json.linked ? defaultWrittenConfig.linked : json.linked.map((linkedGroup => normalizePackageNames(linkedGroup, pkgNames)[0])),
fixed: fixed,
linked: linked,
baseBranch: void 0 === json.baseBranch ? defaultWrittenConfig.baseBranch : json.baseBranch,
updateInternalDependencies: void 0 === json.updateInternalDependencies ? defaultWrittenConfig.updateInternalDependencies : json.updateInternalDependencies,
ignore: void 0 === json.ignore ? defaultWrittenConfig.ignore : normalizePackageNames(json.ignore, pkgNames)[0],
ignore: void 0 === json.ignore ? defaultWrittenConfig.ignore : micromatch__default.default(pkgNames, json.ignore),
bumpVersionsWithWorkspaceProtocolOnly: !0 === json.bumpVersionsWithWorkspaceProtocolOnly,

@@ -125,0 +147,0 @@ ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {

@@ -10,3 +10,3 @@ import { readJSON } from 'fs-extra';

name: "@changesets/config",
version: "1.6.3",
version: "1.7.0-temp.0",
description: "Utilities for reading and parsing Changeset's config",

@@ -23,5 +23,5 @@ main: "dist/config.cjs.js",

"@changesets/errors": "^0.1.4",
"@changesets/get-dependents-graph": "^1.2.4",
"@changesets/get-dependents-graph": "^1.2.5-temp.0",
"@changesets/logger": "^0.0.5",
"@changesets/types": "^4.0.2",
"@changesets/types": "^4.1.0-temp.0",
"@manypkg/get-packages": "^1.1.3",

@@ -42,2 +42,3 @@ "fs-extra": "^7.0.1",

commit: false,
fixed: [],
linked: [],

@@ -50,2 +51,6 @@ access: "restricted",

function flatten(arr) {
return [].concat(...arr);
}
function getNormalisedChangelogOption(thing) {

@@ -63,15 +68,12 @@ if (thing === false) {

function normalizePackageNames(listOfPackageNamesOrGlob, pkgNames) {
const matchingPackages = micromatch(pkgNames, listOfPackageNamesOrGlob); // Go through the list of given package globs (again) in order to find out
// which packages didn't match so that we can show a validation message.
function getUnmatchedPatterns(listOfPackageNamesOrGlob, pkgNames) {
return listOfPackageNamesOrGlob.filter(pkgNameOrGlob => !pkgNames.some(pkgName => micromatch.isMatch(pkgName, pkgNameOrGlob)));
}
const nonExistingPackages = listOfPackageNamesOrGlob.filter(pkgNameOrGlob => !pkgNames.some(pkgName => micromatch.isMatch(pkgName, pkgNameOrGlob))); // Since the validation happens in subsequent steps, we need to return a tuple
// with the list of non-existing packages.
// TODO: refactor the validation logic to exit early when something is not valid.
const havePackageGroupsCorrectShape = pkgGroups => {
return isArray(pkgGroups) && pkgGroups.every(arr => isArray(arr) && arr.every(pkgName => typeof pkgName === "string"));
}; // TODO: it might be possible to remove this if improvements to `Array.isArray` ever land
// related thread: github.com/microsoft/TypeScript/issues/36554
return [matchingPackages, nonExistingPackages];
} // TODO: replace usage with Array.isArray when TS 4.1 gets released
// source: https://github.com/microsoft/TypeScript/pull/39258/files#diff-a6b488d9bd802977827b535a3011c1f3R1379
function isArray(arg) {

@@ -116,4 +118,37 @@ return Array.isArray(arg);

let fixed = [];
if (json.fixed !== undefined) {
if (!havePackageGroupsCorrectShape(json.fixed)) {
messages.push(`The \`fixed\` option is set as ${JSON.stringify(json.fixed, null, 2)} when the only valid values are undefined or an array of arrays of package names`);
} else {
let foundPkgNames = new Set();
let duplicatedPkgNames = new Set();
for (let fixedGroup of json.fixed) {
messages.push(...getUnmatchedPatterns(fixedGroup, pkgNames).map(pkgOrGlob => `The package or glob expression "${pkgOrGlob}" specified in the \`fixed\` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.`));
let expandedFixedGroup = micromatch(pkgNames, fixedGroup);
fixed.push(expandedFixedGroup);
for (let fixedPkgName of expandedFixedGroup) {
if (foundPkgNames.has(fixedPkgName)) {
duplicatedPkgNames.add(fixedPkgName);
}
foundPkgNames.add(fixedPkgName);
}
}
if (duplicatedPkgNames.size) {
duplicatedPkgNames.forEach(pkgName => {
messages.push(`The package "${pkgName}" is defined in multiple sets of fixed packages. Packages can only be defined in a single set of fixed packages. If you are using glob expressions, make sure that they are valid according to https://www.npmjs.com/package/micromatch.`);
});
}
}
}
let linked = [];
if (json.linked !== undefined) {
if (!(isArray(json.linked) && json.linked.every(arr => Array.isArray(arr) && arr.every(pkgName => typeof pkgName === "string")))) {
if (!havePackageGroupsCorrectShape(json.linked)) {
messages.push(`The \`linked\` option is set as ${JSON.stringify(json.linked, null, 2)} when the only valid values are undefined or an array of arrays of package names`);

@@ -125,5 +160,7 @@ } else {

for (let linkedGroup of json.linked) {
let [normalizedLinkedGroup, nonExistingPackages] = normalizePackageNames(linkedGroup, pkgNames);
messages.push(...getUnmatchedPatterns(linkedGroup, pkgNames).map(pkgOrGlob => `The package or glob expression "${pkgOrGlob}" specified in the \`linked\` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.`));
let expandedLinkedGroup = micromatch(pkgNames, linkedGroup);
linked.push(expandedLinkedGroup);
for (let linkedPkgName of normalizedLinkedGroup) {
for (let linkedPkgName of expandedLinkedGroup) {
if (foundPkgNames.has(linkedPkgName)) {

@@ -134,9 +171,2 @@ duplicatedPkgNames.add(linkedPkgName);

foundPkgNames.add(linkedPkgName);
} // Show validation message for each non-existing package
if (nonExistingPackages.length > 0) {
nonExistingPackages.forEach(nonExistingPkgName => {
messages.push(`The package or glob expression "${nonExistingPkgName}" specified in the \`linked\` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.`);
});
}

@@ -153,2 +183,10 @@ }

const allFixedPackages = new Set(flatten(fixed));
const allLinkedPackages = new Set(flatten(linked));
allFixedPackages.forEach(pkgName => {
if (allLinkedPackages.has(pkgName)) {
messages.push(`The package "${pkgName}" can be found in both fixed and linked groups. A package can only be either fixed or linked.`);
}
});
if (json.updateInternalDependencies !== undefined && !["patch", "minor"].includes(json.updateInternalDependencies)) {

@@ -162,11 +200,4 @@ messages.push(`The \`updateInternalDependencies\` option is set as ${JSON.stringify(json.updateInternalDependencies, null, 2)} but can only be 'patch' or 'minor'`);

} else {
let [, nonExistingPackages] = normalizePackageNames(json.ignore, pkgNames);
messages.push(...getUnmatchedPatterns(json.ignore, pkgNames).map(pkgOrGlob => `The package or glob expression "${pkgOrGlob}" is specified in the \`ignore\` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.`)); // Validate that all dependents of ignored packages are listed in the ignore list
if (nonExistingPackages.length > 0) {
nonExistingPackages.forEach(nonExistingPkgName => {
messages.push(`The package or glob expression "${nonExistingPkgName}" is specified in the \`ignore\` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.`);
});
} // Validate that all dependents of ignored packages are listed in the ignore list
const dependentsGraph = getDependentsGraph(packages);

@@ -214,6 +245,7 @@

commit: json.commit === undefined ? defaultWrittenConfig.commit : json.commit,
linked: json.linked === undefined ? defaultWrittenConfig.linked : json.linked.map(linkedGroup => normalizePackageNames(linkedGroup, pkgNames)[0]),
fixed,
linked,
baseBranch: json.baseBranch === undefined ? defaultWrittenConfig.baseBranch : json.baseBranch,
updateInternalDependencies: json.updateInternalDependencies === undefined ? defaultWrittenConfig.updateInternalDependencies : json.updateInternalDependencies,
ignore: json.ignore === undefined ? defaultWrittenConfig.ignore : normalizePackageNames(json.ignore, pkgNames)[0],
ignore: json.ignore === undefined ? defaultWrittenConfig.ignore : micromatch(pkgNames, json.ignore),
bumpVersionsWithWorkspaceProtocolOnly: json.bumpVersionsWithWorkspaceProtocolOnly === true,

@@ -220,0 +252,0 @@ ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {

import { Packages } from "@manypkg/get-packages";
import { Config, WrittenConfig, Linked } from "@changesets/types";
import { Config, WrittenConfig, Fixed, Linked } from "@changesets/types";
export declare let defaultWrittenConfig: {
readonly $schema: string;
readonly $schema: `https://unpkg.com/@changesets/config@${string}/schema.json`;
readonly changelog: "@changesets/cli/changelog";
readonly commit: false;
readonly fixed: Fixed;
readonly linked: Linked;

@@ -8,0 +9,0 @@ readonly access: "restricted";

{
"name": "@changesets/config",
"version": "1.6.3",
"version": "1.7.0-temp.0",
"description": "Utilities for reading and parsing Changeset's config",

@@ -15,5 +15,5 @@ "main": "dist/config.cjs.js",

"@changesets/errors": "^0.1.4",
"@changesets/get-dependents-graph": "^1.2.4",
"@changesets/get-dependents-graph": "^1.2.5-temp.0",
"@changesets/logger": "^0.0.5",
"@changesets/types": "^4.0.2",
"@changesets/types": "^4.1.0-temp.0",
"@manypkg/get-packages": "^1.1.3",

@@ -20,0 +20,0 @@ "fs-extra": "^7.0.1",

@@ -30,2 +30,13 @@ {

},
"fixed": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
},
"description": "Packages that should always be released together with the same version.",
"default": []
},
"linked": {

@@ -32,0 +43,0 @@ "type": "array",

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