Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 🎉 Brand new site #19

Merged
merged 65 commits into from
Sep 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
c89a42a
fist add
2250918808 May 16, 2016
a9dcfac
add json
2250918808 May 16, 2016
6690abc
update
May 17, 2016
75edc57
update
May 17, 2016
bbc7cda
update
May 18, 2016
4b1a920
update style.
May 19, 2016
fccd45c
修复执行页面载入其他数据错误。
May 19, 2016
10437ab
update
May 19, 2016
0e99734
update
May 19, 2016
1be46bb
update
May 19, 2016
7373235
update
simaQ May 25, 2016
51dbaab
Update README.md
simaQ May 25, 2016
8713bac
add license.
May 25, 2016
a27eecf
update
May 25, 2016
251f5a5
Update README.md
simaQ May 25, 2016
04755fd
add LICENSE
May 25, 2016
faeeaaf
update style
May 26, 2016
6907076
update
May 26, 2016
7a444a8
update
May 31, 2016
3742cc3
update
Jun 2, 2016
e9fc223
添加demo页面。
Jul 25, 2016
1cf2e60
更新
Jul 25, 2016
9a4ae89
Update exec.html
dxq613 Jul 28, 2016
badbebb
Update exec.html
dxq613 Aug 5, 2016
0c50bb1
升级 g2 的版本。
Oct 18, 2016
9d66374
update
May 13, 2017
4cf64b8
更新文案
May 13, 2017
708ed8c
update
May 17, 2017
f55af84
update
May 17, 2017
fc9d63b
auto
May 17, 2017
a0b026d
improve
May 25, 2017
6e08cc9
layout
Jun 2, 2017
856286a
exec
2250918808 Jun 11, 2017
7331e86
change to old site
2250918808 Nov 15, 2017
4605679
Create README.md
leungwensen Nov 15, 2017
02c34ce
upperCase word error
2250918808 Dec 7, 2017
e00cd33
fix(doc): fixing links for demos and vis docs
leungwensen Jan 6, 2018
341d664
g6 -> 1.2.8
Jun 7, 2018
31769d4
dataBase -> database
Jun 11, 2018
fcbf4b4
dev
Jun 11, 2018
cd37e78
fix url bug
Jun 27, 2018
0ac984b
fix url
Jun 27, 2018
54ce15f
修复“网图编辑器(锚点禁止连接)”实例连接
qjs2000 Jul 16, 2018
98626df
修复文件名和图片路径错误
qjs2000 Jul 16, 2018
9fcf852
:zap: import gatsby
afc163 Sep 17, 2019
548ea98
:zap: Add more gatsby plugin
afc163 Sep 17, 2019
e40f9b1
:zap: clean up files
afc163 Sep 17, 2019
f81cfd9
:up: fix package.json
afc163 Sep 17, 2019
750c2c4
`gatsby-plugin-offline`
afc163 Sep 17, 2019
f64a647
:lipstick: prettier all code
afc163 Sep 17, 2019
86242c3
🖼 favicon
afc163 Sep 17, 2019
5407ceb
[ImgBot] Optimize images
ImgBotApp Sep 17, 2019
cbd26a5
remove propTypes
afc163 Sep 17, 2019
eb7d597
:hammer: use TypeScript and less
afc163 Sep 17, 2019
5b3e325
:bug: fix ts error
afc163 Sep 17, 2019
b368ee4
:bug: Fix alt
afc163 Sep 17, 2019
6d0ef8c
:lipstick: update package.json
afc163 Sep 17, 2019
cf525b6
:hammer: remove page-2
afc163 Sep 17, 2019
f41b044
Update nodejs.yml
afc163 Sep 18, 2019
3f04e2f
:white_check_mark: Add jest and ui test
afc163 Sep 18, 2019
d6b7c60
:lipstick: prettier code
afc163 Sep 18, 2019
45b76de
:white_check_mark: fix test name
afc163 Sep 18, 2019
e0794b4
:memo: update README.md
afc163 Sep 18, 2019
d0c96e5
chore: :memo: update README and package.json
afc163 Sep 18, 2019
2120509
:white_check_mark: fix image alt
afc163 Sep 18, 2019
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
21 changes: 21 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Node CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: npm install, and test
run: |
npm install
npm test
env:
CI: true
69 changes: 69 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# 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/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# dotenv environment variables file
.env

# gatsby files
.cache/
public

# Mac files
.DS_Store

# Yarn
yarn-error.log
.pnp/
.pnp.js
# Yarn Integrity file
.yarn-integrity
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.cache
package.json
package-lock.json
public
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"endOfLine": "lf",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all"
}
41 changes: 41 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
The MIT License (MIT)

Copyright (c) 2015 gatsbyjs

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.

Copyright (c) 2019-present Ant UED, https://xtech.antfin.com/

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.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# AntV New Site 📈

![CI status](https://github.com/antvis/antvis.github.io/workflows/Node%20CI/badge.svg)
[![Dependency Status](https://david-dm.org/antvis/antvis.github.io.svg?style=flat-square)](https://david-dm.org/antvis/antvis.github.io)
[![devDependencies Status](https://david-dm.org/antvis/antvis.github.io/dev-status.svg)](https://david-dm.org/antvis/antvis.github.io?type=dev)
![prettier code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)

## Install

```bash
npm install
```

## Preview

```bash
npm start
```

Visit http://127.0.0.1:8000

## Prettier

```bash
npm run format
```

## Test

```bash
npm test
```

## Deploy

Not ready.

## Used libraries

- [Gatsby](https://www.gatsbyjs.org/docs/)
- [Jest](https://jestjs.io/)
- [Testing Library](https://testing-library.com/)
1 change: 1 addition & 0 deletions __mocks__/file-mock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = `test-file-stub`;
14 changes: 14 additions & 0 deletions __mocks__/gatsby.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const React = require(`react`);
const gatsby = jest.requireActual(`gatsby`);

module.exports = {
...gatsby,
graphql: jest.fn(),
Link: jest.fn().mockImplementation(({ to, ...rest }) =>
React.createElement(`a`, {
...rest,
href: to,
}),
),
useStaticQuery: jest.fn(),
};
7 changes: 7 additions & 0 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Implement Gatsby's Browser APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/browser-apis/
*/

// You can delete this file if you're not using it
54 changes: 54 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
module.exports = {
siteMetadata: {
title: `AntV`,
siteUrl: `https://antvis.github.io`,
description: `Ant Visualization solution home page`,
},
plugins: [
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
`gatsby-plugin-offline`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `gatsby-starter-default`,
short_name: `starter`,
start_url: `/`,
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/images/favicon.png`, // This path is relative to the root of the site.
},
},
`gatsby-plugin-typescript`,
{
resolve: 'gatsby-plugin-less',
options: {
javascriptEnabled: true,
},
},
{
resolve: 'gatsby-plugin-antd',
options: {
style: true,
},
},
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: `UA-148148901-1`,
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
],
};
7 changes: 7 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Implement Gatsby's Node APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/node-apis/
*/

// You can delete this file if you're not using it
7 changes: 7 additions & 0 deletions gatsby-ssr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Implement Gatsby's SSR (Server Side Rendering) APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/ssr-apis/
*/

// You can delete this file if you're not using it
4 changes: 4 additions & 0 deletions jest-preprocess.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const babelOptions = {
presets: ['babel-preset-gatsby'],
};
module.exports = require('babel-jest').createTransformer(babelOptions);
19 changes: 19 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.jsx?$': `<rootDir>/jest-preprocess.js`,
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
moduleNameMapper: {
'.+\\.(css|styl|less|sass|scss)$': `identity-obj-proxy`,
'.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': `<rootDir>/__mocks__/file-mock.js`,
},
testPathIgnorePatterns: [`node_modules`, `.cache`],
transformIgnorePatterns: [`node_modules/(?!(gatsby)/)`],
globals: {
__PATH_PREFIX__: ``,
},
testURL: `http://localhost`,
setupFilesAfterEnv: [`<rootDir>/jest.setup.js`],
setupFiles: [`<rootDir>/loadershim.js`],
};
1 change: 1 addition & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require(`@testing-library/jest-dom/extend-expect`);
3 changes: 3 additions & 0 deletions loadershim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
global.___loader = {
enqueue: jest.fn(),
};
60 changes: 60 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "@antv/website",
"description": "Ant Visualization solution home page",
"version": "0.1.0",
"author": "AntV Team <antv@antfin.com>",
"keywords": [
"gatsby",
"antvis",
"antv"
],
"homepage": "https://antvis.github.io",
"repository": {
"type": "git",
"url": "https://github.com/antvis/antvis.github.io"
},
"bugs": {
"url": "https://github.com/antvis/antvis.github.io/issues"
},
"devDependencies": {
"gatsby": "^2.15.16",
"gatsby-image": "^2.2.19",
"gatsby-plugin-antd": "^2.0.2",
"gatsby-plugin-google-analytics": "^2.1.16",
"gatsby-plugin-less": "^3.0.6",
"gatsby-plugin-manifest": "^2.2.16",
"gatsby-plugin-offline": "^3.0.7",
"gatsby-plugin-react-helmet": "^3.1.7",
"gatsby-plugin-sharp": "^2.2.22",
"gatsby-plugin-typescript": "^2.1.8",
"gatsby-source-filesystem": "^2.1.22",
"gatsby-transformer-sharp": "^2.2.14",
"less": "^3.10.3",
"prettier": "^1.18.2",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-helmet": "^5.2.1",
"@testing-library/jest-dom": "^4.1.0",
"@testing-library/react": "^9.1.4",
"@types/jest": "^24.0.18",
"@types/react": "^16.9.2",
"@types/react-dom": "^16.9.0",
"@types/react-helmet": "^5.0.10",
"babel-jest": "^24.9.0",
"babel-preset-gatsby": "^0.2.13",
"identity-obj-proxy": "^3.0.0",
"jest": "^24.9.0",
"react-test-renderer": "^16.9.0",
"ts-jest": "^24.1.0",
"typescript": "^3.6.3"
},
"license": "MIT",
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
"start": "npm run develop",
"serve": "gatsby serve",
"test": "jest"
}
}
15 changes: 15 additions & 0 deletions src/components/__tests__/header.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import { render } from '@testing-library/react';

import Header from '../header';

describe(`Header`, () => {
it(`renders siteTitle`, () => {
const siteTitle = `Hello World`;
const { getByText } = render(<Header siteTitle={siteTitle} />);

const title = getByText(siteTitle);

expect(title).toBeInTheDocument();
});
});
Loading