├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ └── test.yml ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.js ├── docs ├── .gitignore ├── .nvmrc ├── assets │ └── custom.css ├── components │ └── global │ │ ├── Example.vue │ │ └── InjectCode.vue ├── content │ ├── en │ │ ├── cookbook │ │ │ ├── components.md │ │ │ ├── configuration.md │ │ │ ├── middlewares.md │ │ │ ├── modules.md │ │ │ ├── plugins.md │ │ │ ├── server-middlewares.md │ │ │ └── store.md │ │ ├── examples │ │ │ ├── class-api │ │ │ │ ├── basic.md │ │ │ │ └── minimal.md │ │ │ ├── composition-api │ │ │ │ ├── basic.md │ │ │ │ └── minimal.md │ │ │ └── options-api │ │ │ │ ├── basic.md │ │ │ │ └── minimal.md │ │ ├── guide │ │ │ ├── introduction.md │ │ │ ├── lint.md │ │ │ ├── runtime.md │ │ │ └── setup.md │ │ └── index.md │ ├── es │ │ ├── cookbook │ │ │ ├── components.md │ │ │ ├── configuration.md │ │ │ ├── middlewares.md │ │ │ ├── modules.md │ │ │ ├── plugins.md │ │ │ ├── server-middlewares.md │ │ │ └── store.md │ │ ├── examples │ │ │ ├── class-api │ │ │ │ └── minimal.md │ │ │ ├── composition-api │ │ │ │ └── minimal.md │ │ │ └── options-api │ │ │ │ └── minimal.md │ │ ├── guide │ │ │ ├── introduction.md │ │ │ ├── lint.md │ │ │ ├── runtime.md │ │ │ └── setup.md │ │ └── index.md │ ├── ja │ │ ├── cookbook │ │ │ ├── components.md │ │ │ ├── configuration.md │ │ │ ├── middlewares.md │ │ │ ├── modules.md │ │ │ ├── plugins.md │ │ │ ├── server-middlewares.md │ │ │ └── store.md │ │ ├── examples │ │ │ ├── class-api │ │ │ │ └── minimal.md │ │ │ ├── composition-api │ │ │ │ └── minimal.md │ │ │ └── options-api │ │ │ │ └── minimal.md │ │ ├── guide │ │ │ ├── introduction.md │ │ │ ├── lint.md │ │ │ ├── runtime.md │ │ │ └── setup.md │ │ └── index.md │ ├── pt │ │ ├── cookbook │ │ │ ├── components.md │ │ │ ├── configuration.md │ │ │ ├── middlewares.md │ │ │ ├── modules.md │ │ │ ├── plugins.md │ │ │ ├── server-middlewares.md │ │ │ └── store.md │ │ ├── examples │ │ │ ├── class-api │ │ │ │ └── minimal.md │ │ │ ├── composition-api │ │ │ │ └── minimal.md │ │ │ └── options-api │ │ │ │ └── minimal.md │ │ ├── guide │ │ │ ├── introduction.md │ │ │ ├── lint.md │ │ │ ├── runtime.md │ │ │ └── setup.md │ │ └── index.md │ ├── settings.json │ ├── shared │ │ ├── components │ │ │ ├── script.class-api.ts.md │ │ │ ├── script.composition-api.ts.md │ │ │ ├── script.options-api-vue26.ts.md │ │ │ ├── script.options-api-vue27.ts.md │ │ │ └── template.html.md │ │ └── tsconfig.json.md │ ├── zh-Hans │ │ ├── cookbook │ │ │ ├── components.md │ │ │ ├── configuration.md │ │ │ ├── middlewares.md │ │ │ ├── modules.md │ │ │ ├── plugins.md │ │ │ ├── server-middlewares.md │ │ │ └── store.md │ │ ├── examples │ │ │ ├── class-api │ │ │ │ └── minimal.md │ │ │ ├── composition-api │ │ │ │ └── minimal.md │ │ │ └── options-api │ │ │ │ └── minimal.md │ │ ├── guide │ │ │ ├── introduction.md │ │ │ ├── lint.md │ │ │ ├── runtime.md │ │ │ └── setup.md │ │ └── index.md │ └── zh-Hant │ │ ├── cookbook │ │ ├── components.md │ │ ├── configuration.md │ │ ├── middlewares.md │ │ ├── modules.md │ │ ├── plugins.md │ │ ├── server-middlewares.md │ │ └── store.md │ │ ├── examples │ │ ├── class-api │ │ │ └── minimal.md │ │ ├── composition-api │ │ │ └── minimal.md │ │ └── options-api │ │ │ └── minimal.md │ │ ├── guide │ │ ├── introduction.md │ │ ├── lint.md │ │ ├── runtime.md │ │ └── setup.md │ │ └── index.md ├── nuxt.config.js ├── package.json ├── plugins │ └── vue-tabs.js ├── static │ ├── favicon.ico │ ├── icon.png │ └── icon.svg ├── tailwind.config.js └── yarn.lock ├── examples ├── class-api │ ├── basic │ │ ├── README.md │ │ ├── nuxt.config.js │ │ ├── package.json │ │ ├── pages │ │ │ └── index.vue │ │ └── tsconfig.json │ └── minimal │ │ ├── README.md │ │ ├── nuxt.config.js │ │ ├── package.json │ │ ├── pages │ │ └── index.vue │ │ └── tsconfig.json ├── composition-api │ ├── basic │ │ ├── README.md │ │ ├── nuxt.config.js │ │ ├── package.json │ │ ├── pages │ │ │ └── index.vue │ │ ├── plugins │ │ │ └── composition-api.js │ │ └── tsconfig.json │ └── minimal │ │ ├── README.md │ │ ├── nuxt.config.js │ │ ├── package.json │ │ ├── pages │ │ └── index.vue │ │ ├── plugins │ │ └── composition-api.js │ │ └── tsconfig.json └── options-api │ ├── basic │ ├── README.md │ ├── nuxt.config.js │ ├── package.json │ ├── pages │ │ └── index.vue │ └── tsconfig.json │ └── minimal │ ├── README.md │ ├── nuxt.config.js │ ├── package.json │ ├── pages │ └── index.vue │ └── tsconfig.json ├── jest.config.js ├── lerna.json ├── netlify.toml ├── package.json ├── packages ├── typescript-build │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ │ └── index.ts │ ├── test │ │ ├── fixture │ │ │ ├── @types │ │ │ │ └── vue.d.ts │ │ │ ├── nuxt.config.ts │ │ │ ├── pages │ │ │ │ ├── about.ts │ │ │ │ ├── contact.tsx │ │ │ │ ├── index.vue │ │ │ │ └── interface.vue │ │ │ ├── serverMiddlewares │ │ │ │ └── logger.ts │ │ │ ├── shims-tsx.d.ts │ │ │ └── tsconfig.json │ │ └── module.test.ts │ └── tsconfig.json └── typescript-runtime │ ├── CHANGELOG.md │ ├── README.md │ ├── bin │ └── nuxt-ts.js │ ├── package.json │ ├── src │ └── index.ts │ ├── test │ └── hooks.test.ts │ └── tsconfig.json ├── renovate.json ├── stub.d.ts ├── tsconfig.json ├── tsconfig.test.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_size = 2 6 | indent_style = space 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | .nuxt 4 | static 5 | coverage 6 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [ 3 | '@nuxtjs/eslint-config-typescript' 4 | ], 5 | rules: { 6 | 'vue/multi-word-component-names': 'off' 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Clone repository '...' 16 | 2. Run '....' 17 | 3. See error 18 | 19 | **Expected behavior** 20 | A clear and concise description of what you expected to happen. 21 | 22 | **Screenshots** 23 | If applicable, add screenshots to help explain your problem. 24 | 25 | **Additional context** 26 | Add any other context about the problem here. 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: feature request 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | test: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@master 17 | 18 | - uses: actions/cache@v3 19 | id: cache 20 | with: 21 | path: "node_modules" 22 | key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }} 23 | 24 | - name: Install dependencies 25 | if: steps.cache.outputs.cache-hit != 'true' 26 | run: yarn 27 | 28 | - name: Run tests 29 | run: yarn test 30 | 31 | - name: Build project 32 | run: yarn build 33 | 34 | - name: Coverage 35 | run: yarn codecov 36 | env: 37 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | node_modules 3 | 4 | # Only keep yarn.lock in the root 5 | */**/yarn.lock 6 | 7 | # Logs 8 | *.log 9 | 10 | # Other 11 | .nuxt* 12 | !.nuxtignore 13 | 14 | # Dist folders 15 | dist 16 | 17 | # Coverage reports 18 | coverage 19 | 20 | # VSCode 21 | .vscode 22 | 23 | # Intellij idea 24 | *.iml 25 | .idea 26 | 27 | # OSX 28 | .DS_Store 29 | .AppleDouble 30 | .LSOverride 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016-2019 Nuxt.js Team 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | nuxt-typescript 3 |

