Skip to content

Commit

Permalink
refactor: use /src as source code root (#1190)
Browse files Browse the repository at this point in the history
- **feat: add modern theme for authentication flows**
- **WIP**
- **WIP**
- **WIP**
- **WIP**
- **WIP**
- **WIP**
- **WIP**
- **refactor: use /src as source code root**
  • Loading branch information
philprime committed Sep 7, 2024
1 parent f181955 commit a146c90
Show file tree
Hide file tree
Showing 248 changed files with 468 additions and 1,457 deletions.
25 changes: 2 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,35 +48,14 @@ FROM base AS build
# Caching depends on previous layers, therefore a changed layer will invalidate all following layers.
# Order the layers from least-to-change to frequent-to-change.

# Rarely changed
COPY sentry.client.config.ts .
COPY instrumentation.ts .

COPY postcss.config.js .
COPY tailwind.config.js .

COPY config ./config
COPY fonts ./fonts
COPY mailTemplate ./mailTemplate
COPY public ./public

# Regularly changed
COPY types ./types
COPY hooks ./hooks
COPY styles ./styles
COPY util ./util
COPY components ./components
COPY theme ./theme
COPY providers ./providers

# Frequently changed
COPY lib ./lib
COPY errors ./errors
COPY models ./models
COPY routes ./routes
COPY api ./api
COPY app ./app
COPY pages ./pages
COPY public ./public
COPY src ./src

# copy node_modules with all build tools included
COPY --from=dependencies_development /home/node/app/prisma ./prisma
Expand Down
12 changes: 6 additions & 6 deletions __tests__/util/adminApi/auth.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import prisma from "@/services/db";
import { authenticate } from "@/util/adminApi/auth";
import { decodeToken } from "@/util/adminApi/tokenDecoding";
import { StatusCodes } from "http-status-codes";
import prisma from "../../../lib/services/db";
import { authenticate } from "../../../util/adminApi/auth";
import { decodeToken } from "../../../util/adminApi/tokenDecoding";

jest.mock("../../../lib/services/db", () => ({
jest.mock("../../../src/services/db", () => ({
organisationAdminToken: {
findFirst: jest.fn(),
},
Expand All @@ -12,14 +12,14 @@ jest.mock("../../../lib/services/db", () => ({
},
}));

jest.mock("../../../util/logger", () => ({
jest.mock("../../../src/util/logger", () => ({
Logger: jest.fn().mockImplementation(() => ({
log: jest.fn(),
error: jest.fn(),
})),
}));

jest.mock("../../../util/adminApi/tokenDecoding", () => ({
jest.mock("../../../src/util/adminApi/tokenDecoding", () => ({
decodeToken: jest.fn(),
}));

Expand Down
2 changes: 1 addition & 1 deletion __tests__/util/adminApi/tokenDecoding.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { decodeToken } from "../../../util/adminApi/tokenDecoding";
import { decodeToken } from "@/util/adminApi/tokenDecoding";

const delimiter = "_";
const appPrefix = "app";
Expand Down
5 changes: 1 addition & 4 deletions __tests__/util/adminApi/tokenEncoding.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
encodeAppToken,
encodeOrgToken,
} from "../../../util/adminApi/tokenEncoding";
import { encodeAppToken, encodeOrgToken } from "@/util/adminApi/tokenEncoding";

const delimiter = "_";
const appPrefix = "app";
Expand Down
5 changes: 2 additions & 3 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// jest.config.js
import nextJest from "next/jest";
import * as jest from "jest";
import nextJest from "next/jest";

const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
Expand All @@ -10,7 +9,7 @@ const createJestConfig = nextJest({
// Add any custom config to be passed to Jest
const customJestConfig: jest.Config = {
collectCoverageFrom: [
"**/*.{js,jsx,ts,tsx}",
"src/**/*.{js,jsx,ts,tsx}",
"!**/*.d.ts",
"!**/node_modules/**",
"!<rootDir>/out/**",
Expand Down
Loading

0 comments on commit a146c90

Please sign in to comment.