diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b5f7e27..9b86ec0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,18 +17,18 @@ jobs: if: "!contains(github.event.head_commit.message, 'docs:')" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v1 with: - bun-version: 1.0.25 + bun-version: 1.1.3 - run: bun install --frozen-lockfile - run: bun run tsc - run: bun run lint - run: bun run build-cli - run: bun run sanity-check - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 registry-url: 'https://npm.pkg.github.com' scope: '@navikt' - run: npm publish diff --git a/bun.lockb b/bun.lockb index c9fd0a1..b35a87a 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index d327243..053f4dd 100644 --- a/package.json +++ b/package.json @@ -26,12 +26,12 @@ }, "devDependencies": { "@navikt/eslint-config-teamsykmelding": "^5.2.0", + "@types/bun": "^1.0.12", "@types/fs-extra": "^11.0.4", "@types/inquirer": "^9.0.7", "@types/inquirer-autocomplete-prompt": "^3.0.3", "@types/yargs": "^17.0.32", "@typescript-eslint/eslint-plugin": "^6.8.0", - "bun-types": "^1.1.3", "eslint": "^8.54.0", "husky": "^9.0.11", "lint-staged": "^15.2.2", diff --git a/src/actions/gh.ts b/src/actions/gh.ts index 20240d7..40fbff6 100644 --- a/src/actions/gh.ts +++ b/src/actions/gh.ts @@ -94,7 +94,7 @@ async function loadCachedRepos(): Promise { const cachedRepos = Bun.file(path.join(CACHE_DIR, `repos-${team}.json`)) if (!(await cachedRepos.exists())) return [] - return await cachedRepos.json() + return await cachedRepos.json() } catch (e) { logError('Error loading cached repos', e) return [] diff --git a/src/analytics/analytics-global.ts b/src/analytics/analytics-global.ts index 5dc8ed1..29fe91a 100644 --- a/src/analytics/analytics-global.ts +++ b/src/analytics/analytics-global.ts @@ -47,7 +47,7 @@ async function loadGlobalAnalytics(): Promise { const cachedAnalytics = Bun.file(path.join(CONFIG_DIR, `analytics${IS_DEV ? '-dev' : ''}.json`)) if (!(await cachedAnalytics.exists())) return { user: Bun.env.USER ?? 'unknown', usage: {} } - return await cachedAnalytics.json() + return await cachedAnalytics.json() } async function saveGlobalAnalytics(updated: UserCommandUsage): Promise { diff --git a/src/analytics/analytics.ts b/src/analytics/analytics.ts index 9f2d79e..3b03062 100644 --- a/src/analytics/analytics.ts +++ b/src/analytics/analytics.ts @@ -16,7 +16,7 @@ async function loadCachedAnalytics(): Promise { const cachedAnalytics = Bun.file(path.join(CACHE_DIR, 'analytics.json')) if (!(await cachedAnalytics.exists())) return { user: Bun.env.USER ?? 'unknown', usage: {} } - return await cachedAnalytics.json() + return await cachedAnalytics.json() } async function saveCachedAnalytics(updated: UserCommandUsage): Promise { diff --git a/src/common/authors.ts b/src/common/authors.ts index aaf1582..01c1ecf 100644 --- a/src/common/authors.ts +++ b/src/common/authors.ts @@ -59,7 +59,7 @@ async function getCachedCoAuthors(): Promise { const coAuthorsFile = Bun.file(path.join(CACHE_DIR, 'co-authors.json')) if (await coAuthorsFile.exists()) { - return coAuthorsFile.json() + return coAuthorsFile.json() } return [] diff --git a/src/common/cache/team.ts b/src/common/cache/team.ts index 487988e..9138009 100644 --- a/src/common/cache/team.ts +++ b/src/common/cache/team.ts @@ -21,5 +21,5 @@ export async function getTeamsCache(): Promise { return [] } - return file.json() + return file.json() } diff --git a/src/common/config.ts b/src/common/config.ts index a1bc223..97d1c40 100644 --- a/src/common/config.ts +++ b/src/common/config.ts @@ -46,7 +46,7 @@ export async function getConfig(): Promise { config = defaultConfig as Config await Bun.write(configFile, JSON.stringify(defaultConfig)) } else { - config = await configFile.json() + config = await configFile.json() } if (!config.ide) { @@ -73,7 +73,7 @@ export async function isTeamConfigured(): Promise { if (!fileExists) return false - const config = await configFile.json<{ team: string | undefined }>() + const config: { team: string | undefined } = await configFile.json() return config.team != null } @@ -82,7 +82,7 @@ export async function migrateFromCacheToConfigDir(cacheDir: string, configDir: s const cacheConfigFile = Bun.file(configInCacheDir) if (await cacheConfigFile.exists()) { log(chalk.blue('\n...Found config in cache dir, migrating to config dir. This is a one-time-thing. :)\n')) - const cacheConfigContent = await cacheConfigFile.json() + const cacheConfigContent: Config = await cacheConfigFile.json() const newConfigFile = Bun.file(path.join(configDir, 'config.json')) await Bun.write(newConfigFile, JSON.stringify(cacheConfigContent)) fs.unlinkSync(configInCacheDir) diff --git a/src/index.ts b/src/index.ts index 2a9603e..ea0d6aa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -35,7 +35,7 @@ if ( } } -if (!semver || !semver.satisfies(Bun.version, '>= 1.0.25')) { +if (!semver || !semver.satisfies(Bun.version, '>= 1.1.0')) { log(chalk.red('Oh no!!!!!')) log(`This version of ${chalk.blue('tsm')} requires at least ${chalk.green('bun')} version ${chalk.green('1.0.25')}`) log(`Please run ${chalk.green('bun upgrade')} to upgrade`)