From da93d25577d812f25110878f88b7e8ffc98f550c Mon Sep 17 00:00:00 2001 From: Andrew Courtice Date: Wed, 18 Aug 2021 10:17:30 +1000 Subject: [PATCH] fix: fixed package.json config for output --- core/package.json | 17 +++++++++++------ core/src/index.ts | 4 +++- extensions/action/package.json | 19 ++++++++++++------- extensions/history/package.json | 19 ++++++++++++------- extensions/lazy/package.json | 19 ++++++++++++------- extensions/reset/package.json | 19 ++++++++++++------- extensions/snapshot/package.json | 19 ++++++++++++------- extensions/storage/package.json | 19 ++++++++++++------- extensions/trace/package.json | 19 ++++++++++++------- extensions/transaction/package.json | 19 ++++++++++++------- packages/task/package.json | 19 ++++++++++++------- plugins/devtools/package.json | 19 ++++++++++++------- plugins/ssr/package.json | 19 ++++++++++++------- tsup.config.ts | 1 + 14 files changed, 147 insertions(+), 84 deletions(-) diff --git a/core/package.json b/core/package.json index 848bad98..528ab856 100644 --- a/core/package.json +++ b/core/package.json @@ -6,13 +6,18 @@ "author": "Andrew Courtice ", "description": "Simple, unopinionated, lightweight and extensible state management for Vue 3", "homepage": "https://harlemjs.com", - "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "exports": "./dist/index.js", - "unpkg": "./dist/index.global.js", - "types": "./dist/index.d.ts", "source": "src/index.ts", + "main": "dist/index.js", + "module": "dist/esm/index.js", + "unpkg": "dist/iife/index.js", + "jsdelivr": "dist/iife/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/index.js" + } + }, "keywords": [ "vue", "state", diff --git a/core/src/index.ts b/core/src/index.ts index 3f382230..ca7c9034 100644 --- a/core/src/index.ts +++ b/core/src/index.ts @@ -30,7 +30,9 @@ import type { StoreOptions, } from './types'; -export { EVENTS } from './constants'; +export { + EVENTS, +} from './constants'; export * from './types'; diff --git a/extensions/action/package.json b/extensions/action/package.json index b6fe6349..7f850e9b 100644 --- a/extensions/action/package.json +++ b/extensions/action/package.json @@ -6,13 +6,18 @@ "author": "Andrew Courtice ", "description": "The official action extension for Harlem", "homepage": "https://harlemjs.com", - "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "exports": "./dist/index.js", - "unpkg": "./dist/index.global.js", - "types": "./dist/index.d.ts", - "source": "./src/index.ts", + "source": "src/index.ts", + "main": "dist/index.js", + "module": "dist/esm/index.js", + "unpkg": "dist/iife/index.js", + "jsdelivr": "dist/iife/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/index.js" + } + }, "keywords": [ "vue", "state", diff --git a/extensions/history/package.json b/extensions/history/package.json index 10a0d451..7e3c4416 100644 --- a/extensions/history/package.json +++ b/extensions/history/package.json @@ -6,13 +6,18 @@ "author": "Andrew Courtice ", "description": "The official history extension for Harlem", "homepage": "https://harlemjs.com", - "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "exports": "./dist/index.js", - "unpkg": "./dist/index.global.js", - "types": "./dist/index.d.ts", - "source": "./src/index.ts", + "source": "src/index.ts", + "main": "dist/index.js", + "module": "dist/esm/index.js", + "unpkg": "dist/iife/index.js", + "jsdelivr": "dist/iife/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/index.js" + } + }, "keywords": [ "vue", "state", diff --git a/extensions/lazy/package.json b/extensions/lazy/package.json index 1e070291..0b82946b 100644 --- a/extensions/lazy/package.json +++ b/extensions/lazy/package.json @@ -6,13 +6,18 @@ "author": "Andrew Courtice ", "description": "The official lazy extension for Harlem", "homepage": "https://harlemjs.com", - "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "exports": "./dist/index.js", - "unpkg": "./dist/index.global.js", - "types": "./dist/index.d.ts", - "source": "./src/index.ts", + "source": "src/index.ts", + "main": "dist/index.js", + "module": "dist/esm/index.js", + "unpkg": "dist/iife/index.js", + "jsdelivr": "dist/iife/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/index.js" + } + }, "keywords": [ "vue", "state", diff --git a/extensions/reset/package.json b/extensions/reset/package.json index 5251ce6f..52804339 100644 --- a/extensions/reset/package.json +++ b/extensions/reset/package.json @@ -6,13 +6,18 @@ "author": "Andrew Courtice ", "description": "The official reset extension for Harlem", "homepage": "https://harlemjs.com", - "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "exports": "./dist/index.js", - "unpkg": "./dist/index.global.js", - "types": "./dist/index.d.ts", - "source": "./src/index.ts", + "source": "src/index.ts", + "main": "dist/index.js", + "module": "dist/esm/index.js", + "unpkg": "dist/iife/index.js", + "jsdelivr": "dist/iife/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/index.js" + } + }, "keywords": [ "vue", "state", diff --git a/extensions/snapshot/package.json b/extensions/snapshot/package.json index 94a899d5..38429c75 100644 --- a/extensions/snapshot/package.json +++ b/extensions/snapshot/package.json @@ -6,13 +6,18 @@ "author": "Andrew Courtice ", "description": "The official snapshot extension for Harlem", "homepage": "https://harlemjs.com", - "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "exports": "./dist/index.js", - "unpkg": "./dist/index.global.js", - "types": "./dist/index.d.ts", - "source": "./src/index.ts", + "source": "src/index.ts", + "main": "dist/index.js", + "module": "dist/esm/index.js", + "unpkg": "dist/iife/index.js", + "jsdelivr": "dist/iife/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/index.js" + } + }, "keywords": [ "vue", "state", diff --git a/extensions/storage/package.json b/extensions/storage/package.json index e25e9f61..4a6607da 100644 --- a/extensions/storage/package.json +++ b/extensions/storage/package.json @@ -6,13 +6,18 @@ "author": "Andrew Courtice ", "description": "The official storage extension for Harlem", "homepage": "https://harlemjs.com", - "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "exports": "./dist/index.js", - "unpkg": "./dist/index.global.js", - "types": "./dist/index.d.ts", - "source": "./src/index.ts", + "source": "src/index.ts", + "main": "dist/index.js", + "module": "dist/esm/index.js", + "unpkg": "dist/iife/index.js", + "jsdelivr": "dist/iife/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/index.js" + } + }, "keywords": [ "vue", "state", diff --git a/extensions/trace/package.json b/extensions/trace/package.json index 88b5a804..ffbb8494 100644 --- a/extensions/trace/package.json +++ b/extensions/trace/package.json @@ -6,13 +6,18 @@ "author": "Andrew Courtice ", "description": "The official trace extension for Harlem", "homepage": "https://harlemjs.com", - "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "exports": "./dist/index.js", - "unpkg": "./dist/index.global.js", - "types": "./dist/index.d.ts", - "source": "./src/index.ts", + "source": "src/index.ts", + "main": "dist/index.js", + "module": "dist/esm/index.js", + "unpkg": "dist/iife/index.js", + "jsdelivr": "dist/iife/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/index.js" + } + }, "keywords": [ "vue", "state", diff --git a/extensions/transaction/package.json b/extensions/transaction/package.json index 822253f9..b2d6dc06 100644 --- a/extensions/transaction/package.json +++ b/extensions/transaction/package.json @@ -6,13 +6,18 @@ "author": "Andrew Courtice ", "description": "The official transaction extension for Harlem", "homepage": "https://harlemjs.com", - "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "exports": "./dist/index.js", - "unpkg": "./dist/index.global.js", - "types": "./dist/index.d.ts", - "source": "./src/index.ts", + "source": "src/index.ts", + "main": "dist/index.js", + "module": "dist/esm/index.js", + "unpkg": "dist/iife/index.js", + "jsdelivr": "dist/iife/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/index.js" + } + }, "keywords": [ "vue", "state", diff --git a/packages/task/package.json b/packages/task/package.json index 08ebb700..d711985a 100644 --- a/packages/task/package.json +++ b/packages/task/package.json @@ -6,13 +6,18 @@ "author": "Andrew Courtice ", "description": "Harlem task package", "homepage": "https://harlemjs.com", - "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "exports": "./dist/index.js", - "unpkg": "./dist/index.global.js", - "types": "./dist/index.d.ts", - "source": "./src/index.ts", + "source": "src/index.ts", + "main": "dist/index.js", + "module": "dist/esm/index.js", + "unpkg": "dist/iife/index.js", + "jsdelivr": "dist/iife/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/index.js" + } + }, "keywords": [ "vue", "state", diff --git a/plugins/devtools/package.json b/plugins/devtools/package.json index 3ec5e4c8..752b981a 100644 --- a/plugins/devtools/package.json +++ b/plugins/devtools/package.json @@ -6,13 +6,18 @@ "author": "Andrew Courtice ", "description": "The official Vue devtools plugin for Harlem", "homepage": "https://harlemjs.com", - "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "exports": "./dist/index.js", - "unpkg": "./dist/index.global.js", - "types": "./dist/index.d.ts", - "source": "./src/index.ts", + "source": "src/index.ts", + "main": "dist/index.js", + "module": "dist/esm/index.js", + "unpkg": "dist/iife/index.js", + "jsdelivr": "dist/iife/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/index.js" + } + }, "keywords": [ "vue", "state", diff --git a/plugins/ssr/package.json b/plugins/ssr/package.json index 09c2208b..f315210d 100644 --- a/plugins/ssr/package.json +++ b/plugins/ssr/package.json @@ -6,13 +6,18 @@ "author": "Andrew Courtice ", "description": "The official server-side rendering plugin for Harlem", "homepage": "https://harlemjs.com", - "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "exports": "./dist/index.js", - "unpkg": "./dist/index.global.js", - "types": "./dist/index.d.ts", - "source": "./src/index.ts", + "source": "src/index.ts", + "main": "dist/index.js", + "module": "dist/esm/index.js", + "unpkg": "dist/iife/index.js", + "jsdelivr": "dist/iife/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/index.js" + } + }, "keywords": [ "vue", "state", diff --git a/tsup.config.ts b/tsup.config.ts index 1c9988ed..f754945d 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -6,6 +6,7 @@ export default { clean: true, dts: true, sourcemap: true, + legacyOutput: true, target: 'es2020', format: [ 'esm',