chore(node-utils): migrate build to tsdown

This commit is contained in:
xingyu4j
2026-03-15 19:40:09 +08:00
parent c1b1fe90fd
commit a1ca296fc0
7 changed files with 69 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
import dayjs from 'dayjs';
import timezone from 'dayjs/plugin/timezone';
import utc from 'dayjs/plugin/utc';
import timezone from 'dayjs/plugin/timezone.js';
import utc from 'dayjs/plugin/utc.js';
dayjs.extend(utc);
dayjs.extend(timezone);

View File

@@ -1,10 +1,13 @@
import type { Package } from '@manypkg/get-packages';
import { dirname } from 'node:path';
import {
getPackages as getPackagesFunc,
getPackagesSync as getPackagesSyncFunc,
} from '@manypkg/get-packages';
import { findUpSync } from 'find-up';
import * as manypkg from '@manypkg/get-packages';
import * as findUp from 'find-up';
const { getPackages: getPackagesFunc, getPackagesSync: getPackagesSyncFunc } =
manypkg;
const { findUpSync } = findUp;
/**
* 查找大仓的根目录
@@ -40,7 +43,7 @@ async function getPackages() {
*/
async function getPackage(pkgName: string) {
const { packages } = await getPackages();
return packages.find((pkg) => pkg.packageJson.name === pkgName);
return packages.find((pkg: Package) => pkg.packageJson.name === pkgName);
}
export { findMonorepoRoot, getPackage, getPackages, getPackagesSync };