Skip to content

Commit

Permalink
fix: make typescript a peer dependency (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl committed Mar 13, 2023
1 parent 305ef79 commit 6ba1937
Show file tree
Hide file tree
Showing 33 changed files with 6,198 additions and 5,625 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.js
@@ -1,5 +1,8 @@
module.exports = {
extends: [
'@nuxtjs/eslint-config-typescript'
]
],
rules: {
'vue/multi-word-component-names': 'off'
}
}
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -11,6 +11,8 @@

# Nuxt Typescript

Build and runtime support for Typescript in Nuxt 2.

Documentation: https://typescript.nuxtjs.org

## 📑 License
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/guide/runtime.md
Expand Up @@ -47,10 +47,10 @@ All you need to do is update your **package.json** file:
},
"dependencies": {
"@nuxt/typescript-runtime": "latest",
"nuxt": "latest"
"nuxt": "2.x"
},
"devDependencies": {
"@nuxt/types": "latest",
"@nuxt/types": "2.x",
"@nuxt/typescript-build": "latest"
}
```
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/index.md
Expand Up @@ -4,7 +4,7 @@ title: ''
menuTitle: Introduction
fullscreen: true
category: ''
description: TypeScript Support for Nuxt.js
description: TypeScript Support for Nuxt 2
heroImage: /assets/logo.svg
actionText: Get Started →
actionLink: /guide/
Expand All @@ -19,7 +19,7 @@ footer: MIT Licensed | Copyright © 2019-present Nuxt.js Team
# Nuxt TypeScript

<p class="text-xl">
TypeScript Support for Nuxt.js
TypeScript Support for Nuxt 2
</p>
<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">
Get Started →
Expand Down
4 changes: 2 additions & 2 deletions docs/content/es/guide/runtime.md
Expand Up @@ -47,10 +47,10 @@ Todo lo que necesitas es actualizar tu archivo **package.json**:
},
"dependencies": {
"@nuxt/typescript-runtime": "latest",
"nuxt": "latest",
"nuxt": "2.x",
},
"devDependencies": {
"@nuxt/types": "latest",
"@nuxt/types": "2.x",
"@nuxt/typescript-build": "latest"
}
```
Expand Down
4 changes: 2 additions & 2 deletions docs/content/es/index.md
Expand Up @@ -4,7 +4,7 @@ title: ''
menuTitle: Introduction
fullscreen: true
category: ''
description: 'Soporte de Typescript para Nuxt.js'
description: 'Soporte de Typescript para Nuxt 2'
heroImage: /assets/logo.svg
actionText: Comenzamos →
actionLink: /es/guide/
Expand All @@ -18,7 +18,7 @@ footer: MIT Licensed | Copyright © 2019-present Nuxt.js Team
# Nuxt TypeScript

<p class="text-xl">
Soporte de Typescript para Nuxt.js
Soporte de Typescript para Nuxt 2
</p>
<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">
Comenzamos →
Expand Down
4 changes: 2 additions & 2 deletions docs/content/ja/guide/runtime.md
Expand Up @@ -47,10 +47,10 @@ npm install @nuxt/typescript-runtime
},
"dependencies": {
"@nuxt/typescript-runtime": "latest",
"nuxt": "latest"
"nuxt": "2.x"
},
"devDependencies": {
"@nuxt/types": "latest",
"@nuxt/types": "2.x",
"@nuxt/typescript-build": "latest"
}
```
Expand Down
4 changes: 2 additions & 2 deletions docs/content/ja/index.md
Expand Up @@ -4,7 +4,7 @@ title: ''
menuTitle: Introduction
fullscreen: true
category: ''
description: 'Nuxt.js 向け TypeScript サポート'
description: 'Nuxt 2 向け TypeScript サポート'
footer: MIT Licensed | Copyright © 2019-present Nuxt.js Team
---

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

<p class="text-xl">
Nuxt.js 向け TypeScript サポート
Nuxt 2 向け TypeScript サポート
</p>
<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">
はじめる →
Expand Down
4 changes: 2 additions & 2 deletions docs/content/pt/guide/runtime.md
Expand Up @@ -47,10 +47,10 @@ Tudo que você precisa fazer é atualizar o seu arquivo **package.json**:
},
"dependencies": {
"@nuxt/typescript-runtime": "latest",
"nuxt": "latest"
"nuxt": "2.x"
},
"devDependencies": {
"@nuxt/types": "latest",
"@nuxt/types": "2.x",
"@nuxt/typescript-build": "latest"
}
```
Expand Down
4 changes: 2 additions & 2 deletions docs/content/pt/index.md
Expand Up @@ -4,7 +4,7 @@ title: ''
menuTitle: Introdução
fullscreen: true
category: ''
description: 'Suporte de TypeScript para Nuxt.js'
description: 'Suporte de TypeScript para Nuxt 2'
heroImage: /assets/logo.svg
actionText: Introdução →
actionLink: /guide/
Expand All @@ -18,7 +18,7 @@ footer: Distribuído sob a Licença MIT | Copyright © 2019-present Nuxt.js Team
# Nuxt TypeScript

