Skip to content

Commit

Permalink
rename preview (previously config) to entry-preview, for easier ident…
Browse files Browse the repository at this point in the history
…ification
  • Loading branch information
ndelangen committed Oct 31, 2023
1 parent 09778c8 commit 54cb15a
Show file tree
Hide file tree
Showing 31 changed files with 48 additions and 47 deletions.
8 changes: 4 additions & 4 deletions code/renderers/html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"import": "./dist/index.mjs"
},
"./preset": "./preset.js",
"./dist/preview.mjs": "./dist/preview.mjs",
"./dist/preview-docs.mjs": "./dist/preview-docs.mjs",
"./dist/entry-preview.mjs": "./dist/entry-preview.mjs",
"./dist/entry-docs.mjs": "./dist/entry-docs.mjs",
"./package.json": "./package.json"
},
"main": "dist/index.js",
Expand Down Expand Up @@ -70,8 +70,8 @@
"entries": [
"./src/index.ts",
"./src/preset.ts",
"./src/preview.ts",
"./src/preview-docs.ts"
"./src/entry-preview.ts",
"./src/entry-docs.ts"
],
"platform": "browser"
},
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions code/renderers/html/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export const previewAnnotations: StorybookConfig['previewAnnotations'] = async (

return result
.concat(input)
.concat([join(__dirname, 'preview.mjs')])
.concat(docsEnabled ? [join(__dirname, 'preview-docs.mjs')] : []);
.concat([join(__dirname, 'entry-preview.mjs')])
.concat(docsEnabled ? [join(__dirname, 'entry-docs.mjs')] : []);
};
8 changes: 4 additions & 4 deletions code/renderers/preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"import": "./dist/index.mjs"
},
"./preset": "./preset.js",
"./dist/preview.mjs": "./dist/preview.mjs",
"./dist/preview-docs.mjs": "./dist/preview-docs.mjs",
"./dist/entry-preview.mjs": "./dist/entry-preview.mjs",
"./dist/entry-docs.mjs": "./dist/entry-docs.mjs",
"./package.json": "./package.json"
},
"main": "dist/index.js",
Expand Down Expand Up @@ -70,8 +70,8 @@
"entries": [
"./src/index.ts",
"./src/preset.ts",
"./src/preview.ts",
"./src/preview-docs.ts"
"./src/entry-preview.ts",
"./src/entry-docs.ts"
],
"platform": "browser"
},
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions code/renderers/preact/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export const previewAnnotations: StorybookConfig['previewAnnotations'] = async (

return result
.concat(input)
.concat([join(__dirname, 'preview.mjs')])
.concat(docsEnabled ? [join(__dirname, 'preview-docs.mjs')] : []);
.concat([join(__dirname, 'entry-preview.mjs')])
.concat(docsEnabled ? [join(__dirname, 'entry-docs.mjs')] : []);
};
8 changes: 4 additions & 4 deletions code/renderers/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"import": "./dist/index.mjs"
},
"./preset": "./preset.js",
"./dist/preview.mjs": "./dist/preview.mjs",
"./dist/preview-docs.mjs": "./dist/preview-docs.mjs",
"./dist/entry-preview.mjs": "./dist/entry-preview.mjs",
"./dist/entry-docs.mjs": "./dist/entry-docs.mjs",
"./package.json": "./package.json"
},
"main": "dist/index.js",
Expand Down Expand Up @@ -97,8 +97,8 @@
"entries": [
"./src/index.ts",
"./src/preset.ts",
"./src/preview.ts",
"./src/preview-docs.ts"
"./src/entry-preview.ts",
"./src/entry-docs.ts"
],
"platform": "browser"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { parameters } from './docs/config';
export { decorators, argTypesEnhancers } from './docs/config';
export { applyDecorators } from './applyDecorators';
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export const parameters: {} = { renderer: 'react' };
export { render, renderToCanvas } from './render';
export { applyDecorators } from './applyDecorators';
7 changes: 4 additions & 3 deletions code/renderers/react/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ export const addons: StorybookConfig['addons'] = [
];

export const previewAnnotations: StorybookConfig['previewAnnotations'] = async (input, options) => {
const docsEnabled = Object.keys(await options.presets.apply('docs', {}, options)).length > 0;
const docsConfig = await options.presets.apply('docs', {}, options);
const docsEnabled = Object.keys(docsConfig).length > 0;
const result: string[] = [];

return result
.concat(input)
.concat([join(__dirname, 'preview.mjs')])
.concat(docsEnabled ? [join(__dirname, 'preview-docs.mjs')] : []);
.concat([join(__dirname, 'entry-preview.mjs')])
.concat(docsEnabled ? [join(__dirname, 'entry-docs.mjs')] : []);
};
4 changes: 2 additions & 2 deletions code/renderers/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"import": "./dist/index.mjs"
},
"./preset": "./preset.js",
"./dist/preview.mjs": "./dist/preview.mjs",
"./dist/entry-preview.mjs": "./dist/entry-preview.mjs",
"./package.json": "./package.json"
},
"main": "dist/index.js",
Expand Down Expand Up @@ -70,7 +70,7 @@
"entries": [
"./src/index.ts",
"./src/preset.ts",
"./src/preview.ts"
"./src/entry-preview.ts"
],
"platform": "browser"
},
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion code/renderers/server/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ export const previewAnnotations: StorybookConfig['previewAnnotations'] = async (
}
const result: string[] = [];

