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

Add React/Svelte/Vue app examples, with React component wrapper #21

Merged
merged 16 commits into from
Apr 16, 2024

Conversation

spwoodcock
Copy link
Member

@spwoodcock spwoodcock commented Apr 1, 2024

Fixes #13

Includes

  • Adds an example Svelte/Vue app, that work without any additional code.
  • Adds a HotButton.tsx wrapper for the hot-button web component usage in React.
    • Uses createComponent from @lit/react.

In the long run I am thinking we can:

Still to do

  • The logic works well, but at some point along the way I broke the CSS loading.
  • This needs to be fixed so the styles load correctly.
  • I assume it's not too tricky to fix, but the goal of this PR was to demo that the components work well in different frameworks, including React.

@spwoodcock spwoodcock added the enhancement New feature or request label Apr 1, 2024
@spwoodcock spwoodcock requested review from emi420 and JoltCode April 1, 2024 23:07
Copy link
Collaborator

@JoltCode JoltCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super great work Sam! - coming along nicely, just a few small things, otherwise LGTM! 👍

examples/react/package.json Outdated Show resolved Hide resolved
import hotLogo from './assets/hot_logo.png';
import { useState } from 'react';

import HotButton from '../../../react/HotButton';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps something for the future - but maybe we could make it so this either imports directly from our npm package? - Would look more clear for people looking at the example

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely! I was wondering on the best approach here:

  1. Bundle the React wrappers in the main ui.js, as it's very little code.
  2. Create a separate NPM package for the React wrappers and serve in the CDN via react.js or something.
  3. Other I haven't thought of.

