这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions examples/with-nestjs/.eslintrc.js

This file was deleted.

23 changes: 23 additions & 0 deletions examples/with-nestjs/.eslintrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { libraryConfig } from "@repo/eslint-config/library";
import tsParser from "@typescript-eslint/parser";

export default [
{
ignores: ["apps/**", "packages/**", "dist/**", "node_modules/**"],
},
...libraryConfig,
{
parser: tsParser,
parserOptions: {
project: true,
},
},
{
rules: {
// add override for any (a metric ton of them, initial conversion)
"@typescript-eslint/no-explicit-any": "off",
// we generally use this in isFunction, not via calling
"@typescript-eslint/unbound-method": "off",
},
},
];
4 changes: 0 additions & 4 deletions examples/with-nestjs/.prettierrc.js

This file was deleted.

4 changes: 4 additions & 0 deletions examples/with-nestjs/.prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import config from "@repo/eslint-config/prettier-base";

/** @type {import("prettier").Config} */
export default config;
9 changes: 0 additions & 9 deletions examples/with-nestjs/apps/api/.eslintrc.js

This file was deleted.

4 changes: 0 additions & 4 deletions examples/with-nestjs/apps/api/.prettierrc.js

This file was deleted.

4 changes: 4 additions & 0 deletions examples/with-nestjs/apps/api/.prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import config from "@repo/eslint-config/prettier-base";

/** @type {import("prettier").Config} */
export default config;
4 changes: 4 additions & 0 deletions examples/with-nestjs/apps/api/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { nestJsConfig } from "@repo/eslint-config/nest-js";

/** @type {import("eslint").Linter.Config} */
export default nestJsConfig;
4 changes: 2 additions & 2 deletions examples/with-nestjs/apps/api/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { config } from '@repo/jest-config/nest';
import { nestConfig } from '@repo/jest-config';

export default config;
export default nestConfig;
16 changes: 8 additions & 8 deletions examples/with-nestjs/apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\""
},
"dependencies": {
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/common": "^11.0.0",
"@nestjs/core": "^11.0.0",
"@nestjs/platform-express": "^11.0.0",
"@repo/api": "workspace:*",
"reflect-metadata": "^0.2.0",
"rxjs": "^7.8.1"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@nestjs/cli": "^11.0.0",
"@nestjs/schematics": "^11.0.0",
"@nestjs/testing": "^11.0.0",
"@repo/eslint-config": "workspace:*",
"@repo/jest-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@types/express": "^4.17.17",
"@types/node": "^20.3.1",
"@types/node": "^22.10.7",
"@types/supertest": "^6.0.0",
"jest": "^29.7.0",
"source-map-support": "^0.5.21",
"supertest": "^6.3.3",
"supertest": "^7.0.0",
"ts-jest": "^29.2.5",
"ts-loader": "^9.4.3",
"ts-node": "^10.9.2",
Expand Down
3 changes: 2 additions & 1 deletion examples/with-nestjs/apps/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ async function bootstrap() {
const app = await NestFactory.create(AppModule);
await app.listen(3000);
}
bootstrap();

void bootstrap();
2 changes: 1 addition & 1 deletion examples/with-nestjs/apps/api/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
"exclude": ["node_modules", "test", "dist", "**/*spec.ts", ".prettierrc.mjs", "eslint.config.mjs", "jest.config.mjs", "jest.config.ts"]
}
2 changes: 1 addition & 1 deletion examples/with-nestjs/apps/api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"extends": "@repo/typescript-config/nestjs.json",
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist",
"outDir": "./dist"
}
}
7 changes: 0 additions & 7 deletions examples/with-nestjs/apps/web/.eslintrc.js

This file was deleted.

36 changes: 36 additions & 0 deletions examples/with-nestjs/apps/web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# env files (can opt-in for commiting if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
4 changes: 0 additions & 4 deletions examples/with-nestjs/apps/web/.prettierrc.js

This file was deleted.

30 changes: 15 additions & 15 deletions examples/with-nestjs/apps/web/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
# With-NestJs | Web
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/create-next-app).

## Getting Started

> 🏁 This app depends on the [apps/api](../api/README.md) server. make sure your server is running at the port `3000`

Run the development server:
First, run the development server:

```bash
pnpm run dev
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [localhost:3001](http://localhost:3001) with your browser to see the result.
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

To create [API routes](https://nextjs.org/docs/app/building-your-application/routing/router-handlers) add an `api/` directory to the `app/` directory with a `route.ts` file. For individual endpoints, create a subfolder in the `api` directory, as `api/hello/route.ts` would map to [http://localhost:3000/api/hello](http://localhost:3000/api/hello).

### ⚠️ Note about build

If you plan to only build this app. Please make sure you've built the packages first.
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js.
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
Binary file modified examples/with-nestjs/apps/web/app/favicon.ico
Binary file not shown.
Binary file not shown.
Binary file not shown.
64 changes: 32 additions & 32 deletions examples/with-nestjs/apps/web/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,31 +1,13 @@
:root {
--max-width: 1100px;
--border-radius: 12px;
--font-mono: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono",
"Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro",
"Fira Mono", "Droid Sans Mono", "Courier New", monospace;

--foreground-rgb: 255, 255, 255;
--background-start-rgb: 0, 0, 0;
--background-end-rgb: 0, 0, 0;

--callout-rgb: 20, 20, 20;
--callout-border-rgb: 108, 108, 108;
--card-rgb: 100, 100, 100;
--card-border-rgb: 200, 200, 200;

--glow-conic: conic-gradient(
from 180deg at 50% 50%,
#2a8af6 0deg,
#a853ba 180deg,
#e92a67 360deg
);
--background: #ffffff;
--foreground: #171717;
}

* {
box-sizing: border-box;
padding: 0;
margin: 0;
@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
}

html,
Expand All @@ -35,16 +17,34 @@ body {
}

body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
to bottom,
transparent,
rgb(var(--background-end-rgb))
)
rgb(var(--background-start-rgb));
color: var(--foreground);
background: var(--background);
}

* {
box-sizing: border-box;
padding: 0;
margin: 0;
}

a {
color: inherit;
text-decoration: none;
}

.imgDark {
display: none;
}

@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}

.imgLight {
display: none;
}
.imgDark {
display: unset;
}
}
27 changes: 19 additions & 8 deletions examples/with-nestjs/apps/web/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
import { PropsWithChildren } from 'react';
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';

import localFont from 'next/font/local';
import './globals.css';

const inter = Inter({ subsets: ['latin'] });
const geistSans = localFont({
src: './fonts/GeistVF.woff',
variable: '--font-geist-sans',
});
const geistMono = localFont({
src: './fonts/GeistMonoVF.woff',
variable: '--font-geist-mono',
});

export const metadata: Metadata = {
title: 'Create Turborepo',
description: 'Generated by create turbo',
title: 'Create Next App',
description: 'Generated by create next app',
};

export default function RootLayout({ children }: Readonly<PropsWithChildren>) {
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<body className={`${geistSans.variable} ${geistMono.variable}`}>
{children}
</body>
</html>
);
}
Loading
Loading