Skip to content

Commit

Permalink
fix this undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyie committed Jun 26, 2024
1 parent e539082 commit 16b9418
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 35 deletions.
1 change: 0 additions & 1 deletion packages/storybook-renderer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import './globals';

// export * from './types/public-api';
export * from './types/public-types';
export * from './types/types';
export * from './helpers';
Expand Down
6 changes: 3 additions & 3 deletions packages/storybook-renderer/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const resizeState = {

function updater() {
let first = false;
return (ticker: Ticker) => {
return function (ticker: Ticker){
if (first) {
resizeApplication({
containerWidth: window.innerWidth,
Expand Down Expand Up @@ -170,7 +170,7 @@ function addStory({

if (storyObject.update) {
updateRef = updater();
Ticker.shared.add(storyObject.update, updateRef);
Ticker.shared.add(updateRef);
}

return storyResizeHandler;
Expand All @@ -186,7 +186,7 @@ function removeStory({
storyResizeHandler: EventHandler;
}) {
if (storyObject.update) {
Ticker.shared.remove(storyObject.update, updateRef);
Ticker.shared.remove(updateRef);
}

app.stage.removeChild(storyObject.view);
Expand Down
27 changes: 0 additions & 27 deletions packages/storybook-renderer/src/types/public-api.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/storybook-vite/src/preset.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from "path";
import type { PresetProperty } from "@storybook/types";
import type { PresetProperty, PresetPropertyFn } from "@storybook/types";
import type { StorybookConfig } from "./types";

export const addons: PresetProperty<"addons", StorybookConfig> = [
Expand All @@ -11,7 +11,7 @@ export const addons: PresetProperty<"addons", StorybookConfig> = [
),
];

export const core: PresetProperty<"core", StorybookConfig> = async (
export const core: PresetPropertyFn<"core", StorybookConfig> = async (
config,
options
) => {
Expand Down
4 changes: 4 additions & 0 deletions packages/storybook-vite/src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module 'global';

// will be provided by the webpack define plugin
declare var NODE_ENV: string | undefined;
4 changes: 2 additions & 2 deletions packages/storybook-webpack5/src/preset.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import path from 'path';
import type { PresetProperty } from '@storybook/types';
import type { PresetProperty, PresetPropertyFn } from '@storybook/types';
import type { StorybookConfig } from './types';

export const addons: PresetProperty<'addons', StorybookConfig> = [
path.dirname(require.resolve(path.join('@pixi/storybook-preset-webpack', 'package.json'))),
path.dirname(require.resolve(path.join('@pixi/storybook-renderer', 'package.json'))),
];

export const core: PresetProperty<'core', StorybookConfig> = async (config, options) => {
export const core: PresetPropertyFn<'core', StorybookConfig> = async (config, options) => {
const framework = await options.presets.apply<StorybookConfig['framework']>('framework');

return {
Expand Down

0 comments on commit 16b9418

Please sign in to comment.