Skip to content

Commit

Permalink
fix(imports): add .js extension
Browse files Browse the repository at this point in the history
Closes #8
  • Loading branch information
kentcdodds committed Aug 3, 2024
1 parent 9d85eee commit c6737e2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ npm install @epic-web/client-hints

## The Problem

Sometimes your server rendered code needs to know something about the client that
the browser doesn't send. For example, the server might need to know the user's
preferred language, or whether the user prefers light or dark mode.
Sometimes your server rendered code needs to know something about the client
that the browser doesn't send. For example, the server might need to know the
user's preferred language, or whether the user prefers light or dark mode.

For some of this you should have user preferences which can be persisted in a
cookie or a database, but you can't do this for first-time visitors. All you can
Expand Down
2 changes: 1 addition & 1 deletion src/color-scheme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ClientHint } from './utils'
import { type ClientHint } from './utils.js'

export const clientHint = {
cookieName: 'CH-prefers-color-scheme',
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ClientHint, ClientHintsValue } from './utils'
import { ClientHint, ClientHintsValue } from './utils.js'

export type { ClientHint }

Expand Down
2 changes: 1 addition & 1 deletion src/reduced-motion.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ClientHint } from './utils'
import { type ClientHint } from './utils.js'

export const clientHint = {
cookieName: 'CH-reduced-motion',
Expand Down
2 changes: 1 addition & 1 deletion src/time-zone.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ClientHint } from './utils'
import { type ClientHint } from './utils.js'

export const clientHint = {
cookieName: 'CH-time-zone',
Expand Down
8 changes: 4 additions & 4 deletions test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { test } from 'node:test'
import { getHintUtils } from '../src'
import { clientHint as colorSchemeHint } from '../src/color-scheme'
import { clientHint as timeZoneHint } from '../src/time-zone'
import { clientHint as reducedMotionHint } from '../src/reduced-motion'
import { getHintUtils } from '../src/index.js'
import { clientHint as colorSchemeHint } from '../src/color-scheme.js'
import { clientHint as timeZoneHint } from '../src/time-zone.js'
import { clientHint as reducedMotionHint } from '../src/reduced-motion.js'
import assert from 'node:assert'

test('client script works', () => {
Expand Down

0 comments on commit c6737e2

Please sign in to comment.