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
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f003cf9
wip: start typescript migration of polymer
kroeder Sep 17, 2019
bdeef27
remove exclusion of __tests__
kroeder Sep 17, 2019
862369d
add types for polymer/server
kroeder Sep 17, 2019
1c11681
wip: migrate polymer/client to typescript
kroeder Sep 17, 2019
8569339
Merge branch 'next' into ts-migration/polymer
ndelangen Nov 15, 2019
c11ee24
wip: proceed ts migration
kroeder Nov 19, 2019
a9afa17
Merge branch 'next' into ts-migration/polymer
kroeder Nov 19, 2019
7cc8043
trigger ci
kroeder Nov 19, 2019
2d70ce2
Merge branch 'next' into ts-migration/polymer
ndelangen Nov 21, 2019
13816cb
Merge branch 'next' into ts-migration/polymer
shilman Nov 26, 2019
c38000e
Merge branch 'next' into ts-migration/polymer
ndelangen Nov 28, 2019
754579a
Merge branch 'next-6.0.0' into ts-migration/polymer
ndelangen Dec 20, 2019
55b9876
Merge branch 'next-6.0.0' into ts-migration/polymer
ndelangen Jan 11, 2020
ad67e81
Merge branch 'next-6.0.0' into ts-migration/polymer
ndelangen Jan 14, 2020
9e7e2c7
Update 1-Button.stories.ts
devtronic Jan 19, 2020
36ee762
fix: clean usage of `@types/webpack-env` dep in all packages
gaetanmaisse Jan 19, 2020
3046a88
Merge branch 'next-6.0.0' into ts-migration/polymer
ndelangen Jan 20, 2020
5779f18
Clean usage of `@types/webpack-env` dep in all packages (#9536)
shilman Jan 20, 2020
3026db9
Next 6.0.0 (#9212)
ndelangen Jan 20, 2020
593ac5f
Fixed Angular button example story (#9540)
ndelangen Jan 20, 2020
3ab7e7a
6.0.0-alpha.0 changelog
shilman Jan 20, 2020
b8543b5
Merge branch 'next' into pr/kroeder/8102
ndelangen Jan 20, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/polymer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"directory": "app/polymer"
},
"license": "MIT",
"main": "dist/client/index.js",
"main": "dist/client/index.ts",
"types": "dist/client/index.d.ts",
"bin": {
"build-storybook": "./bin/build.js",
"start-storybook": "./bin/index.js",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IgnorePlugin } from 'webpack';
import { Configuration, IgnorePlugin, RuleSetUseItem } from 'webpack';

export function webpack(config) {
export function webpack(config: Configuration) {
return {
...config,
module: {
Expand All @@ -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

{
loader: require.resolve('polymer-webpack-loader'),
options: { processStyleLinks: true },
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import packageJson from '../../package.json';
const packageJson = require('../../package.json');

export default {
packageJson,
Expand Down
5 changes: 5 additions & 0 deletions app/polymer/src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module '@storybook/core/*';
declare module 'global';

// will be provided by the webpack define plugin
declare var NODE_ENV: string | undefined;
10 changes: 10 additions & 0 deletions app/polymer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"types": []
},
"include": [
"src/**/*"
]
}