Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: remove adder preconditions #87

New issue

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

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions packages/cli/commands/add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,16 +355,11 @@ export async function runAddCommand(options: Options, adders: string[]): Promise

// run precondition checks
if (options.preconditions) {
const preconditions = selectedAdders
.flatMap(({ adder }) => adder.preconditions)
.filter((p) => p !== undefined);

// add global checks
const { kit } = createWorkspace(options.cwd);
const projectType = kit ? 'kit' : 'svelte';
const adders = selectedAdders.map(({ adder }) => adder);
const globalPreconditions = common.getGlobalPreconditions(options.cwd, projectType, adders);
preconditions.unshift(...globalPreconditions.preconditions);
const { preconditions } = common.getGlobalPreconditions(options.cwd, projectType, adders);

const fails: Array<{ name: string; message?: string }> = [];
for (const condition of preconditions) {
Expand Down
1 change: 0 additions & 1 deletion packages/core/adder/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export type Adder<Args extends OptionDefinition> = {
packages: Array<PackageDefinition<Args>>;
scripts?: Array<Scripts<Args>>;
files: Array<FileType<Args>>;
preconditions?: Precondition[];
nextSteps?: (
data: {
highlighter: Highlighter;
Expand Down