Skip to content

Commit d9302d4

Browse files
authored
feat: add v5 storybook to github pages (#744)
* add nvmrc so npm start works * add storybook build output directory & remove storybook-deployer * add v5 storybook link * add v5 storybook to github actions * alphabetize * add changeset
1 parent ef1735d commit d9302d4

File tree

6 files changed

+36
-16
lines changed

6 files changed

+36
-16
lines changed

.changeset/red-buckets-rhyme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@paypal/react-paypal-js": patch
3+
---
4+
5+
feat: add v5 storybook to github pages

.github/workflows/build-and-deploy-docs.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
# Only run when documentation-related files change to avoid unnecessary builds
77
paths:
88
- "packages/paypal-js/types/v6/**/*.d.ts"
9+
- "packages/react-paypal-js/.storybook/**"
10+
- "packages/react-paypal-js/src/**/*.stories.*"
911
- ".github/workflows/build-and-deploy-docs.yml"
1012
- "docs/index.html"
1113
- "docs/readmes/**"
@@ -38,9 +40,12 @@ jobs:
3840
- name: Install dependencies
3941
run: npm ci
4042

41-
- name: Build documentation
43+
- name: Build v6 reference documentation
4244
run: npm run docs:v6
4345

46+
- name: Build v5 react storybook
47+
run: npm run build-storybook:v5
48+
4449
- name: Setup Pages
4550
uses: actions/configure-pages@v5
4651

docs/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ <h3>JS SDK v6 Reference</h3>
9696
</a>
9797
</div>
9898

99+
<div class="docs-grid">
100+
<a href="./web-sdk-v5-react-storybook/" class="doc-card">
101+
<h3>JS SDK v5 React Storybook</h3>
102+
<p>
103+
Explore interactive React components for PayPal JS SDK
104+
v5.
105+
</p>
106+
</a>
107+
</div>
108+
99109
<div class="footer">
100110
<p>© 2025 PayPal, Inc. All rights reserved.</p>
101111
</div>

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,21 @@
1212
},
1313
"scripts": {
1414
"build": "npm run build --workspaces --if-present",
15-
"dev": "concurrently \"npm:dev:*\"",
16-
"dev:paypal-js": "npm run dev --workspace=@paypal/paypal-js",
17-
"dev:react-paypal-js": "npm run dev --workspace=@paypal/react-paypal-js",
15+
"build-storybook:v5": "npm run build-storybook --workspace=@paypal/react-paypal-js",
1816
"changeset:add": "changeset add",
1917
"changeset:release": "npm run build && changeset publish",
2018
"changeset:version": "changeset version && npm i --package-lock-only",
2119
"clean": "npm exec --workspaces -- npx rimraf node_modules && npx rimraf node_modules",
20+
"dev": "concurrently \"npm:dev:*\"",
21+
"dev:paypal-js": "npm run dev --workspace=@paypal/paypal-js",
22+
"dev:react-paypal-js": "npm run dev --workspace=@paypal/react-paypal-js",
2223
"docs:v6": "npm run docs:v6 --workspace=@paypal/paypal-js",
2324
"format": "prettier --write --ignore-unknown .",
2425
"format:check": "prettier --check .",
2526
"lint": "npm run lint --workspaces --if-present",
27+
"prepare": "husky install",
2628
"test": "npm run lint && npm run test --workspaces --if-present",
27-
"test:e2e": "npm run test:e2e --workspaces --if-present",
28-
"prepare": "husky install"
29+
"test:e2e": "npm run test:e2e --workspaces --if-present"
2930
},
3031
"lint-staged": {
3132
"*": [

packages/react-paypal-js/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

packages/react-paypal-js/package.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,20 @@
3131
},
3232
"scripts": {
3333
"build": "rollup --config --bundleConfigAsCjs",
34-
"dev": "concurrently \"rollup --config --bundleConfigAsCjs --watch\" \"npm run type-declarations -- --watch\"",
34+
"build-storybook": "build-storybook -o ../../docs/web-sdk-v5-react-storybook",
3535
"check-node-version": "node scripts/check-node-version.js",
36+
"dev": "concurrently \"rollup --config --bundleConfigAsCjs --watch\" \"npm run type-declarations -- --watch\"",
3637
"lint": "eslint . && npm run typecheck",
38+
"postrelease": "git push && git push --follow-tags && npm run build && npm publish",
3739
"prepack": "rimraf dist && npm run build && npm run type-declarations",
38-
"test": "jest --env=jsdom",
39-
"test:watch": "jest --env=jsdom --watch",
40-
"start": "npm run check-node-version && npm run storybook",
41-
"storybook": "start-storybook -p 6006",
42-
"build-storybook": "build-storybook",
43-
"deploy-storybook": "storybook-to-ghpages",
4440
"prerelease": "npm run validate",
4541
"release": "standard-version",
46-
"postrelease": "git push && git push --follow-tags && npm run build && npm publish",
47-
"typecheck": "tsc --noEmit",
42+
"start": "npm run check-node-version && npm run storybook",
43+
"storybook": "start-storybook -p 6006",
44+
"test": "jest --env=jsdom",
45+
"test:watch": "jest --env=jsdom --watch",
4846
"type-declarations": "tsc --emitDeclarationOnly --outDir dist/types --project tsconfig.declarations.json",
47+
"typecheck": "tsc --noEmit",
4948
"validate": "npm run check-node-version && npm run typecheck && npm run build && npm run lint && npm test -- --coverage"
5049
},
5150
"files": [
@@ -80,7 +79,6 @@
8079
"@storybook/addon-essentials": "^6.4.9",
8180
"@storybook/addon-links": "^6.4.9",
8281
"@storybook/react": "^6.4.9",
83-
"@storybook/storybook-deployer": "^2.8.10",
8482
"@testing-library/jest-dom": "^6.6.3",
8583
"@testing-library/react": "^12.1.3",
8684
"@testing-library/react-hooks": "^7.0.2",

0 commit comments

Comments
 (0)