Skip to content

Commit 4b9029e

Browse files
init nextjs UI renewal
1 parent d3c6e4a commit 4b9029e

File tree

20 files changed

+6486
-761
lines changed

20 files changed

+6486
-761
lines changed

.github/workflows/nextjs.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on: [push]
2+
3+
name: "CI"
4+
5+
jobs:
6+
test:
7+
name: Test
8+
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
node-versions: [16, 18]
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: ${{ matrix.node-versions }}
22+
23+
- name: NPM Install
24+
working-directory: ./ui
25+
run: npm install
26+
27+
- name: Build, lint and export
28+
working-directory: ./ui
29+
run: npm run export
30+
31+
32+

composer.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@
4444
"scripts": {
4545
"psalm": "vendor/bin/psalm",
4646
"test": "./vendor/bin/testbench package:test --parallel --no-coverage",
47-
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
47+
"test-coverage": "vendor/bin/phpunit --coverage-html coverage",
48+
"post-install-cmd": [
49+
"php artisan vendor:publish --tag=request-docs-assets --force",
50+
"php artisan vendor:publish --tag=request-docs-config"
51+
],
52+
"post-update-cmd": [
53+
"php artisan vendor:publish --tag=request-docs-assets --force",
54+
"php artisan vendor:publish --tag=request-docs-config"
55+
]
4856
},
4957
"config": {
5058
"sort-packages": true

resources/dist/app.js

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

resources/dist/favicon.ico

25.3 KB
Binary file not shown.

resources/views/index.blade.php

Lines changed: 1 addition & 759 deletions
Large diffs are not rendered by default.

src/Controllers/LaravelRequestDocsController.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ public function index(Request $request)
3232
JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE
3333
);
3434
}
35+
if ($request->json) {
36+
return response()->json(
37+
$docs,
38+
Response::HTTP_OK,
39+
[
40+
'Content-type'=> 'application/json; charset=utf-8'
41+
],
42+
JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE
43+
);
44+
}
45+
// nextjs static page rendered via blade
3546
return view('request-docs::index')->with(compact('docs'));
3647
}
3748
}

ui/.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

ui/.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
.pnpm-debug.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts

ui/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
```
12+
13+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
14+
15+
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
16+
17+
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
18+
19+
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
20+
21+
## Learn More
22+
23+
To learn more about Next.js, take a look at the following resources:
24+
25+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
26+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
27+
28+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
29+
30+
## Deploy on Vercel
31+
32+
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.
33+
34+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

ui/next.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {
3+
reactStrictMode: true,
4+
swcMinify: true,
5+
// for --turbo, remove basePath below
6+
images: {
7+
unoptimized: true
8+
},
9+
basePath: '/vendor/request-docs',
10+
}
11+
12+
module.exports = nextConfig

0 commit comments

Comments
 (0)