diff --git a/change/beachball-68ef8117-b338-4a39-996b-803a38057146.json b/change/beachball-68ef8117-b338-4a39-996b-803a38057146.json new file mode 100644 index 000000000..94c1f57e4 --- /dev/null +++ b/change/beachball-68ef8117-b338-4a39-996b-803a38057146.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "Use import/export type", + "packageName": "beachball", + "email": "elcraig@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/src/__e2e__/bump.test.ts b/src/__e2e__/bump.test.ts index 1392250bb..b5ba80457 100644 --- a/src/__e2e__/bump.test.ts +++ b/src/__e2e__/bump.test.ts @@ -4,10 +4,10 @@ import path from 'path'; import { generateChangeFiles, getChangeFiles } from '../__fixtures__/changeFiles'; import { readChangelogJson } from '../__fixtures__/changelog'; import { initMockLogs } from '../__fixtures__/mockLogs'; -import { RepoFixture, RepositoryFactory } from '../__fixtures__/repositoryFactory'; +import { type RepoFixture, RepositoryFactory } from '../__fixtures__/repositoryFactory'; import { bump } from '../commands/bump'; import { getPackageInfos } from '../monorepo/getPackageInfos'; -import { BeachballOptions, HooksOptions } from '../types/BeachballOptions'; +import type { BeachballOptions, HooksOptions } from '../types/BeachballOptions'; import type { Repository } from '../__fixtures__/repository'; import { getDefaultOptions } from '../options/getDefaultOptions'; import type { PackageJson } from '../types/PackageInfo'; diff --git a/src/__e2e__/change.test.ts b/src/__e2e__/change.test.ts index ecb9e4b8b..d1fb9844f 100644 --- a/src/__e2e__/change.test.ts +++ b/src/__e2e__/change.test.ts @@ -3,14 +3,14 @@ import fs from 'fs-extra'; import type prompts from 'prompts'; import { getChangeFiles } from '../__fixtures__/changeFiles'; import { initMockLogs } from '../__fixtures__/mockLogs'; -import { RepoFixture, RepositoryFactory } from '../__fixtures__/repositoryFactory'; +import { type RepoFixture, RepositoryFactory } from '../__fixtures__/repositoryFactory'; import { change } from '../commands/change'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { defaultBranchName } from '../__fixtures__/gitDefaults'; import { MockStdout } from '../__fixtures__/mockStdout'; import { MockStdin } from '../__fixtures__/mockStdin'; import type { ChangeFileInfo, ChangeInfoMultiple } from '../types/ChangeInfo'; -import { Repository } from '../__fixtures__/repository'; +import type { Repository } from '../__fixtures__/repository'; import { getDefaultOptions } from '../options/getDefaultOptions'; // prompts writes to stdout (not console) in a way that can't really be mocked with spies, diff --git a/src/__e2e__/getChangedPackages.test.ts b/src/__e2e__/getChangedPackages.test.ts index 5607631fb..cf329afc1 100644 --- a/src/__e2e__/getChangedPackages.test.ts +++ b/src/__e2e__/getChangedPackages.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it, afterEach } from '@jest/globals'; import { defaultBranchName } from '../__fixtures__/gitDefaults'; import { RepositoryFactory } from '../__fixtures__/repositoryFactory'; import { getPackageInfos } from '../monorepo/getPackageInfos'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { getChangedPackages } from '../changefile/getChangedPackages'; import { initMockLogs } from '../__fixtures__/mockLogs'; import { generateChangeFiles } from '../__fixtures__/changeFiles'; diff --git a/src/__e2e__/publishE2E.test.ts b/src/__e2e__/publishE2E.test.ts index 98d31cf28..bb73f866c 100644 --- a/src/__e2e__/publishE2E.test.ts +++ b/src/__e2e__/publishE2E.test.ts @@ -6,11 +6,11 @@ import { generateChangeFiles } from '../__fixtures__/changeFiles'; import { defaultBranchName, defaultRemoteBranchName } from '../__fixtures__/gitDefaults'; import { initMockLogs } from '../__fixtures__/mockLogs'; import { npmShow } from '../__fixtures__/npmShow'; -import { Repository } from '../__fixtures__/repository'; -import { PackageJsonFixture, RepositoryFactory } from '../__fixtures__/repositoryFactory'; +import type { Repository } from '../__fixtures__/repository'; +import { type PackageJsonFixture, RepositoryFactory } from '../__fixtures__/repositoryFactory'; import { publish } from '../commands/publish'; import { getDefaultOptions } from '../options/getDefaultOptions'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { _mockNpmPublish, initNpmMock } from '../__fixtures__/mockNpm'; import type { PackageJson } from '../types/PackageInfo'; diff --git a/src/__e2e__/publishGit.test.ts b/src/__e2e__/publishGit.test.ts index 68073b619..c58f8c8bf 100644 --- a/src/__e2e__/publishGit.test.ts +++ b/src/__e2e__/publishGit.test.ts @@ -3,13 +3,13 @@ import fs from 'fs-extra'; import { defaultRemoteBranchName } from '../__fixtures__/gitDefaults'; import { generateChangeFiles, getChangeFiles } from '../__fixtures__/changeFiles'; import { initMockLogs } from '../__fixtures__/mockLogs'; -import { Repository } from '../__fixtures__/repository'; +import type { Repository } from '../__fixtures__/repository'; import { RepositoryFactory } from '../__fixtures__/repositoryFactory'; import { bumpAndPush } from '../publish/bumpAndPush'; import { publish } from '../commands/publish'; import { gatherBumpInfo } from '../bump/gatherBumpInfo'; -import { BeachballOptions } from '../types/BeachballOptions'; -import { ChangeFileInfo } from '../types/ChangeInfo'; +import type { BeachballOptions } from '../types/BeachballOptions'; +import type { ChangeFileInfo } from '../types/ChangeInfo'; import { getPackageInfos } from '../monorepo/getPackageInfos'; import { getDefaultOptions } from '../options/getDefaultOptions'; import type { PackageJson } from '../types/PackageInfo'; diff --git a/src/__e2e__/publishRegistry.test.ts b/src/__e2e__/publishRegistry.test.ts index f3f0f3622..f39c7de75 100644 --- a/src/__e2e__/publishRegistry.test.ts +++ b/src/__e2e__/publishRegistry.test.ts @@ -3,11 +3,11 @@ import { defaultRemoteBranchName } from '../__fixtures__/gitDefaults'; import { generateChangeFiles } from '../__fixtures__/changeFiles'; import { initMockLogs } from '../__fixtures__/mockLogs'; import { npmShow } from '../__fixtures__/npmShow'; -import { Repository } from '../__fixtures__/repository'; +import type { Repository } from '../__fixtures__/repository'; import { RepositoryFactory } from '../__fixtures__/repositoryFactory'; import { publish } from '../commands/publish'; import { getDefaultOptions } from '../options/getDefaultOptions'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { initNpmMock } from '../__fixtures__/mockNpm'; // Spawning actual npm to run commands against a fake registry is extremely slow, so mock it for diff --git a/src/__e2e__/syncE2E.test.ts b/src/__e2e__/syncE2E.test.ts index df35a924d..ca3f8847f 100644 --- a/src/__e2e__/syncE2E.test.ts +++ b/src/__e2e__/syncE2E.test.ts @@ -2,13 +2,13 @@ import { describe, expect, it, afterEach, jest } from '@jest/globals'; import fs from 'fs-extra'; import { defaultRemoteBranchName } from '../__fixtures__/gitDefaults'; import { initMockLogs } from '../__fixtures__/mockLogs'; -import { Repository } from '../__fixtures__/repository'; +import type { Repository } from '../__fixtures__/repository'; import { RepositoryFactory } from '../__fixtures__/repositoryFactory'; import { sync } from '../commands/sync'; import { getPackageInfos } from '../monorepo/getPackageInfos'; -import { packagePublish } from '../packageManager/packagePublish'; +import type { packagePublish } from '../packageManager/packagePublish'; import { getDefaultOptions } from '../options/getDefaultOptions'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { initNpmMock } from '../__fixtures__/mockNpm'; // Spawning actual npm to run commands against a fake registry is extremely slow, so mock it for diff --git a/src/__e2e__/validate.test.ts b/src/__e2e__/validate.test.ts index 136db1e50..c7d000b85 100644 --- a/src/__e2e__/validate.test.ts +++ b/src/__e2e__/validate.test.ts @@ -1,7 +1,7 @@ -import { describe, expect, it, afterAll, jest, beforeAll, afterEach } from '@jest/globals'; +import { describe, expect, it, afterAll, type jest, beforeAll, afterEach } from '@jest/globals'; import { defaultBranchName } from '../__fixtures__/gitDefaults'; import { RepositoryFactory } from '../__fixtures__/repositoryFactory'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { initMockLogs } from '../__fixtures__/mockLogs'; import { validate } from '../validation/validate'; import type { Repository } from '../__fixtures__/repository'; diff --git a/src/__fixtures__/changeFiles.ts b/src/__fixtures__/changeFiles.ts index d02b57530..4a958d3b4 100644 --- a/src/__fixtures__/changeFiles.ts +++ b/src/__fixtures__/changeFiles.ts @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import { writeChangeFiles } from '../changefile/writeChangeFiles'; import { getChangePath } from '../paths'; -import { ChangeFileInfo, ChangeType } from '../types/ChangeInfo'; +import type { ChangeFileInfo, ChangeType } from '../types/ChangeInfo'; import type { BeachballOptions } from '../types/BeachballOptions'; /** Change file with `packageName` required and other props optional */ diff --git a/src/__fixtures__/changelog.ts b/src/__fixtures__/changelog.ts index 8853a0caf..50ea3a650 100644 --- a/src/__fixtures__/changelog.ts +++ b/src/__fixtures__/changelog.ts @@ -1,6 +1,6 @@ import fs from 'fs-extra'; import path from 'path'; -import { ChangelogJson } from '../types/ChangeLog'; +import type { ChangelogJson } from '../types/ChangeLog'; import { markerComment } from '../changelog/renderChangelog'; /** Placeholder commit as replaced by cleanChangelogJson */ diff --git a/src/__fixtures__/gitDefaults.ts b/src/__fixtures__/gitDefaults.ts index cfb94f31a..99f630947 100644 --- a/src/__fixtures__/gitDefaults.ts +++ b/src/__fixtures__/gitDefaults.ts @@ -1,4 +1,4 @@ -import { git, gitFailFast } from 'workspace-tools'; +import { type git, gitFailFast } from 'workspace-tools'; export const defaultBranchName = 'master'; export const defaultRemoteName = 'origin'; diff --git a/src/__fixtures__/mockNpm.test.ts b/src/__fixtures__/mockNpm.test.ts index f65b1cd99..cc7331da1 100644 --- a/src/__fixtures__/mockNpm.test.ts +++ b/src/__fixtures__/mockNpm.test.ts @@ -4,8 +4,8 @@ import { afterAll, afterEach, beforeAll, describe, expect, it, jest } from '@jest/globals'; import fs from 'fs-extra'; -import { NpmResult, npm } from '../packageManager/npm'; -import { PackageJson } from '../types/PackageInfo'; +import { type NpmResult, npm } from '../packageManager/npm'; +import type { PackageJson } from '../types/PackageInfo'; import { initNpmMock, _makeRegistryData, _mockNpmPublish, _mockNpmShow, type MockNpmResult } from './mockNpm'; jest.mock('fs-extra'); diff --git a/src/__fixtures__/mockNpm.ts b/src/__fixtures__/mockNpm.ts index 51fd769d3..88a336821 100644 --- a/src/__fixtures__/mockNpm.ts +++ b/src/__fixtures__/mockNpm.ts @@ -1,11 +1,11 @@ -import { afterAll, afterEach, beforeAll, jest } from '@jest/globals'; +import { afterAll, afterEach, beforeAll, type jest } from '@jest/globals'; import fs from 'fs-extra'; import _ from 'lodash'; import path from 'path'; import semver from 'semver'; -import { NpmShowResult } from '../packageManager/listPackageVersions'; +import type { NpmShowResult } from '../packageManager/listPackageVersions'; import { npm, NpmResult } from '../packageManager/npm'; -import { PackageJson } from '../types/PackageInfo'; +import type { PackageJson } from '../types/PackageInfo'; import type { PackageManagerOptions } from '../packageManager/packageManager'; /** Published versions and dist-tags for a package */ diff --git a/src/__fixtures__/npmShow.ts b/src/__fixtures__/npmShow.ts index 5fe536327..b4aefd0b3 100644 --- a/src/__fixtures__/npmShow.ts +++ b/src/__fixtures__/npmShow.ts @@ -1,9 +1,9 @@ import { expect } from '@jest/globals'; import os from 'os'; import { env } from '../env'; -import { NpmShowResult } from '../packageManager/listPackageVersions'; +import type { NpmShowResult } from '../packageManager/listPackageVersions'; import { npm } from '../packageManager/npm'; -import { Registry } from './registry'; +import type { Registry } from './registry'; /** * Runs `npm show ` on the fake registry and returns the result. diff --git a/src/__fixtures__/packageInfos.ts b/src/__fixtures__/packageInfos.ts index fd91c08f4..3285d4af3 100644 --- a/src/__fixtures__/packageInfos.ts +++ b/src/__fixtures__/packageInfos.ts @@ -1,6 +1,6 @@ import _ from 'lodash'; -import { BeachballOptions } from '../types/BeachballOptions'; -import { PackageInfo, PackageInfos } from '../types/PackageInfo'; +import type { BeachballOptions } from '../types/BeachballOptions'; +import type { PackageInfo, PackageInfos } from '../types/PackageInfo'; import { getDefaultOptions } from '../options/getDefaultOptions'; const defaultOptions = getDefaultOptions(); diff --git a/src/__fixtures__/repositoryFactory.ts b/src/__fixtures__/repositoryFactory.ts index adcd5cfd0..cba933340 100644 --- a/src/__fixtures__/repositoryFactory.ts +++ b/src/__fixtures__/repositoryFactory.ts @@ -1,8 +1,8 @@ import fs from 'fs-extra'; import path from 'path'; -import { PackageJson } from '../types/PackageInfo'; -import { Repository, RepositoryCloneOptions } from './repository'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { PackageJson } from '../types/PackageInfo'; +import { Repository, type RepositoryCloneOptions } from './repository'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { tmpdir } from './tmpdir'; import { gitFailFast } from 'workspace-tools'; import { setDefaultBranchName } from './gitDefaults'; diff --git a/src/__functional__/changefile/readChangeFiles.test.ts b/src/__functional__/changefile/readChangeFiles.test.ts index 680f57e23..fcd9339df 100644 --- a/src/__functional__/changefile/readChangeFiles.test.ts +++ b/src/__functional__/changefile/readChangeFiles.test.ts @@ -6,10 +6,10 @@ import { RepositoryFactory } from '../../__fixtures__/repositoryFactory'; import { getPackageInfos } from '../../monorepo/getPackageInfos'; import { readChangeFiles } from '../../changefile/readChangeFiles'; -import { BeachballOptions } from '../../types/BeachballOptions'; +import type { BeachballOptions } from '../../types/BeachballOptions'; import type { Repository } from '../../__fixtures__/repository'; import { getDefaultOptions } from '../../options/getDefaultOptions'; -import { ChangeInfo } from '../../types/ChangeInfo'; +import type { ChangeInfo } from '../../types/ChangeInfo'; describe('readChangeFiles', () => { let repositoryFactory: RepositoryFactory; diff --git a/src/__functional__/git/fetch.test.ts b/src/__functional__/git/fetch.test.ts index c8c562cd5..5e3d96680 100644 --- a/src/__functional__/git/fetch.test.ts +++ b/src/__functional__/git/fetch.test.ts @@ -2,10 +2,10 @@ import { describe, expect, it, beforeAll, afterAll, jest, afterEach } from '@jes import * as workspaceTools from 'workspace-tools'; import { RepositoryFactory } from '../../__fixtures__/repositoryFactory'; import { initMockLogs } from '../../__fixtures__/mockLogs'; -import { Repository } from '../../__fixtures__/repository'; +import type { Repository } from '../../__fixtures__/repository'; import { gitFetch } from '../../git/fetch'; import { defaultBranchName, defaultRemoteName } from '../../__fixtures__/gitDefaults'; -import { GitProcessOutput } from 'workspace-tools'; +import type { GitProcessOutput } from 'workspace-tools'; // required for `jest.spyOn('workspace-tools', git)` to work jest.mock('workspace-tools', () => { diff --git a/src/__functional__/monorepo/getScopedPackages.test.ts b/src/__functional__/monorepo/getScopedPackages.test.ts index a22f9bce7..f0a457e0d 100644 --- a/src/__functional__/monorepo/getScopedPackages.test.ts +++ b/src/__functional__/monorepo/getScopedPackages.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it, beforeAll, afterAll } from '@jest/globals'; -import { Repository } from '../../__fixtures__/repository'; +import type { Repository } from '../../__fixtures__/repository'; import { RepositoryFactory } from '../../__fixtures__/repositoryFactory'; import { getScopedPackages } from '../../monorepo/getScopedPackages'; -import { PackageInfos } from '../../types/PackageInfo'; +import type { PackageInfos } from '../../types/PackageInfo'; import { getPackageInfos } from '../../monorepo/getPackageInfos'; describe('getScopedPackages', () => { diff --git a/src/__functional__/options/getOptions.test.ts b/src/__functional__/options/getOptions.test.ts index 2af4151ff..e65cd2701 100644 --- a/src/__functional__/options/getOptions.test.ts +++ b/src/__functional__/options/getOptions.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, beforeAll, afterEach, afterAll } from '@jest/globals'; import fs from 'fs-extra'; -import { Repository } from '../../__fixtures__/repository'; +import type { Repository } from '../../__fixtures__/repository'; import { RepositoryFactory } from '../../__fixtures__/repositoryFactory'; import { getOptions } from '../../options/getOptions'; diff --git a/src/__functional__/packageManager/packagePublish.test.ts b/src/__functional__/packageManager/packagePublish.test.ts index 1d30bd610..2feca6fc1 100644 --- a/src/__functional__/packageManager/packagePublish.test.ts +++ b/src/__functional__/packageManager/packagePublish.test.ts @@ -7,8 +7,8 @@ import { Registry } from '../../__fixtures__/registry'; import { tmpdir } from '../../__fixtures__/tmpdir'; import * as npmModule from '../../packageManager/npm'; import { packagePublish } from '../../packageManager/packagePublish'; -import { PackageInfo } from '../../types/PackageInfo'; -import { npm, NpmResult } from '../../packageManager/npm'; +import type { PackageInfo } from '../../types/PackageInfo'; +import type { npm, NpmResult } from '../../packageManager/npm'; import type { PackageOptions } from '../../types/BeachballOptions'; const testTag = 'testbeachballtag'; diff --git a/src/__functional__/validation/areChangeFilesDeleted.test.ts b/src/__functional__/validation/areChangeFilesDeleted.test.ts index 231d3dc5c..4cc47dd96 100644 --- a/src/__functional__/validation/areChangeFilesDeleted.test.ts +++ b/src/__functional__/validation/areChangeFilesDeleted.test.ts @@ -3,9 +3,9 @@ import fs from 'fs-extra'; import { generateChangeFiles } from '../../__fixtures__/changeFiles'; import { defaultRemoteBranchName } from '../../__fixtures__/gitDefaults'; import { initMockLogs } from '../../__fixtures__/mockLogs'; -import { Repository } from '../../__fixtures__/repository'; +import type { Repository } from '../../__fixtures__/repository'; import { RepositoryFactory } from '../../__fixtures__/repositoryFactory'; -import { BeachballOptions } from '../../types/BeachballOptions'; +import type { BeachballOptions } from '../../types/BeachballOptions'; import { areChangeFilesDeleted } from '../../validation/areChangeFilesDeleted'; import { getChangePath } from '../../paths'; import { getDefaultOptions } from '../../options/getDefaultOptions'; diff --git a/src/__functional__/validation/isChangeFileNeeded.test.ts b/src/__functional__/validation/isChangeFileNeeded.test.ts index 327afbbf2..0c1e002d7 100644 --- a/src/__functional__/validation/isChangeFileNeeded.test.ts +++ b/src/__functional__/validation/isChangeFileNeeded.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it, beforeAll, beforeEach, afterAll } from '@jest/globals'; import { defaultRemoteBranchName, defaultRemoteName } from '../../__fixtures__/gitDefaults'; import { initMockLogs } from '../../__fixtures__/mockLogs'; -import { Repository } from '../../__fixtures__/repository'; +import type { Repository } from '../../__fixtures__/repository'; import { RepositoryFactory } from '../../__fixtures__/repositoryFactory'; import { isChangeFileNeeded } from '../../validation/isChangeFileNeeded'; -import { BeachballOptions } from '../../types/BeachballOptions'; +import type { BeachballOptions } from '../../types/BeachballOptions'; import { getPackageInfos } from '../../monorepo/getPackageInfos'; import { getDefaultOptions } from '../../options/getDefaultOptions'; diff --git a/src/__tests__/bump/updateRelatedChangeType.test.ts b/src/__tests__/bump/updateRelatedChangeType.test.ts index ee64a4078..9179200ab 100644 --- a/src/__tests__/bump/updateRelatedChangeType.test.ts +++ b/src/__tests__/bump/updateRelatedChangeType.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from '@jest/globals'; import { updateRelatedChangeType } from '../../bump/updateRelatedChangeType'; -import { BumpInfo } from '../../types/BumpInfo'; +import type { BumpInfo } from '../../types/BumpInfo'; import _ from 'lodash'; -import { ChangeInfo, ChangeSet, ChangeType } from '../../types/ChangeInfo'; +import type { ChangeInfo, ChangeSet, ChangeType } from '../../types/ChangeInfo'; import { makePackageInfos } from '../../__fixtures__/packageInfos'; type DeepPartial = { diff --git a/src/__tests__/changefile/changeTypes.test.ts b/src/__tests__/changefile/changeTypes.test.ts index 37ad320fe..06c2b78f5 100644 --- a/src/__tests__/changefile/changeTypes.test.ts +++ b/src/__tests__/changefile/changeTypes.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from '@jest/globals'; import { getMaxChangeType, initializePackageChangeTypes } from '../../changefile/changeTypes'; -import { ChangeSet } from '../../types/ChangeInfo'; +import type { ChangeSet } from '../../types/ChangeInfo'; describe('getMaxChangeType', () => { it('handles equal change types', () => { diff --git a/src/__tests__/changefile/getDisallowedChangeTypes.test.ts b/src/__tests__/changefile/getDisallowedChangeTypes.test.ts index bc532d96e..7ae921e08 100644 --- a/src/__tests__/changefile/getDisallowedChangeTypes.test.ts +++ b/src/__tests__/changefile/getDisallowedChangeTypes.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from '@jest/globals'; import { getDisallowedChangeTypes } from '../../changefile/getDisallowedChangeTypes'; -import { PackageGroups } from '../../types/PackageInfo'; +import type { PackageGroups } from '../../types/PackageInfo'; import { makePackageInfos } from '../../__fixtures__/packageInfos'; describe('getDisallowedChangeTypes', () => { diff --git a/src/__tests__/changefile/getQuestionsForPackage.test.ts b/src/__tests__/changefile/getQuestionsForPackage.test.ts index e57959ca6..5f73824d2 100644 --- a/src/__tests__/changefile/getQuestionsForPackage.test.ts +++ b/src/__tests__/changefile/getQuestionsForPackage.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, jest } from '@jest/globals'; -import prompts from 'prompts'; +import type prompts from 'prompts'; import { getQuestionsForPackage } from '../../changefile/getQuestionsForPackage'; -import { ChangeFilePromptOptions } from '../../types/ChangeFilePrompt'; +import type { ChangeFilePromptOptions } from '../../types/ChangeFilePrompt'; import { initMockLogs } from '../../__fixtures__/mockLogs'; import { makePackageInfos } from '../../__fixtures__/packageInfos'; import type { ChangeType } from '../../types/ChangeInfo'; diff --git a/src/__tests__/changefile/promptForChange.test.ts b/src/__tests__/changefile/promptForChange.test.ts index c2510cfd5..33e1bd7b5 100644 --- a/src/__tests__/changefile/promptForChange.test.ts +++ b/src/__tests__/changefile/promptForChange.test.ts @@ -1,7 +1,7 @@ import { afterEach, beforeEach, describe, expect, it, jest } from '@jest/globals'; -import prompts from 'prompts'; +import type prompts from 'prompts'; import { promptForChange } from '../../changefile/promptForChange'; -import { ChangeFilePromptOptions } from '../../types/ChangeFilePrompt'; +import type { ChangeFilePromptOptions } from '../../types/ChangeFilePrompt'; import { initMockLogs } from '../../__fixtures__/mockLogs'; import { MockStdin } from '../../__fixtures__/mockStdin'; import { MockStdout } from '../../__fixtures__/mockStdout'; diff --git a/src/__tests__/changefile/promptForChange_promptForPackageChange.test.ts b/src/__tests__/changefile/promptForChange_promptForPackageChange.test.ts index fbef046ed..c8d0a529c 100644 --- a/src/__tests__/changefile/promptForChange_promptForPackageChange.test.ts +++ b/src/__tests__/changefile/promptForChange_promptForPackageChange.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, jest } from '@jest/globals'; -import prompts from 'prompts'; +import type prompts from 'prompts'; import { _promptForPackageChange } from '../../changefile/promptForChange'; import { initMockLogs } from '../../__fixtures__/mockLogs'; import { MockStdin } from '../../__fixtures__/mockStdin'; diff --git a/src/__tests__/changelog/getPackageChangelogs.test.ts b/src/__tests__/changelog/getPackageChangelogs.test.ts index 19a50cc91..2fc36bd7c 100644 --- a/src/__tests__/changelog/getPackageChangelogs.test.ts +++ b/src/__tests__/changelog/getPackageChangelogs.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it, jest } from '@jest/globals'; import { getPackageChangelogs } from '../../changelog/getPackageChangelogs'; -import { BumpInfo } from '../../types/BumpInfo'; -import { ChangeFileInfo, ChangeSet } from '../../types/ChangeInfo'; -import { PackageInfos } from '../../types/PackageInfo'; +import type { BumpInfo } from '../../types/BumpInfo'; +import type { ChangeFileInfo, ChangeSet } from '../../types/ChangeInfo'; +import type { PackageInfos } from '../../types/PackageInfo'; import { makePackageInfos } from '../../__fixtures__/packageInfos'; const commit = 'deadbeef'; diff --git a/src/__tests__/changelog/mergeChangelogs.test.ts b/src/__tests__/changelog/mergeChangelogs.test.ts index 16e1ff247..8ff8b39dd 100644 --- a/src/__tests__/changelog/mergeChangelogs.test.ts +++ b/src/__tests__/changelog/mergeChangelogs.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from '@jest/globals'; -import { PackageChangelog } from '../../types/ChangeLog'; +import type { PackageChangelog } from '../../types/ChangeLog'; import { mergeChangelogs } from '../../changelog/mergeChangelogs'; -import { PackageInfo } from '../../types/PackageInfo'; +import type { PackageInfo } from '../../types/PackageInfo'; describe('mergeChangelogs', () => { const primaryPackageInfo = { diff --git a/src/__tests__/changelog/renderChangelog.test.ts b/src/__tests__/changelog/renderChangelog.test.ts index 501e61c91..3eef79902 100644 --- a/src/__tests__/changelog/renderChangelog.test.ts +++ b/src/__tests__/changelog/renderChangelog.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, jest } from '@jest/globals'; import { initMockLogs } from '../../__fixtures__/mockLogs'; import { - MarkdownChangelogRenderOptions, + type MarkdownChangelogRenderOptions, renderChangelog, markerComment, _trimPreviousLog, diff --git a/src/__tests__/changelog/renderJsonChangelog.test.ts b/src/__tests__/changelog/renderJsonChangelog.test.ts index 1946f908e..4c4d1eaef 100644 --- a/src/__tests__/changelog/renderJsonChangelog.test.ts +++ b/src/__tests__/changelog/renderJsonChangelog.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from '@jest/globals'; -import { ChangelogJson, PackageChangelog } from '../..'; +import type { ChangelogJson, PackageChangelog } from '../../types/ChangeLog'; import { renderJsonChangelog } from '../../changelog/renderJsonChangelog'; describe('renderJsonChangelog', () => { diff --git a/src/__tests__/changelog/renderPackageChangelog.test.ts b/src/__tests__/changelog/renderPackageChangelog.test.ts index 377086a8c..459b648ab 100644 --- a/src/__tests__/changelog/renderPackageChangelog.test.ts +++ b/src/__tests__/changelog/renderPackageChangelog.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from '@jest/globals'; -import { PackageChangelogRenderInfo } from '../../types/ChangelogOptions'; +import type { PackageChangelogRenderInfo } from '../../types/ChangelogOptions'; import { defaultRenderers, renderPackageChangelog } from '../../changelog/renderPackageChangelog'; import type { ChangelogEntry, ChangelogJson } from '../../types/ChangeLog'; import { SortedChangeTypes } from '../../changefile/changeTypes'; diff --git a/src/__tests__/monorepo/getPackageGraph.test.ts b/src/__tests__/monorepo/getPackageGraph.test.ts index 7e94647d6..8ecde1b8a 100644 --- a/src/__tests__/monorepo/getPackageGraph.test.ts +++ b/src/__tests__/monorepo/getPackageGraph.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from '@jest/globals'; import { toposortPackages } from '../../publish/toposortPackages'; -import { PackageInfo, PackageInfos } from '../../types/PackageInfo'; +import type { PackageInfo, PackageInfos } from '../../types/PackageInfo'; import { makePackageInfos } from '../../__fixtures__/packageInfos'; import { getPackageGraph } from '../../monorepo/getPackageGraph'; diff --git a/src/__tests__/packageManager/listPackageVersions.test.ts b/src/__tests__/packageManager/listPackageVersions.test.ts index ac09e48fe..14e0d0601 100644 --- a/src/__tests__/packageManager/listPackageVersions.test.ts +++ b/src/__tests__/packageManager/listPackageVersions.test.ts @@ -5,7 +5,7 @@ import { listPackageVersionsByTag, _clearPackageVersionsCache, } from '../../packageManager/listPackageVersions'; -import { NpmOptions } from '../../types/NpmOptions'; +import type { NpmOptions } from '../../types/NpmOptions'; import { initNpmMock } from '../../__fixtures__/mockNpm'; import { makePackageInfos } from '../../__fixtures__/packageInfos'; diff --git a/src/__tests__/packageManager/npmArgs.test.ts b/src/__tests__/packageManager/npmArgs.test.ts index c00b643ee..ea3cabf0d 100644 --- a/src/__tests__/packageManager/npmArgs.test.ts +++ b/src/__tests__/packageManager/npmArgs.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from '@jest/globals'; import { getNpmAuthArgs, getNpmPublishArgs } from '../../packageManager/npmArgs'; -import { AuthType } from '../../types/Auth'; -import { NpmOptions } from '../../types/NpmOptions'; +import type { AuthType } from '../../types/Auth'; +import type { NpmOptions } from '../../types/NpmOptions'; import { makePackageInfos } from '../../__fixtures__/packageInfos'; describe('getNpmAuthArgs', () => { diff --git a/src/__tests__/publish/getNewPackages.test.ts b/src/__tests__/publish/getNewPackages.test.ts index 5a92c09d0..d1be907d1 100644 --- a/src/__tests__/publish/getNewPackages.test.ts +++ b/src/__tests__/publish/getNewPackages.test.ts @@ -1,7 +1,7 @@ import { afterEach, describe, expect, it, jest } from '@jest/globals'; import { _clearPackageVersionsCache } from '../../packageManager/listPackageVersions'; import { getNewPackages } from '../../publish/getNewPackages'; -import { NpmOptions } from '../../types/NpmOptions'; +import type { NpmOptions } from '../../types/NpmOptions'; import { initMockLogs } from '../../__fixtures__/mockLogs'; import { initNpmMock } from '../../__fixtures__/mockNpm'; import { makePackageInfos } from '../../__fixtures__/packageInfos'; diff --git a/src/__tests__/publish/performPublishOverrides.test.ts b/src/__tests__/publish/performPublishOverrides.test.ts index f95a507a3..846966a9b 100644 --- a/src/__tests__/publish/performPublishOverrides.test.ts +++ b/src/__tests__/publish/performPublishOverrides.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it, afterEach, jest } from '@jest/globals'; import * as fs from 'fs-extra'; import _ from 'lodash'; import { performPublishOverrides } from '../../publish/performPublishOverrides'; -import { PackageInfos, PackageJson, PublishConfig } from '../../types/PackageInfo'; +import type { PackageInfos, PackageJson, PublishConfig } from '../../types/PackageInfo'; import { makePackageInfos } from '../../__fixtures__/packageInfos'; jest.mock('fs-extra', () => ({ diff --git a/src/__tests__/publish/toposortPackages.test.ts b/src/__tests__/publish/toposortPackages.test.ts index f438d504c..71d5e11a4 100644 --- a/src/__tests__/publish/toposortPackages.test.ts +++ b/src/__tests__/publish/toposortPackages.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from '@jest/globals'; import { toposortPackages } from '../../publish/toposortPackages'; -import { PackageInfos } from '../../types/PackageInfo'; +import type { PackageInfos } from '../../types/PackageInfo'; import { makePackageInfos } from '../../__fixtures__/packageInfos'; describe('toposortPackages', () => { diff --git a/src/__tests__/publish/validatePackageVersions.test.ts b/src/__tests__/publish/validatePackageVersions.test.ts index 5e2f037a2..46bb1e300 100644 --- a/src/__tests__/publish/validatePackageVersions.test.ts +++ b/src/__tests__/publish/validatePackageVersions.test.ts @@ -1,7 +1,7 @@ import { afterEach, describe, expect, it, jest } from '@jest/globals'; import { _clearPackageVersionsCache } from '../../packageManager/listPackageVersions'; import { validatePackageVersions } from '../../publish/validatePackageVersions'; -import { NpmOptions } from '../../types/NpmOptions'; +import type { NpmOptions } from '../../types/NpmOptions'; import { initMockLogs } from '../../__fixtures__/mockLogs'; import { initNpmMock } from '../../__fixtures__/mockNpm'; import { makePackageInfos } from '../../__fixtures__/packageInfos'; diff --git a/src/bump/bumpInPlace.ts b/src/bump/bumpInPlace.ts index 86eb0307c..f761d6d67 100644 --- a/src/bump/bumpInPlace.ts +++ b/src/bump/bumpInPlace.ts @@ -1,8 +1,8 @@ -import { BumpInfo } from '../types/BumpInfo'; +import type { BumpInfo } from '../types/BumpInfo'; import { getDependentsForPackages } from './getDependentsForPackages'; import { updateRelatedChangeType } from './updateRelatedChangeType'; import { bumpPackageInfoVersion } from './bumpPackageInfoVersion'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { setDependentVersions } from './setDependentVersions'; /** diff --git a/src/bump/bumpPackageInfoVersion.ts b/src/bump/bumpPackageInfoVersion.ts index ef8e5ed9d..cbd006947 100644 --- a/src/bump/bumpPackageInfoVersion.ts +++ b/src/bump/bumpPackageInfoVersion.ts @@ -1,6 +1,6 @@ -import { BumpInfo } from '../types/BumpInfo'; +import type { BumpInfo } from '../types/BumpInfo'; import semver from 'semver'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; /** * Bumps an individual package version based on the change type. diff --git a/src/bump/callHook.ts b/src/bump/callHook.ts index 1231db1f8..054fb7e46 100644 --- a/src/bump/callHook.ts +++ b/src/bump/callHook.ts @@ -1,6 +1,6 @@ import path from 'path'; -import { HooksOptions } from '../types/BeachballOptions'; -import { PackageInfo, PackageInfos } from '../types/PackageInfo'; +import type { HooksOptions } from '../types/BeachballOptions'; +import type { PackageInfo, PackageInfos } from '../types/PackageInfo'; import { getPackageGraph } from '../monorepo/getPackageGraph'; /** diff --git a/src/bump/gatherBumpInfo.ts b/src/bump/gatherBumpInfo.ts index e6a0b2900..a430e9b2d 100644 --- a/src/bump/gatherBumpInfo.ts +++ b/src/bump/gatherBumpInfo.ts @@ -1,10 +1,10 @@ import { initializePackageChangeTypes } from '../changefile/changeTypes'; import { readChangeFiles } from '../changefile/readChangeFiles'; -import { BumpInfo } from '../types/BumpInfo'; +import type { BumpInfo } from '../types/BumpInfo'; import { bumpInPlace } from './bumpInPlace'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { getScopedPackages } from '../monorepo/getScopedPackages'; -import { PackageInfos } from '../types/PackageInfo'; +import type { PackageInfos } from '../types/PackageInfo'; import { getPackageGroups } from '../monorepo/getPackageGroups'; /** diff --git a/src/bump/performBump.ts b/src/bump/performBump.ts index f5cddb176..2c18ed9c5 100644 --- a/src/bump/performBump.ts +++ b/src/bump/performBump.ts @@ -1,7 +1,7 @@ import { unlinkChangeFiles } from '../changefile/unlinkChangeFiles'; import { writeChangelog } from '../changelog/writeChangelog'; -import { BumpInfo } from '../types/BumpInfo'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BumpInfo } from '../types/BumpInfo'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { callHook } from './callHook'; import { updatePackageJsons } from './updatePackageJsons'; import { updateLockFile } from './updateLockFile'; diff --git a/src/bump/setDependentVersions.ts b/src/bump/setDependentVersions.ts index f59c8cf78..a56de5b4c 100644 --- a/src/bump/setDependentVersions.ts +++ b/src/bump/setDependentVersions.ts @@ -1,5 +1,5 @@ import type { BeachballOptions } from '../types/BeachballOptions'; -import { BumpInfo } from '../types/BumpInfo'; +import type { BumpInfo } from '../types/BumpInfo'; import { consideredDependencies } from '../types/PackageInfo'; import { bumpMinSemverRange } from './bumpMinSemverRange'; diff --git a/src/bump/updatePackageJsons.ts b/src/bump/updatePackageJsons.ts index 41f3a9cb9..d54947264 100644 --- a/src/bump/updatePackageJsons.ts +++ b/src/bump/updatePackageJsons.ts @@ -1,5 +1,5 @@ import fs from 'fs-extra'; -import { PackageInfos, PackageJson, consideredDependencies } from '../types/PackageInfo'; +import { type PackageInfos, type PackageJson, consideredDependencies } from '../types/PackageInfo'; /** * Update package.json files for modified packages after bumping. diff --git a/src/bump/updateRelatedChangeType.ts b/src/bump/updateRelatedChangeType.ts index d41c4d40b..45ceef1dc 100644 --- a/src/bump/updateRelatedChangeType.ts +++ b/src/bump/updateRelatedChangeType.ts @@ -1,5 +1,5 @@ import { getMaxChangeType, MinChangeType } from '../changefile/changeTypes'; -import { BumpInfo, PackageDependents } from '../types/BumpInfo'; +import type { BumpInfo, PackageDependents } from '../types/BumpInfo'; /** * This is the core of the bumpInfo dependency bumping logic - done once per change file diff --git a/src/changefile/changeTypes.ts b/src/changefile/changeTypes.ts index faa88ac65..f1c61fac2 100644 --- a/src/changefile/changeTypes.ts +++ b/src/changefile/changeTypes.ts @@ -1,4 +1,4 @@ -import { ChangeSet, ChangeType } from '../types/ChangeInfo'; +import type { ChangeSet, ChangeType } from '../types/ChangeInfo'; /** * List of all change types from least to most significant. diff --git a/src/changefile/getChangedPackages.ts b/src/changefile/getChangedPackages.ts index 4fddc7f1e..42944ef30 100644 --- a/src/changefile/getChangedPackages.ts +++ b/src/changefile/getChangedPackages.ts @@ -1,12 +1,12 @@ import fs from 'fs-extra'; import path from 'path'; import minimatch from 'minimatch'; -import { ChangeFileInfo, ChangeInfoMultiple } from '../types/ChangeInfo'; +import type { ChangeFileInfo, ChangeInfoMultiple } from '../types/ChangeInfo'; import { getChangePath } from '../paths'; import { getChanges, getStagedChanges, git } from 'workspace-tools'; import { getScopedPackages } from '../monorepo/getScopedPackages'; -import { BeachballOptions } from '../types/BeachballOptions'; -import { PackageInfos, PackageInfo } from '../types/PackageInfo'; +import type { BeachballOptions } from '../types/BeachballOptions'; +import type { PackageInfos, PackageInfo } from '../types/PackageInfo'; import { ensureSharedHistory } from '../git/ensureSharedHistory'; const count = (n: number, str: string) => `${n} ${str}${n === 1 ? '' : 's'}`; diff --git a/src/changefile/getDisallowedChangeTypes.ts b/src/changefile/getDisallowedChangeTypes.ts index d59280ef6..2a262a4fc 100644 --- a/src/changefile/getDisallowedChangeTypes.ts +++ b/src/changefile/getDisallowedChangeTypes.ts @@ -1,5 +1,5 @@ -import { ChangeType } from '../types/ChangeInfo'; -import { PackageGroups, PackageInfos } from '../types/PackageInfo'; +import type { ChangeType } from '../types/ChangeInfo'; +import type { PackageGroups, PackageInfos } from '../types/PackageInfo'; export function getDisallowedChangeTypes( packageName: string, diff --git a/src/changefile/getQuestionsForPackage.ts b/src/changefile/getQuestionsForPackage.ts index 02300ce66..defec79c8 100644 --- a/src/changefile/getQuestionsForPackage.ts +++ b/src/changefile/getQuestionsForPackage.ts @@ -1,10 +1,10 @@ -import prompts from 'prompts'; +import type prompts from 'prompts'; import semver from 'semver'; -import { ChangeType } from '../types/ChangeInfo'; -import { BeachballOptions } from '../types/BeachballOptions'; -import { DefaultPrompt } from '../types/ChangeFilePrompt'; +import type { ChangeType } from '../types/ChangeInfo'; +import type { BeachballOptions } from '../types/BeachballOptions'; +import type { DefaultPrompt } from '../types/ChangeFilePrompt'; import { getDisallowedChangeTypes } from './getDisallowedChangeTypes'; -import { PackageGroups, PackageInfos } from '../types/PackageInfo'; +import type { PackageGroups, PackageInfos } from '../types/PackageInfo'; /** * Build the list of questions to ask the user for this package. diff --git a/src/changefile/promptForChange.ts b/src/changefile/promptForChange.ts index b4f62dc66..e3d682749 100644 --- a/src/changefile/promptForChange.ts +++ b/src/changefile/promptForChange.ts @@ -1,8 +1,8 @@ import prompts from 'prompts'; -import { ChangeFileInfo, ChangeType } from '../types/ChangeInfo'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { ChangeFileInfo, ChangeType } from '../types/ChangeInfo'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { isValidChangeType } from '../validation/isValidChangeType'; -import { PackageGroups, PackageInfos } from '../types/PackageInfo'; +import type { PackageGroups, PackageInfos } from '../types/PackageInfo'; import { getQuestionsForPackage } from './getQuestionsForPackage'; export type ChangePromptResponse = { type?: ChangeType; comment?: string }; diff --git a/src/changefile/readChangeFiles.ts b/src/changefile/readChangeFiles.ts index 2f832918d..3fc09b1e3 100644 --- a/src/changefile/readChangeFiles.ts +++ b/src/changefile/readChangeFiles.ts @@ -1,11 +1,11 @@ -import { ChangeSet, ChangeInfo, ChangeInfoMultiple } from '../types/ChangeInfo'; +import type { ChangeSet, ChangeInfo, ChangeInfoMultiple } from '../types/ChangeInfo'; import { getChangePath } from '../paths'; import fs from 'fs-extra'; import path from 'path'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { getScopedPackages } from '../monorepo/getScopedPackages'; import { getChangesBetweenRefs } from 'workspace-tools'; -import { PackageInfos } from '../types/PackageInfo'; +import type { PackageInfos } from '../types/PackageInfo'; /** * Read change files, excluding any changes for packages that are: diff --git a/src/changefile/unlinkChangeFiles.ts b/src/changefile/unlinkChangeFiles.ts index 901d6e3d3..f0a1f8291 100644 --- a/src/changefile/unlinkChangeFiles.ts +++ b/src/changefile/unlinkChangeFiles.ts @@ -1,10 +1,10 @@ -import { ChangeSet } from '../types/ChangeInfo'; +import type { ChangeSet } from '../types/ChangeInfo'; import { getChangePath } from '../paths'; import fs from 'fs-extra'; import path from 'path'; -import { PackageInfos } from '../types/PackageInfo'; +import type { PackageInfos } from '../types/PackageInfo'; import type { BeachballOptions } from '../types/BeachballOptions'; -import { DeepReadonly } from '../types/DeepReadonly'; +import type { DeepReadonly } from '../types/DeepReadonly'; /** * Unlink only change files that are specified in the changes param diff --git a/src/changefile/writeChangeFiles.ts b/src/changefile/writeChangeFiles.ts index 158dbb61f..79a8a0141 100644 --- a/src/changefile/writeChangeFiles.ts +++ b/src/changefile/writeChangeFiles.ts @@ -1,4 +1,4 @@ -import { ChangeFileInfo } from '../types/ChangeInfo'; +import type { ChangeFileInfo } from '../types/ChangeInfo'; import { getChangePath } from '../paths'; import { getBranchName, stage, commit } from 'workspace-tools'; import crypto from 'crypto'; diff --git a/src/changelog/getPackageChangelogs.ts b/src/changelog/getPackageChangelogs.ts index c8845fc64..4db1ad750 100644 --- a/src/changelog/getPackageChangelogs.ts +++ b/src/changelog/getPackageChangelogs.ts @@ -1,8 +1,8 @@ import path from 'path'; -import { PackageInfo } from '../types/PackageInfo'; -import { PackageChangelog } from '../types/ChangeLog'; +import type { PackageInfo } from '../types/PackageInfo'; +import type { PackageChangelog } from '../types/ChangeLog'; import { generateTag } from '../git/generateTag'; -import { BumpInfo } from '../types/BumpInfo'; +import type { BumpInfo } from '../types/BumpInfo'; import { getChangePath } from '../paths'; import { getFileAddedHash } from 'workspace-tools'; import type { BeachballOptions } from '../types/BeachballOptions'; diff --git a/src/changelog/mergeChangelogs.ts b/src/changelog/mergeChangelogs.ts index 72d1514c0..5aaaae75b 100644 --- a/src/changelog/mergeChangelogs.ts +++ b/src/changelog/mergeChangelogs.ts @@ -1,7 +1,7 @@ -import { PackageChangelog } from '../types/ChangeLog'; -import { PackageInfo } from '../types/PackageInfo'; +import type { PackageChangelog } from '../types/ChangeLog'; +import type { PackageInfo } from '../types/PackageInfo'; import { generateTag } from '../git/generateTag'; -import { ChangeType } from '../types/ChangeInfo'; +import type { ChangeType } from '../types/ChangeInfo'; /** * Merge multiple package changelogs into one. diff --git a/src/changelog/renderChangelog.ts b/src/changelog/renderChangelog.ts index 8fdb4756a..2af1c696a 100644 --- a/src/changelog/renderChangelog.ts +++ b/src/changelog/renderChangelog.ts @@ -1,5 +1,5 @@ import { renderPackageChangelog, defaultRenderers } from './renderPackageChangelog'; -import { ChangelogOptions, PackageChangelogRenderInfo } from '../types/ChangelogOptions'; +import type { ChangelogOptions, PackageChangelogRenderInfo } from '../types/ChangelogOptions'; import type { PackageChangelog } from '../types/ChangeLog'; export interface MarkdownChangelogRenderOptions extends Omit { diff --git a/src/changelog/renderJsonChangelog.ts b/src/changelog/renderJsonChangelog.ts index 69dffb8b6..7dfcfa9d7 100644 --- a/src/changelog/renderJsonChangelog.ts +++ b/src/changelog/renderJsonChangelog.ts @@ -1,4 +1,4 @@ -import { PackageChangelog, ChangelogJson } from '../types/ChangeLog'; +import type { PackageChangelog, ChangelogJson } from '../types/ChangeLog'; export function renderJsonChangelog(params: { changelog: PackageChangelog; diff --git a/src/changelog/renderPackageChangelog.ts b/src/changelog/renderPackageChangelog.ts index 9473b8bf3..457b5fb0e 100644 --- a/src/changelog/renderPackageChangelog.ts +++ b/src/changelog/renderPackageChangelog.ts @@ -1,7 +1,7 @@ -import { ChangelogEntry } from '../types/ChangeLog'; +import type { ChangelogEntry } from '../types/ChangeLog'; import _ from 'lodash'; -import { PackageChangelogRenderInfo, ChangelogRenderers } from '../types/ChangelogOptions'; -import { ChangeType } from '../types/ChangeInfo'; +import type { PackageChangelogRenderInfo, ChangelogRenderers } from '../types/ChangelogOptions'; +import type { ChangeType } from '../types/ChangeInfo'; import { SortedChangeTypes } from '../changefile/changeTypes'; const groupNames: { [k in ChangeType]: string } = { diff --git a/src/changelog/writeChangelog.ts b/src/changelog/writeChangelog.ts index f5f671989..907fbd161 100644 --- a/src/changelog/writeChangelog.ts +++ b/src/changelog/writeChangelog.ts @@ -1,13 +1,13 @@ import path from 'path'; import fs from 'fs-extra'; -import { PackageInfo } from '../types/PackageInfo'; +import type { PackageInfo } from '../types/PackageInfo'; import { getPackageChangelogs } from './getPackageChangelogs'; import { renderChangelog } from './renderChangelog'; import { renderJsonChangelog } from './renderJsonChangelog'; -import { BeachballOptions } from '../types/BeachballOptions'; -import { BumpInfo } from '../types/BumpInfo'; +import type { BeachballOptions } from '../types/BeachballOptions'; +import type { BumpInfo } from '../types/BumpInfo'; import { isPathIncluded } from '../monorepo/isPathIncluded'; -import { PackageChangelog, ChangelogJson } from '../types/ChangeLog'; +import type { PackageChangelog, ChangelogJson } from '../types/ChangeLog'; import { mergeChangelogs } from './mergeChangelogs'; import { prepareChangelogPaths } from './prepareChangelogPaths'; diff --git a/src/commands/bump.ts b/src/commands/bump.ts index efefec603..1aed7b700 100644 --- a/src/commands/bump.ts +++ b/src/commands/bump.ts @@ -1,8 +1,8 @@ import { gatherBumpInfo } from '../bump/gatherBumpInfo'; import { performBump } from '../bump/performBump'; import { getPackageInfos } from '../monorepo/getPackageInfos'; -import { BeachballOptions } from '../types/BeachballOptions'; -import { BumpInfo } from '../types/BumpInfo'; +import type { BeachballOptions } from '../types/BeachballOptions'; +import type { BumpInfo } from '../types/BumpInfo'; export async function bump(options: BeachballOptions): Promise { const bumpInfo = gatherBumpInfo(options, getPackageInfos(options.path)); diff --git a/src/commands/canary.ts b/src/commands/canary.ts index 9a9213e56..051215cdd 100644 --- a/src/commands/canary.ts +++ b/src/commands/canary.ts @@ -5,7 +5,7 @@ import { setDependentVersions } from '../bump/setDependentVersions'; import { getPackageInfos } from '../monorepo/getPackageInfos'; import { listPackageVersions } from '../packageManager/listPackageVersions'; import { publishToRegistry } from '../publish/publishToRegistry'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; export async function canary(options: BeachballOptions): Promise { const oldPackageInfo = getPackageInfos(options.path); diff --git a/src/commands/change.ts b/src/commands/change.ts index 8b817ca20..524fa7c2e 100644 --- a/src/commands/change.ts +++ b/src/commands/change.ts @@ -1,4 +1,4 @@ -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { promptForChange } from '../changefile/promptForChange'; import { writeChangeFiles } from '../changefile/writeChangeFiles'; import { getPackageInfos } from '../monorepo/getPackageInfos'; diff --git a/src/commands/init.ts b/src/commands/init.ts index 266baa979..3b3e79c11 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -1,9 +1,9 @@ -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import * as fs from 'fs-extra'; import * as path from 'path'; import { findProjectRoot } from 'workspace-tools'; import { npm } from '../packageManager/npm'; -import { PackageJson } from '../types/PackageInfo'; +import type { PackageJson } from '../types/PackageInfo'; function errorExit(message: string): void { console.error(message); diff --git a/src/commands/publish.ts b/src/commands/publish.ts index 880939b78..a7a65d028 100644 --- a/src/commands/publish.ts +++ b/src/commands/publish.ts @@ -1,5 +1,5 @@ import { gatherBumpInfo } from '../bump/gatherBumpInfo'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { gitFailFast, getBranchName, getCurrentHash, git } from 'workspace-tools'; import prompts from 'prompts'; import { readChangeFiles } from '../changefile/readChangeFiles'; @@ -7,7 +7,7 @@ import { bumpAndPush } from '../publish/bumpAndPush'; import { publishToRegistry } from '../publish/publishToRegistry'; import { getNewPackages } from '../publish/getNewPackages'; import { getPackageInfos } from '../monorepo/getPackageInfos'; -import { PublishBumpInfo } from '../types/BumpInfo'; +import type { PublishBumpInfo } from '../types/BumpInfo'; export async function publish(options: BeachballOptions): Promise { console.log('\nPreparing to publish'); diff --git a/src/commands/sync.ts b/src/commands/sync.ts index c1ec91d33..a5e83fb3a 100644 --- a/src/commands/sync.ts +++ b/src/commands/sync.ts @@ -1,4 +1,4 @@ -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { getScopedPackages } from '../monorepo/getScopedPackages'; import { getPackageInfos } from '../monorepo/getPackageInfos'; import { listPackageVersionsByTag } from '../packageManager/listPackageVersions'; diff --git a/src/git/ensureSharedHistory.ts b/src/git/ensureSharedHistory.ts index a79f39f71..db2938590 100644 --- a/src/git/ensureSharedHistory.ts +++ b/src/git/ensureSharedHistory.ts @@ -1,5 +1,5 @@ import { git, parseRemoteBranch } from 'workspace-tools'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { gitFetch } from './fetch'; /** diff --git a/src/git/fetch.ts b/src/git/fetch.ts index 12155f6ad..3950e183e 100644 --- a/src/git/fetch.ts +++ b/src/git/fetch.ts @@ -1,4 +1,4 @@ -import { git, GitProcessOutput } from 'workspace-tools'; +import { git, type GitProcessOutput } from 'workspace-tools'; import { getGitEnv } from './gitAsync'; type GitFetchParams = { diff --git a/src/index.ts b/src/index.ts index 1e4cd1132..a3478c333 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,14 +1,14 @@ // Public types of Beachball used in config files // (the package does not have a callable public API since it's meant to be invoked via command line) -import { RepoOptions, PackageOptions } from './types/BeachballOptions'; +import type { RepoOptions, PackageOptions } from './types/BeachballOptions'; export type BeachballConfig = Partial & Partial; -export { VersionGroupOptions } from './types/BeachballOptions'; -export { ChangeFilePromptOptions } from './types/ChangeFilePrompt'; -export { ChangeType } from './types/ChangeInfo'; -export { ChangelogEntry, ChangelogJson, ChangelogJsonEntry, PackageChangelog } from './types/ChangeLog'; -export { +export type { VersionGroupOptions } from './types/BeachballOptions'; +export type { ChangeFilePromptOptions } from './types/ChangeFilePrompt'; +export type { ChangeType } from './types/ChangeInfo'; +export type { ChangelogEntry, ChangelogJson, ChangelogJsonEntry, PackageChangelog } from './types/ChangeLog'; +export type { ChangelogOptions, ChangelogGroupOptions, PackageChangelogRenderInfo, diff --git a/src/monorepo/getPackageDependencyGraph.ts b/src/monorepo/getPackageDependencyGraph.ts index 445032be2..07259db84 100644 --- a/src/monorepo/getPackageDependencyGraph.ts +++ b/src/monorepo/getPackageDependencyGraph.ts @@ -1,5 +1,5 @@ import { getPackageDependencies } from 'workspace-tools/lib/graph/getPackageDependencies'; -import { PackageInfos } from '../types/PackageInfo'; +import type { PackageInfos } from '../types/PackageInfo'; /** * @returns Each element is a tuple of [dependency, dependent] where `dependent` depends on `dependency`. diff --git a/src/monorepo/getPackageGraph.ts b/src/monorepo/getPackageGraph.ts index df898257a..8fe9e39be 100644 --- a/src/monorepo/getPackageGraph.ts +++ b/src/monorepo/getPackageGraph.ts @@ -1,5 +1,5 @@ -import { PackageInfo, PackageInfos } from '../types/PackageInfo'; -import pGraph, { PGraphNodeMap } from 'p-graph'; +import type { PackageInfo, PackageInfos } from '../types/PackageInfo'; +import pGraph, { type PGraphNodeMap } from 'p-graph'; import { getPackageDependencyGraph } from './getPackageDependencyGraph'; // this export is missing from the top level of the package diff --git a/src/monorepo/getPackageGroups.ts b/src/monorepo/getPackageGroups.ts index 2e89fc0c2..149f92466 100644 --- a/src/monorepo/getPackageGroups.ts +++ b/src/monorepo/getPackageGroups.ts @@ -1,6 +1,6 @@ -import { VersionGroupOptions } from '../types/BeachballOptions'; +import type { VersionGroupOptions } from '../types/BeachballOptions'; import path from 'path'; -import { PackageInfos, PackageGroups } from '../types/PackageInfo'; +import type { PackageInfos, PackageGroups } from '../types/PackageInfo'; import { isPathIncluded } from './isPathIncluded'; export function getPackageGroups( diff --git a/src/monorepo/getPackageInfos.ts b/src/monorepo/getPackageInfos.ts index 9fd167ea7..6cd27b63d 100644 --- a/src/monorepo/getPackageInfos.ts +++ b/src/monorepo/getPackageInfos.ts @@ -5,7 +5,7 @@ import { listAllTrackedFiles, findPackageRoot, findProjectRoot, - WorkspaceInfo, + type WorkspaceInfo, } from 'workspace-tools'; import type { PackageInfos, PackageJson } from '../types/PackageInfo'; import { infoFromPackageJson } from './infoFromPackageJson'; diff --git a/src/monorepo/getScopedPackages.ts b/src/monorepo/getScopedPackages.ts index c74ac1984..e59dbbda2 100644 --- a/src/monorepo/getScopedPackages.ts +++ b/src/monorepo/getScopedPackages.ts @@ -1,5 +1,5 @@ -import { BeachballOptions } from '../types/BeachballOptions'; -import { PackageInfos } from '../types/PackageInfo'; +import type { BeachballOptions } from '../types/BeachballOptions'; +import type { PackageInfos } from '../types/PackageInfo'; import path from 'path'; import { isPathIncluded } from './isPathIncluded'; diff --git a/src/monorepo/infoFromPackageJson.ts b/src/monorepo/infoFromPackageJson.ts index 8e6072034..05211e19e 100644 --- a/src/monorepo/infoFromPackageJson.ts +++ b/src/monorepo/infoFromPackageJson.ts @@ -1,5 +1,5 @@ import path from 'path'; -import { PackageInfo, PackageJson } from '../types/PackageInfo'; +import type { PackageInfo, PackageJson } from '../types/PackageInfo'; import { getPackageOptions, getCombinedPackageOptions } from '../options/getPackageOptions'; export function infoFromPackageJson(packageJson: PackageJson, packageJsonPath: string): PackageInfo { diff --git a/src/options/getCliOptions.ts b/src/options/getCliOptions.ts index 352fd1b41..a1ac55e1d 100644 --- a/src/options/getCliOptions.ts +++ b/src/options/getCliOptions.ts @@ -1,5 +1,5 @@ import parser from 'yargs-parser'; -import { CliOptions } from '../types/BeachballOptions'; +import type { CliOptions } from '../types/BeachballOptions'; import { getDefaultRemoteBranch, findProjectRoot } from 'workspace-tools'; import { env } from '../env'; diff --git a/src/options/getDefaultOptions.ts b/src/options/getDefaultOptions.ts index 6761f592c..8d100198d 100644 --- a/src/options/getDefaultOptions.ts +++ b/src/options/getDefaultOptions.ts @@ -1,5 +1,5 @@ import { env } from '../env'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; /** * Default options. diff --git a/src/options/getOptions.ts b/src/options/getOptions.ts index 467e909ba..1f59b7722 100644 --- a/src/options/getOptions.ts +++ b/src/options/getOptions.ts @@ -1,4 +1,4 @@ -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { getCliOptions } from './getCliOptions'; import { getRepoOptions } from './getRepoOptions'; import { getDefaultOptions } from './getDefaultOptions'; diff --git a/src/options/getPackageOptions.ts b/src/options/getPackageOptions.ts index 6af3ff917..b661f6945 100644 --- a/src/options/getPackageOptions.ts +++ b/src/options/getPackageOptions.ts @@ -1,5 +1,5 @@ import { cosmiconfigSync } from 'cosmiconfig'; -import { PackageOptions } from '../types/BeachballOptions'; +import type { PackageOptions } from '../types/BeachballOptions'; import { getCliOptions } from './getCliOptions'; import { getRepoOptions } from './getRepoOptions'; import { getDefaultOptions } from './getDefaultOptions'; diff --git a/src/options/getRepoOptions.ts b/src/options/getRepoOptions.ts index 62c34f0c8..2bb865b0c 100644 --- a/src/options/getRepoOptions.ts +++ b/src/options/getRepoOptions.ts @@ -1,7 +1,7 @@ import { cosmiconfigSync } from 'cosmiconfig'; import { getDefaultRemoteBranch } from 'workspace-tools'; import { env } from '../env'; -import { RepoOptions, CliOptions, BeachballOptions } from '../types/BeachballOptions'; +import type { RepoOptions, CliOptions, BeachballOptions } from '../types/BeachballOptions'; const cachedRepoOptions = new Map(); diff --git a/src/packageManager/listPackageVersions.ts b/src/packageManager/listPackageVersions.ts index 5390180b7..fcd1b965c 100644 --- a/src/packageManager/listPackageVersions.ts +++ b/src/packageManager/listPackageVersions.ts @@ -1,6 +1,6 @@ import pLimit from 'p-limit'; -import { PackageInfo, PackageJson } from '../types/PackageInfo'; -import { NpmOptions } from '../types/NpmOptions'; +import type { PackageInfo, PackageJson } from '../types/PackageInfo'; +import type { NpmOptions } from '../types/NpmOptions'; import { env } from '../env'; import { npm } from './npm'; import { getNpmAuthArgs } from './npmArgs'; diff --git a/src/packageManager/npm.ts b/src/packageManager/npm.ts index 1621d40ff..2b1ced139 100644 --- a/src/packageManager/npm.ts +++ b/src/packageManager/npm.ts @@ -1,4 +1,5 @@ -import { PackageManagerResult, packageManager } from './packageManager'; +import type { PackageManagerResult } from './packageManager'; +import { packageManager } from './packageManager'; // The npm wrapper for packageManager is preserved for convenience. diff --git a/src/packageManager/npmArgs.ts b/src/packageManager/npmArgs.ts index 886eaf096..fd4c2fcca 100644 --- a/src/packageManager/npmArgs.ts +++ b/src/packageManager/npmArgs.ts @@ -1,6 +1,6 @@ -import { AuthType } from '../types/Auth'; -import { NpmOptions } from '../types/NpmOptions'; -import { PackageInfo } from '../types/PackageInfo'; +import type { AuthType } from '../types/Auth'; +import type { NpmOptions } from '../types/NpmOptions'; +import type { PackageInfo } from '../types/PackageInfo'; export function getNpmPublishArgs(packageInfo: PackageInfo, options: Omit): string[] { const { registry, token, authType, access } = options; diff --git a/src/packageManager/packagePublish.ts b/src/packageManager/packagePublish.ts index 6d2c1c862..12604aec9 100644 --- a/src/packageManager/packagePublish.ts +++ b/src/packageManager/packagePublish.ts @@ -1,9 +1,9 @@ -import { PackageInfo } from '../types/PackageInfo'; +import type { PackageInfo } from '../types/PackageInfo'; import path from 'path'; -import { npm, NpmResult } from './npm'; -import { BeachballOptions } from '../types/BeachballOptions'; +import { npm, type NpmResult } from './npm'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { getNpmPublishArgs } from './npmArgs'; -import { NpmOptions } from '../types/NpmOptions'; +import type { NpmOptions } from '../types/NpmOptions'; /** * Attempt to publish the package with retries. Returns the result of the final npm publish call diff --git a/src/publish/bumpAndPush.ts b/src/publish/bumpAndPush.ts index 8d281cae9..7ff9af5f0 100644 --- a/src/publish/bumpAndPush.ts +++ b/src/publish/bumpAndPush.ts @@ -1,6 +1,6 @@ import { performBump } from '../bump/performBump'; -import { BumpInfo } from '../types/BumpInfo'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BumpInfo } from '../types/BumpInfo'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { revertLocalChanges, parseRemoteBranch } from 'workspace-tools'; import { tagPackages } from './tagPackages'; import { displayManualRecovery } from './displayManualRecovery'; diff --git a/src/publish/displayManualRecovery.ts b/src/publish/displayManualRecovery.ts index ed22bf8dd..f915bfcb1 100644 --- a/src/publish/displayManualRecovery.ts +++ b/src/publish/displayManualRecovery.ts @@ -1,4 +1,4 @@ -import { BumpInfo } from '../types/BumpInfo'; +import type { BumpInfo } from '../types/BumpInfo'; export function displayManualRecovery(bumpInfo: BumpInfo, succeededPackages: Set = new Set()): void { const errorLines: string[] = []; diff --git a/src/publish/getNewPackages.ts b/src/publish/getNewPackages.ts index c18b13e7d..c179e8a14 100644 --- a/src/publish/getNewPackages.ts +++ b/src/publish/getNewPackages.ts @@ -1,6 +1,6 @@ -import { BumpInfo } from '../types/BumpInfo'; +import type { BumpInfo } from '../types/BumpInfo'; import { listPackageVersions } from '../packageManager/listPackageVersions'; -import { NpmOptions } from '../types/NpmOptions'; +import type { NpmOptions } from '../types/NpmOptions'; /** * Get package versions from the registry to determine if there are any new packages that didn't diff --git a/src/publish/getPackagesToPublish.ts b/src/publish/getPackagesToPublish.ts index e919a2d7c..c5d9076a1 100644 --- a/src/publish/getPackagesToPublish.ts +++ b/src/publish/getPackagesToPublish.ts @@ -1,5 +1,5 @@ import { formatList } from '../logging/format'; -import { PublishBumpInfo } from '../types/BumpInfo'; +import type { PublishBumpInfo } from '../types/BumpInfo'; import { toposortPackages } from './toposortPackages'; /** diff --git a/src/publish/publishToRegistry.ts b/src/publish/publishToRegistry.ts index 429f6b341..8ee1759b6 100644 --- a/src/publish/publishToRegistry.ts +++ b/src/publish/publishToRegistry.ts @@ -1,7 +1,7 @@ import _ from 'lodash'; import { performBump } from '../bump/performBump'; -import { PublishBumpInfo } from '../types/BumpInfo'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { PublishBumpInfo } from '../types/BumpInfo'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { packagePublish } from '../packageManager/packagePublish'; import { validatePackageVersions } from './validatePackageVersions'; import { displayManualRecovery } from './displayManualRecovery'; @@ -10,7 +10,7 @@ import { performPublishOverrides } from './performPublishOverrides'; import { getPackagesToPublish } from './getPackagesToPublish'; import { callHook } from '../bump/callHook'; import { getPackageGraph } from '../monorepo/getPackageGraph'; -import { PackageInfo } from '../types/PackageInfo'; +import type { PackageInfo } from '../types/PackageInfo'; /** * Publish all the bumped packages to the registry. diff --git a/src/publish/tagPackages.ts b/src/publish/tagPackages.ts index 540497b9d..d07a0d5ef 100644 --- a/src/publish/tagPackages.ts +++ b/src/publish/tagPackages.ts @@ -1,8 +1,8 @@ -import { PublishBumpInfo } from '../types/BumpInfo'; +import type { PublishBumpInfo } from '../types/BumpInfo'; import { generateTag } from '../git/generateTag'; import { gitFailFast } from 'workspace-tools'; -import { BeachballOptions } from '../types/BeachballOptions'; -import { DeepReadonly } from '../types/DeepReadonly'; +import type { BeachballOptions } from '../types/BeachballOptions'; +import type { DeepReadonly } from '../types/DeepReadonly'; function createTag(tag: string, cwd: string): void { gitFailFast(['tag', '-a', '-f', tag, '-m', tag], { cwd }); diff --git a/src/publish/toposortPackages.ts b/src/publish/toposortPackages.ts index 196374421..1cfe955f8 100644 --- a/src/publish/toposortPackages.ts +++ b/src/publish/toposortPackages.ts @@ -1,5 +1,5 @@ import toposort from 'toposort'; -import { PackageInfos } from '../types/PackageInfo'; +import type { PackageInfos } from '../types/PackageInfo'; import { getPackageDependencyGraph } from '../monorepo/getPackageDependencyGraph'; /** diff --git a/src/publish/validatePackageDependencies.ts b/src/publish/validatePackageDependencies.ts index 071dc42c1..e638fd511 100644 --- a/src/publish/validatePackageDependencies.ts +++ b/src/publish/validatePackageDependencies.ts @@ -1,4 +1,4 @@ -import { PackageInfos } from '../types/PackageInfo'; +import type { PackageInfos } from '../types/PackageInfo'; /** * Validate no private package is listed as package dependency for packages which will be published. diff --git a/src/publish/validatePackageVersions.ts b/src/publish/validatePackageVersions.ts index d9c621bff..a62b2c9d1 100644 --- a/src/publish/validatePackageVersions.ts +++ b/src/publish/validatePackageVersions.ts @@ -1,7 +1,7 @@ import { listPackageVersions } from '../packageManager/listPackageVersions'; -import { NpmOptions } from '../types/NpmOptions'; +import type { NpmOptions } from '../types/NpmOptions'; import { formatList } from '../logging/format'; -import { PackageInfos } from '../types/PackageInfo'; +import type { PackageInfos } from '../types/PackageInfo'; /** * Validate each package version being published doesn't already exist in the registry. diff --git a/src/types/BeachballOptions.ts b/src/types/BeachballOptions.ts index 3f84fd454..9dd4dd6e8 100644 --- a/src/types/BeachballOptions.ts +++ b/src/types/BeachballOptions.ts @@ -1,8 +1,8 @@ -import { AuthType } from './Auth'; -import { ChangeInfo, ChangeInfoMultiple, ChangeType } from './ChangeInfo'; -import { ChangeFilePromptOptions } from './ChangeFilePrompt'; -import { ChangelogOptions } from './ChangelogOptions'; -import { PackageInfos } from './PackageInfo'; +import type { AuthType } from './Auth'; +import type { ChangeInfo, ChangeInfoMultiple, ChangeType } from './ChangeInfo'; +import type { ChangeFilePromptOptions } from './ChangeFilePrompt'; +import type { ChangelogOptions } from './ChangelogOptions'; +import type { PackageInfos } from './PackageInfo'; export type BeachballOptions = CliOptions & RepoOptions & PackageOptions; diff --git a/src/types/BumpInfo.ts b/src/types/BumpInfo.ts index 96de649d0..d3b54c4c7 100644 --- a/src/types/BumpInfo.ts +++ b/src/types/BumpInfo.ts @@ -1,6 +1,6 @@ -import { ChangeSet, ChangeType } from './ChangeInfo'; -import { DeepReadonly } from './DeepReadonly'; -import { PackageInfos, PackageGroups } from './PackageInfo'; +import type { ChangeSet, ChangeType } from './ChangeInfo'; +import type { DeepReadonly } from './DeepReadonly'; +import type { PackageInfos, PackageGroups } from './PackageInfo'; export type BumpInfo = { /** Changes coming from the change files */ diff --git a/src/types/ChangeFilePrompt.ts b/src/types/ChangeFilePrompt.ts index 3805a8954..28ec03e85 100644 --- a/src/types/ChangeFilePrompt.ts +++ b/src/types/ChangeFilePrompt.ts @@ -1,4 +1,4 @@ -import prompts from 'prompts'; +import type prompts from 'prompts'; export interface DefaultPrompt { changeType: prompts.PromptObject | undefined; diff --git a/src/types/ChangeLog.ts b/src/types/ChangeLog.ts index 3fb7a4aaf..91f843db9 100644 --- a/src/types/ChangeLog.ts +++ b/src/types/ChangeLog.ts @@ -3,7 +3,7 @@ * Changes made to interfaces here can affect custom changelog rendering done by end-user. */ -import { ChangeType } from './ChangeInfo'; +import type { ChangeType } from './ChangeInfo'; /** * Entry ("comment") in CHANGELOG.json from a change file or dependent bump. diff --git a/src/types/ChangelogOptions.ts b/src/types/ChangelogOptions.ts index 99583d5d6..3ad07f22e 100644 --- a/src/types/ChangelogOptions.ts +++ b/src/types/ChangelogOptions.ts @@ -1,5 +1,5 @@ -import { ChangelogJson, PackageChangelog, ChangelogEntry } from './ChangeLog'; -import { ChangeType } from './ChangeInfo'; +import type { ChangelogJson, PackageChangelog, ChangelogEntry } from './ChangeLog'; +import type { ChangeType } from './ChangeInfo'; /** * Options for changelog-related configuration. diff --git a/src/types/NpmOptions.ts b/src/types/NpmOptions.ts index f161c9a98..5f2fdf154 100644 --- a/src/types/NpmOptions.ts +++ b/src/types/NpmOptions.ts @@ -1,4 +1,4 @@ -import { BeachballOptions } from './BeachballOptions'; +import type { BeachballOptions } from './BeachballOptions'; export type NpmOptions = Required> & { path: string | undefined } & Partial< Pick diff --git a/src/types/PackageInfo.ts b/src/types/PackageInfo.ts index 815a18cf8..85812b102 100644 --- a/src/types/PackageInfo.ts +++ b/src/types/PackageInfo.ts @@ -1,5 +1,5 @@ -import { PackageOptions, BeachballOptions } from './BeachballOptions'; -import { ChangeType } from './ChangeInfo'; +import type { PackageOptions, BeachballOptions } from './BeachballOptions'; +import type { ChangeType } from './ChangeInfo'; export interface PackageDeps { [dep: string]: string; diff --git a/src/validation/areChangeFilesDeleted.ts b/src/validation/areChangeFilesDeleted.ts index a89ec0734..cdcadaec6 100644 --- a/src/validation/areChangeFilesDeleted.ts +++ b/src/validation/areChangeFilesDeleted.ts @@ -1,5 +1,5 @@ import { getChangePath } from '../paths'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { getChangesBetweenRefs, findProjectRoot } from 'workspace-tools'; export function areChangeFilesDeleted(options: Pick): boolean { diff --git a/src/validation/isChangeFileNeeded.ts b/src/validation/isChangeFileNeeded.ts index 1dcc0b653..570f7b94d 100644 --- a/src/validation/isChangeFileNeeded.ts +++ b/src/validation/isChangeFileNeeded.ts @@ -1,5 +1,5 @@ import { getChangedPackages } from '../changefile/getChangedPackages'; -import { PackageInfos } from '../types/PackageInfo'; +import type { PackageInfos } from '../types/PackageInfo'; export function isChangeFileNeeded( options: Parameters[0], diff --git a/src/validation/isValidAuthType.ts b/src/validation/isValidAuthType.ts index 346351799..771bd64e0 100644 --- a/src/validation/isValidAuthType.ts +++ b/src/validation/isValidAuthType.ts @@ -1,4 +1,4 @@ -import { AuthType } from '../types/Auth'; +import type { AuthType } from '../types/Auth'; export function isValidAuthType(authType: string): boolean { const authTypes: AuthType[] = ['authtoken', 'password']; diff --git a/src/validation/isValidChangelogOptions.ts b/src/validation/isValidChangelogOptions.ts index 28356f3e4..b5a25a1c1 100644 --- a/src/validation/isValidChangelogOptions.ts +++ b/src/validation/isValidChangelogOptions.ts @@ -1,5 +1,5 @@ import { singleLineStringify } from '../logging/format'; -import { ChangelogOptions } from '../types/ChangelogOptions'; +import type { ChangelogOptions } from '../types/ChangelogOptions'; export function isValidChangelogOptions(options: ChangelogOptions): boolean { if (!options.groups) { diff --git a/src/validation/isValidGroupOptions.ts b/src/validation/isValidGroupOptions.ts index 788ffe1a9..c374a59ce 100644 --- a/src/validation/isValidGroupOptions.ts +++ b/src/validation/isValidGroupOptions.ts @@ -1,6 +1,6 @@ import { formatList, singleLineStringify } from '../logging/format'; -import { VersionGroupOptions } from '../types/BeachballOptions'; -import { PackageGroups, PackageInfos } from '../types/PackageInfo'; +import type { VersionGroupOptions } from '../types/BeachballOptions'; +import type { PackageGroups, PackageInfos } from '../types/PackageInfo'; export function isValidGroupOptions(groups: VersionGroupOptions[]): boolean { // Values that violate types could happen in a user-provided object diff --git a/src/validation/validate.ts b/src/validation/validate.ts index 875b2cbea..7f0ffd892 100644 --- a/src/validation/validate.ts +++ b/src/validation/validate.ts @@ -4,7 +4,7 @@ import { isValidAuthType } from './isValidAuthType'; import { isValidChangeType } from './isValidChangeType'; import { isChangeFileNeeded } from './isChangeFileNeeded'; import { isValidGroupedPackageOptions, isValidGroupOptions } from './isValidGroupOptions'; -import { BeachballOptions } from '../types/BeachballOptions'; +import type { BeachballOptions } from '../types/BeachballOptions'; import { isValidChangelogOptions } from './isValidChangelogOptions'; import { readChangeFiles } from '../changefile/readChangeFiles'; import { getPackageInfos } from '../monorepo/getPackageInfos';