Skip to content

Commit 3ca9c53

Browse files
authored
Move app to src and use import aliases (#66)
1 parent 5b63282 commit 3ca9c53

28 files changed

+64
-66
lines changed

playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig, devices } from "@playwright/test";
22

33
export default defineConfig({
4-
testDir: "./app",
4+
testDir: "./src/app",
55
testMatch: "*.spec.ts",
66
fullyParallel: true,
77
forbidOnly: !!process.env.CI,

src/actions/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"use server";
22

3-
import type { GifsResult } from "../types/Gif";
4-
import { searchGifs, shareEvent } from "../api/tenor";
5-
import { deployEnv } from "../constants";
3+
import { deployEnv } from "@/constants";
4+
import { searchGifs, shareEvent } from "@/api/tenor";
5+
import type { GifsResult } from "@/types/Gif";
66

77
export const handleSearchGifs = async (
88
searchTerm: string,

src/api/tenor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { cache } from "react";
2-
import type { Gif, GifsResult, SearchOptions } from "../types/Gif";
32
import {
43
gifLimit,
54
tenorApiKey,
65
tenorBaseUrl,
76
tenorClientKey,
8-
} from "../constants";
9-
import type { TenorGif, TenorRequestType, TenorResponse } from "../types/Tenor";
7+
} from "@/constants";
8+
import type { Gif, GifsResult, SearchOptions } from "@/types/Gif";
9+
import type { TenorGif, TenorRequestType, TenorResponse } from "@/types/Tenor";
1010

1111
const baseParams = {
1212
key: tenorApiKey,

app/error.spec.ts renamed to src/app/error.spec.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import { expect, type Page } from "@playwright/test";
2-
import { test } from "../src/test/browser/fixtures";
3-
import {
4-
tenorFeaturedHandler,
5-
tenorSearchHandler,
6-
} from "../src/test/api/tenor";
7-
import { testLayout } from "../src/test/browser/shared";
1+
import { type Page, expect } from "@playwright/test";
2+
import { tenorFeaturedHandler, tenorSearchHandler } from "@/test/api/tenor";
3+
import { test } from "@/test/browser/fixtures";
4+
import { testLayout } from "@/test/browser/shared";
85

96
const testPage = async (page: Page) => {
107
await testLayout(page);
File renamed without changes.
File renamed without changes.

app/layout.tsx renamed to src/app/layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import type { Metadata } from "next";
2-
import { Search } from "../src/components/Search";
3-
import { Analytics } from "@vercel/analytics/react";
41
import "./globals.css";
2+
import type { Metadata } from "next";
53
import Image from "next/image";
64
import Link from "next/link";
5+
import { Analytics } from "@vercel/analytics/react";
6+
import { Search } from "@/components/Search";
77

88
export const metadata: Metadata = {
99
title: "gifs.run - the fastest way to share gifs",

app/not-found.spec.ts renamed to src/app/not-found.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from "@playwright/test";
2-
import { test } from "../src/test/browser/fixtures";
3-
import { testLayout } from "../src/test/browser/shared";
2+
import { test } from "@/test/browser/fixtures";
3+
import { testLayout } from "@/test/browser/shared";
44

55
test("page", async ({ page, baseUrl }) => {
66
await page.goto(`${baseUrl}/dskfjsdkjfk`);
File renamed without changes.

app/page.spec.ts renamed to src/app/page.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { expect } from "@playwright/test";
2-
import { test } from "../src/test/browser/fixtures";
3-
import { getTabKey } from "../src/test/browser/utils";
4-
import { mockedFeaturedResponse } from "../src/test/api/tenor/mocks/featuredResponse";
5-
import { testLayout } from "../src/test/browser/shared";
6-
import { gifLimit } from "../src/constants";
2+
import { gifLimit } from "@/constants";
3+
import { mockedFeaturedResponse } from "@/test/api/tenor/mocks/featuredResponse";
4+
import { test } from "@/test/browser/fixtures";
5+
import { testLayout } from "@/test/browser/shared";
6+
import { getTabKey } from "@/test/browser/utils";
77

88
test("initial render", async ({ page, baseUrl }) => {
99
await page.goto(baseUrl);

0 commit comments

Comments
 (0)