Comment on lines +6 to +13
<link
rel="stylesheet"
href="http://localhost:8080/style.css"
/>
<script
type="module"
src="http://localhost:8080/ui.js"
></script>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be using localhost for these examples - would be nice so they can be deployed standalone on github pages for example - thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah true, it would be cool to serve these (although as far as the user would see, it's exactly the same page being rendered for each framework).

I was using localhost for testing & updated vite dev to serve both the components & the demo page.

Can be updated once the lib is released and stable! (and published to GH pages too)

vue({
template: {
compilerOptions: {
isCustomElement: (tag) => ['hot-button'].includes(tag),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice in the future to make it so this is auto generated by our lib!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be so nice.
We could actually generate the React wrappers dynamically in the same way that shoelace do it too!
So react wrappers / vue vite config are dynamic

examples/react/README.md Show resolved Hide resolved
@emi420
Copy link
Collaborator

emi420 commented Apr 3, 2024

Thanks Sam, so we should now make CSS styling work and also have a way to generate the NPM package for React, compatible with React 18 but also 17.

Regarding the development process, the component is developed as a web component and then a React version will be generated automatically, right?

@emi420
Copy link
Collaborator

emi420 commented Apr 3, 2024

Also, I think we should have a React storybook, because we need to be sure that things are working good on React first, as it's our priority #1.

@spwoodcock
Copy link
Member Author

Joe fixed the CSS loading 😁

Currently the Reacrlt wrapper is written manually, released as a separate package to import (it's a small amount of code).
It would be very nice, and not too tricky, to automatically generate the wrappers.

@emi420 have you managed to run the storybook we have currently? It loads the button and all it's props. Feel free to modify!

@emi420
Copy link
Collaborator

emi420 commented Apr 3, 2024

I'm cloning the project, running yarn install and then trying to run the Storybook with yarn dev but now I get:

yarn run v1.22.19
$ storybook dev -p 3001
🔴 Error: It looks like you are having a known issue with package hoisting.
Please check the following issue for details and solutions: https://github.com/storybookjs/storybook/issues/22431#issuecomment-1630086092

/Users/nn/www/hot/ui/node_modules/cli-table3/src/utils.js:1
const stringWidth = require('string-width');
                    ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/nn/www/hot/ui/node_modules/string-width/index.js from /Users/nn/www/hot/ui/node_modules/cli-table3/src/utils.js not supported.
Instead change the require of index.js in /Users/nn/www/hot/ui/node_modules/cli-table3/src/utils.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/Users/nn/www/hot/ui/node_modules/cli-table3/src/utils.js:1:21)
    at Object.<anonymous> (/Users/nn/www/hot/ui/node_modules/cli-table3/src/table.js:2:15)
    at Object.<anonymous> (/Users/nn/www/hot/ui/node_modules/cli-table3/index.js:1:18)
    at Object.<anonymous> (/Users/nn/www/hot/ui/node_modules/@storybook/core-server/dist/index.js:66:2799)
    at Object.<anonymous> (/Users/nn/www/hot/ui/node_modules/@storybook/cli/dist/generate.js:11:4494)
    at Object.<anonymous> (/Users/nn/www/hot/ui/node_modules/@storybook/cli/bin/index.js:26:1)
    at Object.<anonymous> (/Users/nn/www/hot/ui/node_modules/storybook/index.js:3:1) {
  code: 'ERR_REQUIRE_ESM'
}

@spwoodcock
Copy link
Member Author

Try with pnpm - this project uses pnpm

@spwoodcock
Copy link
Member Author

Also the storybook hasn't been tested in this PR! (lots of changes, hopefully something hasn't broken)

It should work on the main branch

@emi420
Copy link
Collaborator

emi420 commented Apr 3, 2024

Try with pnpm - this project uses pnpm

Not working (pnpm install yarn dev), maybe there are global dependencies or something missing in package.json ?

@emi420
Copy link
Collaborator

emi420 commented Apr 3, 2024

Also the storybook hasn't been tested in this PR! (lots of changes, hopefully something hasn't broken)

It should work on the main branch

We can try merging the master branch into this one.

@spwoodcock
Copy link
Member Author

image

Can you post a few more details to help debug please?

Perhaps it's a conflict with trying yarn install before pnpm install.
It could also be a difference in node version, as we have not pinned it in the package.json.
I am using node v20.11.0 and pnpm works nicely.

@emi420
Copy link
Collaborator

emi420 commented Apr 16, 2024

I've removed the whole directory and cloned it again, installed packages with pnpm install and ran yarn dev. I'm using node 20.11.0

➜  ui git:(feat/react-wrappers) yarn dev           
yarn run v1.22.19
$ storybook dev -p 3001
@storybook/cli v7.6.5

info => Starting manager..
info => Starting preview..
[tsconfig-paths] An error occurred while parsing "/Users/nn/www/hot/ui/examples/vue/tsconfig.json". See below for details. To disable this message, set the `ignoreConfigErrors` option to true.
_TSConfckParseError: failed to resolve "extends":"@vue/tsconfig/tsconfig.json" in /Users/nn/www/hot/ui/examples/vue/tsconfig.json
    at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:496:9)
    at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
    ... 13 lines matching cause stack trace ...
    at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
  code: 'EXTENDS_RESOLVE',
  cause: Error: Cannot find module '@vue/tsconfig/tsconfig.json/tsconfig.json'
  Require stack:
  - /Users/nn/www/hot/ui/examples/vue/tsconfig.json
      at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
      at Module._resolveFilename (/Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/esbuild-register/dist/node.js:4799:36)
      at Function.resolve (node:internal/modules/helpers:187:19)
      at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:491:34)
      at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
      at Module.parse (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:388:24)
      at async Promise.all (index 2)
      at async configResolved (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/vite-tsconfig-paths/dist/index.mjs:99:10)
      at async Promise.all (index 0)
      at async resolveConfig (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:67363:5)
      at async getOptimizeDeps (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:9031)
      at async createViteServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:10475)
      at async Module.start (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:12771)
      at async storybookDevServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:66:2459)
      at async buildOrThrow (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:60:8290)
      at async buildDevStandalone (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:120:1397)
      at async withTelemetry (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:65:3948)
      at async dev (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:478:401)
      at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/Users/nn/www/hot/ui/examples/vue/tsconfig.json' ]
  },
  tsconfigFile: '/Users/nn/www/hot/ui/examples/vue/tsconfig.json'
}
[tsconfig-paths] An error occurred while parsing "/Users/nn/www/hot/ui/examples/react/tsconfig.json". See below for details.
_TSConfckParseError: failed to resolve "extends":"@tsconfig/vite-react/tsconfig.json" in /Users/nn/www/hot/ui/examples/react/tsconfig.json
    at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:496:9)
    at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
    ... 13 lines matching cause stack trace ...
    at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
  code: 'EXTENDS_RESOLVE',
  cause: Error: Cannot find module '@tsconfig/vite-react/tsconfig.json/tsconfig.json'
  Require stack:
  - /Users/nn/www/hot/ui/examples/react/tsconfig.json
      at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
      at Module._resolveFilename (/Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/esbuild-register/dist/node.js:4799:36)
      at Function.resolve (node:internal/modules/helpers:187:19)
      at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:491:34)
      at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
      at Module.parse (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:388:24)
      at async Promise.all (index 1)
      at async configResolved (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/vite-tsconfig-paths/dist/index.mjs:99:10)
      at async Promise.all (index 0)
      at async resolveConfig (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:67363:5)
      at async getOptimizeDeps (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:9031)
      at async createViteServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:10475)
      at async Module.start (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:12771)
      at async storybookDevServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:66:2459)
      at async buildOrThrow (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:60:8290)
      at async buildDevStandalone (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:120:1397)
      at async withTelemetry (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:65:3948)
      at async dev (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:478:401)
      at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/Users/nn/www/hot/ui/examples/react/tsconfig.json' ]
  },
  tsconfigFile: '/Users/nn/www/hot/ui/examples/react/tsconfig.json'
}
[tsconfig-paths] An error occurred while parsing "/Users/nn/www/hot/ui/examples/svelte/tsconfig.json". See below for details.
_TSConfckParseError: failed to resolve "extends":"@tsconfig/svelte/tsconfig.json" in /Users/nn/www/hot/ui/examples/svelte/tsconfig.json
    at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:496:9)
    at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
    ... 13 lines matching cause stack trace ...
    at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
  code: 'EXTENDS_RESOLVE',
  cause: Error: Cannot find module '@tsconfig/svelte/tsconfig.json/tsconfig.json'
  Require stack:
  - /Users/nn/www/hot/ui/examples/svelte/tsconfig.json
      at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
      at Module._resolveFilename (/Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/esbuild-register/dist/node.js:4799:36)
      at Function.resolve (node:internal/modules/helpers:187:19)
      at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:491:34)
      at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
      at Module.parse (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:388:24)
      at async Promise.all (index 3)
      at async configResolved (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/vite-tsconfig-paths/dist/index.mjs:99:10)
      at async Promise.all (index 0)
      at async resolveConfig (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:67363:5)
      at async getOptimizeDeps (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:9031)
      at async createViteServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:10475)
      at async Module.start (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:12771)
      at async storybookDevServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:66:2459)
      at async buildOrThrow (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:60:8290)
      at async buildDevStandalone (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:120:1397)
      at async withTelemetry (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:65:3948)
      at async dev (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:478:401)
      at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/Users/nn/www/hot/ui/examples/svelte/tsconfig.json' ]
  },
  tsconfigFile: '/Users/nn/www/hot/ui/examples/svelte/tsconfig.json'
}
[tsconfig-paths] An error occurred while parsing "/Users/nn/www/hot/ui/examples/react/tsconfig.json". See below for details. To disable this message, set the `ignoreConfigErrors` option to true.
_TSConfckParseError: failed to resolve "extends":"@tsconfig/vite-react/tsconfig.json" in /Users/nn/www/hot/ui/examples/react/tsconfig.json
    at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:496:9)
    at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
    ... 12 lines matching cause stack trace ...
    at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
  code: 'EXTENDS_RESOLVE',
  cause: Error: Cannot find module '@tsconfig/vite-react/tsconfig.json/tsconfig.json'
  Require stack:
  - /Users/nn/www/hot/ui/examples/react/tsconfig.json
      at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
      at Module._resolveFilename (/Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/esbuild-register/dist/node.js:4799:36)
      at Function.resolve (node:internal/modules/helpers:187:19)
      at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:491:34)
      at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
      at Module.parse (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:388:24)
      at async Promise.all (index 1)
      at async configResolved (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/vite-tsconfig-paths/dist/index.mjs:99:10)
      at async Promise.all (index 0)
      at async resolveConfig (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:67363:5)
      at async _createServer (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:59634:20)
      at async Module.start (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:12771)
      at async storybookDevServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:66:2459)
      at async buildOrThrow (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:60:8290)
      at async buildDevStandalone (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:120:1397)
      at async withTelemetry (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:65:3948)
      at async dev (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:478:401)
      at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/Users/nn/www/hot/ui/examples/react/tsconfig.json' ]
  },
  tsconfigFile: '/Users/nn/www/hot/ui/examples/react/tsconfig.json'
}
[tsconfig-paths] An error occurred while parsing "/Users/nn/www/hot/ui/examples/svelte/tsconfig.json". See below for details.
_TSConfckParseError: failed to resolve "extends":"@tsconfig/svelte/tsconfig.json" in /Users/nn/www/hot/ui/examples/svelte/tsconfig.json
    at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:496:9)
    at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
    ... 12 lines matching cause stack trace ...
    at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
  code: 'EXTENDS_RESOLVE',
  cause: Error: Cannot find module '@tsconfig/svelte/tsconfig.json/tsconfig.json'
  Require stack:
  - /Users/nn/www/hot/ui/examples/svelte/tsconfig.json
      at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
      at Module._resolveFilename (/Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/esbuild-register/dist/node.js:4799:36)
      at Function.resolve (node:internal/modules/helpers:187:19)
      at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:491:34)
      at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
      at Module.parse (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:388:24)
      at async Promise.all (index 2)
      at async configResolved (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/vite-tsconfig-paths/dist/index.mjs:99:10)
      at async Promise.all (index 0)
      at async resolveConfig (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:67363:5)
      at async _createServer (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:59634:20)
      at async Module.start (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:12771)
      at async storybookDevServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:66:2459)
      at async buildOrThrow (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:60:8290)
      at async buildDevStandalone (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:120:1397)
      at async withTelemetry (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:65:3948)
      at async dev (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:478:401)
      at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/Users/nn/www/hot/ui/examples/svelte/tsconfig.json' ]
  },
  tsconfigFile: '/Users/nn/www/hot/ui/examples/svelte/tsconfig.json'
}
[tsconfig-paths] An error occurred while parsing "/Users/nn/www/hot/ui/examples/vue/tsconfig.json". See below for details.
_TSConfckParseError: failed to resolve "extends":"@vue/tsconfig/tsconfig.json" in /Users/nn/www/hot/ui/examples/vue/tsconfig.json
    at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:496:9)
    at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
    ... 12 lines matching cause stack trace ...
    at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
  code: 'EXTENDS_RESOLVE',
  cause: Error: Cannot find module '@vue/tsconfig/tsconfig.json/tsconfig.json'
  Require stack:
  - /Users/nn/www/hot/ui/examples/vue/tsconfig.json
      at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
      at Module._resolveFilename (/Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/esbuild-register/dist/node.js:4799:36)
      at Function.resolve (node:internal/modules/helpers:187:19)
      at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:491:34)
      at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
      at Module.parse (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:388:24)
      at async Promise.all (index 3)
      at async configResolved (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/vite-tsconfig-paths/dist/index.mjs:99:10)
      at async Promise.all (index 0)
      at async resolveConfig (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:67363:5)
      at async _createServer (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:59634:20)
      at async Module.start (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:12771)
      at async storybookDevServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:66:2459)
      at async buildOrThrow (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:60:8290)
      at async buildDevStandalone (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:120:1397)
      at async withTelemetry (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:65:3948)
      at async dev (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:478:401)
      at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/Users/nn/www/hot/ui/examples/vue/tsconfig.json' ]
  },
  tsconfigFile: '/Users/nn/www/hot/ui/examples/vue/tsconfig.json'
}

