Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Release date? #19

Closed
jrson83 opened this issue Aug 6, 2023 · 15 comments
Closed

Release date? #19

jrson83 opened this issue Aug 6, 2023 · 15 comments

Comments

@jrson83
Copy link
Collaborator

jrson83 commented Aug 6, 2023

Description

I found the repo when looking for a lightweight storybook/ladle alternative. It looks great so far but it seems you didn't release on npm yet? Are you planing to release soon? I would love to see storylite in action and maybe help contributing.

@itsjavi
Copy link
Owner

itsjavi commented Aug 7, 2023

Hey there, the project is still very experimental, and I still need to figure out how to bundle it properly for npm, but I will give it a try in the next days :)

contributions will be also very helpful

@jrson83
Copy link
Collaborator Author

jrson83 commented Aug 8, 2023

I cloned the repo and checked the dashboard, looks really great so far, can't wait to use it!

Currently I tested multiple bundlers with my react components. I ended up using pkgroll today, since it is very easy to setup, uses rollup and produces clean bundles.

I tested rollup bundlers: rollup & vite, and esbuild bundlers: esbuild, unbuild, tsup, ptsup.

Have a look at my react and react-hooks packages for the setup, I can just recommend.

@itsjavi
Copy link
Owner

itsjavi commented Aug 8, 2023

@jrson83 thank you, in the last hours I've rewritten many parts of the project to be able to publish it (@storylite/storylite now released as v0.1.1) and integrate with other projects.

Now it's bundled with tsup, and it's more a drop-in plugin for Vite + a React app on top.

You can check how to integrate it in this React example setup https://github.com/itsjavi/storylite/tree/main/packages/examples/react

I am going to start using it actively in one of my projects soon, so I hope to make it more stable.

@itsjavi itsjavi closed this as completed Aug 8, 2023
@jrson83
Copy link
Collaborator Author

jrson83 commented Aug 8, 2023

@itsjavi awesome, thanks! I gonna try replace ladle with storylite in my monorepo.

@itsjavi
Copy link
Owner

itsjavi commented Aug 11, 2023

@jrson83 v0.1.x was not working properly,
I released v0.2.0 which now resolves stories and virtual modules properly,
more info: https://github.com/itsjavi/storylite/blob/main/packages/storylite/CHANGELOG.md#breaking-changes

Now the UI can work with other frameworks, not only Vite

@jrson83
Copy link
Collaborator Author

jrson83 commented Aug 11, 2023

@itsjavi thanks, I gonna check it out!

Will it also be compatible with Preact?

@jrson83
Copy link
Collaborator Author

jrson83 commented Aug 13, 2023

@itsjavi I read the changelog and tried to use it in my monorepo. I checked the react example, but I can't make use of it in the current state, because it is using @storylite/vite-plugin as devDependencies and import storylitePlugin from '@storylite/vite-plugin' in the vite.config,ts. So the example works inside your monorepo, but not for me, since you did not release @storylite/vite-plugin.

I see on my installed @storylite/storylite dist folder, it is somehow merged with the vite-plugin, so includes plugins.d.ts and virtual-modules.d.ts. To get the correct storylitePlugin I used the following settings as workaround, since index.d.ts does not export storylitePlugin .

// vite.config.ts
import { storylitePlugin } from '@storylite/storylite/dist/plugins'

Using types with @storylite/storylite/dist/virtual-modules.d.ts breaks my tsconfig cause:

Cannot find type definition file for '@storylite/storylite/dist/virtual-modules.d.ts'.

As workaround I used this config to get the named storylitePlugin import working:

// tsconfig.json
{
  "types": ["node", "react", "react-dom", "@storylite/storylite"]
}

But when I try import stories from 'virtual:storylite-stories' in storylite.tsx I get:

Cannot find module 'virtual:storylite-stories' or its corresponding type declarations.ts(2307)

Could you update the react example to work without @storylite/vite-plugin or what am I doing wrong?

@itsjavi
Copy link
Owner

itsjavi commented Aug 14, 2023

Thanks for your infos, what's on main is not stable, I plan to separate the vite plugin but is not yet released (I will have time this weekend)

@itsjavi
Copy link
Owner

itsjavi commented Aug 14, 2023

meanwhile please check the examples in some commit previous to separating the plugin

@jrson83
Copy link
Collaborator Author

jrson83 commented Aug 14, 2023

Thanks for your infos, what's on main is not stable, I plan to separate the vite plugin but is not yet released (I will have time this weekend)

Oh okay, I did not realize there was another branch.

@itsjavi
Copy link
Owner

itsjavi commented Aug 20, 2023

released 0.3.0 together with @storylite/vite-plugin

@jrson83
Copy link
Collaborator Author

jrson83 commented Aug 21, 2023

released 0.3.0 together with @storylite/vite-plugin

Thanks, I will try again.

@jrson83
Copy link
Collaborator Author

jrson83 commented Aug 22, 2023

@itsjavi thanks, now installation and setup took just a minute in a new vite react-ts project.

@jrson83
Copy link
Collaborator Author

jrson83 commented Aug 22, 2023

@itsjavi I'm having problems migrating my ladle stories.

I like to have a Sidebar Category Components, which holds all components from src folder.

Can you take a look here?

https://github.com/jrson83/shrtcss/blob/main/packages/react/src/divider/divider.stories.tsx

@itsjavi
Copy link
Owner

itsjavi commented Aug 22, 2023

@jrson83 if you only export one component, it is not grouped.

maybe that's a not an obvious behaviour. it would be ok for me to change it.
That's here:

if (exports.length === 1) {

Repository owner locked and limited conversation to collaborators Aug 22, 2023
@itsjavi itsjavi converted this issue into discussion #29 Aug 22, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants