Skip to content

Commit

Permalink
cleanup unused root entries, add preset entry
Browse files Browse the repository at this point in the history
  • Loading branch information
JReinhold committed Feb 16, 2024
1 parent 50e37b3 commit fff70cf
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
1 change: 0 additions & 1 deletion manager.js

This file was deleted.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
},
"./preview": {
"types": "./dist/index.d.ts",
"import": "./dist/preview.js"
"import": "./dist/preview.js",
"require": "./dist/preview.js"
},
"./preset": "./dist/preset.cjs",
"./manager": "./dist/manager.js",
"./package.json": "./package.json"
},
Expand Down Expand Up @@ -92,6 +94,9 @@
],
"previewEntries": [
"src/preview.ts"
],
"nodeEntries": [
"src/preset.ts"
]
},
"storybook": {
Expand Down
1 change: 0 additions & 1 deletion preview.js

This file was deleted.

4 changes: 0 additions & 4 deletions src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ addons.register(ADDON_ID, () => {
addons.add(TAB_ID, {
type: types.TAB,
title: "My addon",
//👇 Checks the current route for the story
route: ({ storyId }) => `/myaddon/${storyId}`,
//👇 Shows the Tab UI element in myaddon view mode
match: ({ viewMode }) => viewMode === "myaddon",
render: Tab,
});
});
14 changes: 14 additions & 0 deletions src/preset.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// You can use presets to augment the Storybook configuration
// You rarely want to do this in addons,
// so often you want to delete this file and remove the reference to it in package.json#exports and package.json#bunder.nodeEntries
// Read more about presets at https://storybook.js.org/docs/addons/writing-presets

export const viteFinal = async (config: any) => {
console.log("This addon is augmenting the Vite config");
return config;
};

export const webpack = async (config: any) => {
console.log("This addon is augmenting the Webpack config");
return config;
};

0 comments on commit fff70cf

Please sign in to comment.