-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: setup typescript check, prettier, eslint, conventional commits,…
… prevent push to main branch (#8)
- Loading branch information
1 parent
aac0a6f
commit f98f94f
Showing
15 changed files
with
2,008 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
pnpm commitlint --edit $1 | ||
|
||
branch="$(git rev-parse --abbrev-ref HEAD)" | ||
|
||
color_red="$(tput setaf 1)" | ||
bold="$(tput bold)" | ||
reset="$(tput sgr0)" | ||
|
||
if [ "$branch" = "main" ]; then | ||
echo "${color_red}${bold}You can't commit directly to the main branch${reset}" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pnpm lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
public | ||
build | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default { | ||
trailingComma: 'all', | ||
useTabs: true, | ||
tabWidth: 1, | ||
singleQuote: true, | ||
jsxSingleQuote: false, | ||
semi: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,38 @@ | ||
{ | ||
"name": "docs", | ||
"version": "0.1.18", | ||
"type": "module", | ||
"private": true, | ||
"scripts": { | ||
"dev": "storybook dev -p 6006", | ||
"build": "storybook build --docs", | ||
"preview-storybook": "serve storybook-static", | ||
"clean": "rm -rf .turbo && rm -rf node_modules", | ||
"lint": "eslint ./stories/*.stories.tsx --max-warnings 0" | ||
}, | ||
"dependencies": { | ||
"@signozhq/button": "workspace:*", | ||
"@signozhq/input": "workspace:*", | ||
"@signozhq/tailwind-config": "workspace:*", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@chromatic-com/storybook": "^1", | ||
"@repo/eslint-config": "workspace:*", | ||
"@repo/typescript-config": "workspace:*", | ||
"@storybook/addon-actions": "^8.3.3", | ||
"@storybook/addon-designs": "^8.0.3", | ||
"@storybook/addon-essentials": "^8.3.3", | ||
"@storybook/addon-links": "^8.3.3", | ||
"@storybook/react": "^8.3.3", | ||
"@storybook/react-vite": "^8.3.3", | ||
"@vitejs/plugin-react": "^4.2.1", | ||
"eslint": "^9.11.0", | ||
"serve": "^14.2.1", | ||
"storybook": "^8.3.3", | ||
"typescript": "^5.3.3", | ||
"vite": "^5.1.4" | ||
} | ||
"name": "docs", | ||
"version": "0.1.18", | ||
"type": "module", | ||
"private": true, | ||
"scripts": { | ||
"dev": "storybook dev -p 6006", | ||
"build": "storybook build --docs", | ||
"preview-storybook": "serve storybook-static", | ||
"clean": "rm -rf .turbo && rm -rf node_modules", | ||
"lint": "eslint ./stories/*.stories.tsx --max-warnings 0" | ||
}, | ||
"dependencies": { | ||
"@signozhq/button": "workspace:*", | ||
"@signozhq/input": "workspace:*", | ||
"@signozhq/tailwind-config": "workspace:*", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@chromatic-com/storybook": "^1", | ||
"@repo/eslint-config": "workspace:*", | ||
"@repo/typescript-config": "workspace:*", | ||
"@storybook/addon-actions": "^8.3.3", | ||
"@storybook/addon-designs": "^8.0.3", | ||
"@storybook/addon-essentials": "^8.3.3", | ||
"@storybook/addon-links": "^8.3.3", | ||
"@storybook/react": "^8.3.3", | ||
"@storybook/react-vite": "^8.3.3", | ||
"@types/react": "^18.3.11", | ||
"@vitejs/plugin-react": "^4.2.1", | ||
"eslint": "^9.11.0", | ||
"serve": "^14.2.1", | ||
"storybook": "^8.3.3", | ||
"typescript": "^5.3.3", | ||
"vite": "^5.1.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"extends": "@repo/typescript-config/react-app.json", | ||
"include": ["."], | ||
"exclude": ["dist", "build", "node_modules"] | ||
"extends": "@repo/typescript-config/react-library.json", | ||
"include": ["."], | ||
"exclude": ["dist", "build", "node_modules"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
import { StrictMode } from "react"; | ||
import { createRoot } from "react-dom/client"; | ||
import App from "./App.tsx"; | ||
import "./index.css"; | ||
import { ThemeProvider, useTheme } from "@signozhq/theme"; | ||
import React from 'react'; | ||
import { StrictMode } from 'react'; | ||
import { createRoot } from 'react-dom/client'; | ||
import App from './App'; | ||
import './index.css'; | ||
import { ThemeProvider, useTheme } from '@signozhq/theme'; | ||
|
||
function ThemedApp() { | ||
const { theme } = useTheme(); | ||
const { theme } = useTheme(); | ||
|
||
return ( | ||
<div className={`app ${theme}`}> | ||
<App /> | ||
</div> | ||
); | ||
return ( | ||
<div className={`app ${theme}`}> | ||
<App /> | ||
</div> | ||
); | ||
} | ||
|
||
createRoot(document.getElementById("root")!).render( | ||
<StrictMode> | ||
<ThemeProvider> | ||
<ThemedApp /> | ||
</ThemeProvider> | ||
</StrictMode> | ||
createRoot(document.getElementById('root')!).render( | ||
<StrictMode> | ||
<ThemeProvider> | ||
<ThemedApp /> | ||
</ThemeProvider> | ||
</StrictMode>, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default { extends: ['@commitlint/config-conventional'] }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import globals from 'globals'; | ||
import pluginJs from '@eslint/js'; | ||
import tseslint from 'typescript-eslint'; | ||
import pluginReact from 'eslint-plugin-react'; | ||
|
||
export default [ | ||
{ | ||
ignores: [ | ||
'dist', | ||
'node_modules', | ||
'packages/**/dist', | ||
'apps/**/dist', | ||
'packages/**/node_modules', | ||
'apps/**/node_modules', | ||
], | ||
}, | ||
{ files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] }, | ||
{ languageOptions: { globals: globals.browser } }, | ||
pluginJs.configs.recommended, | ||
...tseslint.configs.recommended, | ||
pluginReact.configs.flat.recommended, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,49 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"build": "turbo run build", | ||
"dev": "turbo run dev", | ||
"lint": "turbo run lint", | ||
"clean": "turbo run clean && rm -rf node_modules", | ||
"format": "prettier --write \"**/*.{ts,tsx,md}\"", | ||
"changeset": "changeset", | ||
"version-packages": "changeset version", | ||
"update-version": "changeset && changeset version", | ||
"release": "turbo run build --filter=docs^... && changeset publish" | ||
}, | ||
"devDependencies": { | ||
"@changesets/cli": "^2.27.1", | ||
"inquirer": "^11.0.2", | ||
"prettier": "^3.2.5", | ||
"turbo": "^2.1.2" | ||
}, | ||
"packageManager": "[email protected]", | ||
"name": "design-system" | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"build": "turbo run build", | ||
"dev": "turbo run dev", | ||
"lint": "turbo run lint", | ||
"clean": "turbo run clean && rm -rf node_modules", | ||
"format": "prettier --write \"**/*.{ts,tsx,md}\"", | ||
"changeset": "changeset", | ||
"version-packages": "changeset version", | ||
"update-version": "changeset && changeset version", | ||
"release": "turbo run build --filter=docs^... && changeset publish", | ||
"prepare": "husky", | ||
"pre-commit": "lint-staged" | ||
}, | ||
"lint-staged": { | ||
"*.{js, jsx,ts,tsx}": [ | ||
"sh scripts/typecheck-staged.sh", | ||
"eslint --quiet --fix", | ||
"prettier --write" | ||
], | ||
"*.{json,js,ts,jsx,tsx,html}": [ | ||
"prettier --write --ignore-unknown" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@changesets/cli": "^2.27.1", | ||
"@commitlint/cli": "^19.5.0", | ||
"@commitlint/config-conventional": "^19.5.0", | ||
"@eslint/js": "^9.9.0", | ||
"@repo/typescript-config": "workspace:*", | ||
"@turbo/gen": "^2.1.2", | ||
"@types/fs-extra": "^11.0.4", | ||
"eslint": "^9.11.0", | ||
"eslint-plugin-react": "^7.37.1", | ||
"fs-extra": "^11.2.0", | ||
"globals": "^15.9.0", | ||
"husky": "^9.1.6", | ||
"inquirer": "^11.0.2", | ||
"lint-staged": "^15.2.10", | ||
"prettier": "^3.2.5", | ||
"turbo": "^2.1.2", | ||
"typescript": "^5.6.2", | ||
"typescript-eslint": "^8.0.1" | ||
}, | ||
"packageManager": "[email protected]", | ||
"name": "design-system" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"display": "React Library", | ||
"extends": "./base.json", | ||
"compilerOptions": { | ||
"jsx": "react-jsx", | ||
"lib": ["dom", "ES2015"], | ||
"module": "ESNext", | ||
"target": "es6" | ||
} | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"display": "React Library", | ||
"extends": "./base.json", | ||
"compilerOptions": { | ||
"jsx": "react-jsx", | ||
"lib": ["dom", "ES2015"], | ||
"module": "ESNext", | ||
"target": "es6", | ||
"noImplicitAny": true, | ||
"noFallthroughCasesInSwitch": true | ||
} | ||
} |
Oops, something went wrong.