Skip to content

Commit

Permalink
feat: change vanilla-jsoneditor from peerDependency to dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
cloydlau committed Oct 9, 2023
1 parent bff6f1b commit bce9b4d
Show file tree
Hide file tree
Showing 6 changed files with 304 additions and 305 deletions.
30 changes: 20 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,28 @@

## Install

### Peer Dependencies
### Dependencies

- vue
- vanilla-jsoneditor: Standalone bundle provided by [svelte-jsoneditor](https://github.com/josdejong/svelte-jsoneditor) (successor to [jsoneditor](https://github.com/josdejong/jsoneditor))
- ~~@vue/composition-api~~: Only for Vue 2.6 or earlier
As of v0.11, it's no longer necessary to explicitly install [vanilla-jsoneditor](https://github.com/josdejong/svelte-jsoneditor).

If you want to specify dependency versions:

```json
// package.json
{
"overrides": {
"vanilla-jsoneditor": "x.x.x",
"vue-demi": "x.x.x"
}
}
```

<br>

### Vue 3

```shell
npm i json-editor-vue vanilla-jsoneditor
npm i json-editor-vue
```

#### Local Registration
Expand Down Expand Up @@ -171,7 +181,7 @@ createApp()
### Vue 2.7

```shell
npm i json-editor-vue vanilla-jsoneditor
npm i json-editor-vue
```

#### Local Registration
Expand Down Expand Up @@ -286,7 +296,7 @@ Vue.use(JsonEditorVue, {
### Vue 2.6 or Earlier

```shell
npm i json-editor-vue vanilla-jsoneditor @vue/composition-api
npm i json-editor-vue @vue/composition-api
```

#### Local Registration
Expand Down Expand Up @@ -423,7 +433,7 @@ Vue.use(JsonEditorVue, {
### Nuxt 3

```shell
npm i json-editor-vue vanilla-jsoneditor
npm i json-editor-vue
```

#### Local Registration
Expand Down Expand Up @@ -510,7 +520,7 @@ const value = ref()
### Nuxt 2 + Vue 2.7

```shell
npm i json-editor-vue vanilla-jsoneditor
npm i json-editor-vue
```

#### Local Registration
Expand Down Expand Up @@ -611,7 +621,7 @@ const value = ref()
### Nuxt 2 + Vue 2.6 or Earlier

```shell
npm i json-editor-vue vanilla-jsoneditor @vue/composition-api
npm i json-editor-vue @vue/composition-api
```

#### Local Registration
Expand Down
32 changes: 20 additions & 12 deletions docs/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,33 @@
- Vue 2.6/2.7/3 一体通用
- 支持 SSR (Nuxt 2/3 一体通用)
- 支持 Vite,Vue CLI,webpack,CDN...
- 支持微前端 ([wujie](https://github.com/Tencent/wujie)[qiankun](https://github.com/umijs/qiankun)[single-spa](https://github.com/single-spa/single-spa)……)
- 支持微前端 ([wujie](https://github.com/Tencent/wujie)[qiankun](https://github.com/umijs/qiankun)[single-spa](https://github.com/single-spa/single-spa)...)
- 局部注册并传参,或全局注册并传参 ([vue-global-config](https://github.com/cloydlau/vue-global-config) 提供技术支持)

<br>

## 安装

### 外置依赖
### 依赖

- vue
- vanilla-jsoneditor:[svelte-jsoneditor](https://github.com/josdejong/svelte-jsoneditor) ([jsoneditor](https://github.com/josdejong/jsoneditor) 的继任者) 提供的原生 JS 版本
- ~~@vue/composition-api~~:仅 Vue 2.6 或更早版本需要
从 v0.11 开始,不再需要显式安装 [vanilla-jsoneditor](https://github.com/josdejong/svelte-jsoneditor)

<br>
如果需要指定依赖的版本:

```json
// package.json
{
"overrides": {
"vanilla-jsoneditor": "x.x.x",
"vue-demi": "x.x.x"
}
}
```

### Vue 3

```shell
npm i json-editor-vue vanilla-jsoneditor
npm i json-editor-vue
```

#### 局部注册
Expand Down Expand Up @@ -171,7 +179,7 @@ createApp()
### Vue 2.7

```shell
npm i json-editor-vue vanilla-jsoneditor
npm i json-editor-vue
```

#### 局部注册
Expand Down Expand Up @@ -286,7 +294,7 @@ Vue.use(JsonEditorVue, {
### Vue 2.6 或更早版本

```shell
npm i json-editor-vue vanilla-jsoneditor @vue/composition-api
npm i json-editor-vue @vue/composition-api
```

#### 局部注册
Expand Down Expand Up @@ -423,7 +431,7 @@ Vue.use(JsonEditorVue, {
### Nuxt 3

```shell
npm i json-editor-vue vanilla-jsoneditor
npm i json-editor-vue
```

#### 局部注册
Expand Down Expand Up @@ -510,7 +518,7 @@ const value = ref()
### Nuxt 2 + Vue 2.7

```shell
npm i json-editor-vue vanilla-jsoneditor
npm i json-editor-vue
```

#### 局部注册
Expand Down Expand Up @@ -611,7 +619,7 @@ const value = ref()
### Nuxt 2 + Vue 2.6 或更早版本

```shell
npm i json-editor-vue vanilla-jsoneditor @vue/composition-api
npm i json-editor-vue @vue/composition-api
```

#### 局部注册
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"docs",
"nuxt.ts"
],
"engines": { "npm": ">=8.3.0" },
"scripts": {
"dev": "esno ./scripts/dev.mts",
"doc": "vitepress dev --open /README",
Expand All @@ -60,7 +61,6 @@
},
"peerDependencies": {
"@vue/composition-api": ">=1",
"vanilla-jsoneditor": ">=0",
"vue": "2||3"
},
"peerDependenciesMeta": {
Expand All @@ -69,7 +69,8 @@
}
},
"dependencies": {
"vue-demi": "latest"
"vanilla-jsoneditor": "^0.18.8",
"vue-demi": "^0.14.6"
},
"devDependencies": {
"@antfu/eslint-config": "~0.42.1",
Expand Down Expand Up @@ -105,7 +106,6 @@
"typescript": "latest",
"unplugin-auto-import": "latest",
"unplugin-vue-components": "latest",
"vanilla-jsoneditor": "latest",
"vite": "latest",
"vite-plugin-dts": "latest",
"vitepress": "latest",
Expand Down
Loading

0 comments on commit bce9b4d

Please sign in to comment.