Skip to content

Commit b36c536

Browse files
committed
feat: add date-fn
1 parent 32736df commit b36c536

File tree

8 files changed

+22604
-12976
lines changed

8 files changed

+22604
-12976
lines changed

jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ module.exports = {
99
'src/**/*.{ts,tsx}',
1010
'!src/**/**.d.ts',
1111
'!src/index.tsx',
12+
'!src/components/App/tabs.ts',
13+
'!src/helpers/const.ts',
14+
'!src/helpers/global.ts',
1215
'!src/reportWebVitals.ts',
1316
],
1417
coverageThreshold: {

package-lock.json

Lines changed: 22572 additions & 12975 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"dependencies": {
4343
"@testing-library/jest-dom": "^5.16.5",
4444
"axios": "^0.21.4",
45+
"date-fns": "^2.29.3",
4546
"gh-pages": "^3.2.3",
4647
"github-fork-ribbon-css": "^0.2.3",
4748
"lodash": "^4.17.21",
@@ -92,6 +93,7 @@
9293
"lint-staged": "^13.0.2",
9394
"mini-css-extract-plugin": "^2.6.1",
9495
"prettier": "^2.3.2",
96+
"semantic-release": "^21.0.0",
9597
"ts-jest": "^29.0.1",
9698
"ts-loader": "^9.3.1",
9799
"webpack": "^5.74.0",

src/components/About/About.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ const About: React.FC = () => {
4040
target="_blank"
4141
rel="noopener noreferrer"
4242
>
43-
{lib.name}
43+
{lib.name}{' '}
44+
<span className="text-sm">v{lib.version}</span>
4445
</a>
4546
<span>Use as {lib.use}</span>
4647
</div>

src/helpers/const.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,34 @@
22
export const LIBRARIES: Library[] = [
33
{
44
name: 'redux',
5+
version: '4.2.0',
56
url: 'https://redux.js.org/',
67
use: 'Redux',
78
},
89
{
910
name: 'lodash',
11+
version: '4.17.21',
1012
url: 'http://lodash.com',
1113
use: '_',
1214
},
1315
{
1416
name: 'axios',
17+
version: '0.21.4',
1518
url: 'https://github.com/axios/axios',
1619
use: 'axios',
1720
},
1821
{
1922
name: 'luxon',
23+
version: '1.28.0',
2024
url: 'https://moment.github.io/luxon/docs',
2125
use: 'luxon',
2226
},
27+
{
28+
name: 'date-fns',
29+
version: '2.29.3',
30+
url: 'https://date-fns.org/',
31+
use: 'dfn',
32+
},
2333
];
2434

2535
export const CODE_SAMPLES: CodeSample[] = [
@@ -47,6 +57,12 @@ export const CODE_SAMPLES: CodeSample[] = [
4757
codeSample:
4858
"// Luxon code example. Reference Luxon in the code as `luxon` \n\nconst luxonDate = luxon.DateTime.now().setZone('America/New_York').minus({weeks:1}).endOf('day').toISO();\nluxonDate",
4959
},
60+
{
61+
id: 5,
62+
name: 'date-fns',
63+
codeSample:
64+
'// date-fns code example. Reference date-fns in the code as `dfn` \n\nconst value = dfn.formatDistance(dfn.subDays(new Date(), 3), new Date(), { addSuffix: true });\nvalue;',
65+
},
5066
];
5167

5268
export const EDITOR_THEMES: EditorTheme[] = [

src/helpers/global.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import _ from 'lodash';
22
import { createStore, combineReducers } from 'redux';
33
import axios from 'axios';
44
import * as luxon from 'luxon';
5+
import * as dfn from 'date-fns';
56

67
_.extend(window, {
78
_,
89
axios,
910
luxon,
11+
dfn,
1012
Redux: { createStore, combineReducers },
1113
});

src/helpers/type.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ interface Library {
1414
name: string;
1515
url: string;
1616
use: string;
17+
version: string;
1718
}

src/styles/App.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,9 @@ body {
9393
width: 100%;
9494
text-align: left;
9595
}
96+
97+
98+
.text-sm {
99+
color: #aaa;
100+
font-size: 0.7rem;
101+
}

0 commit comments

Comments
 (0)