Skip to content

Commit

Permalink
fix(vue): import JSX from default component library export (#574)
Browse files Browse the repository at this point in the history
* fix(vue): import JSX from default component library export

* prettier

* update deps
  • Loading branch information
christian-bromann authored Dec 19, 2024
1 parent 3310969 commit 2526b82
Show file tree
Hide file tree
Showing 10 changed files with 1,482 additions and 1,823 deletions.
2 changes: 1 addition & 1 deletion example-project/component-library-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.1",
"@vitejs/plugin-react": "^4.3.2",
"@wdio/cli": "^9.1.5",
"@wdio/cli": "^9.4.5",
"@wdio/globals": "^9.1.5",
"@wdio/mocha-framework": "^9.1.3",
"@wdio/spec-reporter": "^9.1.3",
Expand Down
2 changes: 1 addition & 1 deletion example-project/component-library-vue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* auto-generated vue proxies */
import { defineContainer, defineStencilSSRComponent } from '@stencil/vue-output-target/runtime';

import type { JSX } from 'component-library/components';
import type { JSX } from 'component-library';

import { defineCustomElement as defineMyButton } from 'component-library/components/my-button.js';
import { defineCustomElement as defineMyCheckbox } from 'component-library/components/my-checkbox.js';
Expand Down
2 changes: 1 addition & 1 deletion example-project/next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@wdio/cli": "^9.1.5",
"@wdio/cli": "^9.4.5",
"@wdio/globals": "^9.1.5",
"@wdio/local-runner": "^9.1.5",
"@wdio/mocha-framework": "^9.1.3",
Expand Down
2 changes: 1 addition & 1 deletion example-project/nuxt-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"vue": "^3.4.38"
},
"devDependencies": {
"@wdio/cli": "^9.1.3",
"@wdio/cli": "^9.4.5",
"@wdio/globals": "^9.1.3",
"@wdio/local-runner": "^9.1.3",
"@wdio/mocha-framework": "^9.1.3",
Expand Down
2 changes: 1 addition & 1 deletion example-project/vue-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.1.4",
"@wdio/cli": "^9.2.1",
"@wdio/cli": "^9.4.5",
"@wdio/globals": "^9.2.1",
"@wdio/mocha-framework": "^9.1.3",
"@wdio/spec-reporter": "^9.1.3",
Expand Down
3 changes: 1 addition & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
"ts-dedent": "^2.2.0",
"typescript": "^5.4.4",
"vite": "^5.0.0",
"vite-plugin-dts": "^3.8.1",
"vitest": "^2.1.3"
"vite-plugin-dts": "^3.8.1"
},
"gitHead": "a3588e905186a0e86e7f88418fd5b2f9531b55e0",
"dependencies": {
Expand Down
1 change: 0 additions & 1 deletion packages/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"@types/node": "^18.0.0",
"@rollup/plugin-typescript": "^12.1.0",
"@vue/shared": "^3.5.12",
"vitest": "^2.0.5",
"rimraf": "^5.0.0",
"rollup": "^4.14.3",
"typescript": "~5.7.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/output-vue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ import type { JSX } from 'component-library';
/* auto-generated vue proxies */
import { defineContainer } from '@stencil/vue-output-target/runtime';
import type { JSX } from 'component-library/components';
import type { JSX } from 'component-library';
Expand Down
7 changes: 4 additions & 3 deletions packages/vue/src/output-vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ import { ${importKeys.join(', ')} } from '@stencil/vue-output-target/runtime';\n

const generateTypeImports = () => {
if (outputTarget.componentCorePackage !== undefined) {
const dirPath = outputTarget.includeImportCustomElements
? `/${outputTarget.customElementsDir || 'components'}`
: '';
const dirPath =
outputTarget.includeImportCustomElements && outputTarget.customElementsDir
? `/${outputTarget.customElementsDir}`
: '';
return `import type { ${IMPORT_TYPES} } from '${normalizePath(outputTarget.componentCorePackage)}${dirPath}';\n`;
}

Expand Down
Loading

0 comments on commit 2526b82

Please sign in to comment.