@storybook/preact-vite 7.0.0-beta.16
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +48 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +0 -0
- package/dist/preset.d.ts +6 -0
- package/dist/preset.js +1 -0
- package/dist/preset.mjs +1 -0
- package/jest.config.js +7 -0
- package/package.json +84 -0
- package/preset.js +1 -0
package/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# Storybook for Preact <!-- omit in toc -->
|
2
|
+
|
3
|
+
## Requirements
|
4
|
+
|
5
|
+
- [Preact](https://preactjs.com/) >= 10.x
|
6
|
+
- [Storybook](https://storybook.js.org/) >= 7.x
|
7
|
+
|
8
|
+
## Getting Started
|
9
|
+
|
10
|
+
### In a project without Storybook
|
11
|
+
|
12
|
+
Follow the prompts after running this command in your Next.js project's root directory:
|
13
|
+
|
14
|
+
```bash
|
15
|
+
npx storybook@next init
|
16
|
+
```
|
17
|
+
|
18
|
+
[More on getting started with Storybook](https://storybook.js.org/docs/preact/get-started/install)
|
19
|
+
|
20
|
+
### In a project with Storybook
|
21
|
+
|
22
|
+
This framework is designed to work with Storybook 7. If you’re not already using v7, upgrade with this command:
|
23
|
+
|
24
|
+
```bash
|
25
|
+
npx storybook@next upgrade --prerelease
|
26
|
+
```
|
27
|
+
|
28
|
+
#### Manual migration
|
29
|
+
|
30
|
+
Install the framework:
|
31
|
+
|
32
|
+
```bash
|
33
|
+
yarn add --dev @storybook/preact-vite@next
|
34
|
+
```
|
35
|
+
|
36
|
+
Update your `main.js` to change the framework property:
|
37
|
+
|
38
|
+
```js
|
39
|
+
// .storybook/main.js
|
40
|
+
module.exports = {
|
41
|
+
// ...
|
42
|
+
framework: {
|
43
|
+
// name: '@storybook/react-webpack5', // Remove this
|
44
|
+
name: '@storybook/preact-vite', // Add this
|
45
|
+
options: {},
|
46
|
+
},
|
47
|
+
};
|
48
|
+
```
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export { StorybookConfig } from '@storybook/builder-vite';
|
package/dist/index.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};module.exports=__toCommonJS(src_exports);
|
package/dist/index.mjs
ADDED
File without changes
|
package/dist/preset.d.ts
ADDED
package/dist/preset.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var preset_exports={};__export(preset_exports,{core:()=>core,viteFinal:()=>viteFinal});module.exports=__toCommonJS(preset_exports);var import_builder_vite=require("@storybook/builder-vite"),import_preset_vite=__toESM(require("@preact/preset-vite")),core={builder:"@storybook/builder-vite",renderer:"@storybook/preact"},viteFinal=async config=>{let{plugins=[]}=config;return await(0,import_builder_vite.hasVitePlugins)(plugins,["vite:preact-jsx"])||plugins.push((0,import_preset_vite.default)()),config};0&&(module.exports={core,viteFinal});
|
package/dist/preset.mjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
import{hasVitePlugins}from"@storybook/builder-vite";import preact from"@preact/preset-vite";var core={builder:"@storybook/builder-vite",renderer:"@storybook/preact"},viteFinal=async config=>{let{plugins=[]}=config;return await hasVitePlugins(plugins,["vite:preact-jsx"])||plugins.push(preact()),config};export{core,viteFinal};
|
package/jest.config.js
ADDED
package/package.json
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
{
|
2
|
+
"name": "@storybook/preact-vite",
|
3
|
+
"version": "7.0.0-beta.16",
|
4
|
+
"description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.",
|
5
|
+
"keywords": [
|
6
|
+
"storybook"
|
7
|
+
],
|
8
|
+
"homepage": "https://github.com/storybookjs/storybook/tree/main/frameworks/preact-vite",
|
9
|
+
"bugs": {
|
10
|
+
"url": "https://github.com/storybookjs/storybook/issues"
|
11
|
+
},
|
12
|
+
"repository": {
|
13
|
+
"type": "git",
|
14
|
+
"url": "https://github.com/storybookjs/storybook.git",
|
15
|
+
"directory": "frameworks/preact-vite"
|
16
|
+
},
|
17
|
+
"funding": {
|
18
|
+
"type": "opencollective",
|
19
|
+
"url": "https://opencollective.com/storybook"
|
20
|
+
},
|
21
|
+
"license": "MIT",
|
22
|
+
"exports": {
|
23
|
+
".": {
|
24
|
+
"require": "./dist/index.js",
|
25
|
+
"import": "./dist/index.mjs",
|
26
|
+
"types": "./dist/index.d.ts"
|
27
|
+
},
|
28
|
+
"./preset": {
|
29
|
+
"require": "./dist/preset.js",
|
30
|
+
"import": "./dist/preset.mjs",
|
31
|
+
"types": "./dist/preset.d.ts"
|
32
|
+
},
|
33
|
+
"./package.json": {
|
34
|
+
"require": "./package.json",
|
35
|
+
"import": "./package.json",
|
36
|
+
"types": "./package.json"
|
37
|
+
}
|
38
|
+
},
|
39
|
+
"main": "dist/index.js",
|
40
|
+
"module": "dist/index.mjs",
|
41
|
+
"types": "dist/index.d.ts",
|
42
|
+
"files": [
|
43
|
+
"dist/**/*",
|
44
|
+
"types/**/*",
|
45
|
+
"README.md",
|
46
|
+
"*.js",
|
47
|
+
"*.d.ts"
|
48
|
+
],
|
49
|
+
"scripts": {
|
50
|
+
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
|
51
|
+
"prep": "../../../scripts/prepare/bundle.ts"
|
52
|
+
},
|
53
|
+
"dependencies": {
|
54
|
+
"@preact/preset-vite": "^2.5.0",
|
55
|
+
"@rollup/pluginutils": "^4.2.0",
|
56
|
+
"@storybook/builder-vite": "7.0.0-beta.16",
|
57
|
+
"@storybook/preact": "7.0.0-beta.16",
|
58
|
+
"ast-types": "^0.14.2",
|
59
|
+
"magic-string": "^0.26.1"
|
60
|
+
},
|
61
|
+
"devDependencies": {
|
62
|
+
"@types/node": "^16.0.0",
|
63
|
+
"typescript": "~4.9.3",
|
64
|
+
"vite": "^4.0.0"
|
65
|
+
},
|
66
|
+
"peerDependencies": {
|
67
|
+
"preact": ">=10",
|
68
|
+
"vite": "^3.0.0 || ^4.0.0"
|
69
|
+
},
|
70
|
+
"engines": {
|
71
|
+
"node": "^14.18 || >=16"
|
72
|
+
},
|
73
|
+
"publishConfig": {
|
74
|
+
"access": "public"
|
75
|
+
},
|
76
|
+
"bundler": {
|
77
|
+
"entries": [
|
78
|
+
"./src/index.ts",
|
79
|
+
"./src/preset.ts"
|
80
|
+
],
|
81
|
+
"platform": "node"
|
82
|
+
},
|
83
|
+
"gitHead": "7ca5d329ef50ec4cded3c6586761a25a8e79e67c"
|
84
|
+
}
|
package/preset.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
module.exports = require('./dist/preset');
|