Skip to content

Commit 08974a5

Browse files
committed
initial release preparation
1 parent a052c34 commit 08974a5

File tree

15 files changed

+3801
-420
lines changed

15 files changed

+3801
-420
lines changed

.github/workflows/lint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Lint
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- "*"
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
- name: Set up Node.js
19+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
20+
with:
21+
node-version: '20.x'
22+
cache: 'yarn'
23+
- name: Install deps
24+
run: yarn install --frozen-lockfile
25+
- name: Run lint
26+
run: yarn lint
27+
- name: Run formatter check
28+
run: |
29+
yarn run --silent format-check || ( \
30+
echo "Run this command on your local device to fix the error:" && \
31+
echo "" && \
32+
echo " yarn run format" && \
33+
echo "" && exit 1)

.github/workflows/publish.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
release:
55
types: [created]
66
workflow_dispatch:
7+
push:
8+
branches:
9+
- main
710

811
jobs:
912
publish:
@@ -12,14 +15,14 @@ jobs:
1215
contents: read
1316
packages: write
1417
steps:
15-
- uses: actions/checkout@v4
16-
- uses: actions/setup-node@v4
18+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
- uses: actions/setup-node@8f152de45cc393bb48ceea73d27597364c9af683 # v4
1720
with:
1821
node-version: '20.x'
1922
registry-url: 'https://npm.pkg.github.com'
2023
scope: '@tailscale'
2124

22-
- name: Install dependencies
25+
- name: Install deps
2326
run: yarn install --frozen-lockfile
2427

2528
- name: Build package

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
yarn.lock
3+
package.json

.storybook/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ const config: StorybookConfig = {
1111
"@storybook/addon-docs",
1212
"@storybook/addon-onboarding",
1313
"@storybook/addon-a11y",
14-
"@storybook/addon-vitest"
14+
"@storybook/addon-vitest",
15+
"@storybook/addon-designs",
1516
],
1617
staticDirs: ['../src/assets'],
1718
"framework": {

.storybook/preview.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const preview: Preview = {
1010
},
1111
},
1212
},
13+
tags: ['autodocs'],
1314
};
1415

1516
export default preview;

package.json

Lines changed: 86 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
{
22
"name": "@tailscale/tailscale-ui-components",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"author": "Tailscale",
55
"license": "BSD-3-Clause",
66
"main": "dist/tailscale-ui-components.umd.js",
77
"module": "dist/tailscale-ui-components.es.js",
88
"types": "dist/index.d.ts",
99
"type": "module",
1010
"files": [
11-
"dist"
11+
"dist",
12+
"tailwind.preset.js"
1213
],
1314
"exports": {
1415
".": {
1516
"types": "./dist/index.d.ts",
1617
"import": "./dist/tailscale-ui-components.es.js",
1718
"require": "./dist/tailscale-ui-components.umd.js"
19+
},
20+
"./tailwind.preset": {
21+
"import": "./tailwind.preset.cjs",
22+
"require": "./tailwind.preset.cjs",
23+
"default": "./tailwind.preset.cjs"
1824
}
1925
},
2026
"publishConfig": {
@@ -33,10 +39,11 @@
3339
"@radix-ui/react-popover": "^1.1.14",
3440
"@radix-ui/react-select": "^2.2.5",
3541
"@radix-ui/react-tabs": "^1.1.12",
42+
"@radix-ui/react-toast": "^1.2.15",
3643
"@radix-ui/react-toggle-group": "^1.1.10",
3744
"@radix-ui/react-tooltip": "^1.2.7",
3845
"classnames": "^2.5.1",
39-
"date-fns": "^4.1.0",
46+
"date-fns": "^2.28.0",
4047
"date-fns-tz": "^2.0.1",
4148
"downshift": "^9.0.10",
4249
"lucide-react": "^0.536.0"
@@ -51,12 +58,20 @@
5158
"@types/node": "^24.2.0",
5259
"@types/react": "^18.2.0",
5360
"@types/react-dom": "^18.2.0",
61+
"@typescript-eslint/eslint-plugin": "^6.2.1",
62+
"@typescript-eslint/parser": "^6.2.1",
5463
"@vitejs/plugin-react-swc": "^3.11.0",
5564
"@vitest/browser": "^3.2.4",
5665
"@vitest/coverage-v8": "^3.2.4",
5766
"autoprefixer": "^10.4.21",
67+
"eslint": "^8.23.1",
68+
"eslint-config-react-app": "^7.0.1",
69+
"eslint-plugin-curly-quotes": "^1.0.4",
70+
"eslint-plugin-unicorn": "^41.0.0",
5871
"playwright": "^1.54.2",
5972
"postcss": "^8.5.6",
73+
"prettier": "^2.5.1",
74+
"prettier-plugin-organize-imports": "^3.2.2",
6075
"react": "^18.2.0",
6176
"react-dom": "^18.2.0",
6277
"storybook": "^9.1.1",
@@ -70,6 +85,73 @@
7085
"scripts": {
7186
"build": "vite build && tsc --emitDeclarationOnly",
7287
"storybook": "storybook dev -p 6006",
73-
"build-storybook": "storybook build"
88+
"build-storybook": "storybook build",
89+
"format": "prettier --write 'src/**/*.{ts,tsx}'",
90+
"format-check": "prettier --check 'src/**/*.{ts,tsx}'",
91+
"lint": "tsc --noEmit && eslint 'src/**/*.{ts,tsx,js,jsx}' --fix --max-warnings=0"
92+
},
93+
"eslintConfig": {
94+
"extends": [
95+
"react-app",
96+
"plugin:unicorn/recommended"
97+
],
98+
"plugins": [
99+
"curly-quotes",
100+
"react-hooks"
101+
],
102+
"rules": {
103+
"unicorn/catch-error-name": "off",
104+
"unicorn/consistent-function-scoping": "off",
105+
"unicorn/consistent-destructuring": "off",
106+
"unicorn/expiring-todo-comments": "off",
107+
"unicorn/prefer-json-parse-buffer": "off",
108+
"unicorn/prefer-object-from-entries": "off",
109+
"unicorn/prefer-spread": "off",
110+
"unicorn/prevent-abbreviations": "off",
111+
"unicorn/no-array-callback-reference": "off",
112+
"unicorn/no-array-for-each": "off",
113+
"unicorn/no-array-reduce": "off",
114+
"unicorn/no-nested-ternary": "off",
115+
"unicorn/no-null": "off",
116+
"unicorn/no-useless-undefined": [
117+
"error",
118+
{
119+
"checkArguments": false
120+
}
121+
],
122+
"unicorn/numeric-separators-style": "off",
123+
"curly-quotes/no-straight-quotes": "warn",
124+
"react-hooks/rules-of-hooks": "error",
125+
"react-hooks/exhaustive-deps": "error",
126+
"@typescript-eslint/no-restricted-imports": [
127+
"error",
128+
{
129+
"paths": [
130+
{
131+
"name": "lucide-react",
132+
"message": "Use `src/ui/icons` instead of `lucide-react`"
133+
}
134+
]
135+
}
136+
],
137+
"no-restricted-imports": [
138+
"error",
139+
{
140+
"paths": [
141+
{
142+
"name": "lucide-react",
143+
"importNames": [
144+
"*"
145+
],
146+
"message": "Please import only the specific icons you need from 'lucide-react' to enable tree-shaking."
147+
}
148+
]
149+
}
150+
]
151+
}
152+
},
153+
"prettier": {
154+
"semi": false,
155+
"printWidth": 80
74156
}
75157
}

src/card.tsx

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)