<p class="text-xl">
Suporte de TypeScript para Nuxt.js
Suporte de TypeScript para Nuxt 2
</p>
<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">
Introdução →
Expand Down
4 changes: 2 additions & 2 deletions docs/content/zh-Hans/guide/runtime.md
Expand Up @@ -47,10 +47,10 @@ npm install @nuxt/typescript-runtime
},
"dependencies": {
"@nuxt/typescript-runtime": "latest",
"nuxt": "latest"
"nuxt": "2.x"
},
"devDependencies": {
"@nuxt/types": "latest",
"@nuxt/types": "2.x",
"@nuxt/typescript-build": "latest"
}
```
Expand Down
4 changes: 2 additions & 2 deletions docs/content/zh-Hans/index.md
Expand Up @@ -4,7 +4,7 @@ title: ''
menuTitle: Introduction
fullscreen: true
category: ''
description: 'Nuxt.js 的 Typescript 支持'
description: 'Nuxt 2 的 Typescript 支持'
footer: MIT Licensed | Copyright © 2019-present Nuxt.js Team
---

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

<p class="text-xl">
Nuxt.js 的 Typescript 支持
Nuxt 2 的 Typescript 支持
</p>
<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">
快速入门 →
Expand Down
4 changes: 2 additions & 2 deletions docs/content/zh-Hant/guide/runtime.md
Expand Up @@ -47,10 +47,10 @@ npm install @nuxt/typescript-runtime
},
"dependencies": {
"@nuxt/typescript-runtime": "latest",
"nuxt": "latest"
"nuxt": "2.x"
},
"devDependencies": {
"@nuxt/types": "latest",
"@nuxt/types": "2.x",
"@nuxt/typescript-build": "latest"
}
```
Expand Down
4 changes: 2 additions & 2 deletions docs/content/zh-Hant/index.md
Expand Up @@ -4,7 +4,7 @@ title: ''
menuTitle: Introduction
fullscreen: true
category: ''
description: 'Nuxt.js 的 Typescript 支援'
description: 'Nuxt 2 的 Typescript 支援'
footer: MIT Licensed | Copyright © 2019-present Nuxt.js Team
---

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

<p class="text-xl">
Nuxt.js 的 Typescript 支援
Nuxt 2 的 Typescript 支援
</p>
<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">
快速入門 →
Expand Down
8 changes: 4 additions & 4 deletions examples/class-api/basic/package.json
Expand Up @@ -3,9 +3,9 @@
"version": "1.0.0",
"private": true,
"dependencies": {
"nuxt": "latest",
"vue-class-component": "latest",
"vue-property-decorator": "latest"
"nuxt": "2.x",
"vue-class-component": "^7.2.6",
"vue-property-decorator": "^9.1.2"
},
"scripts": {
"dev": "nuxt",
Expand All @@ -15,7 +15,7 @@
"post-update": "yarn upgrade --latest"
},
"devDependencies": {
"@nuxt/types": "latest",
"@nuxt/types": "2.x",
"@nuxt/typescript-build": "latest"
}
}
8 changes: 4 additions & 4 deletions examples/class-api/minimal/package.json
Expand Up @@ -3,9 +3,9 @@
"version": "1.0.0",
"private": true,
"dependencies": {
"nuxt": "latest",
"vue-class-component": "latest",
"vue-property-decorator": "latest"
"nuxt": "2.x",
"vue-class-component": "^7.2.6",
"vue-property-decorator": "^9.1.2"
},
"scripts": {
"dev": "nuxt",
Expand All @@ -15,7 +15,7 @@
"post-update": "yarn upgrade --latest"
},
"devDependencies": {
"@nuxt/types": "latest",
"@nuxt/types": "2.x",
"@nuxt/typescript-build": "latest"
}
}
1 change: 1 addition & 0 deletions examples/class-api/minimal/pages/index.vue
Expand Up @@ -9,6 +9,7 @@ import { Component, Vue } from 'vue-property-decorator'
@Component
export default class PageIndex extends Vue {
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
message: string = 'This is a message'
}
</script>
6 changes: 3 additions & 3 deletions examples/composition-api/basic/package.json
Expand Up @@ -3,8 +3,8 @@
"version": "1.0.0",
"private": true,
"dependencies": {
"@vue/composition-api": "latest",
"nuxt": "latest"
"@vue/composition-api": "^1.7.1",
"nuxt": "2.x"
},
"scripts": {
"dev": "nuxt",
Expand All @@ -14,7 +14,7 @@
"post-update": "yarn upgrade --latest"
},
"devDependencies": {
"@nuxt/types": "latest",
"@nuxt/types": "2.x",
"@nuxt/typescript-build": "latest"
}
}
6 changes: 3 additions & 3 deletions examples/composition-api/minimal/package.json
Expand Up @@ -3,8 +3,8 @@
"version": "1.0.0",
"private": true,
"dependencies": {
"@vue/composition-api": "latest",
"nuxt": "latest"
"@vue/composition-api": "^1.7.1",
"nuxt": "2.x"
},
"scripts": {
"dev": "nuxt",
Expand All @@ -14,7 +14,7 @@
"post-update": "yarn upgrade --latest"
},
"devDependencies": {
"@nuxt/types": "latest",
"@nuxt/types": "2.x",
"@nuxt/typescript-build": "latest"
}
}
4 changes: 2 additions & 2 deletions examples/options-api/basic/package.json
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"private": true,
"dependencies": {
"nuxt": "latest"
"nuxt": "2.x"
},
"scripts": {
"dev": "nuxt",
Expand All @@ -13,7 +13,7 @@
"post-update": "yarn upgrade --latest"
},
"devDependencies": {
"@nuxt/types": "latest",
"@nuxt/types": "2.x",
"@nuxt/typescript-build": "latest"
}
}
4 changes: 2 additions & 2 deletions examples/options-api/minimal/package.json
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"private": true,
"dependencies": {
"nuxt": "latest"
"nuxt": "2.x"
},
"scripts": {
"dev": "nuxt",
Expand All @@ -13,7 +13,7 @@
"post-update": "yarn upgrade --latest"
},
"devDependencies": {
"@nuxt/types": "latest",
"@nuxt/types": "2.x",
"@nuxt/typescript-build": "latest"
}
}
1 change: 1 addition & 0 deletions examples/options-api/minimal/pages/index.vue
Expand Up @@ -9,6 +9,7 @@ import Vue from 'vue'
export default Vue.extend({
data () {
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
const message: string = 'This is a message'
return {
Expand Down
16 changes: 8 additions & 8 deletions jest.config.js
@@ -1,15 +1,15 @@
module.exports = {
testEnvironment: 'node',
transform: {
'^.+\\.ts$': 'ts-jest'
},
globals: {
'ts-jest': {
tsconfig: 'tsconfig.test.json',
diagnostics: {
ignoreCodes: [2345]
'^.+\\.ts$': [
'ts-jest',
{
tsconfig: 'tsconfig.test.json',
diagnostics: {
ignoreCodes: [2345]
}
}
}
]
},
collectCoverage: true,
collectCoverageFrom: [
Expand Down
24 changes: 12 additions & 12 deletions package.json
Expand Up @@ -10,17 +10,17 @@
"test": "yarn lint && jest"
},
"devDependencies": {
"@nuxt/types": "npm:@nuxt/types-edge@latest",
"@nuxtjs/eslint-config-typescript": "latest",
"@types/jest": "latest",
"@vue/composition-api": "latest",
"codecov": "latest",
"eslint": "latest",
"jest": "latest",
"lerna": "latest",
"nuxt-edge": "latest",
"ts-jest": "latest",
"typescript": "~4.2",
"vue-property-decorator": "latest"
"@nuxt/types": "2.x",
"@nuxtjs/eslint-config-typescript": "^12.0.0",
"@types/jest": "^29.4.0",
"@vue/composition-api": "^1.7.1",
"codecov": "^3.8.3",
"eslint": "^8.36.0",
"jest": "^29.5.0",
"lerna": "^6.5.1",
"nuxt": "2.x",
"ts-jest": "^29.0.5",
"typescript": "^4.9.5",
"vue-property-decorator": "^9.1.2"
}
}

0 comments on commit 6ba1937

Please sign in to comment.