Skip to content

Commit c447ab7

Browse files
committed
remove ncu
1 parent 370ca0c commit c447ab7

File tree

3 files changed

+0
-68
lines changed

3 files changed

+0
-68
lines changed

packages/cli-v3/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@
106106
"mock-fs": "^5.2.0",
107107
"nanoid": "^4.0.2",
108108
"node-fetch": "^3.3.0",
109-
"npm-check-updates": "^16.12.2",
110109
"object-hash": "^3.0.0",
111110
"p-debounce": "^4.0.0",
112111
"p-throttle": "^6.1.0",

packages/cli-v3/src/commands/update.ts

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { confirm, intro, isCancel, log, outro } from "@clack/prompts";
2-
import { RunOptions, run as ncuRun } from "npm-check-updates";
32
import { z } from "zod";
43
import { readJSONFile, removeFile, writeJSONFile } from "../utilities/fileSystem.js";
54
import { spinner } from "../utilities/windows.js";
@@ -40,9 +39,6 @@ export function configureUpdateCommand(program: Command) {
4039
});
4140
}
4241

43-
const NcuRunResult = z.record(z.string());
44-
type NcuRunResult = z.infer<typeof NcuRunResult>;
45-
4642
const triggerPackageFilter = /^@trigger\.dev/;
4743

4844
export async function updateCommand(dir: string, options: UpdateCommandOptions) {
@@ -265,20 +261,6 @@ function mutatePackageJsonWithUpdatedPackages(
265261
}
266262
}
267263

268-
function getNcuTargetVersion(version: string): RunOptions["target"] {
269-
switch (version) {
270-
case "latest":
271-
case "newest":
272-
case "greatest":
273-
case "minor":
274-
case "patch":
275-
case "semver":
276-
return version;
277-
default:
278-
return `@${version}`;
279-
}
280-
}
281-
282264
function printUpdateTable(depsToUpdate: Dependency[], targetVersion: string): void {
283265
log.message("Suggested updates");
284266

@@ -310,49 +292,3 @@ export async function getPackageJson(absoluteProjectPath: string) {
310292

311293
return { packageJson, readonlyPackageJson, packageJsonPath };
312294
}
313-
314-
export async function checkForPackageUpdates(
315-
packageJson: PackageJson,
316-
targetVersion: string,
317-
existingSpinner?: ReturnType<typeof spinner>
318-
) {
319-
const updateCheckSpinner = existingSpinner ?? spinner();
320-
321-
updateCheckSpinner[existingSpinner ? "message" : "start"]("Checking for updates");
322-
323-
const normalizedTarget = getNcuTargetVersion(targetVersion);
324-
325-
// Use npm-check-updates to get updated dependency versions
326-
const ncuOptions: RunOptions = {
327-
packageData: packageJson as RunOptions["packageData"],
328-
target: normalizedTarget,
329-
filter: triggerPackageFilter,
330-
};
331-
332-
logger.debug({ ncuOptions: JSON.stringify(ncuOptions, undefined, 2) });
333-
334-
// Check for new versions of @trigger.dev packages
335-
const ncuRunResult = await ncuRun(ncuOptions);
336-
logger.debug({ ncuRunResult });
337-
338-
const triggerDepsToUpdate = NcuRunResult.safeParse(ncuRunResult);
339-
340-
if (!triggerDepsToUpdate.success) {
341-
logger.error("Failed to parse ncu result", { ncuRunResult });
342-
updateCheckSpinner.stop("Couldn't update dependencies");
343-
return;
344-
}
345-
346-
console.log({ triggerDepsToUpdate: triggerDepsToUpdate.data });
347-
348-
const totalToUpdate = Object.keys(triggerDepsToUpdate.data).length;
349-
350-
if (totalToUpdate === 0) {
351-
updateCheckSpinner.stop("No package updates found");
352-
return;
353-
}
354-
355-
updateCheckSpinner.stop("Found packages to update");
356-
357-
return triggerDepsToUpdate.data;
358-
}

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)