From 2ed75f1282572ebdc0b4b7fc7fda714e756136f8 Mon Sep 17 00:00:00 2001 From: Paul Christ Date: Fri, 13 Sep 2024 12:41:35 +0200 Subject: [PATCH] fix: repair build and package export --- .eslintrc.cjs | 11 +++++++---- package-lock.json | 7 +++++-- package.json | 18 ++++++++++++------ src/components/DOTGraph/DOTGraph.vue | 2 +- tsconfig.app.json | 3 +-- tsconfig.json | 6 +++++- tsconfig.node.json | 3 +++ tsconfig.vitest.json | 3 +++ vite.config.ts | 2 +- 9 files changed, 38 insertions(+), 17 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index b7631b0..1f39e77 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,9 +1,9 @@ /* eslint-env node */ -require('@rushstack/eslint-patch/modern-module-resolution') +require("@rushstack/eslint-patch/modern-module-resolution"); module.exports = { root: true, - 'extends': [ + extends: [ "plugin:vue/vue3-essential", "eslint:recommended", "@vue/eslint-config-typescript", @@ -11,6 +11,9 @@ module.exports = { "plugin:storybook/recommended" ], parserOptions: { - ecmaVersion: 'latest' + ecmaVersion: "latest", + ecmaFeatures: { + jsx: false + } } -} +}; diff --git a/package-lock.json b/package-lock.json index d9d049b..1e0ef4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "carpet-component-library", - "version": "0.0.2", + "version": "0.0.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "carpet-component-library", - "version": "0.0.2", + "version": "0.0.4", "dependencies": { "d3": "^7.9.0", "d3-graphviz": "^5.6.0", @@ -51,6 +51,9 @@ }, "engines": { "node": "22.8.0" + }, + "peerDependencies": { + "vue": "^3.4.29" } }, "node_modules/@adobe/css-tools": { diff --git a/package.json b/package.json index 6531e99..28ca76e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "carpet-component-library", - "version": "0.0.4", + "version": "0.0.5", "author": "Paul Christ", "files": [ "dist", @@ -13,16 +13,22 @@ "component", "library" ], - "main": "./dist/carpet-component-library.umd.cjs", - "module": "./dist/carpet-component-library.js", + "type": "module", + "main": "dist/carpet-component-library.umd.cjs", "exports": { ".": { - "import": "./dist/carpet-component-library.js", - "require": "./dist/carpet-component-library.umd.cjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/carpet-component-library.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/carpet-component-library.umd.cjs" + } }, "./style.css": "./dist/style.css" }, - "types": "./dist/index.d.ts", + "types": "dist/index.d.ts", "engines": { "node": "22.8.0" }, diff --git a/src/components/DOTGraph/DOTGraph.vue b/src/components/DOTGraph/DOTGraph.vue index f6fc396..af06f11 100644 --- a/src/components/DOTGraph/DOTGraph.vue +++ b/src/components/DOTGraph/DOTGraph.vue @@ -45,7 +45,7 @@ const renderGraph = (description: string) => { const renderIfGraph = () => { let dotDescription = ""; if (component.validate()) { - dotDescription = getDOTDescription(); + dotDescription = (getDOTDescription()) as string; } renderGraph(dotDescription); }; diff --git a/tsconfig.app.json b/tsconfig.app.json index d8620a5..c9473bd 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -5,11 +5,10 @@ "compilerOptions": { "composite": true, "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", - - "baseUrl": ".", "paths": { "@/*": ["./src/*"] }, + "baseUrl": ".", "outDir": "dist", "declaration": true } diff --git a/tsconfig.json b/tsconfig.json index 119f598..5a37760 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,8 +12,12 @@ } ], "compilerOptions": { + "composite": true, "outDir": "dist", - "declaration": true + "declaration": true, + "paths": { + "@/*": ["./src/*"] + } }, "exclude": ["src/App.vue", "src/main.ts"] } diff --git a/tsconfig.node.json b/tsconfig.node.json index 6e30d97..96aef6e 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -11,6 +11,9 @@ "compilerOptions": { "composite": true, "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "paths": { + "@/*": ["./src/*"] + }, "module": "ESNext", "moduleResolution": "Bundler", diff --git a/tsconfig.vitest.json b/tsconfig.vitest.json index 571995d..91bc687 100644 --- a/tsconfig.vitest.json +++ b/tsconfig.vitest.json @@ -4,6 +4,9 @@ "compilerOptions": { "composite": true, "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo", + "paths": { + "@/*": ["./src/*"] + }, "lib": [], "types": ["node", "jsdom"] diff --git a/vite.config.ts b/vite.config.ts index 2c6e14a..70737b4 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -8,7 +8,7 @@ import dts from "vite-plugin-dts"; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue(), vueDevTools(), dts({ insertTypesEntry: true })], + plugins: [vue(), vueDevTools(), dts({ tsconfigPath: "./tsconfig.app.json", rollupTypes: true })], resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url))