Skip to content

Commit ab976cd

Browse files
authored
chore(cli): add type imports (#2943)
1 parent f4b771a commit ab976cd

File tree

11 files changed

+21
-17
lines changed

11 files changed

+21
-17
lines changed

cli/src/api/artifacts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as colors from 'colorette'
44

55
import {
66
applyDefaultArtifactsOptions,
7-
ArtifactsOptions,
7+
type ArtifactsOptions,
88
} from '../def/artifacts.js'
99
import {
1010
readNapiConfig,

cli/src/api/build.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,31 @@ import { parse, join, resolve } from 'node:path'
77

88
import * as colors from 'colorette'
99

10-
import { BuildOptions as RawBuildOptions } from '../def/build.js'
10+
import type { BuildOptions as RawBuildOptions } from '../def/build.js'
1111
import {
1212
CLI_VERSION,
1313
copyFileAsync,
14-
Crate,
14+
type Crate,
1515
debugFactory,
1616
DEFAULT_TYPE_DEF_HEADER,
1717
fileExists,
1818
getSystemDefaultTarget,
1919
getTargetLinker,
2020
mkdirAsync,
21-
NapiConfig,
21+
type NapiConfig,
2222
parseMetadata,
2323
parseTriple,
2424
processTypeDef,
2525
readFileAsync,
2626
readNapiConfig,
27-
Target,
27+
type Target,
2828
targetToEnvVar,
2929
tryInstallCargoBinary,
3030
unlinkAsync,
3131
writeFileAsync,
3232
dirExistsAsync,
3333
readdirAsync,
34-
CargoWorkspaceMetadata,
34+
type CargoWorkspaceMetadata,
3535
} from '../utils/index.js'
3636

3737
import { createCjsBinding, createEsmBinding } from './templates/index.js'

cli/src/api/create-npm-dirs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import { parse } from 'semver'
44

55
import {
66
applyDefaultCreateNpmDirsOptions,
7-
CreateNpmDirsOptions,
7+
type CreateNpmDirsOptions,
88
} from '../def/create-npm-dirs.js'
99
import {
1010
debugFactory,
1111
readNapiConfig,
1212
mkdirAsync as rawMkdirAsync,
1313
pick,
1414
writeFileAsync as rawWriteFileAsync,
15-
Target,
15+
type Target,
1616
type CommonPackageJsonFields,
1717
} from '../utils/index.js'
1818

cli/src/api/new.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { load as yamlLoad, dump as yamlDump } from 'js-yaml'
88

99
import {
1010
applyDefaultNewOptions,
11-
NewOptions as RawNewOptions,
11+
type NewOptions as RawNewOptions,
1212
} from '../def/new.js'
1313
import {
1414
AVAILABLE_TARGETS,
@@ -17,7 +17,7 @@ import {
1717
mkdirAsync,
1818
readdirAsync,
1919
statAsync,
20-
SupportedPackageManager,
20+
type SupportedPackageManager,
2121
} from '../utils/index.js'
2222
import { napiEngineRequirement } from '../utils/version.js'
2323
import { renameProject } from './rename.js'
@@ -469,4 +469,4 @@ function getBinaryName(name: string): string {
469469
return name.split('/').pop()!
470470
}
471471

472-
export { NewOptions }
472+
export type { NewOptions }

cli/src/api/pre-publish.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Octokit } from '@octokit/rest'
66

77
import {
88
applyDefaultPrePublishOptions,
9-
PrePublishOptions,
9+
type PrePublishOptions,
1010
} from '../def/pre-publish.js'
1111
import {
1212
readFileAsync,

cli/src/api/rename.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { load as yamlParse, dump as yamlStringify } from 'js-yaml'
77
import { isNil, merge, omitBy, pick } from 'es-toolkit'
88
import * as find from 'empathic/find'
99

10-
import { applyDefaultRenameOptions, RenameOptions } from '../def/rename.js'
10+
import { applyDefaultRenameOptions, type RenameOptions } from '../def/rename.js'
1111
import { readConfig, readFileAsync, writeFileAsync } from '../utils/index.js'
1212

1313
export async function renameProject(userOptions: RenameOptions) {

cli/src/api/universalize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { join, resolve } from 'node:path'
33

44
import {
55
applyDefaultUniversalizeOptions,
6-
UniversalizeOptions,
6+
type UniversalizeOptions,
77
} from '../def/universalize.js'
88
import { readNapiConfig } from '../utils/config.js'
99
import { debugFactory } from '../utils/log.js'

cli/src/api/version.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { join, resolve } from 'node:path'
22

3-
import { applyDefaultVersionOptions, VersionOptions } from '../def/version.js'
3+
import {
4+
applyDefaultVersionOptions,
5+
type VersionOptions,
6+
} from '../def/version.js'
47
import {
58
readNapiConfig,
69
debugFactory,

cli/src/commands/new.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
AVAILABLE_TARGETS,
1010
debugFactory,
1111
DEFAULT_TARGETS,
12-
TargetTriple,
12+
type TargetTriple,
1313
} from '../utils/index.js'
1414
import { napiEngineRequirement } from '../utils/version.js'
1515

cli/src/utils/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { underline, yellow } from 'colorette'
22
import { merge, omit } from 'es-toolkit'
33

44
import { fileExists, readFileAsync } from './misc.js'
5-
import { DEFAULT_TARGETS, parseTriple, Target } from './target.js'
5+
import { DEFAULT_TARGETS, parseTriple, type Target } from './target.js'
66

77
export type ValueOfConstArray<T> = T[Exclude<keyof T, keyof Array<any>>]
88

0 commit comments

Comments
 (0)