@JoltCode
Copy link
Collaborator

@spwoodcock Could we merge this, as it is working, then I could work on moving us to a monorepo as discussed? I think that should sort any of these dep issues for @emi420 anyway.

@JoltCode
Copy link
Collaborator

I've removed the whole directory and cloned it again, installed packages with pnpm install and ran yarn dev. I'm using node 20.11.0

➜  ui git:(feat/react-wrappers) yarn dev           
yarn run v1.22.19
$ storybook dev -p 3001
@storybook/cli v7.6.5

info => Starting manager..
info => Starting preview..
[tsconfig-paths] An error occurred while parsing "/Users/nn/www/hot/ui/examples/vue/tsconfig.json". See below for details. To disable this message, set the `ignoreConfigErrors` option to true.
_TSConfckParseError: failed to resolve "extends":"@vue/tsconfig/tsconfig.json" in /Users/nn/www/hot/ui/examples/vue/tsconfig.json
    at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:496:9)
    at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
    ... 13 lines matching cause stack trace ...
    at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
  code: 'EXTENDS_RESOLVE',
  cause: Error: Cannot find module '@vue/tsconfig/tsconfig.json/tsconfig.json'
  Require stack:
  - /Users/nn/www/hot/ui/examples/vue/tsconfig.json
      at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
      at Module._resolveFilename (/Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/esbuild-register/dist/node.js:4799:36)
      at Function.resolve (node:internal/modules/helpers:187:19)
      at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:491:34)
      at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
      at Module.parse (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:388:24)
      at async Promise.all (index 2)
      at async configResolved (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/vite-tsconfig-paths/dist/index.mjs:99:10)
      at async Promise.all (index 0)
      at async resolveConfig (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:67363:5)
      at async getOptimizeDeps (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:9031)
      at async createViteServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:10475)
      at async Module.start (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:12771)
      at async storybookDevServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:66:2459)
      at async buildOrThrow (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:60:8290)
      at async buildDevStandalone (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:120:1397)
      at async withTelemetry (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:65:3948)
      at async dev (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:478:401)
      at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/Users/nn/www/hot/ui/examples/vue/tsconfig.json' ]
  },
  tsconfigFile: '/Users/nn/www/hot/ui/examples/vue/tsconfig.json'
}
[tsconfig-paths] An error occurred while parsing "/Users/nn/www/hot/ui/examples/react/tsconfig.json". See below for details.
_TSConfckParseError: failed to resolve "extends":"@tsconfig/vite-react/tsconfig.json" in /Users/nn/www/hot/ui/examples/react/tsconfig.json
    at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:496:9)
    at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
    ... 13 lines matching cause stack trace ...
    at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
  code: 'EXTENDS_RESOLVE',
  cause: Error: Cannot find module '@tsconfig/vite-react/tsconfig.json/tsconfig.json'
  Require stack:
  - /Users/nn/www/hot/ui/examples/react/tsconfig.json
      at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
      at Module._resolveFilename (/Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/esbuild-register/dist/node.js:4799:36)
      at Function.resolve (node:internal/modules/helpers:187:19)
      at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:491:34)
      at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
      at Module.parse (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:388:24)
      at async Promise.all (index 1)
      at async configResolved (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/vite-tsconfig-paths/dist/index.mjs:99:10)
      at async Promise.all (index 0)
      at async resolveConfig (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:67363:5)
      at async getOptimizeDeps (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:9031)
      at async createViteServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:10475)
      at async Module.start (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:12771)
      at async storybookDevServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:66:2459)
      at async buildOrThrow (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:60:8290)
      at async buildDevStandalone (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:120:1397)
      at async withTelemetry (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:65:3948)
      at async dev (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:478:401)
      at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/Users/nn/www/hot/ui/examples/react/tsconfig.json' ]
  },
  tsconfigFile: '/Users/nn/www/hot/ui/examples/react/tsconfig.json'
}
[tsconfig-paths] An error occurred while parsing "/Users/nn/www/hot/ui/examples/svelte/tsconfig.json". See below for details.
_TSConfckParseError: failed to resolve "extends":"@tsconfig/svelte/tsconfig.json" in /Users/nn/www/hot/ui/examples/svelte/tsconfig.json
    at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:496:9)
    at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
    ... 13 lines matching cause stack trace ...
    at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
  code: 'EXTENDS_RESOLVE',
  cause: Error: Cannot find module '@tsconfig/svelte/tsconfig.json/tsconfig.json'
  Require stack:
  - /Users/nn/www/hot/ui/examples/svelte/tsconfig.json
      at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
      at Module._resolveFilename (/Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/esbuild-register/dist/node.js:4799:36)
      at Function.resolve (node:internal/modules/helpers:187:19)
      at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:491:34)
      at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
      at Module.parse (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:388:24)
      at async Promise.all (index 3)
      at async configResolved (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/vite-tsconfig-paths/dist/index.mjs:99:10)
      at async Promise.all (index 0)
      at async resolveConfig (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:67363:5)
      at async getOptimizeDeps (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:9031)
      at async createViteServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:10475)
      at async Module.start (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:12771)
      at async storybookDevServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:66:2459)
      at async buildOrThrow (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:60:8290)
      at async buildDevStandalone (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:120:1397)
      at async withTelemetry (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:65:3948)
      at async dev (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:478:401)
      at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/Users/nn/www/hot/ui/examples/svelte/tsconfig.json' ]
  },
  tsconfigFile: '/Users/nn/www/hot/ui/examples/svelte/tsconfig.json'
}
[tsconfig-paths] An error occurred while parsing "/Users/nn/www/hot/ui/examples/react/tsconfig.json". See below for details. To disable this message, set the `ignoreConfigErrors` option to true.
_TSConfckParseError: failed to resolve "extends":"@tsconfig/vite-react/tsconfig.json" in /Users/nn/www/hot/ui/examples/react/tsconfig.json
    at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:496:9)
    at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
    ... 12 lines matching cause stack trace ...
    at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
  code: 'EXTENDS_RESOLVE',
  cause: Error: Cannot find module '@tsconfig/vite-react/tsconfig.json/tsconfig.json'
  Require stack:
  - /Users/nn/www/hot/ui/examples/react/tsconfig.json
      at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
      at Module._resolveFilename (/Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/esbuild-register/dist/node.js:4799:36)
      at Function.resolve (node:internal/modules/helpers:187:19)
      at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:491:34)
      at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
      at Module.parse (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:388:24)
      at async Promise.all (index 1)
      at async configResolved (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/vite-tsconfig-paths/dist/index.mjs:99:10)
      at async Promise.all (index 0)
      at async resolveConfig (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:67363:5)
      at async _createServer (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:59634:20)
      at async Module.start (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:12771)
      at async storybookDevServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:66:2459)
      at async buildOrThrow (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:60:8290)
      at async buildDevStandalone (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:120:1397)
      at async withTelemetry (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:65:3948)
      at async dev (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:478:401)
      at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/Users/nn/www/hot/ui/examples/react/tsconfig.json' ]
  },
  tsconfigFile: '/Users/nn/www/hot/ui/examples/react/tsconfig.json'
}
[tsconfig-paths] An error occurred while parsing "/Users/nn/www/hot/ui/examples/svelte/tsconfig.json". See below for details.
_TSConfckParseError: failed to resolve "extends":"@tsconfig/svelte/tsconfig.json" in /Users/nn/www/hot/ui/examples/svelte/tsconfig.json
    at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:496:9)
    at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
    ... 12 lines matching cause stack trace ...
    at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
  code: 'EXTENDS_RESOLVE',
  cause: Error: Cannot find module '@tsconfig/svelte/tsconfig.json/tsconfig.json'
  Require stack:
  - /Users/nn/www/hot/ui/examples/svelte/tsconfig.json
      at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
      at Module._resolveFilename (/Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/esbuild-register/dist/node.js:4799:36)
      at Function.resolve (node:internal/modules/helpers:187:19)
      at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:491:34)
      at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
      at Module.parse (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:388:24)
      at async Promise.all (index 2)
      at async configResolved (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/vite-tsconfig-paths/dist/index.mjs:99:10)
      at async Promise.all (index 0)
      at async resolveConfig (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:67363:5)
      at async _createServer (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:59634:20)
      at async Module.start (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:12771)
      at async storybookDevServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:66:2459)
      at async buildOrThrow (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:60:8290)
      at async buildDevStandalone (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:120:1397)
      at async withTelemetry (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:65:3948)
      at async dev (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:478:401)
      at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/Users/nn/www/hot/ui/examples/svelte/tsconfig.json' ]
  },
  tsconfigFile: '/Users/nn/www/hot/ui/examples/svelte/tsconfig.json'
}
[tsconfig-paths] An error occurred while parsing "/Users/nn/www/hot/ui/examples/vue/tsconfig.json". See below for details.
_TSConfckParseError: failed to resolve "extends":"@vue/tsconfig/tsconfig.json" in /Users/nn/www/hot/ui/examples/vue/tsconfig.json
    at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:496:9)
    at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
    ... 12 lines matching cause stack trace ...
    at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
  code: 'EXTENDS_RESOLVE',
  cause: Error: Cannot find module '@vue/tsconfig/tsconfig.json/tsconfig.json'
  Require stack:
  - /Users/nn/www/hot/ui/examples/vue/tsconfig.json
      at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
      at Module._resolveFilename (/Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/esbuild-register/dist/node.js:4799:36)
      at Function.resolve (node:internal/modules/helpers:187:19)
      at resolveExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:491:34)
      at parseExtends (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:450:28)
      at Module.parse (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected]/node_modules/tsconfck/dist/index.js:388:24)
      at async Promise.all (index 3)
      at async configResolved (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/vite-tsconfig-paths/dist/index.mjs:99:10)
      at async Promise.all (index 0)
      at async resolveConfig (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:67363:5)
      at async _createServer (file:///Users/nn/www/hot/ui/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-wTaJK0Jt.js:59634:20)
      at async Module.start (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@storybook/builder-vite/dist/index.js:159:12771)
      at async storybookDevServer (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:66:2459)
      at async buildOrThrow (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:60:8290)
      at async buildDevStandalone (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:120:1397)
      at async withTelemetry (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/core-server/dist/index.js:65:3948)
      at async dev (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:478:401)
      at async Command.<anonymous> (/Users/nn/www/hot/ui/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/dist/generate.js:493:225) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/Users/nn/www/hot/ui/examples/vue/tsconfig.json' ]
  },
  tsconfigFile: '/Users/nn/www/hot/ui/examples/vue/tsconfig.json'
}

