Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
- name: Format check
run: npm run format:check

- name: Typecheck
run: npm run typecheck

- name: Lint
run: npm run lint

Expand Down
6 changes: 2 additions & 4 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env sh

echo "Running checks before push..."

npm run lint
npm run test
echo "Running CI checks..."
npm run ci
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import tseslint from 'typescript-eslint';
import { defineConfig, globalIgnores } from 'eslint/config';

export default defineConfig([
globalIgnores(['dist']),
globalIgnores(['dist', 'node_modules', 'build', 'coverage']),
{
files: ['**/*.{ts,tsx}'],
extends: [
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"elint": "eslint .",
"lint": "tsc --noEmit -p tsconfig.json",
"preview": "vite preview",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"typecheck": "tsc --noEmit",
"format": "prettier --write .",
"format:check": "prettier --check .",
"test": "",
"ci": "npm run format:check && npm run typecheck && npm run lint && npm run test",
"lint-staged": "lint-staged",
"prepare": "husky"
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const Footer = () => {
npm
</Link>
<Link
href="https://github.com/dfsyncjs/dfsync"
href="https://github.com/dfsyncjs/dfsync/tree/main/packages/client"
target="_blank"
rel="noreferrer"
underline="hover"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const Header = () => {
</Button>
<Button
color="inherit"
href="https://github.com/dfsyncjs/dfsync"
href="https://github.com/dfsyncjs/dfsync/tree/main/packages/client"
target="_blank"
rel="noreferrer"
startIcon={<GitHubIcon />}
Expand Down
14 changes: 9 additions & 5 deletions src/components/Hero/Hero.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
import ListIcon from '@mui/icons-material/List';
import { Box, Button, Chip, Container, Stack, Typography } from '@mui/material';
import { Link as RouterLink } from 'react-router-dom';
import { InstallCommand } from '../InstallCommand/InstallCommand';
import { ProjectBadges } from '../ProjectBadges/ProjectBadges.tsx';

export const Hero = () => {
return (
Expand Down Expand Up @@ -37,6 +40,8 @@ export const Hero = () => {
}}
/>

<ProjectBadges />

<Typography
variant="h6"
color="text.secondary"
Expand Down Expand Up @@ -64,12 +69,11 @@ export const Hero = () => {
View on npm
</Button>
<Button
component={RouterLink}
variant="outlined"
size="medium"
href="https://github.com/dfsyncjs/dfsync/blob/main/packages/client/README.md"
target="_blank"
rel="noreferrer"
endIcon={<OpenInNewIcon />}
to="/docs"
startIcon={<ListIcon />}
>
Documentation
</Button>
Expand All @@ -82,7 +86,7 @@ export const Hero = () => {
mt: 3,
width: '100%',
p: { xs: 3, md: 4 },
borderRadius: 4,
borderRadius: 1,
bgcolor: 'background.paper',
border: '1px solid',
borderColor: 'divider',
Expand Down
2 changes: 1 addition & 1 deletion src/components/InstallCommand/InstallCommand.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const InstallCommand = () => {
bgcolor: 'background.paper',
border: '1px solid',
borderColor: 'divider',
borderRadius: 3,
borderRadius: 1,
px: 3,
py: 2,
maxWidth: 500,
Expand Down
65 changes: 65 additions & 0 deletions src/components/ProjectBadges/ProjectBadges.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { Stack, Box, Link } from '@mui/material';

const packageName = '@dfsync/client';
const repoName = 'dfsyncjs/dfsync';

export const ProjectBadges = () => {
return (
<Stack direction="row" spacing={1.5} alignItems="center" flexWrap="wrap" sx={{ mt: 2 }}>
{/* npm version */}
<Link
href={`https://www.npmjs.com/package/${packageName}`}
target="_blank"
rel="noreferrer"
underline="none"
sx={{ lineHeight: 1 }}
>
<Box
component="img"
src={`https://img.shields.io/npm/v/${encodeURI(packageName)}`}
alt="npm version"
sx={{ height: 20 }}
/>
</Link>

{/* npm weekly downloads */}
<Link
href={`https://www.npmjs.com/package/${packageName}`}
target="_blank"
rel="noreferrer"
underline="none"
sx={{ lineHeight: 1 }}
>
<Box
component="img"
src={`https://img.shields.io/npm/dw/${encodeURI(packageName)}`}
alt="npm downloads"
sx={{ height: 20 }}
/>
</Link>

{/* github stars */}
<Link
href={`https://github.com/${repoName}/tree/main/packages/client`}
target="_blank"
rel="noreferrer"
underline="none"
sx={{ lineHeight: 1 }}
>
<Box
component="img"
src={`https://img.shields.io/github/stars/${repoName}`}
alt="github stars"
sx={{ height: 20 }}
/>
</Link>

<Box
component="img"
src={`https://img.shields.io/github/license/${repoName}`}
alt="license"
sx={{ height: 20 }}
/>
</Stack>
);
};
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export { Features } from './Features/Features';
export { Footer } from './Footer/Footer';
export { Header } from './Header/Header';
export { Hero } from './Hero/Hero';
export { ProjectBadges } from './ProjectBadges/ProjectBadges';