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

Typescript: Migrate @storybook/polymer #8102

Merged
merged 22 commits into from Jan 20, 2020
Merged

Conversation

kroeder
Copy link
Member

@kroeder kroeder commented Sep 17, 2019

What I did

Issue #5030

@vercel
Copy link

vercel bot commented Sep 17, 2019

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/storybook/monorepo/i8488gg8x
✅ Preview: https://monorepo-git-ts-migration-polymer.storybook.now.sh

@@ -10,7 +10,7 @@ export function webpack(config) {
{
test: /\.html$/,
use: [
...config.module.rules[0].use,
...(config.module.rules[0].use as RuleSetUseItem[]),
Copy link
Member Author

@kroeder kroeder Sep 17, 2019

Choose a reason for hiding this comment

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

tslint complained about the typing of use. I had to cast it but it might be a bug

rules[0].use can be

type RuleSetUse =
        | RuleSetUseItem
        | RuleSetUseItem[]
        | ((data: any) => RuleSetUseItem | RuleSetUseItem[]);

or are we 100% certain it is always RuleSetUseItem[]? Do we need to add a check here?

Copy link
Member

Choose a reason for hiding this comment

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

We can't be not sure, we should probably check

@kroeder
Copy link
Member Author

kroeder commented Sep 17, 2019

I could use some help migrating the client storyFn parts of polymer to typescript 😬
Can you help or ping someone who can help with that? @ndelangen @shilman

@stale stale bot added the inactive label Oct 24, 2019
@ndelangen ndelangen self-assigned this Nov 15, 2019
@stale stale bot removed the inactive label Nov 15, 2019
# Conflicts:
#	app/polymer/package.json
@storybookjs storybookjs deleted a comment from stale bot Nov 15, 2019
@ndelangen
Copy link
Member

@daKmoR would you possibly be able to help with this one?

@ndelangen ndelangen added this to the 5.4.0 milestone Nov 16, 2019
@daKmoR
Copy link
Contributor

daKmoR commented Nov 17, 2019

with storyFn you mean what the user has in his foo.stories.js files right?

then it would be

import { TemplateResult } from 'lit-html';

export type StoryFnPolymerReturnType = string | Node | TemplateResult;

it's actually also "wrong" in app/web-components 🙈
https://github.com/storybookjs/storybook/blob/next/app/web-components/src/client/preview/types.ts#L3

@ndelangen ndelangen changed the base branch from next to next-6.0.0 December 21, 2019 00:01
@stale stale bot added the inactive label Jan 11, 2020
devtronic and others added 3 commits January 19, 2020 18:39
The property in the Angular component is lowercase. Without this change, the button example story wont work properly.
(The button text isn't rendered)
 - `@types/webpack-env` must be defined as `dependencies` in packages that export a type/function using typings from `@types/webpack-env` (it is often `NodeModule`). In that case `/// <reference types="webpack-env" />` is present in some files of the `dist` folder of the lib. Example: `lib/client-api`.
 - `@types/webpack-env` must be defined as `devDependencies` in packages that use its typings internally but does not expose anything related to it. Many addons need the type because they use `module.hot` function. Example: `addons/a11y`
 - `webpack-env` should be removed from "compilerOptions.types" key of `tsconfig.json` of packages that don't need it.

 I also bump `@types/webpack-env` to ^1.15.0 to have the same version all across the monorepo
shilman and others added 5 commits January 20, 2020 18:23
Clean usage of `@types/webpack-env` dep in all packages
Fixed Angular button example story
# Conflicts:
#	app/polymer/package.json
@ndelangen ndelangen merged commit d8c7ebc into next-6.0.0 Jan 20, 2020
@ndelangen ndelangen deleted the ts-migration/polymer branch January 20, 2020 20:14
@ndelangen ndelangen restored the ts-migration/polymer branch January 20, 2020 22:20
@stof stof deleted the ts-migration/polymer branch May 25, 2022 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance User-facing maintenance tasks typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants