Skip to content

Commit

Permalink
🎉 chore: 初始化热力图组件
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed May 1, 2021
1 parent a682229 commit c4747d9
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 0 deletions.
1 change: 1 addition & 0 deletions jest.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
'<rootDir>/packages/macos-traffic-light/src',
'@arvinxu/journey-map': '<rootDir>/packages/journey-map/src',
'@arvinxu/user-panel': '<rootDir>/packages/user-panel/src',
'@arvinxu/heatmap-calendar': '<rootDir>/packages/heatmap-calendar/src',
'@arvinxu/float-label-input': '<rootDir>/packages/float-label-input/src',
'@arvinxu/page-loading': '<rootDir>/packages/page-loading/src',
'@arvinxu/mindflow': '<rootDir>/packages/mindflow/src',
Expand Down
5 changes: 5 additions & 0 deletions packages/heatmap-calendar/.fatherrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const base = require('../../.fatherrc');

module.exports = {
...base,
};
14 changes: 14 additions & 0 deletions packages/heatmap-calendar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# @arvinxu/heatmap-calendar

[![NPM version][version-image]][version-url] [![NPM downloads][download-image]][download-url]

## License

[MIT](../../LICENSE) ® Arvin Xu

<!-- npm url -->

[version-image]: http://img.shields.io/npm/v/@arvinxu/heatmap-calendar.svg?color=deepgreen&label=latest
[version-url]: http://npmjs.org/package/@arvinxu/heatmap-calendar
[download-image]: https://img.shields.io/npm/dm/@arvinxu/heatmap-calendar.svg
[download-url]: https://npmjs.org/package/@arvinxu/heatmap-calendar
14 changes: 14 additions & 0 deletions packages/heatmap-calendar/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const base = require('../../jest.config.base');

const packageName = '@arvinxu/heatmap-calendar';

const root = '<rootDir>/packages/heatmap-calendar';

module.exports = {
...base,
rootDir: '../..',
roots: [root],
name: packageName,
displayName: packageName,
collectCoverageFrom: [`${root}/src/**/*.tsx`, `${root}/src/**/*.ts`],
};
25 changes: 25 additions & 0 deletions packages/heatmap-calendar/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "@arvinxu/heatmap-calendar",
"version": "1.0.0",
"files": [
"lib",
"es"
],
"main": "lib/index.js",
"module": "es/index.js",
"homepage": "https://github.com/arvinxx/components/tree/master/packages/heatmap-calendar#readme",
"repository": "git+https://github.com/arvinxx/components.git",
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public"
},
"scripts": {
"build": "father-build && yarn webpack",
"webpack": "webpack",
"test": "jest",
"test:update": "jest -u",
"prepublishOnly": "yarn build",
"cov": "jest --coverage",
"clean": "rm -rf es lib dist build coverage .umi"
}
}
10 changes: 10 additions & 0 deletions packages/heatmap-calendar/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import type { FC } from 'react';

export interface HeatmapCalendarProps {}

const HeatmapCalendar: FC<HeatmapCalendarProps> = () => {
return <div>HeatmapCalendar</div>;
};

export default HeatmapCalendar;
11 changes: 11 additions & 0 deletions packages/heatmap-calendar/tests/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import { render } from '@testing-library/react';

import HeatmapCalendar from '@arvinxu/heatmap-calendar';

describe('HeatmapCalendar', () => {
it('默认状态', () => {
const { container } = render(<HeatmapCalendar />);
expect(container).toMatchSnapshot();
});
});
15 changes: 15 additions & 0 deletions packages/heatmap-calendar/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"declaration": true,
"jsx": "react-jsx",
"skipLibCheck": true,
/* babel 输出类型 */
"moduleResolution": "Node",
"target": "ESNext",
"module": "ESNext",
/* 模块导入配置项 */
"esModuleInterop": true,
"types": ["../../types", "@types/jest"]
}
}
11 changes: 11 additions & 0 deletions packages/heatmap-calendar/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const path = require('path');
const config = require('../../webpack.config');

module.exports = {
...config,
output: {
...config.output,
library: 'HeatmapCalendar',
path: path.resolve(__dirname, 'dist'),
},
};
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"@arvinxu/journey-map/*": ["./packages/journey-map/src/*"],
"@arvinxu/user-panel": ["./packages/user-panel/src"],
"@arvinxu/user-panel/*": ["./packages/user-panel/src/*"],
"@arvinxu/heatmap-calendar": ["./packages/heatmap-calendar/src"],
"@arvinxu/heatmap-calendar/*": ["./packages/heatmap-calendar/src/*"],
"@arvinxu/float-label-input": ["./packages/float-label-input/src"],
"@arvinxu/page-loading": ["./packages/page-loading/src"],
"@arvinxu/mindflow": ["./packages/mindflow/src"],
Expand Down

0 comments on commit c4747d9

Please sign in to comment.