Skip to content

Commit 8211df4

Browse files
committed
[optimize] upgrade Upstream packages
[optimize] some details [remove] Jest configuration & script
1 parent 967a27c commit 8211df4

13 files changed

Lines changed: 2842 additions & 5070 deletions

File tree

.github/workflows/main.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,25 @@ jobs:
77
Build-and-Deploy:
88
runs-on: ubuntu-latest
99
steps:
10-
- name: Checkout
11-
uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
11+
1212
- uses: pnpm/action-setup@v2
1313
with:
14-
version: 7
14+
version: 8
1515
- name: Use Node.js
1616
uses: actions/setup-node@v3
1717
with:
18-
node-version: 14
18+
node-version: 18
1919
cache: pnpm
20+
2021
- name: Install
2122
run: pnpm i --frozen-lockfile
2223
- name: Build
23-
run: pnpm export
24+
run: pnpm build
25+
2426
- name: Deploy
2527
uses: peaceiris/actions-gh-pages@v3
2628
with:
2729
publish_dir: ./out
2830
personal_token: ${{ secrets.GITHUB_TOKEN }}
29-
forceOrphan: true
31+
force_orphan: true

.husky/pre-push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
. "$(dirname "$0")/_/husky.sh"
44

5-
npm run export
5+
npm run build

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
auto-install-peers = false

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22

33
开源市集官网项目
44

