Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit c91b485

Browse files
authored
feat: npm publish (#46)
* chore: updated storybook and react-day-picker * chore: fix build and npm publish * chore: installed semantinc release * chore: implemented publish release workflow
1 parent 0e34680 commit c91b485

File tree

8 files changed

+1789
-866
lines changed

8 files changed

+1789
-866
lines changed

.github/workflows/release.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
release:
13+
name: Release
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write # to be able to publish a GitHub release
17+
issues: write # to be able to comment on released issues
18+
pull-requests: write # to be able to comment on released pull requests
19+
id-token: write # to enable use of OIDC for npm provenance
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Install pnpm
27+
uses: pnpm/action-setup@v4
28+
with:
29+
version: 9
30+
run_install: false
31+
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version-file: ".nvmrc"
35+
cache: "pnpm"
36+
37+
- name: Install dependencies
38+
run: pnpm install --frozen-lockfile # Install dependencies with lockfile's versions to ensure consistency
39+
40+
- name: Cache Build
41+
id: cache-build
42+
uses: actions/cache@v4
43+
with:
44+
path: dist
45+
key: ${{ runner.os }}-build-${{ hashFiles('**/*.ts', '**/*.tsx', '**/*.mdx') }} # Cache key based on OS and file hashes
46+
restore-keys: |
47+
${{ runner.os }}-build-
48+
49+
- name: Build
50+
if: steps.cache-build.outputs.cache-hit != 'true'
51+
run: pnpm build
52+
53+
- name: Semantic Release
54+
run: pnpx semantic-release
55+
env:
56+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.storybook/main.ts

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ const config: StorybookConfig = {
2121
core: {
2222
disableTelemetry: true, // 👈 Used to ignore update notifications.
2323
},
24+
typescript: {
25+
reactDocgen: "react-docgen-typescript",
26+
},
2427
async viteFinal(config) {
2528
config.plugins = await withoutVitePlugins(config.plugins, ["vite:dts"]);
2629

.storybook/preview.ts

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const preview: Preview = {
2424
handlers,
2525
},
2626
},
27+
2728
loaders: [mswLoader],
2829
decorators: [
2930
withThemeByDataAttribute({
@@ -35,6 +36,8 @@ const preview: Preview = {
3536
attributeName: "data-mode",
3637
}),
3738
],
39+
40+
tags: ["autodocs"],
3841
};
3942

4043
// NOTE: Example of global loaders

package.json

+31-25
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{
22
"name": "gitcoin-ui",
3-
"version": "0.0.0",
3+
"version": "0.0.10",
44
"type": "module",
55
"types": "./dist/index.d.ts",
6-
"main": "./dist/index.cjs",
7-
"module": "./dist/index.mjs",
6+
"main": "./dist/index.js",
7+
"module": "./dist/index.js",
88
"files": [
99
"dist"
1010
],
1111
"exports": {
1212
".": {
1313
"types": "./dist/index.d.ts",
14-
"import": "./dist/index.mjs",
15-
"require": "./dist/index.cjs"
16-
}
14+
"import": "./dist/index.js",
15+
"require": "./dist/index.js"
16+
},
17+
"./style.css": "./dist/style.css",
18+
"./handlers": "./dist/mocks/handlers.js"
1719
},
1820
"scripts": {
1921
"dev": "pnpm storybook",
@@ -28,21 +30,21 @@
2830
"chromatic": "chromatic"
2931
},
3032
"devDependencies": {
31-
"@chromatic-com/storybook": "^2.0.2",
33+
"@chromatic-com/storybook": "^3.2.2",
3234
"@eslint/js": "^9.11.1",
33-
"@storybook/addon-a11y": "8.3.5",
34-
"@storybook/addon-essentials": "8.3.5",
35-
"@storybook/addon-interactions": "8.3.5",
36-
"@storybook/addon-links": "8.3.5",
37-
"@storybook/addon-themes": "8.3.5",
38-
"@storybook/blocks": "8.3.5",
39-
"@storybook/builder-vite": "8.3.5",
40-
"@storybook/manager-api": "^8.4.3",
41-
"@storybook/react": "8.3.5",
42-
"@storybook/react-vite": "8.3.5",
43-
"@storybook/test": "8.3.5",
35+
"@storybook/addon-a11y": "^8.4.4",
36+
"@storybook/addon-essentials": "^8.4.4",
37+
"@storybook/addon-interactions": "^8.4.4",
38+
"@storybook/addon-links": "^8.4.4",
39+
"@storybook/addon-themes": "^8.4.4",
40+
"@storybook/blocks": "^8.4.4",
41+
"@storybook/builder-vite": "^8.4.4",
42+
"@storybook/manager-api": "^8.4.4",
43+
"@storybook/react": "^8.4.4",
44+
"@storybook/react-vite": "^8.4.4",
45+
"@storybook/test": "^8.4.4",
4446
"@storybook/test-runner": "^0.19.1",
45-
"@storybook/theming": "^8.4.3",
47+
"@storybook/theming": "^8.4.4",
4648
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
4749
"@types/react": "^18.3.10",
4850
"@types/react-dom": "^18.3.0",
@@ -64,14 +66,15 @@
6466
"lint-staged": "^15.2.10",
6567
"lucide-react": "^0.453.0",
6668
"msw": "^2.4.11",
67-
"msw-storybook-addon": "^2.0.3",
69+
"msw-storybook-addon": "^2.0.4",
6870
"playwright": "^1.48.1",
6971
"postcss": "^8.4.47",
7072
"prettier": "3.1.0",
7173
"prettier-plugin-tailwindcss": "0.5.7",
72-
"react": "^18.3.1",
73-
"react-dom": "^18.3.1",
74-
"storybook": "8.3.5",
74+
"react": "18.3.1",
75+
"react-dom": "18.3.1",
76+
"semantic-release": "^24.2.0",
77+
"storybook": "^8.4.4",
7578
"tailwind-merge": "^2.5.4",
7679
"tailwindcss": "^3.4.14",
7780
"tailwindcss-animate": "^1.0.7",
@@ -83,6 +86,10 @@
8386
"vitest": "^2.1.3",
8487
"wait-on": "^8.0.1"
8588
},
89+
"peerDependencies": {
90+
"react": "18.3.1",
91+
"react-dom": "18.3.1"
92+
},
8693
"eslintConfig": {
8794
"extends": [
8895
"plugin:storybook/recommended"
@@ -129,13 +136,12 @@
129136
"@tanstack/react-query": "^5.59.15",
130137
"@uiw/react-markdown-preview": "^5.1.3",
131138
"cmdk": "1.0.0",
132-
"date-fns": "^4.1.0",
133139
"embla-carousel-react": "^8.3.0",
134140
"graphql-request": "^7.1.0",
135141
"input-otp": "^1.2.4",
136142
"moment": "^2.30.1",
137143
"next-themes": "^0.3.0",
138-
"react-day-picker": "8.10.1",
144+
"react-day-picker": "9.3.2",
139145
"react-hook-form": "^7.53.0",
140146
"react-markdown": "^9.0.1",
141147
"react-resizable-panels": "^2.1.4",

0 commit comments

Comments
 (0)