storybook-web-components-rsbuild 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Rspack Contrib
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # storybook-web-components-rsbuild
2
+
3
+ Check out [rspack-contrib/storybook-rsbuild](https://github.com/rspack-contrib/storybook-rsbuild) for documentation.
@@ -0,0 +1,27 @@
1
+ import { BuilderOptions, StorybookConfigRsbuild, TypescriptOptions as TypescriptOptions$1 } from 'storybook-builder-rsbuild';
2
+ import { StorybookConfig as StorybookConfig$1, TypescriptOptions } from 'storybook/internal/types';
3
+
4
+ type FrameworkName = 'storybook-web-components-rsbuild';
5
+ type BuilderName = 'storybook-builder-rsbuild';
6
+ type FrameworkOptions = {
7
+ builder?: BuilderOptions;
8
+ };
9
+ type StorybookConfigFramework = {
10
+ framework: FrameworkName | {
11
+ name: FrameworkName;
12
+ options: FrameworkOptions;
13
+ };
14
+ core?: StorybookConfig$1['core'] & {
15
+ builder?: BuilderName | {
16
+ name: BuilderName;
17
+ options: BuilderOptions;
18
+ };
19
+ };
20
+ typescript?: Partial<TypescriptOptions & TypescriptOptions$1>;
21
+ };
22
+ /**
23
+ * The interface for Storybook configuration in `main.ts` files.
24
+ */
25
+ type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigRsbuild | keyof StorybookConfigFramework> & StorybookConfigRsbuild & StorybookConfigFramework;
26
+
27
+ export { FrameworkOptions, StorybookConfig };
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/index.ts
17
+ var src_exports = {};
18
+ module.exports = __toCommonJS(src_exports);
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,8 @@
1
+ import { PresetProperty } from 'storybook/internal/types';
2
+ import { StorybookConfig } from './index.js';
3
+ import 'storybook-builder-rsbuild';
4
+
5
+ declare const core: PresetProperty<'core'>;
6
+ declare const rsbuildFinal: StorybookConfig['rsbuildFinal'];
7
+
8
+ export { core, rsbuildFinal };
package/dist/preset.js ADDED
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/preset.ts
21
+ var preset_exports = {};
22
+ __export(preset_exports, {
23
+ core: () => core,
24
+ rsbuildFinal: () => rsbuildFinal
25
+ });
26
+ module.exports = __toCommonJS(preset_exports);
27
+ var import_node_path = require("path");
28
+ var getAbsolutePath = (input) => (0, import_node_path.dirname)(require.resolve((0, import_node_path.join)(input, "package.json")));
29
+ var core = async (config, options) => {
30
+ const framework = await options.presets.apply("framework");
31
+ return {
32
+ builder: {
33
+ name: getAbsolutePath("storybook-builder-rsbuild"),
34
+ options: typeof framework === "string" ? {} : framework.options.builder || {}
35
+ },
36
+ renderer: getAbsolutePath("@storybook/web-components")
37
+ };
38
+ };
39
+ var rsbuildFinal = (config, options) => {
40
+ delete config.html;
41
+ return config;
42
+ };
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ core,
46
+ rsbuildFinal
47
+ });
package/package.json ADDED
@@ -0,0 +1,85 @@
1
+ {
2
+ "name": "storybook-web-components-rsbuild",
3
+ "version": "0.1.7",
4
+ "description": "Storybook for web component and Rsbuild: Develop React Component in isolation with Hot Reloading.",
5
+ "keywords": [
6
+ "storybook",
7
+ "rsbuild",
8
+ "rspack",
9
+ "web component",
10
+ "lit",
11
+ "lit2",
12
+ "lit3"
13
+ ],
14
+ "homepage": "https://storybook-rsbuild.netlify.app",
15
+ "bugs": {
16
+ "url": "https://github.com/rspack-contrib/storybook-rsbuild/issues"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/rspack-contrib/storybook-rsbuild",
21
+ "directory": "packages/framework-web-components"
22
+ },
23
+ "license": "MIT",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "node": "./dist/index.js",
28
+ "require": "./dist/index.js",
29
+ "import": "./dist/index.mjs"
30
+ },
31
+ "./preset": {
32
+ "types": "./dist/preset.d.ts",
33
+ "require": "./dist/preset.js"
34
+ },
35
+ "./react-docs": {
36
+ "types": "./dist/react-docs.d.ts",
37
+ "require": "./dist/react-docs.js"
38
+ },
39
+ "./package.json": "./package.json"
40
+ },
41
+ "main": "dist/index.js",
42
+ "module": "dist/index.mjs",
43
+ "types": "dist/index.d.ts",
44
+ "files": [
45
+ "dist/**/*",
46
+ "README.md",
47
+ "*.js",
48
+ "*.d.ts",
49
+ "!src/**/*"
50
+ ],
51
+ "dependencies": {
52
+ "@storybook/web-components": "^8.2.1",
53
+ "storybook-builder-rsbuild": "0.1.7"
54
+ },
55
+ "devDependencies": {
56
+ "@rsbuild/core": "^1.1.12",
57
+ "@types/node": "^18.0.0",
58
+ "lit": "^3.2.1",
59
+ "storybook": "8.5.0-alpha.22",
60
+ "typescript": "^5.7.2"
61
+ },
62
+ "peerDependencies": {
63
+ "@rsbuild/core": "^1.0.1",
64
+ "lit": "^2.0.0 || ^3.0.0",
65
+ "storybook": "^8.2.1"
66
+ },
67
+ "engines": {
68
+ "node": ">=18.0.0"
69
+ },
70
+ "publishConfig": {
71
+ "access": "public"
72
+ },
73
+ "bundler": {
74
+ "entries": [
75
+ "./src/index.ts",
76
+ "./src/preset.ts"
77
+ ],
78
+ "platform": "node"
79
+ },
80
+ "scripts": {
81
+ "build": "pnpm run prep --optimized",
82
+ "check": "node --loader ../../scripts/node_modules/esbuild-register/loader.js -r ../../scripts/node_modules/esbuild-register/register.js ../../scripts/prepare/check.ts",
83
+ "prep": "node --loader ../../scripts/node_modules/esbuild-register/loader.js -r ../../scripts/node_modules/esbuild-register/register.js ../../scripts/prepare/bundle.ts"
84
+ }
85
+ }
package/preset.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/preset')