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

Angular: Add angular 14 sandbox template #19181

Merged
merged 59 commits into from
Oct 13, 2022
Merged

Angular: Add angular 14 sandbox template #19181

merged 59 commits into from
Oct 13, 2022

Conversation

tmeasday
Copy link
Member

@tmeasday tmeasday commented Sep 14, 2022

What I did

Add template for angular 14 and template components for angular 🎉 .

Caveats

The angular template does not work out-of-the-box with yarn bootstrap --prep (It works fine with --core). In particular:

  1. If you --no-link (i.e. verdaccio), it has many TS errors in our code that you can remove by adding "skipLibCheck": true to the generated .storybook/tsconfig.json.
  2. If you --link, it seems the skipLibCheck doesn't work because it doesn't respect symlinks and thus thinks our code isn't in node_modules (at least I think that's what going on.

We are going to follow up the above -- some options are:

  • Fix the TS problems
  • Loosen the TS setting for the angular sandbox.

@tmeasday tmeasday added maintenance User-facing maintenance tasks angular labels Sep 14, 2022
Base automatically changed from shilman/fix-sandbox-multiple-reacts to next September 14, 2022 06:07
@ndelangen
Copy link
Member

@tmeasday It's unfortunate that they are marked as Error because otherwise we could have added them to a ignore list with ignoreWarnings = https://webpack.js.org/configuration

Perhaps something like this is an option:

module.exports = {
  ...
  module: {
    rules: [
      {
        test: /\.tsx?$/,
        use: [
          {
            loader: 'ts-loader',
            options: {
              transpileOnly: true
            }
          }
        ]
      }
    ]
  }
}

source: https://stackoverflow.com/questions/60278796/how-to-ignore-typescript-errors-when-compile-by-webpack-production-mode

@tmeasday tmeasday changed the title Build: Fix sandbox running multiple versions of react Add angular 14 template Sep 15, 2022
@tmeasday tmeasday force-pushed the tom/sb-512-angular-14 branch from c38b060 to 297725c Compare September 15, 2022 06:05
@tmeasday tmeasday marked this pull request as ready for review September 15, 2022 06:09
@tmeasday tmeasday mentioned this pull request Sep 16, 2022
8 tasks
@ndelangen ndelangen marked this pull request as draft October 5, 2022 14:29
import { DiComponent } from './di.component';

export default {
title: 'Basics / Component / With Provider',
// title: 'Basics / Component / With Provider',
Copy link
Contributor

Choose a reason for hiding this comment

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

the title is deactivated in order to take the one of the file ?

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, one thing we wanted to do was to rely on autotitle so it was easier to map stories back to the files they came from. I for one have often struggled to figure out which file a failing story is from due to titles. I left the names in there commented out in case someone wanted to rename the files to better match the old titles.

@kroeder
Copy link
Member

kroeder commented Oct 10, 2022

Creating a template does not work anymore

Nevermind. After merging next it seems to work again

Does not work after merge next into this branch

➤ YN0000: └ Completed in 0s 450ms
➤ YN0000: Done with warnings in 1s 467ms
🔢 Adding package scripts:
Error running task sandbox:

TypeError: (0 , package_json_1.updatePackageScripts) is not a function
    at install (/Users/kroeder/WebstormProjects/storybook/scripts/tasks/sandbox-parts.ts:116:29)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.run (/Users/kroeder/WebstormProjects/storybook/scripts/tasks/sandbox.ts:21:5)
    at async runTask (/Users/kroeder/WebstormProjects/storybook/scripts/task.ts:271:5)
    at async run (/Users/kroeder/WebstormProjects/storybook/scripts/task.ts:401:9)

@tmeasday
Copy link
Member Author

Ughh, bad merge sorry.

@ndelangen ndelangen merged commit 93570f5 into next Oct 13, 2022
@ndelangen ndelangen deleted the tom/sb-512-angular-14 branch October 13, 2022 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
angular maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants