Skip to content

Commit 6ba1937

Browse files
authored
fix: make typescript a peer dependency (#563)
1 parent 305ef79 commit 6ba1937

File tree

33 files changed

+6198
-5625
lines changed

33 files changed

+6198
-5625
lines changed

.eslintrc.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
module.exports = {
22
extends: [
33
'@nuxtjs/eslint-config-typescript'
4-
]
4+
],
5+
rules: {
6+
'vue/multi-word-component-names': 'off'
7+
}
58
}

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
# Nuxt Typescript
1313

14+
Build and runtime support for Typescript in Nuxt 2.
15+
1416
Documentation: https://typescript.nuxtjs.org
1517

1618
## 📑 License

docs/content/en/guide/runtime.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ All you need to do is update your **package.json** file:
4747
},
4848
"dependencies": {
4949
"@nuxt/typescript-runtime": "latest",
50-
"nuxt": "latest"
50+
"nuxt": "2.x"
5151
},
5252
"devDependencies": {
53-
"@nuxt/types": "latest",
53+
"@nuxt/types": "2.x",
5454
"@nuxt/typescript-build": "latest"
5555
}
5656
```

docs/content/en/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: ''
44
menuTitle: Introduction
55
fullscreen: true
66
category: ''
7-
description: TypeScript Support for Nuxt.js
7+
description: TypeScript Support for Nuxt 2
88
heroImage: /assets/logo.svg
99
actionText: Get Started →
1010
actionLink: /guide/
@@ -19,7 +19,7 @@ footer: MIT Licensed | Copyright © 2019-present Nuxt.js Team
1919
# Nuxt TypeScript
2020

2121
<p class="text-xl">
22-
TypeScript Support for Nuxt.js
22+
TypeScript Support for Nuxt 2
2323
</p>
2424
<a href="/guide/introduction" class="rounded bg-primary-100 dark:bg-primary-900 text-primary-500 text-lg font-medium px-3 py-1 inline-block">
2525
Get Started →

docs/content/es/guide/runtime.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ Todo lo que necesitas es actualizar tu archivo **package.json**:
4747
},
4848
"dependencies": {
4949
"@nuxt/typescript-runtime": "latest",
50-
"nuxt": "latest",
50+
"nuxt": "2.x",
5151
},
5252
"devDependencies": {
53-
"@nuxt/types": "latest",
53+
"@nuxt/types": "2.x",
5454
"@nuxt/typescript-build": "latest"
5555
}
5656
```

docs/content/es/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: ''
44
menuTitle: Introduction
55
fullscreen: true
66
category: ''
7-
description: 'Soporte de Typescript para Nuxt.js'
7+
description: 'Soporte de Typescript para Nuxt 2'
88
heroImage: /assets/logo.svg
99
actionText: Comenzamos →
1010
actionLink: /es/guide/
@@ -18,7 +18,7 @@ footer: MIT Licensed | Copyright © 2019-present Nuxt.js Team
1818
# Nuxt TypeScript
1919

2020
<p class="text-xl">
21-
Soporte de Typescript para Nuxt.js
21+
Soporte de Typescript para Nuxt 2
2222
</p>
2323
<a href="/guide/introduction" class="rounded bg-primary-100 dark:bg-primary-900 text-primary-500 text-lg font-medium px-3 py-1 inline-block">
2424
Comenzamos →

docs/content/ja/guide/runtime.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ npm install @nuxt/typescript-runtime
4747
},
4848
"dependencies": {
4949
"@nuxt/typescript-runtime": "latest",
50-
"nuxt": "latest"
50+
"nuxt": "2.x"
5151
},
5252
"devDependencies": {
53-
"@nuxt/types": "latest",
53+
"@nuxt/types": "2.x",
5454
"@nuxt/typescript-build": "latest"
5555
}
5656
```

docs/content/ja/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: ''
44
menuTitle: Introduction
55
fullscreen: true
66
category: ''
7-
description: 'Nuxt.js 向け TypeScript サポート'
7+
description: 'Nuxt 2 向け TypeScript サポート'
88
footer: MIT Licensed | Copyright © 2019-present Nuxt.js Team
99
---
1010

@@ -15,7 +15,7 @@ footer: MIT Licensed | Copyright © 2019-present Nuxt.js Team
1515
# Nuxt TypeScript
1616

1717
<p class="text-xl">
18-
Nuxt.js 向け TypeScript サポート
18+
Nuxt 2 向け TypeScript サポート
1919
</p>
2020
<a href="/ja/guide/introduction" class="rounded bg-primary-100 dark:bg-primary-900 text-primary-500 text-lg font-medium px-3 py-1 inline-block">
2121
はじめる →

docs/content/pt/guide/runtime.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ Tudo que você precisa fazer é atualizar o seu arquivo **package.json**:
4747
},
4848
"dependencies": {
4949
"@nuxt/typescript-runtime": "latest",
50-
"nuxt": "latest"
50+
"nuxt": "2.x"
5151
},
5252
"devDependencies": {
53-
"@nuxt/types": "latest",
53+
"@nuxt/types": "2.x",
5454
"@nuxt/typescript-build": "latest"
5555
}
5656
```

