Skip to content

Commit fbaae35

Browse files
committed
Update code-infra tsconfig to be node16
and related fixes
1 parent 3db5eed commit fbaae35

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

packages/code-infra/src/cli/cmdBuild.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ ${content}`,
6868

6969
/**
7070
* @param {Object} param0
71-
* @param {NonNullable<import('./packageJson').PackageJson.Exports>} param0.importPath
71+
* @param {NonNullable<import('./packageJson.js').PackageJson.Exports>} param0.importPath
7272
* @param {string} param0.key
7373
* @param {string} param0.cwd
7474
* @param {string} param0.dir
7575
* @param {string} param0.type
76-
* @param {import('./packageJson').PackageJson.ExportConditions} param0.newExports
76+
* @param {import('./packageJson.js').PackageJson.ExportConditions} param0.newExports
7777
* @param {string} param0.typeOutExtension
7878
* @param {string} param0.outExtension
7979
* @param {boolean} param0.addTypes
@@ -139,7 +139,7 @@ async function createExportsFor({
139139

140140
/**
141141
* @param {Object} param0
142-
* @param {import('./packageJson').PackageJson} param0.packageJson - The package.json content.
142+
* @param {import('./packageJson.js').PackageJson} param0.packageJson - The package.json content.
143143
* @param {{type: import('../utils/build.mjs').BundleType; dir: string}[]} param0.bundles
144144
* @param {string} param0.outputDir
145145
* @param {string} param0.cwd
@@ -154,15 +154,15 @@ async function writePackageJson({ packageJson, bundles, outputDir, cwd, addTypes
154154
packageJson.type = packageJson.type || 'commonjs';
155155

156156
/**
157-
* @type {import('./packageJson').PackageJson.ExportConditions}
157+
* @type {import('./packageJson.js').PackageJson.ExportConditions}
158158
*/
159159
const originalExports =
160160
typeof packageJson.exports === 'string' || Array.isArray(packageJson.exports)
161161
? { '.': packageJson.exports }
162162
: packageJson.exports || {};
163163
delete packageJson.exports;
164164
/**
165-
* @type {import('./packageJson').PackageJson.ExportConditions}
165+
* @type {import('./packageJson.js').PackageJson.ExportConditions}
166166
*/
167167
const newExports = {
168168
'./package.json': './package.json',

packages/code-infra/src/eslint/index.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/// <reference types="../estree-typescript" />
2-
/// <reference types="../untyped-plugins" />
1+
/// <reference types="../estree-typescript.js" />
2+
/// <reference types="../untyped-plugins.js" />
33

44
export * from './baseConfig.mjs';
55
export * from './docsConfig.mjs';

packages/code-infra/src/utils/babel.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable no-console */
2-
/// <reference types="../untyped-plugins" />
2+
/// <reference types="../untyped-plugins.js" />
33

44
import { findWorkspaceDir } from '@pnpm/find-workspace-dir';
55
import { globby } from 'globby';

packages/code-infra/tsconfig.build.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"outDir": "./build",
77
"rootDir": "./src",
88
"noEmit": false,
9-
"skipLibCheck": true
9+
"skipLibCheck": true,
10+
"module": "node16",
11+
"moduleResolution": "node16"
1012
},
1113
"include": ["src", "package.json"],
1214
"exclude": ["**/*.spec.*", "**/*.test.*", "**/setupVitest.ts", "vite.config.mts", "build"]

0 commit comments

Comments
 (0)