4 | 5 |

6 | npm downloads 7 | Github Actions 8 | Coverage 9 | License 10 |

11 | 12 | # Nuxt Typescript 13 | 14 | Build and runtime support for Typescript in Nuxt 2. 15 | 16 | Documentation: https://typescript.nuxtjs.org 17 | 18 | ## 📑 License 19 | 20 | [MIT License](./LICENSE) 21 | 22 | Copyright (c) Nuxt.js Team 23 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | function isBabelLoader (caller) { 2 | return caller && caller.name === 'babel-loader' 3 | } 4 | 5 | module.exports = function (api) { 6 | if (api.env('test') && !api.caller(isBabelLoader)) { 7 | return { 8 | presets: [ 9 | ['@babel/env', { 10 | targets: { 11 | node: 'current' 12 | } 13 | }] 14 | ] 15 | } 16 | } 17 | return {} 18 | } 19 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | static/sw.js 2 | -------------------------------------------------------------------------------- /docs/.nvmrc: -------------------------------------------------------------------------------- 1 | 16 2 | -------------------------------------------------------------------------------- /docs/assets/custom.css: -------------------------------------------------------------------------------- 1 | li a[href="/"], 2 | li a[href="/es"], 3 | li a[href="/ja"], 4 | li a[href="/pt"], 5 | li a[href="/zh-Hant"], 6 | li a[href="/zh-Hans"] { 7 | @apply -ml-2 mb-2 text-gray-500 uppercase tracking-wider font-bold text-sm; 8 | 9 | @screen lg { 10 | @apply text-xs; 11 | } 12 | } 13 | 14 | aside > div > ul { 15 | @screen lg { 16 | padding-left: 0.5rem !important; 17 | } 18 | } 19 | 20 | .prose { 21 | & pre code::after { 22 | @apply absolute; 23 | } 24 | 25 | & img[src*="img.shields.io"] { 26 | display: inline !important; 27 | } 28 | } 29 | 30 | .tabs-component { 31 | @apply my-16 mx-0 32 | } 33 | 34 | .tabs-component-tabs { 35 | @apply z-10 bg-tabs px-2 rounded-t-md mb-0 !important; 36 | 37 | @screen md { 38 | @apply flex justify-start items-stretch; 39 | } 40 | } 41 | 42 | .tabs-component-tab { 43 | @apply font-bold font-mono pl-0 mr-0 mt-0 mb-0 list-none !important; 44 | } 45 | 46 | .tabs-component-tab::before { 47 | @apply hidden; 48 | } 49 | 50 | .tabs-component-tab.is-active { 51 | border-bottom-style: solid; 52 | @apply border-b-2 border-tabs-active z-10; 53 | } 54 | 55 | .tabs-component-tab.is-disabled * { 56 | @apply cursor-not-allowed text-opacity-50 !important; 57 | } 58 | 59 | .tabs-component-tab-a { 60 | @apply flex items-center no-underline px-4 py-3 text-sm text-gray-400 !important; 61 | } 62 | 63 | .tabs-component-panels { 64 | @apply bg-tabs p-4 rounded-none text-white rounded-b-md border-solid border-l-0 border-r-0 border-b-0 border-t-2 border-tabs-separator transform -translate-y-2; 65 | } 66 | -------------------------------------------------------------------------------- /docs/components/global/Example.vue: -------------------------------------------------------------------------------- 1 |