diff --git a/README.md b/README.md index 002774c..592cfb0 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ pnpm add -D @storylite/storylite vite > You also need `vite` as a devDependency. -For the next steps, please check the [example React](./packages/examples/react) directory +For the next steps, please check the [example React](https://github.com/itsjavi/storylite/tree/main/packages/examples/react) directory to learn how to integrate it in your project. ## Roadmap @@ -57,7 +57,7 @@ to learn how to integrate it in your project. - [ ] Zoom in/out - [ ] Accessibility - [ ] Multiple resizable viewports (side by side) -- [-] Create `packages/examples` packages +- [ ] Create `packages/examples` packages - [x] Support React - [ ] Support other frameworks like Vue, Svelte, Solid, and Qwik. - Customizable components (props, styles, etc.) @@ -69,7 +69,7 @@ to learn how to integrate it in your project. - [ ] Host in GitHub Pages (build and deploy via GitHub Actions) - [ ] Better handling of the iframes - [ ] Better addons API -- [ ] Use redux-toolkit +- [ ] Use redux-toolkit or similar (Zustand?) - [ ] SSR/SSG frameworks support (Next, Astro, etc) - [ ] Stories format compatible with Storybook (backwards compatible with SB v6 and v7) - [ ] Better mobile experience (specially for sidebars and toolbars) @@ -84,15 +84,14 @@ to learn how to integrate it in your project. and/or fixes for Vue, Svelte, Solid, and others is welcome via PRs. - No support for MDX files, to keep the project simple, but adding support via PRs is welcome as long as it doesn't add too much complexity. -- Changes to the config file will require a full server restart at the moment. ## Contributing -Contributions are welcome! Please read the [contributing guidelines](./CONTRIBUTING.md) before submitting a PR. +Contributions are welcome! Please read the [contributing guidelines](https://github.com/itsjavi/storylite/tree/main/CONTRIBUTING.md) before submitting a PR. ## License -[MIT License](./LICENSE) +[MIT License](https://github.com/itsjavi/storylite/tree/main/LICENSE) ## Acknowledgements diff --git a/packages/examples/react/package.json b/packages/examples/react/package.json index aabc9ce..fc3fe6d 100644 --- a/packages/examples/react/package.json +++ b/packages/examples/react/package.json @@ -8,12 +8,11 @@ "dev": "vite --port=7707" }, "dependencies": { - "@storylite/storylite": "workspace:*", "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-router-dom": "^6.15.0" + "react-dom": "^18.2.0" }, "devDependencies": { + "@storylite/storylite": "workspace:*", "@types/react": "^18.2.20", "@types/react-dom": "^18.2.7", "@vitejs/plugin-react-swc": "^3.3.2", diff --git a/packages/examples/react/vite.config.ts b/packages/examples/react/vite.config.ts index 4355f9e..c544794 100644 --- a/packages/examples/react/vite.config.ts +++ b/packages/examples/react/vite.config.ts @@ -15,7 +15,7 @@ export default defineConfig({ }, plugins: [ storylitePlugin({ - stories: 'stories/**/*.stories.tsx', // relative to the CWD + stories: 'stories/**/*.stories.tsx', // relative to process.cwd() }), react(), ], diff --git a/packages/storylite/package.json b/packages/storylite/package.json index 7c4d59b..04276bb 100644 --- a/packages/storylite/package.json +++ b/packages/storylite/package.json @@ -29,7 +29,7 @@ ], "scripts": { "build": "tsup", - "dev": "tsup --watch --clean", + "dev": "sleep 10 && tsup --watch --clean", "lint": "eslint --max-warnings=10 .", "lint-fix": "eslint --fix .", "prepublishOnly": "pnpm run build", @@ -54,15 +54,14 @@ "@types/node": "^20.4.9", "@types/react": "^18.2.19", "@types/react-dom": "^18.2.7", - "@vitejs/plugin-react-swc": "^3.3.2", + "lucide-react": "^0.265.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.14.2", - "typescript": "^5.1.6", - "vite": "^4.4.9" + "typescript": "^5.1.6" }, "peerDependenciesMeta": { - "@vitejs/plugin-react-swc": { + "lucide-react": { "optional": false }, "react": { @@ -76,9 +75,6 @@ }, "typescript": { "optional": false - }, - "vite": { - "optional": false } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e489175..75612c0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -70,19 +70,16 @@ importers: packages/examples/react: dependencies: - '@storylite/storylite': - specifier: workspace:* - version: link:../../storylite react: specifier: ^18.2.0 version: 18.2.0 react-dom: specifier: ^18.2.0 version: 18.2.0(react@18.2.0) - react-router-dom: - specifier: ^6.15.0 - version: 6.15.0(react-dom@18.2.0)(react@18.2.0) devDependencies: + '@storylite/storylite': + specifier: workspace:* + version: link:../../storylite '@types/react': specifier: ^18.2.20 version: 18.2.20 @@ -106,10 +103,6 @@ importers: packages/examples/vue: {} packages/storylite: - dependencies: - '@vitejs/plugin-react-swc': - specifier: ^3.3.2 - version: 3.3.2(vite@4.4.9) devDependencies: '@r1stack/coding-style': specifier: ^0.2.1 @@ -887,6 +880,7 @@ packages: cpu: [arm64] os: [android] requiresBuild: true + dev: true optional: true /@esbuild/android-arm@0.18.20: @@ -895,6 +889,7 @@ packages: cpu: [arm] os: [android] requiresBuild: true + dev: true optional: true /@esbuild/android-x64@0.18.20: @@ -903,6 +898,7 @@ packages: cpu: [x64] os: [android] requiresBuild: true + dev: true optional: true /@esbuild/darwin-arm64@0.18.20: @@ -911,6 +907,7 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true + dev: true optional: true /@esbuild/darwin-x64@0.18.20: @@ -919,6 +916,7 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true + dev: true optional: true /@esbuild/freebsd-arm64@0.18.20: @@ -927,6 +925,7 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true + dev: true optional: true /@esbuild/freebsd-x64@0.18.20: @@ -935,6 +934,7 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true + dev: true optional: true /@esbuild/linux-arm64@0.18.20: @@ -943,6 +943,7 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-arm@0.18.20: @@ -951,6 +952,7 @@ packages: cpu: [arm] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-ia32@0.18.20: @@ -959,6 +961,7 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-loong64@0.18.20: @@ -967,6 +970,7 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-mips64el@0.18.20: @@ -975,6 +979,7 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-ppc64@0.18.20: @@ -983,6 +988,7 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-riscv64@0.18.20: @@ -991,6 +997,7 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-s390x@0.18.20: @@ -999,6 +1006,7 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-x64@0.18.20: @@ -1007,6 +1015,7 @@ packages: cpu: [x64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/netbsd-x64@0.18.20: @@ -1015,6 +1024,7 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true + dev: true optional: true /@esbuild/openbsd-x64@0.18.20: @@ -1023,6 +1033,7 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true + dev: true optional: true /@esbuild/sunos-x64@0.18.20: @@ -1031,6 +1042,7 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true + dev: true optional: true /@esbuild/win32-arm64@0.18.20: @@ -1039,6 +1051,7 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true + dev: true optional: true /@esbuild/win32-ia32@0.18.20: @@ -1047,6 +1060,7 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true + dev: true optional: true /@esbuild/win32-x64@0.18.20: @@ -1055,6 +1069,7 @@ packages: cpu: [x64] os: [win32] requiresBuild: true + dev: true optional: true /@eslint-community/eslint-utils@4.4.0(eslint@8.46.0): @@ -1549,6 +1564,7 @@ packages: /@remix-run/router@1.8.0: resolution: {integrity: sha512-mrfKqIHnSZRyIzBcanNJmVQELTnX+qagEDlcKO90RgRBVOZGSGvZKeDihTRfWcqoDn5N/NkUcwWTccnpN18Tfg==} engines: {node: '>=14.0.0'} + dev: true /@sinclair/typebox@0.27.8: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} @@ -1572,6 +1588,7 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true + dev: true optional: true /@swc/core-darwin-x64@1.3.76: @@ -1580,6 +1597,7 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true + dev: true optional: true /@swc/core-linux-arm-gnueabihf@1.3.76: @@ -1588,6 +1606,7 @@ packages: cpu: [arm] os: [linux] requiresBuild: true + dev: true optional: true /@swc/core-linux-arm64-gnu@1.3.76: @@ -1596,6 +1615,7 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true + dev: true optional: true /@swc/core-linux-arm64-musl@1.3.76: @@ -1604,6 +1624,7 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true + dev: true optional: true /@swc/core-linux-x64-gnu@1.3.76: @@ -1612,6 +1633,7 @@ packages: cpu: [x64] os: [linux] requiresBuild: true + dev: true optional: true /@swc/core-linux-x64-musl@1.3.76: @@ -1620,6 +1642,7 @@ packages: cpu: [x64] os: [linux] requiresBuild: true + dev: true optional: true /@swc/core-win32-arm64-msvc@1.3.76: @@ -1628,6 +1651,7 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true + dev: true optional: true /@swc/core-win32-ia32-msvc@1.3.76: @@ -1636,6 +1660,7 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true + dev: true optional: true /@swc/core-win32-x64-msvc@1.3.76: @@ -1644,6 +1669,7 @@ packages: cpu: [x64] os: [win32] requiresBuild: true + dev: true optional: true /@swc/core@1.3.76: @@ -1666,6 +1692,7 @@ packages: '@swc/core-win32-arm64-msvc': 1.3.76 '@swc/core-win32-ia32-msvc': 1.3.76 '@swc/core-win32-x64-msvc': 1.3.76 + dev: true /@swc/jest@0.2.28(@swc/core@1.3.76): resolution: {integrity: sha512-iCB3lvngkQldLga35krb8LPa+6gmkVXnlpfCTXOAgMaEYFagLxOIFbIO8II7dhHa8ApOv5ap8iFRETI4lVY0vw==} @@ -1840,6 +1867,7 @@ packages: /@types/node@20.4.9: resolution: {integrity: sha512-8e2HYcg7ohnTUbHk8focoklEQYvemQmu9M/f43DZVx43kHn0tE3BY/6gSDxS7k0SprtS0NHvj+L80cGLnoOUcQ==} + dev: true /@types/normalize-package-data@2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} @@ -2104,6 +2132,7 @@ packages: vite: 4.4.9(@types/node@20.4.9) transitivePeerDependencies: - '@swc/helpers' + dev: true /JSONStream@1.3.5: resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} @@ -3279,6 +3308,7 @@ packages: '@esbuild/win32-arm64': 0.18.20 '@esbuild/win32-ia32': 0.18.20 '@esbuild/win32-x64': 0.18.20 + dev: true /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} @@ -3930,6 +3960,7 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true + dev: true optional: true /function-bind@1.1.1: @@ -5585,6 +5616,7 @@ packages: resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + dev: true /natural-compare-lite@1.4.0: resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} @@ -5911,6 +5943,7 @@ packages: /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + dev: true /picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} @@ -5969,6 +6002,7 @@ packages: nanoid: 3.3.6 picocolors: 1.0.0 source-map-js: 1.0.2 + dev: true /preferred-pm@3.0.3: resolution: {integrity: sha512-+wZgbxNES/KlJs9q40F/1sfOd/j7f1O9JaHcW5Dsn3aUUOZg3L2bjpVUcKV2jvtElYfoTuQiNeMfQJ4kwUAhCQ==} @@ -6123,6 +6157,7 @@ packages: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) react-router: 6.15.0(react@18.2.0) + dev: true /react-router@6.15.0(react@18.2.0): resolution: {integrity: sha512-NIytlzvzLwJkCQj2HLefmeakxxWHWAP+02EGqWEZy+DgfHHKQMUoBBjUQLOtFInBMhWtb3hiUy6MfFgwLjXhqg==} @@ -6132,6 +6167,7 @@ packages: dependencies: '@remix-run/router': 1.8.0 react: 18.2.0 + dev: true /react@18.2.0: resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} @@ -6323,6 +6359,7 @@ packages: hasBin: true optionalDependencies: fsevents: 2.3.2 + dev: true /run-applescript@5.0.0: resolution: {integrity: sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==} @@ -6519,6 +6556,7 @@ packages: /source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} + dev: true /source-map-support@0.5.13: resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} @@ -7268,6 +7306,7 @@ packages: rollup: 3.28.0 optionalDependencies: fsevents: 2.3.2 + dev: true /w3c-xmlserializer@4.0.0: resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==}