Code Monkey home page Code Monkey logo

Comments (15)

jrson83 avatar jrson83 commented on August 27, 2024 1

@itsjavi thanks, I gonna check it out!

Will it also be compatible with Preact?

from storylite.

itsjavi avatar itsjavi commented on August 27, 2024 1

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

from storylite.

itsjavi avatar itsjavi commented on August 27, 2024 1

released 0.3.0 together with @storylite/vite-plugin

from storylite.

jrson83 avatar jrson83 commented on August 27, 2024 1

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

from storylite.

itsjavi avatar itsjavi commented on August 27, 2024

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

from storylite.

jrson83 avatar jrson83 commented on August 27, 2024

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.

from storylite.

itsjavi avatar itsjavi commented on August 27, 2024

@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.

from storylite.

jrson83 avatar jrson83 commented on August 27, 2024

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

from storylite.

itsjavi avatar itsjavi commented on August 27, 2024

@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

from storylite.

jrson83 avatar jrson83 commented on August 27, 2024

@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?

from storylite.

itsjavi avatar itsjavi commented on August 27, 2024

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)

from storylite.

jrson83 avatar jrson83 commented on August 27, 2024

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.

from storylite.

jrson83 avatar jrson83 commented on August 27, 2024

released 0.3.0 together with @storylite/vite-plugin

Thanks, I will try again.

from storylite.

jrson83 avatar jrson83 commented on August 27, 2024

@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

from storylite.

itsjavi avatar itsjavi commented on August 27, 2024

@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) {

from storylite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.