Skip to content

Commit db8f223

Browse files
committed
build(dx): 🎨 improve folder structure & type generation
1 parent 2eb0f90 commit db8f223

14 files changed

+40
-37
lines changed

.commitlintrc.json

-1
This file was deleted.

.gacprc.json

-6
This file was deleted.

.huskyrc.json

-6
This file was deleted.

.lintstagedrc.json

-8
This file was deleted.

.storybook/preview.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ export const parameters = {
1515

1616
export const decorators = [
1717
(Story, context) => {
18+
document.body.classList.add("font-sans");
19+
1820
return (
1921
<RenderlesskitProvider theme={theme}>
20-
<div className="box-border font-sans">
21-
<Story />
22-
</div>
22+
<Story />
2323
</RenderlesskitProvider>
2424
);
2525
},

babel.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ module.exports = function (api) {
4343
? [
4444
"**/*/stories",
4545
"**/__tests__",
46-
"**/__test__",
4746
"**/testUtils.tsx",
4847
"./renderlesskit.config.ts",
4948
]

package.json

+27-4
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
"scripts": {
3434
"prebuild": "rimraf dist",
3535
"build": "concurrently \"yarn:build:*\"",
36-
"postinstall": "concurrently \"husky install\" \"patch-package\"",
37-
"postpublish": "pinst --enable",
3836
"build-storybook": "build-storybook",
3937
"build:cjs": "cross-env BABEL_ENV=cjs babel src --extensions .ts,.tsx -d dist/cjs --source-maps",
4038
"build:esm": "cross-env BABEL_ENV=esm babel src --extensions .ts,.tsx -d dist/esm --source-maps",
@@ -44,16 +42,35 @@
4442
"contributors:generate": "all-contributors generate",
4543
"format": "prettier --write \"./**/*.{js,ts,css,less,json,md,html,yml,yaml,pcss,jsx,tsx}\"",
4644
"format:package": "sort-package-json",
45+
"postinstall": "concurrently \"husky install\" \"patch-package\"",
46+
"jit": "cross-env NODE_ENV=development DEBUG=true postcss -w -o tailwind-jit.css ./.storybook/tailwind.css",
4747
"lint": "eslint . --ext .tsx,.ts,.jsx,.js",
4848
"lint:fix": "eslint . --ext .tsx,.ts,.jsx,.js --fix",
4949
"prepublishOnly": "yarn test && yarn build && pinst --disable",
50+
"postpublish": "pinst --enable",
5051
"release": "git add . && standard-version -a",
5152
"postrelease": "concurrently \"yarn:release:*\"",
5253
"release:github": "conventional-github-releaser -p angular && git push",
5354
"storybook": "cross-env DEBUG=true start-storybook -p 6006",
5455
"test": "jest --config ./jest.config.ts --no-cache",
55-
"typecheck": "tsc --noEmit --project tsconfig.prod.json && tsd",
56-
"jit": "cross-env NODE_ENV=development DEBUG=true postcss -w -o tailwind-jit.css ./.storybook/tailwind.css"
56+
"typecheck": "tsc --noEmit --project tsconfig.prod.json && tsd"
57+
},
58+
"commitlint": {
59+
"extends": [
60+
"@commitlint/config-conventional"
61+
]
62+
},
63+
"lint-staged": {
64+
"**/*.{js,jsx,tx,tsx}": [
65+
"yarn lint:fix"
66+
],
67+
"**/*.{js,ts,css,less,json,md,html,yml,yaml,pcss,jsx,tsx}": [
68+
"yarn format",
69+
"git add"
70+
],
71+
"package.json": [
72+
"yarn format:package"
73+
]
5774
},
5875
"browserslist": {
5976
"production": [
@@ -153,6 +170,12 @@
153170
"publishConfig": {
154171
"access": "public"
155172
},
173+
"gacp": {
174+
"add": false,
175+
"push": false,
176+
"emoji": "emoji",
177+
"editor": false
178+
},
156179
"tsd": {
157180
"directory": "src/theme"
158181
}

src/theme/defaultTheme/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import { textarea } from "./textarea";
2222
import { tooltip } from "./tooltip";
2323
import { toast } from "./toast";
2424

25+
// font-sans
26+
// To build css for the storybook body
2527
const theme = {
2628
alert,
2729
avatar,

tailwind.config.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
const path = require("path");
2+
const defaultTheme = require("tailwindcss/defaultTheme");
3+
24
const { preset } = require("./preset");
35

46
module.exports = preset({
@@ -9,6 +11,10 @@ module.exports = preset({
911
],
1012

1113
theme: {
12-
extend: {},
14+
extend: {
15+
fontFamily: {
16+
sans: ["Inter var", ...defaultTheme.fontFamily.sans],
17+
},
18+
},
1319
},
1420
});

tsconfig.prod.json

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
{
22
"extends": "./tsconfig.json",
33
"include": ["src"],
4-
"exclude": [
5-
"**/*/stories",
6-
"**/*/__tests__",
7-
"**/*/__test__",
8-
"**/testUtils.tsx",
9-
"./renderlesskit.config.ts"
10-
]
4+
"exclude": ["**/*/stories", "**/*/__tests__", "**/*/utils"]
115
}

0 commit comments

Comments
 (0)