Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// <reference types="vite/client" />
/// <reference types="vitest" />
/// <reference types="@testing-library/jest-dom" />

interface ImportMetaEnv {
readonly BASE?: string;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"tailwindcss": "4.1.18",
"typescript": "5.9.3",
"typescript-eslint": "8.50.0",
"vite": "npm:rolldown-vite@7.3.0",
"vite": "8.0.0-beta.4",
"vite-plugin-checker": "0.12.0",
"vite-plugin-solid": "2.11.10",
"vite-tsconfig-paths": "6.0.3",
Expand Down
277 changes: 139 additions & 138 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/ClockFace.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ClockHands } from 'ClockHands';
import { getTestId } from 'utilities';
import { Graduations } from 'Graduations';
import { ClockHands } from '@/ClockHands';
import { getTestId } from '@/utilities';
import { Graduations } from '@/Graduations';

export const ClockFace = () => (
<div
Expand Down
6 changes: 3 additions & 3 deletions src/ClockHands.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createSignal, onCleanup } from 'solid-js';
import { ClockLine as ClockHand } from 'ClockLine';
import { hours, rotate, seconds } from 'common';
import { getTestId } from 'utilities';
import { ClockLine as ClockHand } from '@/ClockLine';
import { hours, rotate, seconds } from '@/common';
import { getTestId } from '@/utilities';

const getSecondsSinceMidnight = (): number =>
(Date.now() - new Date().setHours(0, 0, 0, 0)) / 1000;
Expand Down
4 changes: 2 additions & 2 deletions src/Graduations.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { For } from 'solid-js';
import { ClockLine as Graduation } from 'ClockLine';
import { rotate, seconds } from 'common';
import { ClockLine as Graduation } from '@/ClockLine';
import { rotate, seconds } from '@/common';

export const Graduations = () => (
<>
Expand Down
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'index.css';
import '@/index.css';
import { render } from 'solid-js/web';
import { ClockFace } from 'ClockFace';
import { ClockFace } from '@/ClockFace';

render(() => <ClockFace />, document.body);
4 changes: 2 additions & 2 deletions test/ClockFace.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { describe, expect, test } from 'vitest';
import { render, screen } from '@solidjs/testing-library';
import { ClockFace } from 'ClockFace';
import { ClockFace } from '@/ClockFace';

describe('<ClockFace />', () => {
test('renders clock face', () => {
render(() => <ClockFace />);
expect(screen.getByTestId('clock-face')).toBeInTheDocument();
expect(screen.getByTestId('clock-face'));
});
test('unmount clock face', () => {
const { unmount } = render(() => <ClockFace />);
Expand Down
2 changes: 1 addition & 1 deletion test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { render } from 'solid-js/web';
describe('index', () => {
test('renders without crashing', async () => {
vi.mock('solid-js/web', { spy: true });
await import('index');
await import('@/index');
expect(render).toHaveBeenCalledWith(expect.any(Function), document.body);
});
});
2 changes: 1 addition & 1 deletion test/utilitiest.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { afterAll, beforeAll, describe, expect, vi, test } from 'vitest';
import { getTestId } from 'utilities';
import { getTestId } from '@/utilities';

beforeAll(() => void vi.stubEnv('MODE', 'development'));
afterAll(() => void vi.unstubAllEnvs());
Expand Down
1 change: 0 additions & 1 deletion test/vitest-setup.ts

This file was deleted.

6 changes: 4 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",
"baseUrl": "src",
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
Expand All @@ -23,6 +22,9 @@
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noPropertyAccessFromIndexSignature": true,
"erasableSyntaxOnly": true
"erasableSyntaxOnly": true,
"paths": {
"@/*": ["./src/*"]
}
}
}
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { checker } from 'vite-plugin-checker';
export default defineConfig(({ mode }) => ({
base: loadEnv(mode, process.cwd(), '')['BASE'] ?? '',
plugins: [
tsconfigPaths(),
...(mode === 'test' ? [tsconfigPaths({ projectDiscovery: 'lazy' })] : []),
tailwindcss(),
solid(),
checker({
Expand All @@ -22,9 +22,9 @@ export default defineConfig(({ mode }) => ({
],
test: {
environment: 'happy-dom',
setupFiles: 'test/vitest-setup.ts',
},
resolve: {
conditions: ['development', 'browser'],
tsconfigPaths: true,
},
}));