Skip to content

Commit

Permalink
load runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Oct 8, 2024
1 parent 76b13b2 commit 21c6973
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 83 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
},
"scripts": {
"build": "lerna run build",
"build.core": "pnpm --filter component-library run build",
"build.react": "pnpm --filter component-library-react run build",
"build.vue": "pnpm --filter component-library-vue run build",
"changelog": "lerna-changelog",
"prettier": "lerna run prettier",
"prettier.dry-run": "lerna run prettier.dry-run",
Expand Down
20 changes: 16 additions & 4 deletions packages/example-project/component-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,25 @@
},
"./hydrate": {
"types": "./hydrate/index.d.ts",
"import": "./hydrate/index.mjs",
"require": "./hydrate/index.js",
"default": "./hydrate/index.mjs"
"import": "./hydrate/index.js",
"require": "./hydrate/index.cjs.js",
"default": "./hydrate/index.js"
},
"./components/*": {
"./loader": {
"types": "./loader/index.d.ts",
"import": "./loader/index.js",
"require": "./loader/index.js",
"default": "./loader/index.js"
},
"./components/*.js": {
"types": "./dist/types/components/*.d.ts",
"import": "./components/*.js"
},
"./components": {
"types": "./dist/types/components.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs.js",
"default": "./dist/index.js"
}
},
"files": [
Expand Down
3 changes: 3 additions & 0 deletions packages/example-project/component-library/stencil.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ export const config: Config = {
hydrateModule: 'component-library/hydrate'
}),
vueOutputTarget({
includeImportCustomElements: false,
includePolyfills: false,
includeDefineCustomElements: false,
componentCorePackage: 'component-library',
hydrateModule: 'component-library/hydrate',
proxiesFile: '../component-library-vue/src/index.ts',
Expand Down
6 changes: 3 additions & 3 deletions packages/example-project/nuxt-app/components/Input.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script>
import { ref } from 'vue';
import { defineComponent, ref } from 'vue';
import { MyInput } from 'component-library-vue';
export default {
export default defineComponent({
name: 'Input',
components: {
MyInput,
Expand All @@ -28,7 +28,7 @@ export default {
handleChange,
};
},
};
});
</script>

<style scoped>
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-output-target/src/generate-vue-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const createComponentDefinition =
(importTypes: string, outputTarget: OutputTargetVue) =>
(cmpMeta: Pick<ComponentCompilerMeta, 'properties' | 'tagName' | 'methods' | 'events'>) => {
const tagNameAsPascal = dashToPascalCase(cmpMeta.tagName);
const importAs = outputTarget.includeDefineCustomElements ? 'define' + tagNameAsPascal : 'undefined';
const importAs = outputTarget.includeImportCustomElements ? 'define' + tagNameAsPascal : 'undefined';

let props: string[] = [];
let propMap: Record<string, [string, string | undefined]> = {};
Expand Down
109 changes: 34 additions & 75 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 21c6973

Please sign in to comment.