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

Marko: migrate to TS #13449

Merged
merged 1 commit into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export const {
} = clientApi;

const framework = 'marko';
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
export const configure = (...args) => coreConfigure(framework, ...args);
export const storiesOf = (...args: any) =>
clientApi.storiesOf(...args).addParameters({ framework });
export const configure = (...args: any) => coreConfigure(framework, ...args);

export { forceReRender };
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import dedent from 'ts-dedent';
import { logger } from '@storybook/client-logger';

const rootEl = document.getElementById('root');
let activeComponent = null; // currently loaded marko component.
let activeTemplate = null; // template for the currently loaded component.
let activeStoryFn = null; // used to determine if we've switched stories.
let activeComponent: any = null; // currently loaded marko component.
let activeTemplate: any = null; // template for the currently loaded component.
let activeStoryFn: any = null; // used to determine if we've switched stories.

export default function renderMain({
storyFn,
Expand All @@ -15,7 +15,14 @@ export default function renderMain({
showMain,
showError,
parameters,
// forceRender,
}: // forceRender,
{
storyFn: Function;
kind: string;
name: string;
showMain: () => any;
showError: (input: { title: string; description: string }) => void;
parameters: any;
}) {
const isSameStory = activeStoryFn === storyFn;
const config = storyFn();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function webpack(config) {
import { Configuration } from 'webpack';

export function webpack(config: Configuration) {
return {
...config,
module: {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions app/marko/src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare module '@storybook/core/*';
declare module 'global';
7 changes: 7 additions & 0 deletions app/marko/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"types": ["webpack-env"]
}
}