Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Storybook v8 and latest Solid #10

Merged
merged 32 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9f57648
Updated renderer and framework
JonahPlusPlus Oct 12, 2024
46ceafd
Fix reactivity
JonahPlusPlus Oct 12, 2024
d431c7a
Fixed race condition in bundler
JonahPlusPlus Oct 12, 2024
3d57658
Match exports
JonahPlusPlus Oct 21, 2024
498ffc4
Added prettier and eslint
JonahPlusPlus Oct 21, 2024
cc1cc6e
Create ci.yml
JonahPlusPlus Oct 21, 2024
3b2e743
Updated templates
JonahPlusPlus Oct 21, 2024
3dd00e9
Added documentation
JonahPlusPlus Oct 21, 2024
8e53590
Update README.md
JonahPlusPlus Oct 21, 2024
e4843d7
Improved race condition work around
JonahPlusPlus Oct 24, 2024
baec82b
Add bundler check script
JonahPlusPlus Oct 24, 2024
401695f
Refactored CD scripts
JonahPlusPlus Oct 24, 2024
01db1ab
Ran Prettier
JonahPlusPlus Oct 24, 2024
b4511d6
Fix CI
JonahPlusPlus Oct 26, 2024
d452015
Revert "Fix CI"
JonahPlusPlus Oct 26, 2024
ab52e3c
Enable corepack
JonahPlusPlus Oct 26, 2024
fe9eeba
Remove old flag
JonahPlusPlus Oct 26, 2024
f96c947
Debug CI tool versions
JonahPlusPlus Oct 26, 2024
f6c6add
Used proper yarn version
JonahPlusPlus Oct 26, 2024
5b54989
Update types.ts
JonahPlusPlus Oct 26, 2024
4f275bc
Fix bundler checks
JonahPlusPlus Oct 26, 2024
fbf1544
Switch to next versions
JonahPlusPlus Oct 26, 2024
4ccf674
Added global build script and renamed prep to build
JonahPlusPlus Oct 26, 2024
707f1ce
Added example app
JonahPlusPlus Oct 30, 2024
a69504f
Update README.md
JonahPlusPlus Oct 30, 2024
5ba4b0f
Ran formatter
JonahPlusPlus Oct 30, 2024
177268d
Update yarn.lock
JonahPlusPlus Oct 30, 2024
d2c4585
Fixed example
JonahPlusPlus Oct 31, 2024
4be759e
Fixed dependency error and added CONTRIBUTING file
JonahPlusPlus Oct 31, 2024
ffba671
Update CONTRIBUTING.md
JonahPlusPlus Oct 31, 2024
6e053be
make example package private
shilman Nov 2, 2024
c89edce
Update package READMEs
shilman Nov 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
end_of_line = lf

[*.{js,jsx,json,yml,ts,tsx,vue,svelte,html}]
indent_style = space
indent_size = 2
10 changes: 0 additions & 10 deletions .github/workflows/actions/setup-node/action.yml

This file was deleted.

58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI
on:
merge_group:
pull_request:
push:
branches:
- main
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Enable Corepack
run: corepack enable && corepack install
- name: Print versions
run: node --version && yarn --version
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install project dependencies
run: yarn install
- name: Run formatter
run: yarn check:format
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Enable Corepack
run: corepack enable && corepack install
- name: Print versions
run: node --version && yarn --version
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install project dependencies
run: yarn install
- name: Run linter
run: yarn check:lint
39 changes: 26 additions & 13 deletions .github/workflows/solid-vite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,32 @@ jobs:
runs-on: ubuntu-latest
name: Lib workflow
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: ./.github/workflows/actions/setup-node
- name: Install dependencies
run: yarn
shell: bash
- name: 'Build'
run: yarn build
shell: bash
- name: 'Publish to npm'
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Enable Corepack
run: corepack enable && corepack install
- name: Print versions
run: node --version && yarn --version
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install project dependencies
run: yarn install
- name: Check bundling
run: yarn check
working-directory: packages/frameworks/solid-vite
- name: Publish to NPM
if: github.event_name == 'release'
run: npm publish
shell: bash
run: yarn npm publish
working-directory: packages/frameworks/solid-vite
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
39 changes: 26 additions & 13 deletions .github/workflows/solid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,32 @@ jobs:
runs-on: ubuntu-latest
name: Lib workflow
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: ./.github/workflows/actions/setup-node
- name: Install dependencies
run: yarn
shell: bash
- name: 'Build'
run: yarn build
shell: bash
- name: 'Publish to npm'
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Enable Corepack
run: corepack enable && corepack install
- name: Print versions
run: node --version && yarn --version
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install project dependencies
run: yarn install
- name: Check bundling
run: yarn check
working-directory: packages/renderers/solid
- name: Publish to NPM
if: github.event_name == 'release'
run: npm publish
shell: bash
run: yarn npm publish
working-directory: packages/renderers/solid
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
17 changes: 14 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# npm
node_modules
yarn-error.log
.yarnrc.yml
*.DS_Store

# yarn (no zero-install)
/**/.pnp.*
/**/.yarn/*
!/**/.yarn/patches
!/**/.yarn/plugins
!/**/.yarn/releases
!/**/.yarn/sdks
!/**/.yarn/versions

# build
dist
.DS_Store
bench
5 changes: 5 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This is a framework to allow using [Storybook](https://storybook.js.org/) with [
| `JS` and `TS` integration with Storybook cli | ✅ |
| Fine grained updates in storybook controls | ✅ |
| Compatible with `@storybook/addon-interactions` | ✅ |
| Compatible with `@storybook/testing-library` | ✅ |
| Compatible with `@storybook/test` | ✅ |
| Automatic story actions | ⏳ |
| Full props table with description in docs view mode | ⏳ |
| Code snippets generation in docs view mode | ⏳ |
Expand All @@ -25,9 +25,9 @@ This is a framework to allow using [Storybook](https://storybook.js.org/) with [

## Setup

In an existing Solid project, run `npx storybook@next init` (Storybook 7+ is required)
In an existing Solid project, run `npx storybook@next init` (Storybook 8+ is required)

See the [Storybook Docs](https://storybook.js.org/docs/7.0/solid/get-started/introduction) for the best documentation on getting started with Storybook.
See the [Storybook Docs](https://storybook.js.org/docs) for the best documentation on getting started with Storybook.
JonahPlusPlus marked this conversation as resolved.
Show resolved Hide resolved

## License

Expand Down
13 changes: 13 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import * as depend from 'eslint-plugin-depend';

export default [
{ ignores: ['**/dist/'] },
{ files: ['**/*.{ts,tsx}'] },
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
depend.configs['flat/recommended'],
pluginJs.configs.recommended,
...tseslint.configs.recommended,
];
57 changes: 41 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,47 @@
{
"name": "storybook-solidjs",
"name": "@storybook-solidjs/root",
"private": true,
"type": "module",
"version": "1.0.0-beta.1",
"description": "Storybook SolidJS",
"keywords": [
"storybook"
],
"homepage": "https://github.com/storybookjs/storybook/tree/main/renderers/solid",
"bugs": {
"url": "https://github.com/storybookjs/solidjs/issues"
"workspaces": {
"packages": [
"packages/frameworks/*",
"packages/renderers/*"
]
},
"repository": {
"type": "git",
"url": "https://github.com/storybookjs/solidjs.git"
"devDependencies": {
"@eslint/js": "^9.13.0",
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
"@types/fs-extra": "^11.0.4",
"@types/node": "^18.0.0",
"esbuild-plugin-alias": "^0.2.1",
"esbuild-plugin-solid": "^0.6.0",
"eslint": "^9.13.0",
"eslint-plugin-depend": "^0.11.0",
"execa": "^9.4.0",
"fdir": "^6.4.2",
"fs-extra": "^11.2.0",
"globals": "^15.11.0",
"jiti": "^2.3.3",
"picomatch": "^4.0.2",
"prettier": "^3.3.3",
"pretty-hrtime": "^1.0.3",
"rollup": "^4.24.0",
"rollup-plugin-dts": "^6.1.1",
"slash": "^5.1.0",
"sort-package-json": "^2.10.1",
"ts-node": "^10.9.2",
"tsup": "^8.3.0",
"typescript": "^5.6.3",
"typescript-eslint": "^8.10.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/storybook"
"scripts": {
"build": "yarn workspaces foreach --all -pt run build",
"check": "yarn run check:lint && yarn run check:format",
"check:format": "prettier --check .",
"check:lint": "eslint .",
"fix": "yarn run fix:lint && yarn run fix:format",
"fix:format": "prettier --write .",
"fix:lint": "eslint . --fix"
},
"license": "MIT"
"packageManager": "yarn@4.5.1"
}
45 changes: 0 additions & 45 deletions packages/frameworks/solid-vite/bundle.ts

This file was deleted.

Loading