Skip to content

Commit

Permalink
refactor: remove constants package
Browse files Browse the repository at this point in the history
  • Loading branch information
krystxf committed Dec 3, 2024
1 parent 17b1a38 commit ea292e5
Show file tree
Hide file tree
Showing 22 changed files with 38 additions and 122 deletions.
5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ node_modules
.next
pnpm-lock.yaml

schema.gql
schema.gql

apps/backend/dist
apps/mobile/metro-now/build
1 change: 0 additions & 1 deletion apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
},
"dependencies": {
"@apollo/server": "^4.11.0",
"@metro-now/constants": "workspace:*",
"@nestjs/apollo": "^12.2.0",
"@nestjs/cache-manager": "^2.2.2",
"@nestjs/common": "^10.4.4",
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { GRAPHQL_PATH } from "@metro-now/constants";
import { ApolloDriver, type ApolloDriverConfig } from "@nestjs/apollo";
import { CacheModule } from "@nestjs/cache-manager";
import { Module } from "@nestjs/common";
Expand All @@ -8,6 +7,7 @@ import { ScheduleModule } from "@nestjs/schedule";

import { cacheModuleConfig } from "src/config/cache-module.config";
import { configModuleConfig } from "src/config/config-module.config";
import { GRAPHQL_PATH } from "src/constants/api";
import { DepartureModule } from "src/modules/departure/departure.module";
import { ImportModule } from "src/modules/import/import.module";
import { LoggerModule } from "src/modules/logger/logger.module";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { API_URL } from "./external";
export const API_URL = "https://api.metronow.dev";

export const APPSTORE_URL =
"https://apps.apple.com/cz/app/metro-now/id6504659402?platform=appleWatch";

export const HOMEPAGE_URL = "https://metronow.dev";

export const SOURCE_CODE_URL = "https://github.com/krystxf/metro-now";

export const SWAGGER_JSON_PATH = "/swagger-json";
export const SWAGGER_JSON_URL = API_URL + SWAGGER_JSON_PATH;
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/constants/swagger.const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
GRAPHQL_PATH,
SOURCE_CODE_URL,
SWAGGER_JSON_PATH,
} from "@metro-now/constants";
} from "src/constants/api";

export const SWAGGER_TITLE = "Metro Now API";
export const SWAGGER_VERSION = "1.0";
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { SWAGGER_JSON_PATH, SWAGGER_PATH } from "@metro-now/constants";
import { VersioningType } from "@nestjs/common";
import { NestFactory } from "@nestjs/core";
import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger";

import { AppModule } from "src/app.module";
import { SWAGGER_JSON_PATH, SWAGGER_PATH } from "src/constants/api";
import {
SWAGGER_DESCRIPTION,
SWAGGER_TITLE,
Expand Down
1 change: 0 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
},
"dependencies": {
"@heroicons/react": "^2.1.5",
"@metro-now/constants": "workspace:*",
"@next/mdx": "^14.2.2",
"clsx": "^2.1.1",
"framer-motion": "^11.11.17",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
GRAPHQL_URL,
SOURCE_CODE_URL,
SWAGGER_URL,
} from "@metro-now/constants";
} from "../constants/api";
import DownloadOnAppStoreLight from "../../public/download-on-appstore-light.svg";
import MetroNowIcon from "../../public/metro-now-icon.png";
import MetroNowIphoneMockup from "../../public/iphone-mockup.png";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/robots.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HOMEPAGE_URL } from "@metro-now/constants";
import { HOMEPAGE_URL } from "../constants/api";
import type { MetadataRoute } from "next";

const robots = (): MetadataRoute.Robots => ({
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HOMEPAGE_URL } from "@metro-now/constants";
import { HOMEPAGE_URL } from "../constants/api";
import type { MetadataRoute } from "next";

const docsPaths = [
Expand Down
17 changes: 17 additions & 0 deletions apps/web/src/constants/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export const API_URL = "https://api.metronow.dev";

export const APPSTORE_URL =
"https://apps.apple.com/cz/app/metro-now/id6504659402?platform=appleWatch";

export const HOMEPAGE_URL = "https://metronow.dev";

export const SOURCE_CODE_URL = "https://github.com/krystxf/metro-now";

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

export const SWAGGER_PATH = "/";
export const SWAGGER_URL = API_URL + SWAGGER_PATH;

export const GRAPHQL_PATH = "/graphql";
export const GRAPHQL_URL = API_URL + GRAPHQL_PATH;
2 changes: 1 addition & 1 deletion apps/web/theme.config.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SOURCE_CODE_URL } from "@metro-now/constants";
import { SOURCE_CODE_URL } from "./src/constants/api";

import React from "react";

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"scripts": {
"xcode": "xed ./apps/mobile/metro-now",
"dev": "pnpm --recursive --parallel run dev",
"prebuild": "pnpm run -r --filter @metro-now/constants build",
"build": "pnpm --recursive --parallel run build",
"backend:build": "pnpm run -r --filter @metro-now/backend build",
"backend:dev": "pnpm run -r --filter @metro-now/backend dev",
Expand Down
1 change: 0 additions & 1 deletion packages/constants/.gitignore

This file was deleted.

20 changes: 0 additions & 20 deletions packages/constants/package.json

This file was deleted.

8 changes: 0 additions & 8 deletions packages/constants/src/external.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/constants/src/index.ts

This file was deleted.

7 changes: 0 additions & 7 deletions packages/constants/tsconfig.cjs.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/constants/tsconfig.esm.json

This file was deleted.

18 changes: 0 additions & 18 deletions packages/constants/tsconfig.json

This file was deleted.

35 changes: 2 additions & 33 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
packages:
- "apps/*"
- "packages/*"

0 comments on commit ea292e5

Please sign in to comment.