Skip to content

Commit 5d02101

Browse files
committed
fix(lib/packages): import with with keyword
1 parent 9df173b commit 5d02101

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/packages.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import pkgJson from '../package.json' assert { type: 'json' }
1+
import pkgJson from '../package.json' with { type: 'json' }
22
import { createRequire } from 'node:module';
3-
import path from 'node:path';
3+
import { resolve } from 'node:path';
4+
5+
const require = createRequire(import.meta.url);
46

57
const packages = {
68
'0http': { hasRouter: true, package: '0http' },
@@ -33,13 +35,11 @@ const packages = {
3335
'trpc-router': { extra: true, hasRouter: true, package: '@trpc/server' },
3436
}
3537

36-
const require = createRequire(import.meta.url);
37-
3838
const _choices = []
3939
Object.keys(packages).forEach(pkg => {
4040
if (!packages[pkg].version) {
4141
const module = pkgJson.dependencies[pkg] ? pkg : packages[pkg].package
42-
const version = require(path.resolve(`node_modules/${module}/package.json`)).version
42+
const version = require(resolve(`node_modules/${module}/package.json`)).version
4343
packages[pkg].version = version
4444
}
4545
_choices.push(pkg)

0 commit comments

Comments
 (0)