Skip to content

Commit

Permalink
feat: add Vue 3 demo
Browse files Browse the repository at this point in the history
  • Loading branch information
vulcangz committed Apr 23, 2023
1 parent 45af172 commit 3caeb60
Show file tree
Hide file tree
Showing 30 changed files with 50,419 additions and 13,195 deletions.
31 changes: 30 additions & 1 deletion README.md
Expand Up @@ -2,8 +2,37 @@

Simple experiments to integrate web components created with Svelte in React or Vue applications.

在 React 或 Vue 2, Vue 3 应用程序中整合用 Svelte 创建的 Web 组件的简单实验。

The code was written for [this article](https://www.worldlink.com.cn/post/integrating-web-components-created-with-svelte-in-react-or-vue-apps.html).

## lerna branch(default)

To add a demo package for Vue 3, Using [lerna](https://github.com/lerna/lerna) as monorepo tool. If it is not already installed, you can install it with the following command.

```bash
# via npm
npm install -g lerna
# via yarn
yarn global add lerna
```

Then:

```bash
git clone https://github.com/vulcangz/svelte-webcomponent-in-react-vue.git
cd svelte-webcomponent-in-react-vue
npm run init
npm run build

# after that, you can test my-counter web component now
npm run react
# or
npm run vue2
# or
npm run vue3
```

## bolt branch

Adding project management with [bolt](https://github.com/boltpkg/bolt). If it is not already installed, you can install it with the following command.
Expand All @@ -15,7 +44,7 @@ yarn global add bolt
Then:

```bash
git clone https://github.com/vulcangz/svelte-webcomponent-in-react-vue.git
git clone https://github.com/vulcangz/svelte-webcomponent-in-react-vue.git -b bolt
cd svelte-webcomponent-in-react-vue
bolt install
bolt svelte
Expand Down
20 changes: 20 additions & 0 deletions lerna-debug.log
@@ -0,0 +1,20 @@
0 silly argv {
0 silly argv _: [ 'bootstrap' ],
0 silly argv lernaVersion: '6.6.1',
0 silly argv '$0': 'node_modules\\lerna\\dist\\cli.js'
0 silly argv }
1 notice cli v6.6.1
2 verbose rootPath G:\working\svelte-webcomponent-in-react-vue
3 error JSONError: Unexpected string in JSON at position 692 while parsing '{ "name": "react-with-webcomponent",' in packages\react-with-webcomponent\package.json
3 error
3 error   24 | "postcss-preset-env": "^8.3.2"
3 error   25 | }
3 error > 26 | "eslintConfig": {
3 error   | ^
3 error   27 | "extends": [
3 error   28 | "react-app",
3 error   29 | "react-app/jest"
3 error
3 error at parseJson (G:\working\svelte-webcomponent-in-react-vue\node_modules\parse-json\index.js:29:21)
3 error at parse (G:\working\svelte-webcomponent-in-react-vue\node_modules\load-json-file\index.js:15:9)
3 error at module.exports (G:\working\svelte-webcomponent-in-react-vue\node_modules\load-json-file\index.js:18:47)
Expand Down
5 changes: 5 additions & 0 deletions lerna.json
@@ -0,0 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "0.0.0"
}

0 comments on commit 3caeb60

Please sign in to comment.