docs/content/pt/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: ''
44
menuTitle: Introdução
55
fullscreen: true
66
category: ''
7-
description: 'Suporte de TypeScript para Nuxt.js'
7+
description: 'Suporte de TypeScript para Nuxt 2'
88
heroImage: /assets/logo.svg
99
actionText: Introdução →
1010
actionLink: /guide/
@@ -18,7 +18,7 @@ footer: Distribuído sob a Licença MIT | Copyright © 2019-present Nuxt.js Team
1818
# Nuxt TypeScript
1919

2020
<p class="text-xl">
21-
Suporte de TypeScript para Nuxt.js
21+
Suporte de TypeScript para Nuxt 2
2222
</p>
2323
<a href="/pt/guide/introduction" class="rounded bg-primary-100 dark:bg-primary-900 text-primary-500 text-lg font-medium px-3 py-1 inline-block">
2424
Introdução →

docs/content/zh-Hans/guide/runtime.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ npm install @nuxt/typescript-runtime
4747
},
4848
"dependencies": {
4949
"@nuxt/typescript-runtime": "latest",
50-
"nuxt": "latest"
50+
"nuxt": "2.x"
5151
},
5252
"devDependencies": {
53-
"@nuxt/types": "latest",
53+
"@nuxt/types": "2.x",
5454
"@nuxt/typescript-build": "latest"
5555
}
5656
```

docs/content/zh-Hans/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: ''
44
menuTitle: Introduction
55
fullscreen: true
66
category: ''
7-
description: 'Nuxt.js 的 Typescript 支持'
7+
description: 'Nuxt 2 的 Typescript 支持'
88
footer: MIT Licensed | Copyright © 2019-present Nuxt.js Team
99
---
1010

@@ -15,7 +15,7 @@ footer: MIT Licensed | Copyright © 2019-present Nuxt.js Team
1515
# Nuxt TypeScript
1616

1717
<p class="text-xl">
18-
Nuxt.js 的 Typescript 支持
18+
Nuxt 2 的 Typescript 支持
1919
</p>
2020
<a href="/zh-Hans/guide/introduction" class="rounded bg-primary-100 dark:bg-primary-900 text-primary-500 text-lg font-medium px-3 py-1 inline-block">
2121
快速入门 →

docs/content/zh-Hant/guide/runtime.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ npm install @nuxt/typescript-runtime
4747
},
4848
"dependencies": {
4949
"@nuxt/typescript-runtime": "latest",
50-
"nuxt": "latest"
50+
"nuxt": "2.x"
5151
},
5252
"devDependencies": {
53-
"@nuxt/types": "latest",
53+
"@nuxt/types": "2.x",
5454
"@nuxt/typescript-build": "latest"
5555
}
5656
```

docs/content/zh-Hant/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: ''
44
menuTitle: Introduction
55
fullscreen: true
66
category: ''
7-
description: 'Nuxt.js 的 Typescript 支援'
7+
description: 'Nuxt 2 的 Typescript 支援'
88
footer: MIT Licensed | Copyright © 2019-present Nuxt.js Team
99
---
1010

@@ -15,7 +15,7 @@ footer: MIT Licensed | Copyright © 2019-present Nuxt.js Team
1515
# Nuxt TypeScript
1616

1717
<p class="text-xl">
18-
Nuxt.js 的 Typescript 支援
18+
Nuxt 2 的 Typescript 支援
1919
</p>
2020
<a href="/zh-Hant/guide/introduction" class="rounded bg-primary-100 dark:bg-primary-900 text-primary-500 text-lg font-medium px-3 py-1 inline-block">
2121
快速入門 →

examples/class-api/basic/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"version": "1.0.0",
44
"private": true,
55
"dependencies": {
6-
"nuxt": "latest",
7-
"vue-class-component": "latest",
8-
"vue-property-decorator": "latest"
6+
"nuxt": "2.x",
7+
"vue-class-component": "^7.2.6",
8+
"vue-property-decorator": "^9.1.2"
99
},
1010
"scripts": {
1111
"dev": "nuxt",
@@ -15,7 +15,7 @@
1515
"post-update": "yarn upgrade --latest"
1616
},
1717
"devDependencies": {
18-
"@nuxt/types": "latest",
18+
"@nuxt/types": "2.x",
1919
"@nuxt/typescript-build": "latest"
2020
}
2121
}

examples/class-api/minimal/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"version": "1.0.0",
44
"private": true,
55
"dependencies": {
6-
"nuxt": "latest",
7-
"vue-class-component": "latest",
8-
"vue-property-decorator": "latest"
6+
"nuxt": "2.x",
7+
"vue-class-component": "^7.2.6",
8+
"vue-property-decorator": "^9.1.2"
99
},
1010
"scripts": {
1111
"dev": "nuxt",
@@ -15,7 +15,7 @@
1515
"post-update": "yarn upgrade --latest"
1616
},
1717
"devDependencies": {
18-
"@nuxt/types": "latest",
18+
"@nuxt/types": "2.x",
1919
"@nuxt/typescript-build": "latest"
2020
}
2121
}