return result.concat(input).concat([join(__dirname, 'preview.mjs')]);
return result.concat(input).concat([join(__dirname, 'entry-preview.mjs')]);
};
8 changes: 4 additions & 4 deletions code/renderers/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"import": "./dist/index.mjs"
},
"./preset": "./preset.js",
"./dist/preview.mjs": "./dist/preview.mjs",
"./dist/preview-docs.mjs": "./dist/preview-docs.mjs",
"./dist/entry-preview.mjs": "./dist/entry-preview.mjs",
"./dist/entry-docs.mjs": "./dist/entry-docs.mjs",
"./package.json": "./package.json",
"./templates/HOC.svelte": "./templates/HOC.svelte",
"./templates/PreviewRender.svelte": "./templates/PreviewRender.svelte",
Expand Down Expand Up @@ -80,8 +80,8 @@
"entries": [
"./src/index.ts",
"./src/preset.ts",
"./src/preview.ts",
"./src/preview-docs.ts"
"./src/entry-preview.ts",
"./src/entry-docs.ts"
],
"platform": "browser"
},
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions code/renderers/svelte/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export const previewAnnotations: StorybookConfig['previewAnnotations'] = async (

return result
.concat(input)
.concat([join(__dirname, 'preview.mjs')])
.concat(docsEnabled ? [join(__dirname, 'preview-docs.mjs')] : []);
.concat([join(__dirname, 'entry-preview.mjs')])
.concat(docsEnabled ? [join(__dirname, 'entry-docs.mjs')] : []);
};
8 changes: 4 additions & 4 deletions code/renderers/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"import": "./dist/index.mjs"
},
"./preset": "./preset.js",
"./dist/preview.mjs": "./dist/preview.mjs",
"./dist/preview-docs.mjs": "./dist/preview-docs.mjs",
"./dist/entry-preview.mjs": "./dist/entry-preview.mjs",
"./dist/entry-docs.mjs": "./dist/entry-docs.mjs",
"./package.json": "./package.json"
},
"main": "dist/index.js",
Expand Down Expand Up @@ -82,8 +82,8 @@
"entries": [
"./src/index.ts",
"./src/preset.ts",
"./src/preview.ts",
"./src/preview-docs.ts"
"./src/entry-preview.ts",
"./src/entry-docs.ts"
],
"platform": "browser"
},
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions code/renderers/vue/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export const previewAnnotations: StorybookConfig['previewAnnotations'] = async (

return result
.concat(input)
.concat([join(__dirname, 'preview.mjs')])
.concat(docsEnabled ? [join(__dirname, 'preview-docs.mjs')] : []);
.concat([join(__dirname, 'entry-preview.mjs')])
.concat(docsEnabled ? [join(__dirname, 'entry-docs.mjs')] : []);
};
8 changes: 4 additions & 4 deletions code/renderers/vue3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"import": "./dist/index.mjs"
},
"./preset": "./preset.js",
"./dist/preview.mjs": "./dist/preview.mjs",
"./dist/preview-docs.mjs": "./dist/preview-docs.mjs",
"./dist/entry-preview.mjs": "./dist/entry-preview.mjs",
"./dist/entry-docs.mjs": "./dist/entry-docs.mjs",
"./package.json": "./package.json"
},
"main": "dist/index.js",
Expand Down Expand Up @@ -81,8 +81,8 @@
"entries": [
"./src/index.ts",
"./src/preset.ts",
"./src/preview.ts",
"./src/preview-docs.ts"
"./src/entry-preview.ts",
"./src/entry-docs.ts"
],
"platform": "browser"
},
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions code/renderers/vue3/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export const previewAnnotations: StorybookConfig['previewAnnotations'] = async (

return result
.concat(input)
.concat([join(__dirname, 'preview.mjs')])
.concat(docsEnabled ? [join(__dirname, 'preview-docs.mjs')] : []);
.concat([join(__dirname, 'entry-preview.mjs')])
.concat(docsEnabled ? [join(__dirname, 'entry-docs.mjs')] : []);
};
8 changes: 4 additions & 4 deletions code/renderers/web-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"import": "./dist/index.mjs"
},
"./preset": "./preset.js",
"./dist/preview.mjs": "./dist/preview.mjs",
"./dist/preview-docs.mjs": "./dist/preview-docs.mjs",
"./dist/entry-preview.mjs": "./dist/entry-preview.mjs",
"./dist/entry-docs.mjs": "./dist/entry-docs.mjs",
"./package.json": "./package.json"
},
"main": "dist/index.js",
Expand Down Expand Up @@ -81,8 +81,8 @@
"entries": [
"./src/index.ts",
"./src/preset.ts",
"./src/preview.ts",
"./src/preview-docs.ts"
"./src/entry-preview.ts",
"./src/entry-docs.ts"
],
"platform": "browser"
},
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions code/renderers/web-components/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export const previewAnnotations: StorybookConfig['previewAnnotations'] = async (

return result
.concat(input)
.concat([join(__dirname, 'preview.mjs')])
.concat(docsEnabled ? [join(__dirname, 'preview-docs.mjs')] : []);
.concat([join(__dirname, 'entry-preview.mjs')])
.concat(docsEnabled ? [join(__dirname, 'entry-docs.mjs')] : []);
};

0 comments on commit 54cb15a

Please sign in to comment.