Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a0596a2
fix: typo
JASONPANGGO Jan 1, 2022
f84afb5
feat: filter deleted topic
thonatos Jan 2, 2022
f45c656
feat: add create page
thonatos Jan 2, 2022
03f50b4
feat: add about page
thonatos Jan 3, 2022
2175f0d
feat: add top tag to list
JASONPANGGO Jan 4, 2022
e3e3ff4
feat: add backto top
JASONPANGGO Jan 4, 2022
845f78c
feat: add create page
JASONPANGGO Jan 4, 2022
e7558b4
feat: add user page
JASONPANGGO Jan 4, 2022
237a3bd
fix: error rebase info (#6)
thonatos Jan 4, 2022
fca5e16
refactor: topic item list in components (#7)
JASONPANGGO Jan 4, 2022
05445b8
feat: pages (#8)
thonatos Jan 4, 2022
c1da1cd
feat: add ga analytics (#9)
thonatos Jan 4, 2022
678241b
feat: add pkgs to externals (#10)
thonatos Jan 4, 2022
d4078f2
feat: add pkgs to externals (#11)
thonatos Jan 5, 2022
9f257d9
Revert "feat: add pkgs to externals (#11)" (#12)
thonatos Jan 5, 2022
37aed7c
feat: layout (#13)
thonatos Jan 5, 2022
ccc8803
feat: use the BackTop from antd (#14)
JASONPANGGO Jan 5, 2022
fbe0e05
chore: add github actions (#15)
thonatos Jan 5, 2022
93850af
chore: fix action ci command (#16)
thonatos Jan 5, 2022
e8f8f8d
chore: build and release (#17)
thonatos Jan 5, 2022
147fa66
chore: zip dist dir (#18)
thonatos Jan 5, 2022
a0abb9d
feat: update route (#19)
thonatos Jan 5, 2022
f700f5c
chore: add license (#20)
thonatos Jan 5, 2022
8576798
docs: add contributors badge
thonatos Jan 5, 2022
9eeac87
refactor: split component & update doc (#22)
thonatos Jan 5, 2022
916575d
feat: edit topics
JASONPANGGO Jan 7, 2022
6655a42
refactor: rename service method in a CURD way
JASONPANGGO Jan 7, 2022
77f85a6
refactor: headerConfig
JASONPANGGO Jan 7, 2022
a735fbc
feat: add access control to edit topic
JASONPANGGO Jan 7, 2022
6f664f2
refactor: rename page components
JASONPANGGO Jan 7, 2022
b86ee90
feat: add pkgs to externals (#11)
thonatos Jan 5, 2022
a60f664
Revert "feat: add pkgs to externals (#11)" (#12)
thonatos Jan 5, 2022
104180f
feat: mark one or all message (#24)
thonatos Jan 7, 2022
4915902
feat: add pkgs to externals (#11)
thonatos Jan 5, 2022
8fc15aa
Revert "feat: add pkgs to externals (#11)" (#12)
thonatos Jan 5, 2022
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
46 changes: 46 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
schedule:
- cron: '0 2 * * *'

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node-version: [16.x]
os: [ubuntu-latest]

steps:
- name: Checkout Git Source
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm i -g npminstall && npminstall

- name: Continuous Integration
run: npm run ci

- name: Code Coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Actions Release

on:
push:
branches: [ master ]

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node-version: [16.x]
os: [ubuntu-latest]

steps:
- name: Checkout Git Source
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm i -g npminstall && npminstall

- name: Continuous integration
run: npm run ci

- name: Semantic Release
run: npm run build && npm run build:zip && npm run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

# production
/dist
dist.zip

# misc
.DS_Store
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
**/*.ejs
**/*.html
package.json

.umi
.umi-production
.umi-test

dist
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 CNodejs.org

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# react-cnode
# React-CNode.js

CNode 社区 React 版本
> Frontend Powered By React For CNode.js

## Getting Started
## Development

Install dependencies,

Expand All @@ -13,5 +13,9 @@ $ yarn
Start the dev server,

```bash
$ yarn start
$ yarn dev
```

## Contributors

[![contributors](https://ergatejs.implements.io/badges/contributors/cnodejs/react-cnode.svg?owner=cnodejs&repo=react-cnode&type=svg&width=1232&size=64&padding=8)](https://github.com/cnodejs/react-cnode/graphs/contributors)
2 changes: 2 additions & 0 deletions config/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ export default {
logo: '/images/cnodejs.svg',
title: 'CNode.js',
description: 'Node.js 专业中文社区',
concept:
'CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。',
};
74 changes: 73 additions & 1 deletion config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,81 @@ import routes from './routes';
import { defineConfig } from 'umi';

export default defineConfig({
// cnodejs.org
favicon: '/images/favicon.ico',
metas: [
{
name: 'keywords',
content: 'nodejs, node, express, connect, socket.io',
},
{
name: 'referrer',
content: 'always',
},
{
name: 'author',
content: 'EDP@TaoBao',
},
{
name: 'wb:webmaster',
content: '617be6bd946c6b96',
},
{
name: 'wb:webmaster',
content: '617be6bd946c6b96',
},
],
links: [
{
type: 'image/x-icon',
rel: 'icon',
href: '//static2.cnodejs.org/public/images/cnode_icon_32.png',
},
{
title: 'RSS',
type: 'application/rss+xml',
rel: 'alternate',
href: 'https://cnodejs.org/rss',
},
],

analytics: {
ga: 'UA-41753901-5',
},

// umi.js
singular: true,

fastRefresh: {},
// mfsu: {},

mfsu: {},

externals: {
react: 'window.React',
'react-dom': 'ReactDOM',
antd: 'antd',
dayjs: 'dayjs',
},

styles:
process.env.NODE_ENV === 'development'
? ['//unpkg.com/antd@4.x/dist/antd.css']
: ['//unpkg.com/antd@4.x/dist/antd.min.css'],

scripts:
process.env.NODE_ENV === 'development'
? [
'//unpkg.com/react@17.x/umd/react.development.js',
'//unpkg.com/react-dom@17.x/umd/react-dom.development.js',
'//unpkg.com/antd@4.x/dist/antd.js',
'//unpkg.com/dayjs@1.x/dayjs.min.js',
]
: [
'//unpkg.com/react@17.x/umd/react.production.min.js',
'//unpkg.com/react-dom@17.x/umd/react-dom.production.min.js',
'//unpkg.com/antd@4.x/dist/antd.min.js',
'//unpkg.com/dayjs@1.x/dayjs.min.js',
],

nodeModulesTransform: {
type: 'none',
Expand Down
42 changes: 41 additions & 1 deletion config/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,61 @@ const routes: IRoute[] = [
exact: true,
icon: 'home',
name: '主页',
description:
'CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。',
component: '@/page/topic',
},

{
path: '/my/messages',
exact: true,
icon: 'message',
title: '未读消息',
access: 'canReadMessage',
component: '@/page/message',
},
{
path: '/about',
exact: true,
icon: 'info',
name: '关于我们',
component: '@/page/about',
},
{
path: '/links',
exact: true,
icon: 'link',
name: '友情链接',
component: '@/page/links',
},
{
path: '/api',
exact: true,
icon: 'api',
name: 'API',
component: '@/page/api',
},
{
path: '/topic/create',
exact: true,
title: '新建话题',
component: '@/page/topic/create',
access: 'canPostTopic',
},
{
path: '/topic/:id',
exact: true,
component: '@/page/topic/detail',
},
{
path: '/topic/:id/edit',
exact: true,
component: '@/page/topic/create',
},
{
path: '/user/:loginname',
exact: true,
component: '@/page/user/',
},
],
},

Expand Down
49 changes: 46 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{
"private": true,
"name": "react-cnode",
"description": "Frontend Powered By React For CNode.js",
"version": "development",
"private": false,
"license": "MIT",
"scripts": {
"dev": "umi dev",
"build": "umi build",
"build:zip": "node ./scripts/zip.js",
"ci": "npm run test",
"postinstall": "umi generate tmp",
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
"test": "umi-test",
"test:coverage": "umi-test --coverage"
"test:coverage": "umi-test --coverage",
"semantic-release": "semantic-release"
},
"gitHooks": {
"pre-commit": "lint-staged"
Expand All @@ -19,6 +26,37 @@
"prettier --parser=typescript --write"
]
},
"ci": {
"type": "github",
"os": {
"github": "linux"
},
"version": "16.x"
},
"release": {
"branche": "master",
"tagFormat": "${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "History.md"
}
],
[
"@semantic-release/github",
{
"assets": {
"path": "dist.zip",
"label": "Assets Distribution"
},
"addReleases": "bottom"
}
]
]
},
"dependencies": {
"dotenv": "^10.0.0",
"react": "17.x",
Expand All @@ -30,7 +68,9 @@
"@ant-design/pro-layout": "^6.32.1",
"@ant-design/pro-list": "^1.21.12",
"@ant-design/pro-table": "^2.61.9",
"@semantic-release/changelog": "^6.0.1",
"@types/dotenv": "^8.2.0",
"@types/jest": "^27.4.0",
"@types/markdown-it": "^12.2.3",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
Expand All @@ -39,13 +79,16 @@
"@umijs/preset-react": "1.x",
"@umijs/test": "^3.5.20",
"ahooks": "^3.1.3",
"compressing": "^1.5.1",
"dayjs": "^1.10.7",
"egg-ci": "^1.19.0",
"lint-staged": "^10.0.7",
"markdown-it": "^12.3.0",
"prettier": "^2.2.0",
"react-markdown-editor-lite": "^1.3.2",
"semantic-release": "^18.0.1",
"typescript": "^4.1.2",
"umi": "^3.5.20",
"yorkie": "^2.0.0"
}
}
}
Binary file added public/images/cnode_icon_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/cnode_icon_64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading