Skip to content

Commit

Permalink
chore: Switch to ES2022
Browse files Browse the repository at this point in the history
  • Loading branch information
jahands committed Feb 13, 2025
1 parent 158d015 commit 84e2513
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 33 deletions.
8 changes: 8 additions & 0 deletions .changeset/giant-years-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'workers-tagged-logger': patch
'@repo/typescript-config': patch
'http-codex': patch
'@jahands/cli-tools': patch
---

chore: Switch to ES2022
2 changes: 1 addition & 1 deletion packages/cli-tools/src/args.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Command, program } from '@commander-js/extra-typings'
import { beforeAll, beforeEach, describe, expect, it } from 'vitest'
import { z } from 'zod'

import { parseArg } from './args.js'
import { parseArg } from './args'

const exitErrors: Error[] = []
beforeAll(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-tools/src/cmd.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest'

import { cmdExists } from './cmd.js'
import { cmdExists } from './cmd'

describe('cmdExists()', async () => {
it('returns true when command exists', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-tools/src/env.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { program } from '@commander-js/extra-typings'
import { beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'

import { getEnv } from './env.js'
import { getEnv } from './env'

const exitErrors: Error[] = []
beforeAll(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-tools/src/env.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cliError } from './errors.js'
import { cliError } from './errors'

/**
* Get an env var, throwing an error if it's not set
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-tools/src/errors.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Command, program } from '@commander-js/extra-typings'
import { beforeAll, beforeEach, describe, expect, it } from 'vitest'

import { cliError } from './errors.js'
import { cliError } from './errors'

const exitErrors: Error[] = []
beforeAll(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-tools/src/fs.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest'

import { isNotFoundError } from './fs.js'
import { isNotFoundError } from './fs'

describe('isNotFoundError()', () => {
it('returns false if not a not-found error', () => {
Expand Down
14 changes: 7 additions & 7 deletions packages/cli-tools/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export * from './args.js'
export * from './cmd.js'
export * from './env.js'
export * from './errors.js'
export * from './fs.js'
export * from './proc.js'
export * from './promise.js'
export * from './args'
export * from './cmd'
export * from './env'
export * from './errors'
export * from './fs'
export * from './proc'
export * from './promise'
4 changes: 2 additions & 2 deletions packages/http-codex/src/combined.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe, expect, it } from 'vitest'
import { z } from 'zod'

import { httpStatus } from './combined.js'
import { httpStatus } from './combined'

import type { HttpStatusCodeName } from './index.js'
import type { HttpStatusCodeName } from './index'

describe('httpStatus', () => {
const all = Object.keys(httpStatus).filter((key) => (key as keyof typeof httpStatus) !== 'text')
Expand Down
4 changes: 2 additions & 2 deletions packages/http-codex/src/combined.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { httpStatus as statusCodes } from './status.js'
import { text } from './statusText.js'
import { httpStatus as statusCodes } from './status'
import { text } from './statusText'

/**
* HTTP status codes as registered with IANA.
Expand Down
6 changes: 3 additions & 3 deletions packages/http-codex/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type { HttpStatusCodeName, HttpStatusCode } from './status.js'
export type { HttpStatusCodeName, HttpStatusCode } from './status'

export { isNullBodyStatus } from './status.js'
export { httpStatus } from './combined.js'
export { isNullBodyStatus } from './status'
export { httpStatus } from './combined'
2 changes: 1 addition & 1 deletion packages/http-codex/src/status.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest'

import { httpStatus, isNullBodyStatus, nullBodyStatuses } from './status.js'
import { httpStatus, isNullBodyStatus, nullBodyStatuses } from './status'

describe('isNullBodyStatus()', () => {
const nonNullBodyStatuses = Object.values(httpStatus).filter(
Expand Down
4 changes: 2 additions & 2 deletions packages/http-codex/src/statusText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* Commit: 55590f3a2b89f001bcadf0df6eb2dde62618302b
*/

import { httpStatus } from './status.js'
import { httpStatus } from './status'

import type { HttpStatusCode } from './status.js'
import type { HttpStatusCode } from './status'

/**
* statusText returns a text for the HTTP status code. It returns the empty
Expand Down
3 changes: 2 additions & 1 deletion packages/typescript-config/lib-emit.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"forceConsistentCasingInFileNames": true,

// If transpiling with TypeScript:
"module": "NodeNext",
"module": "ES2022",
"moduleResolution": "node",
"outDir": "dist",
// "rootDir": "src",
"sourceMap": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/workers-tagged-logger/src/hono.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Hono } from 'hono'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'

import { useWorkersLogger } from './hono.js'
import { setupTest } from './logger.spec.js'
import { useWorkersLogger } from './hono'
import { setupTest } from './logger.spec'

beforeEach(() => {
vi.useFakeTimers()
Expand Down
4 changes: 2 additions & 2 deletions packages/workers-tagged-logger/src/hono.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { z } from 'zod'

import { withLogTags, WorkersLogger } from './logger.js'
import { withLogTags, WorkersLogger } from './logger'

import type { Context as HonoContext, Handler as HonoHandler, Next as HonoNext } from 'hono'
import type { LogTags } from './logger.js'
import type { LogTags } from './logger'

export type LoggerHonoBindings = z.infer<typeof LoggerHonoBindings>
export const LoggerHonoBindings = z.object({ ENVIRONMENT: z.string().min(1).optional() })
Expand Down
6 changes: 3 additions & 3 deletions packages/workers-tagged-logger/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { WorkersLogger, withLogTags, ConsoleLog, LogTags } from './logger.js'
export type { WorkersLoggerOptions } from './logger.js'
export { useWorkersLogger, LoggerHonoBindings } from './hono.js'
export { WorkersLogger, withLogTags, ConsoleLog, LogTags } from './logger'
export type { WorkersLoggerOptions } from './logger'
export { useWorkersLogger, LoggerHonoBindings } from './hono'
4 changes: 2 additions & 2 deletions packages/workers-tagged-logger/src/logger.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {
stringifyMessages,
withLogTags,
WorkersLogger,
} from './logger.js'
} from './logger'

import type { LogTags, WorkersLoggerOptions } from './logger.js'
import type { LogTags, WorkersLoggerOptions } from './logger'

type ParsedConsoleLog = z.infer<typeof ParsedConsoleLog>
const ParsedConsoleLog = ConsoleLog.merge(
Expand Down

0 comments on commit 84e2513

Please sign in to comment.