From 21690ddd1c1f50bf8c6c6efc6c2c96ba23b04fd7 Mon Sep 17 00:00:00 2001 From: Bryan Thomas <49354825+bryanjtc@users.noreply.github.com> Date: Thu, 13 Oct 2022 20:29:22 -0500 Subject: [PATCH] chore: Migrated addons/storysource to tsup --- code/addons/storysource/package.json | 32 ++++++++++++++++++++++++---- code/addons/storysource/register.js | 2 +- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index b7ff5b3b546..0dba475240f 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -21,9 +21,27 @@ "url": "https://opencollective.com/storybook" }, "license": "MIT", - "main": "dist/cjs/index.js", - "module": "dist/esm/index.js", - "types": "dist/types/index.d.ts", + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + }, + "./preset": { + "require": "./dist/preset.js", + "import": "./dist/preset.mjs", + "types": "./dist/preset.d.ts" + }, + "./register": { + "require": "./dist/register.js", + "import": "./dist/register.mjs", + "types": "./dist/register.d.ts" + }, + "./package.json": "./package.json" + }, + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", "files": [ "dist/**/*", "README.md", @@ -32,7 +50,7 @@ ], "scripts": { "check": "../../../scripts/node_modules/.bin/tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.37", @@ -66,6 +84,12 @@ "publishConfig": { "access": "public" }, + "bundler": { + "entries": [ + "./src/index.ts", + "./src/manager.tsx" + ] + }, "gitHead": "82667a655108283aafc828427f00bb3590a334e5", "storybook": { "displayName": "Storysource", diff --git a/code/addons/storysource/register.js b/code/addons/storysource/register.js index 4e287d25b15..8a2eae4ffce 100644 --- a/code/addons/storysource/register.js +++ b/code/addons/storysource/register.js @@ -1 +1 @@ -import './dist/esm/manager'; +import './dist/manager';