Skip to content

Commit b7d3f2f

Browse files
committed
refactor: remove constants package
1 parent 17b1a38 commit b7d3f2f

24 files changed

+38
-130
lines changed

.github/workflows/backend-ci.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ jobs:
3333
cd apps/backend
3434
pnpm prisma:generate
3535
36-
- name: Build dependencies
37-
run: |
38-
pnpm prebuild
39-
4036
- name: Build
4137
run: |
4238
cd apps/backend

.github/workflows/web-ci.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ jobs:
2828
run: |
2929
pnpm install
3030
31-
- name: Build dependencies
32-
run: |
33-
pnpm prebuild
34-
3531
- name: Build
3632
run: |
3733
cd apps/web

.prettierignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ node_modules
55
.next
66
pnpm-lock.yaml
77

8-
schema.gql
8+
schema.gql
9+
10+
apps/backend/dist
11+
apps/mobile/metro-now/build

apps/backend/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
},
2626
"dependencies": {
2727
"@apollo/server": "^4.11.0",
28-
"@metro-now/constants": "workspace:*",
2928
"@nestjs/apollo": "^12.2.0",
3029
"@nestjs/cache-manager": "^2.2.2",
3130
"@nestjs/common": "^10.4.4",

apps/backend/src/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { GRAPHQL_PATH } from "@metro-now/constants";
21
import { ApolloDriver, type ApolloDriverConfig } from "@nestjs/apollo";
32
import { CacheModule } from "@nestjs/cache-manager";
43
import { Module } from "@nestjs/common";
@@ -8,6 +7,7 @@ import { ScheduleModule } from "@nestjs/schedule";
87

98
import { cacheModuleConfig } from "src/config/cache-module.config";
109
import { configModuleConfig } from "src/config/config-module.config";
10+
import { GRAPHQL_PATH } from "src/constants/api";
1111
import { DepartureModule } from "src/modules/departure/departure.module";
1212
import { ImportModule } from "src/modules/import/import.module";
1313
import { LoggerModule } from "src/modules/logger/logger.module";

packages/constants/src/api.ts renamed to apps/backend/src/constants/api.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import { API_URL } from "./external";
1+
export const API_URL = "https://api.metronow.dev";
2+
3+
export const APPSTORE_URL =
4+
"https://apps.apple.com/cz/app/metro-now/id6504659402?platform=appleWatch";
5+
6+
export const HOMEPAGE_URL = "https://metronow.dev";
7+
8+
export const SOURCE_CODE_URL = "https://github.com/krystxf/metro-now";
29

310
export const SWAGGER_JSON_PATH = "/swagger-json";
411
export const SWAGGER_JSON_URL = API_URL + SWAGGER_JSON_PATH;

apps/backend/src/constants/swagger.const.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
GRAPHQL_PATH,
33
SOURCE_CODE_URL,
44
SWAGGER_JSON_PATH,
5-
} from "@metro-now/constants";
5+
} from "src/constants/api";
66

77
export const SWAGGER_TITLE = "Metro Now API";
88
export const SWAGGER_VERSION = "1.0";

apps/backend/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { SWAGGER_JSON_PATH, SWAGGER_PATH } from "@metro-now/constants";
21
import { VersioningType } from "@nestjs/common";
32
import { NestFactory } from "@nestjs/core";
43
import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger";
54

65
import { AppModule } from "src/app.module";
6+
import { SWAGGER_JSON_PATH, SWAGGER_PATH } from "src/constants/api";
77
import {
88
SWAGGER_DESCRIPTION,
99
SWAGGER_TITLE,

apps/web/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
},
1313
"dependencies": {
1414
"@heroicons/react": "^2.1.5",
15-
"@metro-now/constants": "workspace:*",
1615
"@next/mdx": "^14.2.2",
1716
"clsx": "^2.1.1",
1817
"framer-motion": "^11.11.17",

apps/web/src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
GRAPHQL_URL,
99
SOURCE_CODE_URL,
1010
SWAGGER_URL,
11-
} from "@metro-now/constants";
11+
} from "../constants/api";
1212
import DownloadOnAppStoreLight from "../../public/download-on-appstore-light.svg";
1313
import MetroNowIcon from "../../public/metro-now-icon.png";
1414
import MetroNowIphoneMockup from "../../public/iphone-mockup.png";

apps/web/src/app/robots.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HOMEPAGE_URL } from "@metro-now/constants";
1+
import { HOMEPAGE_URL } from "../constants/api";
22
import type { MetadataRoute } from "next";
33

44
const robots = (): MetadataRoute.Robots => ({

apps/web/src/app/sitemap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HOMEPAGE_URL } from "@metro-now/constants";
1+
import { HOMEPAGE_URL } from "../constants/api";
22
import type { MetadataRoute } from "next";
33

44
const docsPaths = [

apps/web/src/constants/api.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export const API_URL = "https://api.metronow.dev";
2+
3+
export const APPSTORE_URL =
4+
"https://apps.apple.com/cz/app/metro-now/id6504659402?platform=appleWatch";
5+
6+
export const HOMEPAGE_URL = "https://metronow.dev";
7+
8+
export const SOURCE_CODE_URL = "https://github.com/krystxf/metro-now";
9+
10+
export const SWAGGER_JSON_PATH = "/swagger-json";
11+
export const SWAGGER_JSON_URL = API_URL + SWAGGER_JSON_PATH;
12+
13+
export const SWAGGER_PATH = "/";
14+
export const SWAGGER_URL = API_URL + SWAGGER_PATH;
15+
16+
export const GRAPHQL_PATH = "/graphql";
17+
export const GRAPHQL_URL = API_URL + GRAPHQL_PATH;

apps/web/theme.config.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SOURCE_CODE_URL } from "@metro-now/constants";
1+
import { SOURCE_CODE_URL } from "./src/constants/api";
22

33
import React from "react";
44

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"scripts": {
66
"xcode": "xed ./apps/mobile/metro-now",
77
"dev": "pnpm --recursive --parallel run dev",
8-
"prebuild": "pnpm run -r --filter @metro-now/constants build",
98
"build": "pnpm --recursive --parallel run build",
109
"backend:build": "pnpm run -r --filter @metro-now/backend build",
1110
"backend:dev": "pnpm run -r --filter @metro-now/backend dev",

packages/constants/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/constants/package.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

packages/constants/src/external.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/constants/src/index.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/constants/tsconfig.cjs.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/constants/tsconfig.esm.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/constants/tsconfig.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

pnpm-lock.yaml

Lines changed: 2 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
packages:
22
- "apps/*"
3-
- "packages/*"

0 commit comments

Comments
 (0)