This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -3,10 +3,12 @@ import { fileURLToPath } from "node:url";
import { applyReleasePlan } from "@changesets/apply-release-plan";
import { assembleReleasePlan } from "@changesets/assemble-release-plan";
import { ExitError } from "@changesets/errors";
import { getDependentsGraph } from "@changesets/get-dependents-graph";
import * as git from "@changesets/git";
import { readPreState } from "@changesets/pre";
import { readChangesets } from "@changesets/read";
import type { Config } from "@changesets/types";
import { shouldSkipPackage } from "@changesets/should-skip-package";
import type { Config, Packages } from "@changesets/types";
import { log } from "@clack/prompts";
import { getPackages } from "@manypkg/get-packages";
import pc from "picocolors";
Expand All
@@ -15,14 +17,48 @@ import { importantWarning } from "../../utils/cli-utilities.ts";
export async function version(
cwd: string,
options: { snapshot?: string | boolean },
options: {
ignore?: string[];
snapshot?: string | boolean;
snapshotPrereleaseTemplate?: string;
},
config: Config,
) {
const messages: string[] = [];
let ignore: readonly string[] | undefined;
if (options.ignore != null) {
if (config.ignore.length > 0) {
messages.push(
"It looks like you are trying to use the `--ignore` option while ignore is defined in the config file. This is currently not allowed, you can only use one of them at a time.",
`The package ${pc.blue(dependent)} depends on the skipped package ${pc.blue(skippedPackage)} (either by \`ignore\` option or by \`privatePackages.version\`), but ${pc.blue(dependent)} is not being skipped. Please pass ${pc.blue(dependent)} to the ${pc.cyan("--ignore")} flag.`,
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`The package pkg-a depends on the skipped package pkg-b (either by \`ignore\` option or by \`privatePackages.version\`), but pkg-a is not being skipped. Please pass pkg-a to the --ignore flag.`,
);
});
it("should throw if `--ignore` flag is used while ignore array is also defined in the config file", async () => {
`It looks like you are trying to use the \`--ignore\` option while ignore is defined in the config file. This is currently not allowed, you can only use one of them at a time.`,
);
});
describe("when there is a changeset commit", () => {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`The package pkg-a depends on the skipped package pkg-b (either by \`ignore\` option or by \`privatePackages.version\`), but pkg-a is not being skipped. Please pass pkg-a to the --ignore flag.`,
);
});
it("should not throw if dependents of unversioned private packages are not explicitly listed by the ignore flag", async () => {
`It looks like you are trying to use the \`--ignore\` option while ignore is defined in the config file. This is currently not allowed, you can only use one of them at a time.`,
);
});
it("should not throw if `format: false` is configured", async () => {
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Load commands lazily #2002
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Load commands lazily #2002
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.