5-
[![CI & CD](https://github.com/Open-Source-Bazaar/Open-Source-Bazaar.github.io/workflows/CI%20&%20CD/badge.svg)][7]
5+
[![CI & CD](https://github.com/Open-Source-Bazaar/Open-Source-Bazaar.github.io/actions/workflows/main.yml/badge.svg)][7]
66

77
## 上游项目
88

99
- [idea2app/Next-Bootstrap-ts][1]
1010

1111
## 技术栈
1212

13-
- Language: [TypeScript v4][2]
14-
- Component engine: [Nextjs v12][3]
13+
- Language: [TypeScript v5][2]
14+
- Component engine: [Nextjs v14][3]
1515
- Component suite: [Bootstrap v5][4]
16-
- Test framework: [Jest][8] + [Playwright][9]
1716
- CI / CD: GitHub [Actions][10] + [Vercel][11]
1817

1918
## 开始
@@ -32,10 +31,6 @@ yarn dev
3231
[2]: https://www.typescriptlang.org/
3332
[3]: https://nextjs.org/
3433
[4]: https://getbootstrap.com/
35-
[5]: https://github.com/vercel/next.js/tree/canary/packages/create-next-app
36-
[6]: https://david-dm.org/idea2app/next-bootstrap-ts
37-
[7]: https://github.com/Open-Source-Bazaar/Open-Source-Bazaar.github.io/actions
38-
[8]: https://jestjs.io/
39-
[9]: https://playwright.dev/
34+
[7]: https://github.com/Open-Source-Bazaar/Open-Source-Bazaar.github.io/actions/workflows/main.yml
4035
[10]: https://github.com/features/actions
41-
[11]: https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme
36+
[11]: https://vercel.com/

jest-playwright.config.js

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

jest.config.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
/** @type {import('next').NextConfig} */
2-
const withMDX = require('@next/mdx')({
1+
import setMDX from '@next/mdx';
2+
import setPWA from 'next-pwa';
3+
4+
const withMDX = setMDX({
35
options: {
46
remarkPlugins: [],
57
rehypePlugins: [],
68
providerImportSource: '@mdx-js/react',
79
},
810
extension: /\.mdx?$/,
911
}),
10-
withPWA = require('next-pwa')({
12+
withPWA = setPWA({
1113
dest: 'public',
1214
register: true,
1315
skipWaiting: true,
1416
disable: process.env.NODE_ENV === 'development',
1517
});
1618

17-
module.exports = withPWA(
19+
/** @type {import('next').NextConfig} */
20+
export default withPWA(
1821
withMDX({
1922
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdx'],
20-
reactStrictMode: true,
23+
output: 'export',
2124
}),
2225
);

package.json

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,43 @@
44
"description": "Open Source Bazaar web-site",
55
"private": true,
66
"scripts": {
7-
"prepare": "husky install && npx playwright install",
7+
"prepare": "husky install",
88
"dev": "next dev",
99
"build": "next build",
10-
"export": "next build && next export",
1110
"start": "next start",
1211
"lint": "next lint",
13-
"test": "npm run lint && lint-staged",
14-
"e2e": "jest"
12+
"test": "npm run lint && lint-staged"
1513
},
1614
"dependencies": {
17-
"@mdx-js/loader": "^2.0.0",
18-
"@mdx-js/react": "^2.0.0",
19-
"@next/mdx": "^12.1.0",
20-
"idea-react": "^0.27.11",
21-
"next": "^12.3.4",
15+
"@mdx-js/loader": "^3.0.0",
16+
"@mdx-js/react": "^3.0.0",
17+
"@next/mdx": "^14.0.3",
18+
"idea-react": "^1.0.0-rc.30",
19+
"next": "^14.0.3",
2220
"next-pwa": "^5.6.0",
23-
"react": "^17.0.2",
24-
"react-bootstrap": "^2.7.0",
25-
"react-dom": "^17.0.2",
26-
"react-typed-component": "^1.0.4"
21+
"react": "^18.2.0",
22+
"react-bootstrap": "^2.9.1",
23+
"react-dom": "^18.2.0",
24+
"react-typed-component": "^1.0.6"
2725
},
2826
"devDependencies": {
29-
"@jest/types": "^27.5.1",
30-
"@types/jest": "^27.4.1",
31-
"@types/node": "^14.18.12",
32-
"@types/react": "^17.0.53",
33-
"eslint": "^8.10.0",
34-
"eslint-config-next": "^12.1.0",
35-
"husky": "^7.0.4",
36-
"jest": "^27.5.1",
37-
"jest-playwright-preset": "^1.7.0",
38-
"lint-staged": "^12.3.4",
39-
"playwright": "^1.19.2",
40-
"prettier": "^2.5.1",
41-
"sass": "^1.49.9",
42-
"ts-jest": "^27.1.3",
43-
"ts-node": "^10.6.0",
44-
"typescript": "~4.6.2"
27+
"@types/node": "^18.18.9",
28+
"@types/react": "^18.2.37",
29+
"eslint": "^8.53.0",
30+
"eslint-config-next": "^14.0.3",
31+
"husky": "^8.0.3",
32+
"lint-staged": "^15.1.0",
33+
"prettier": "^3.1.0",
34+
"sass": "^1.69.5",
35+
"typescript": "~5.2.2"
4536
},
4637
"prettier": {
4738
"singleQuote": true,
4839
"trailingComma": "all",
4940
"arrowParens": "avoid"
5041
},
5142
"lint-staged": {
52-
"*.{html,md,less,json,yml,js,ts,tsx}": "prettier --write",
53-
"*.{js,jsx,ts,tsx}": "eslint --fix"
43+
"*.{html,md,scss,json,yml,js,mjs,ts,tsx}": "prettier --write",
44+
"*.{js,mjs,ts,tsx}": "eslint --fix"
5445
}
5546
}

pages/_app.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import type { AppProps } from 'next/app';
22
import Head from 'next/head';
33
import { useRouter } from 'next/router';
4-
import Container from 'react-bootstrap/Container';
5-
import Nav from 'react-bootstrap/Nav';
6-
import Navbar from 'react-bootstrap/Navbar';
4+
import { Container, Nav, Navbar } from 'react-bootstrap';
75

8-
import 'idea-react/dist/index.css';
96
import '../styles/globals.css';
107

118
const topNavBarMenu = [
@@ -29,6 +26,10 @@ const topNavBarMenu = [
2926
href: '/open-collaborator-award',
3027
name: '开放协作人奖',
3128
},
29+
{
30+
href: 'https://github.com/Open-Source-Bazaar/Git-Hackathon-scaffold',
31+
name: '黑客马拉松',
32+
},
3233
];
3334

3435
export default function MyApp({ Component, pageProps }: AppProps) {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ export default function Document() {
66
<Head>
77
<link
88
rel="stylesheet"
9-
href="https://unpkg.com/bootstrap@5.2.3/dist/css/bootstrap.min.css"
9+
href="https://unpkg.com/bootstrap@5.3.2/dist/css/bootstrap.min.css"
1010
/>
1111
<link
1212
rel="stylesheet"
13-
href="https://unpkg.com/bootstrap-icons@1.10.2/font/bootstrap-icons.css"
13+
href="https://unpkg.com/bootstrap-icons@1.11.1/font/bootstrap-icons.css"
1414
/>
1515
</Head>
1616
<body>

0 commit comments

Comments
 (0)