examples/class-api/minimal/pages/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { Component, Vue } from 'vue-property-decorator'
99
1010
@Component
1111
export default class PageIndex extends Vue {
12+
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
1213
message: string = 'This is a message'
1314
}
1415
</script>

examples/composition-api/basic/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "1.0.0",
44
"private": true,
55
"dependencies": {
6-
"@vue/composition-api": "latest",
7-
"nuxt": "latest"
6+
"@vue/composition-api": "^1.7.1",
7+
"nuxt": "2.x"
88
},
99
"scripts": {
1010
"dev": "nuxt",
@@ -14,7 +14,7 @@
1414
"post-update": "yarn upgrade --latest"
1515
},
1616
"devDependencies": {
17-
"@nuxt/types": "latest",
17+
"@nuxt/types": "2.x",
1818
"@nuxt/typescript-build": "latest"
1919
}
2020
}

examples/composition-api/minimal/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "1.0.0",
44
"private": true,
55
"dependencies": {
6-
"@vue/composition-api": "latest",
7-
"nuxt": "latest"
6+
"@vue/composition-api": "^1.7.1",
7+
"nuxt": "2.x"
88
},
99
"scripts": {
1010
"dev": "nuxt",
@@ -14,7 +14,7 @@
1414
"post-update": "yarn upgrade --latest"
1515
},
1616
"devDependencies": {
17-
"@nuxt/types": "latest",
17+
"@nuxt/types": "2.x",
1818
"@nuxt/typescript-build": "latest"
1919
}
2020
}

examples/options-api/basic/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"private": true,
55
"dependencies": {
6-
"nuxt": "latest"
6+
"nuxt": "2.x"
77
},
88
"scripts": {
99
"dev": "nuxt",
@@ -13,7 +13,7 @@
1313
"post-update": "yarn upgrade --latest"
1414
},
1515
"devDependencies": {
16-
"@nuxt/types": "latest",
16+
"@nuxt/types": "2.x",
1717
"@nuxt/typescript-build": "latest"
1818
}
1919
}

examples/options-api/minimal/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"private": true,
55
"dependencies": {
6-
"nuxt": "latest"
6+
"nuxt": "2.x"
77
},
88
"scripts": {
99
"dev": "nuxt",
@@ -13,7 +13,7 @@
1313
"post-update": "yarn upgrade --latest"
1414
},
1515
"devDependencies": {
16-
"@nuxt/types": "latest",
16+
"@nuxt/types": "2.x",
1717
"@nuxt/typescript-build": "latest"
1818
}
1919
}

examples/options-api/minimal/pages/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Vue from 'vue'
99
1010
export default Vue.extend({
1111
data () {
12+
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
1213
const message: string = 'This is a message'
1314
1415
return {

jest.config.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
module.exports = {
22
testEnvironment: 'node',
33
transform: {
4-
'^.+\\.ts$': 'ts-jest'
5-
},
6-
globals: {
7-
'ts-jest': {
8-
tsconfig: 'tsconfig.test.json',
9-
diagnostics: {
10-
ignoreCodes: [2345]
4+
'^.+\\.ts$': [
5+
'ts-jest',
6+
{
7+
tsconfig: 'tsconfig.test.json',
8+
diagnostics: {
9+
ignoreCodes: [2345]
10+
}
1111
}
12-
}
12+
]
1313
},
1414
collectCoverage: true,
1515
collectCoverageFrom: [

package.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
"test": "yarn lint && jest"
1111
},
1212
"devDependencies": {
13-
"@nuxt/types": "npm:@nuxt/types-edge@latest",
14-
"@nuxtjs/eslint-config-typescript": "latest",
15-
"@types/jest": "latest",
16-
"@vue/composition-api": "latest",
17-
"codecov": "latest",
18-
"eslint": "latest",
19-
"jest": "latest",
20-
"lerna": "latest",
21-
"nuxt-edge": "latest",
22-
"ts-jest": "latest",
23-
"typescript": "~4.2",
24-
"vue-property-decorator": "latest"
13+
"@nuxt/types": "2.x",
14+
"@nuxtjs/eslint-config-typescript": "^12.0.0",
15+
"@types/jest": "^29.4.0",
16+
"@vue/composition-api": "^1.7.1",
17+
"codecov": "^3.8.3",
18+
"eslint": "^8.36.0",
19+
"jest": "^29.5.0",
20+
"lerna": "^6.5.1",
21+
"nuxt": "2.x",
22+
"ts-jest": "^29.0.5",
23+
"typescript": "^4.9.5",
24+
"vue-property-decorator": "^9.1.2"
2525
}
2626
}

0 commit comments

Comments
 (0)