Try pnpm dev instead?

@emi420
Copy link
Collaborator

emi420 commented Apr 16, 2024

Thanks @JoltCode ! it was that, I was still using yarn for running the project.

Now it's working, but styles are missing:

Main Storybook:

Screenshot 2024-04-16 at 09 55 51

React example:

Screenshot 2024-04-16 at 09 56 18

@spwoodcock
Copy link
Member Author

The styles are missing in the storybook. Try running the examples though, the styles work fine there.
We can fix the storybook in due course 👍

@spwoodcock spwoodcock merged commit bb25a05 into main Apr 16, 2024
2 checks passed
@spwoodcock spwoodcock deleted the feat/react-wrappers branch April 16, 2024 14:20
@spwoodcock
Copy link
Member Author

Adding this here in case we want to use it:

// A parent element for all component to inherit properties from

import { LitElement } from 'lit';
import { property } from 'lit/decorators.js';

export default class HotElement extends LitElement {
  // Make localization attribute reactive
  @property() lang: string = "en-GB";

  // NOTE: register component without decorator, to allow for import via React wrapper
  static define(name: string, elementConstructor = this, options: ElementDefinitionOptions = {}) {
    const currentlyRegisteredConstructor = customElements.get(name) as
      | CustomElementConstructor
      | typeof HotElement;

    if (!currentlyRegisteredConstructor) {
      customElements.define(name, class extends elementConstructor {} as unknown as CustomElementConstructor, options);
    }
  }
}

export interface HotElementProps extends HotElement {
  name: string;
  disabled?: boolean;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

React wrapper for Lit
3 participants