Skip to content

Commit

Permalink
refactor(api): Merge api into edge package (#2038)
Browse files Browse the repository at this point in the history
  • Loading branch information
koistya authored Feb 25, 2023
1 parent 34033e5 commit 2cb8d92
Show file tree
Hide file tree
Showing 42 changed files with 391 additions and 446 deletions.
1 change: 0 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ module.exports = {
"import/resolver": {
typescript: {
project: [
"api/tsconfig.json",
"app/tsconfig.json",
"edge/tsconfig.json",
"scripts/tsconfig.json",
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
- run: yarn tsc --build

# Test
- run: yarn workspace api test
- run: yarn workspace app test
- run: yarn workspace edge test

Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"reactstarter",
"refetch",
"refetchable",
"sendgrid",
"signup",
"sourcemap",
"spdx",
Expand Down
5 changes: 5 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ enableGlobalCache: true

nodeLinker: pnp

packageExtensions:
"@miniflare/r2@*":
dependencies:
"@miniflare/core": ^2.12.1

yarnPath: .yarn/releases/yarn-4.0.0-rc.39.cjs
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Be sure to join our [Discord channel](https://discord.com/invite/2nKEnKq) for as

`├──`[`.github`](.github) — GitHub configuration including CI/CD workflows<br>
`├──`[`.vscode`](.vscode) — VSCode settings including code snippets, recommended extensions etc.<br>
`├──`[`api`](./api) — The API edge endpoint<br>
`├──`[`app`](./app) — Web application front-end built with [React](https://reactjs.org/) and [Material UI](https://mui.com/core/)<br>
`├──`[`edge`](./edge) — Cloudflare Workers (CDN) edge endpoint<br>
`├──`[`env`](./env) — Application settings, API keys, etc.<br>
Expand Down
53 changes: 0 additions & 53 deletions api/README.md

This file was deleted.

23 changes: 0 additions & 23 deletions api/core/app.ts

This file was deleted.

17 changes: 0 additions & 17 deletions api/global.d.ts

This file was deleted.

10 changes: 0 additions & 10 deletions api/index.ts

This file was deleted.

25 changes: 0 additions & 25 deletions api/package.json

This file was deleted.

20 changes: 0 additions & 20 deletions api/routes/login.test.ts

This file was deleted.

19 changes: 0 additions & 19 deletions api/routes/swapi.test.ts

This file was deleted.

13 changes: 0 additions & 13 deletions api/routes/swapi.ts

This file was deleted.

10 changes: 0 additions & 10 deletions api/tsconfig.json

This file was deleted.

24 changes: 0 additions & 24 deletions api/vite.config.ts

This file was deleted.

30 changes: 0 additions & 30 deletions api/wrangler.toml

This file was deleted.

2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
"envars": "^0.4.0",
"typescript": "^4.9.5",
"vite": "^4.1.4",
"vitest": "^0.28.5"
"vitest": "^0.29.1"
}
}
5 changes: 3 additions & 2 deletions edge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ CDN edge endpoint powered by [Cloudflare Workers](https://workers.cloudflare.com

## Directory Structure

`├──`[`dist`](./dist) — The compiled output<br>
`├──`[`core`](./core) — Core application modules<br>
`├──`[`routes`](./routes) — API routes (endpoints)<br>
`├──`[`global.d.ts`](./global.d.ts) — Global TypeScript declarations<br>
`├──`[`index.ts`](./index.tsx)API entry point<br>
`├──`[`index.ts`](./index.tsx)Cloudflare Worker entry point<br>
`├──`[`package.json`](./package.json) — The list of dependencies<br>
`├──`[`tsconfig.ts`](./tsconfig.json) — TypeScript configuration ([docs](https://www.typescriptlang.org/tsconfig))<br>
`├──`[`vite.config.ts`](./vite.config.ts) — JavaScript bundler configuration ([docs](https://vitejs.dev/config/))<br>
Expand Down
10 changes: 10 additions & 0 deletions edge/core/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* SPDX-FileCopyrightText: 2014-present Kriasoft */
/* SPDX-License-Identifier: MIT */

import { Hono } from "hono";

/**
* Application router for Cloudflare Workers
* @see https://honojs.dev/
*/
export const app = new Hono<Env>();
Loading

0 comments on commit 2cb8d92

Please sign in to comment.