Skip to content

Commit

Permalink
refactor: site (#3412)
Browse files Browse the repository at this point in the history
* refactor: 将官网内容全部迁移到 site 目录下

* chore: update release.yml

* fix: 修复 lint 问题

* chore: deploy dist to gh-pages

* fix: cr suggestion

* chore: remove useless files

* chore: modify ignore file

* chore: remove useless files

* chore: fix babel__traverse error

see: https://stackoverflow.com/questions/63903376/angular-node-modules-types-babel-traverse-index-d-ts1137-43-error-ts1109

* chore: use yarn install instead of npm
  • Loading branch information
visiky authored Dec 7, 2022
1 parent f4e797f commit 5a16832
Show file tree
Hide file tree
Showing 1,061 changed files with 1,445 additions and 55 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 14
- name: npm install
- name: yarn install
run: |
npm install
yarn install
- name: lint
run: |
npm run lint
Expand All @@ -26,9 +26,9 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 14
- name: npm install
- name: yarn install
run: |
npm install
yarn install
- name: build
run: |
npm run build
Expand All @@ -41,7 +41,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 14
- name: npm install
- name: yarn install
run: |
yarn install
- name: test
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/release.yml → .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Deploy

on:
workflow_dispatch:
Expand All @@ -13,21 +13,24 @@ jobs:
- run: yarn install
- run: npm run lint

publish-site:
deploy-site:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: cd site
- run: yarn install
- run: npm run site:build
- run: npm run build
- run: |
cd ..
git init
git config --local user.name antv
git config --local user.email [email protected]
mv site/dist ./
git add dist -f
git commit -m "update by release action"
- uses: ad-m/github-push-action@master
with:
github_token: ${{secrets.PERSONAL_ACCESS_TOKEN}}
branch: g2plot-site
branch: gh-pages
force: true
26 changes: 2 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,12 @@ yarn-error.log*
# lock
package-lock.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/
Expand Down Expand Up @@ -69,7 +48,6 @@ temp
.DS_Store
.idea
.cache
demos/assets/screenshots
/lib
/esm
/dist
Expand All @@ -82,5 +60,5 @@ demos/assets/screenshots
.umi

# dumi2 website builder
.dumi/tmp
.dumi/tmp-production
site/.dumi/tmp
site/.dumi/tmp-production
16 changes: 4 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
"url": "https://github.com/antvis/G2plot"
},
"scripts": {
"start": "npm run site:clean && npm run site:develop",
"site:develop": "dumi dev",
"site:build": "dumi build",
"site:clean": "",
"site:deploy": "npm run build && npm run site:build && gh-pages -d public",
"start": "cd site && npm start",
"fix": "eslint --ext .ts ./src ./__tests__ --fix && prettier --write ./src ./__tests__ && lint-md --fix ./examples ./docs",
"build": "run-s clean lib dist size",
"size": "limit-size",
Expand Down Expand Up @@ -66,7 +62,6 @@
},
"devDependencies": {
"@antv/data-set": "^0.11.5",
"@antv/dumi-theme-antv": "^0.3.0-beta.3",
"@babel/core": "^7.10.4",
"@babel/plugin-transform-runtime": "^7.11.5",
"@babel/preset-env": "^7.10.4",
Expand All @@ -78,16 +73,13 @@
"@typescript-eslint/parser": "^2.0.0",
"antd": "^4.8.4",
"babel-loader": "^8.1.0",
"chroma-js": "^2.1.2",
"conventional-changelog-cli": "^2.0.34",
"cross-env": "^7.0.2",
"dumi": "^2.0.0-beta.11",
"eslint": "^6.1.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-prettier": "^3.1.0",
"generate-changelog": "^1.8.0",
"gh-pages": "^3.1.0",
"husky": "^4.2.3",
"jest": "^26.0.1",
"jest-electron": "^0.1.7",
Expand All @@ -99,7 +91,6 @@
"miz": "^1.0.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.0.1",
"rc-for-plots": "^0.0.1",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"react-i18next": "^11.7.0",
Expand Down Expand Up @@ -154,7 +145,8 @@
],
"resolutions": {
"d3-array": "2.12.1",
"@types/lodash": "4.14.182"
"@types/lodash": "4.14.182",
"@types/babel__traverse": "7.0.6"
},
"license": "MIT"
}
}
4 changes: 2 additions & 2 deletions scripts/manual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
const fs = require('fs');
const path = require('path');

const sourceFilePath = path.resolve('./examples');
const targetFilePath = path.resolve('./docs/manual/plots');
const sourceFilePath = path.resolve('./site/examples');
const targetFilePath = path.resolve('./site/docs/manual/plots');
const excludeFilesPath = ['gallery']; // 不处理的路径
const includeFiles = ['API.zh.md', 'API.en.md'];

Expand Down
Loading

0 comments on commit 5a16832

Please sign in to comment.