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

[Bug]: Issues with outline-cli init and yarn start on newly scaffolded project. #396

Open
himerus opened this issue May 24, 2023 · 3 comments
Labels
READY TO CODE This means a ticket is ready to be worked. Any ticket without this label should be verified. Severity: High Type: Bug

Comments

@himerus
Copy link
Contributor

himerus commented May 24, 2023

Describe the bug

  • npx @phase2/outline-cli init builds a new design system
    • moving into the new directory and running yarn start throws errors.

To Reproduce

Build a new design system with @phase2/outline-cli.

npx -y @phase2/outline-cli@latest init \
  --automated \
  --name="Design System" \
  --slug="design-system" \
  --packageName="@phase2/design-system" \
  --description="Web component library powered by OutlineJS." \
  --template="default" && \
cd design-system && \
yarn start

Expected behavior

  • Able to run yarn start
  • Built in tests catch this type of issue

Screenshots
...

@himerus himerus added Type: Bug Severity: High READY TO CODE This means a ticket is ready to be worked. Any ticket without this label should be verified. labels May 24, 2023
@himerus
Copy link
Contributor Author

himerus commented May 24, 2023

As further research shows, this was a result of the dependencies in outline-template's default template being out of date with the latest releases. For some reason, even without a yarn.lock file, a local installation (at the minimum) is caching older versions and not grabbing the latest versions.

Working on various updates that will attempt to fix this, and update title to be more relevant.

@himerus himerus changed the title [Bug]: Issues with outline-cli init and outlineStories on newly scaffolded project. [Bug]: Issues with outline-cli init and yarn start on newly scaffolded project. May 24, 2023
@joeparsons
Copy link

I was able to workaround this problem by adding the following to the src/.storybook/main.js file in my local project. This was adapted from the docs for the Storybook Vite builder.

Added to beginning of file:

const { mergeConfig } = require('vite');

Added to module.exports:

  async viteFinal(config, { configType }) {
    let jsx = 'react/jsx-runtime';
    if (configType === 'DEVELOPMENT') {
      jsx = 'react/jsx-dev-runtime';
    }
    return mergeConfig(config, {
      optimizeDeps: {
        include: [jsx],
      },
    });
  },

@himerus would a PR that makes these changes to https://github.com/phase2/outline/blob/next/packages/documentation/outline-storybook/config/main.js be helpful?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
READY TO CODE This means a ticket is ready to be worked. Any ticket without this label should be verified. Severity: High Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants