diff --git a/.all-contributorsrc b/.all-contributorsrc index 04a77f49c5..e5a92c37bc 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -6,8 +6,9 @@ "files": [ "README.md" ], - "imageSize": 150, + "imageSize": 120, "commit": false, + "contributorsPerLine": 4, "contributors": [ { "login": "Atinux", @@ -94,6 +95,31 @@ "review", "test" ] + }, + { + "login": "aldarund", + "name": "Dmitry Molotkov", + "avatar_url": "https://avatars2.githubusercontent.com/u/571159?v=4", + "profile": "https://github.com/aldarund", + "contributions": [ + "question", + "bug", + "code", + "ideas", + "review" + ] + }, + { + "login": "kevinmarrec", + "name": "Kevin Marrec", + "avatar_url": "https://avatars2.githubusercontent.com/u/25272043?v=4", + "profile": "https://github.com/kevinmarrec", + "contributions": [ + "code", + "ideas", + "platform", + "review" + ] } ] } diff --git a/.circleci/config.yml b/.circleci/config.yml index aad841f786..35c04eb206 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,9 +3,39 @@ version: 2 defaults: &defaults working_directory: ~/project docker: - - image: banian/node-headless-chrome + - image: circleci/node:latest environment: - - NODE_ENV: test + NODE_ENV: test + NODE_OPTIONS: --max_old_space_size=4096 + +release_branches: &release_branches + branches: + only: + - dev + - next + +release: &release + <<: *defaults + steps: + - checkout + - attach_workspace: + at: ~/project + - run: + name: release + command: | + if [ -z "$COMMIT_MSG" ]; then + COMMIT_MSG=$(git --no-pager log --pretty=full -n1 $CIRCLE_SHA1) + fi + if echo "$COMMIT_MSG" | grep -o "\[release\]"; then + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc + yarn lerna version --yes --no-git-tag-version --no-push + PACKAGE_SUFFIX=edge yarn build + if [ "$CIRCLE_BRANCH" = "next" ]; then tag="--tag next"; fi + ./scripts/workspace-run npm publish $tag -q + else + echo "Release phase is skipped." + fi jobs: # -------------------------------------------------------------------------- @@ -19,7 +49,7 @@ jobs: # Restore cache - restore_cache: - key: yarn-{{ checksum "yarn.lock" }} + key: lock-{{ checksum "yarn.lock" }} # Install dependencies - run: @@ -28,7 +58,7 @@ jobs: # Save cache - save_cache: - key: yarn-{{ checksum "yarn.lock" }} + key: lock-{{ checksum "yarn.lock" }} paths: - node_modules - packages/*/node_modules @@ -64,7 +94,7 @@ jobs: at: ~/project - run: name: Security Audit - command: npm install --package-lock-only && npm audit --audit-level=moderate + command: yarn audit build: <<: *defaults @@ -74,14 +104,24 @@ jobs: at: ~/project - run: name: Build Fixtures - command: yarn test:fixtures -w=4 --coverage && yarn coverage + command: yarn test:fixtures -i --coverage && yarn coverage - persist_to_workspace: root: ~/project paths: - test/fixtures + lint-app: + <<: *defaults + steps: + - checkout + - attach_workspace: + at: ~/project + - run: + name: Lint vue-app templates + command: yarn lint:app + # -------------------------------------------------------------------------- - # Phase 3: Unit and E2E tests + # Phase 3: Unit, E2E and types tests # -------------------------------------------------------------------------- test-unit: <<: *defaults @@ -91,10 +131,12 @@ jobs: at: ~/project - run: name: Unit Tests - command: yarn test:unit -w=4 --coverage && yarn coverage + command: yarn test:unit -w=2 --coverage && yarn coverage test-e2e: <<: *defaults + docker: + - image: circleci/node:latest-browsers steps: - checkout - attach_workspace: @@ -103,59 +145,65 @@ jobs: name: E2E Tests command: yarn test:e2e && yarn coverage - # -------------------------------------------------------------------------- - # Phase 4: Release (dev branch only) - # -------------------------------------------------------------------------- - release: + test-types: <<: *defaults + docker: + - image: circleci/node:latest-browsers steps: - checkout - attach_workspace: at: ~/project - run: - name: release - command: | - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc - yarn release --yes - PACKAGE_SUFFIX=edge yarn build - ./scripts/workspace-run npm publish -q + name: Types Tests + command: yarn test:types + + # -------------------------------------------------------------------------- + # Phase 4: Release (dev branch only) + # -------------------------------------------------------------------------- + release-commit: + <<: *release + + release-nightly: + <<: *release + environment: + COMMIT_MSG: '[release]' # Workflow definition workflows: version: 2 - setup-and-test: + + # Build and test after each commit + # Manually release on release branches + commit: jobs: - setup - - - lint: - requires: - - setup - - - audit: - requires: - - setup - - - build: - requires: - - setup - - - test-unit: - requires: - - build - - - test-e2e: - requires: - - build - - - release: - requires: - - build - - lint - - audit - - test-unit - - test-e2e + - lint: { requires: [setup] } + - audit: { requires: [setup] } + - build: { requires: [setup] } + - lint-app: { requires: [build] } + - test-unit: { requires: [build] } + - test-e2e: { requires: [build] } + - test-types: { requires: [build] } + - release-commit: + requires: [build, lint, lint-app, audit, test-unit, test-e2e, test-types] filters: - branches: - only: - - dev + <<: *release_branches + + # Release nightly builds on release branches + nightly: + jobs: + - setup + - lint: { requires: [setup] } + - audit: { requires: [setup] } + - build: { requires: [setup] } + - lint-app: { requires: [build] } + - test-unit: { requires: [build] } + - test-e2e: { requires: [build] } + - test-types: { requires: [build] } + - release-nightly: + requires: [build, lint, lint-app, audit, test-unit, test-e2e, test-types] + triggers: + - schedule: + cron: "0 0 * * *" + filters: + <<: *release_branches diff --git a/.eslintrc.js b/.eslintrc.js index 986bfba056..428eefc3b7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,20 +2,39 @@ module.exports = { root: true, parserOptions: { parser: 'babel-eslint', - sourceType: 'module' + sourceType: 'module', + ecmaFeatures: { + legacyDecorators: true + } }, extends: [ '@nuxtjs' ], + "globals": { + "BigInt": true + }, overrides: [{ files: [ 'test/fixtures/*/.nuxt*/**' ], rules: { - 'vue/name-property-casing': ['error', 'kebab-case'] + 'vue/name-property-casing': 'error' } }, { - files: [ 'test/fixtures/*/.nuxt*/**/+(App|index).js' ], + files: [ + 'examples/storybook/**', + 'examples/with-element-ui/**', + 'examples/with-museui/**', + 'examples/with-vue-material/**', + 'examples/with-vuetify/**', + 'examples/with-vuikit/**', + 'examples/with-vux/**', + ], rules: { - 'import/order': 'ignore' + 'vue/component-name-in-template-casing': ['warn', 'kebab-case'] + } + }, { + files: [ 'test/fixtures/*/.nuxt*/**/+(App|index|server|client).js' ], + rules: { + 'import/order': 'off' } }, { files: [ 'test/fixtures/*/.nuxt*/**/client.js' ], @@ -31,7 +50,18 @@ module.exports = { files: [ 'test/fixtures/*/.nuxt*/**/*.html' ], rules: { 'semi': ['error', 'always', { 'omitLastInOneLineBlock': true }], - 'no-var': 'warn' + 'no-var': 'off' + } + }, { + files: [ 'test/fixtures/*/.nuxt*/**/nuxt-error.vue' ], + rules: { + 'vue/singleline-html-element-content-newline': 'off' + } + }, { + // might be removed in the future, see https://github.com/standard/eslint-plugin-standard/issues/27 + files: [ 'test/fixtures/*/.nuxt*/**/nuxt-link.client.js' ], + rules: { + 'standard/no-callback-literal': 'off' } }] } diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index fbbd84aa65..faba7fff08 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -5,6 +5,7 @@ Please use the following link to create a new issue: - 🚨 Bug report - https://bug.nuxtjs.org/ - πŸ™‹ Feature request - https://feature.nuxtjs.org/ +- πŸ€” Help wanted - https://otechie.com/nuxt - ❗️ All other issues - https://cmty.nuxtjs.org/ If your issue was not created using the app above, **it will be closed immediately**. diff --git a/.github/_main.workflow b/.github/_main.workflow new file mode 100644 index 0000000000..087844ca23 --- /dev/null +++ b/.github/_main.workflow @@ -0,0 +1,43 @@ +workflow "Nuxt.js Actions" { + on = "push" + resolves = ["Audit", "Lint", "Test: Unit", "Test: E2E"] +} + +action "branch-filter" { + uses = "actions/bin/filter@master" + args = ["branch dev"] +} + +action "Install" { + uses = "nuxt/actions-yarn@master" + args = "install --frozen-lockfile --non-interactive" +} + +action "Audit" { + uses = "nuxt/actions-yarn@master" + args = "audit" +} + +action "Lint" { + uses = "nuxt/actions-yarn@master" + needs = ["Install"] + args = "lint" +} + +action "Build" { + uses = "nuxt/actions-yarn@master" + needs = ["Install"] + runs = "yarn test:fixtures --coverage && yarn coverage" +} + +action "Test: Unit" { + uses = "nuxt/actions-yarn@master" + needs = ["Build"] + runs = "yarn test:unit --coverage && yarn coverage" +} + +action "Test: E2E" { + uses = "nuxt/actions-yarn@master" + args = "test:e2e" + needs = ["Build"] +} diff --git a/.github/lock.yml b/.github/lock.yml index 6580ca74ab..4bd5b48a8a 100644 --- a/.github/lock.yml +++ b/.github/lock.yml @@ -1,5 +1,6 @@ # Configuration for lock-threads - https://github.com/dessant/lock-threads -daysUntilLock: 30 +# disable lock bot for now +daysUntilLock: 3650 exemptLabels: [] lockLabel: false lockComment: > diff --git a/.github/stale.yml b/.github/stale.yml index d2963a6b8a..fdf753787c 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -4,6 +4,18 @@ daysUntilClose: 7 staleLabel: stale exemptLabels: - "cmty:feature-request" + - "WIP" + - ":clock1:Pending" + - "type:discussion" markComment: > + Thanks for your contribution to Nuxt.js! + This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. + + If you would like this issue to remain open: + + 1. Verify that you can still reproduce the issue in the latest version of nuxt-edge + 1. Comment the steps to reproduce it + + Issues that are labeled as `πŸ•Pending` will not be automatically marked as stale. diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f9bc524e5..d71f6d7176 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,212 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.4.0](https://github.com/nuxt/nuxt.js/compare/v2.3.4...v2.4.0) (2019-01-28) + + +### Bug Fixes + +* $nuxt is used instead of globalName ([#4743](https://github.com/nuxt/nuxt.js/issues/4743)) ([fe57a5a](https://github.com/nuxt/nuxt.js/commit/fe57a5a)) +* add iron browser as modern ([#4775](https://github.com/nuxt/nuxt.js/issues/4775)) ([9eab558](https://github.com/nuxt/nuxt.js/commit/9eab558)) +* add option to rewatch on path after raw fs event ([#4717](https://github.com/nuxt/nuxt.js/issues/4717)) ([9c6df49](https://github.com/nuxt/nuxt.js/commit/9c6df49)) +* allow keepAliveProps for nuxt component ([#4610](https://github.com/nuxt/nuxt.js/issues/4610)) ([8dc15d0](https://github.com/nuxt/nuxt.js/commit/8dc15d0)) +* allow pcss ending for webpack loader ([#4530](https://github.com/nuxt/nuxt.js/issues/4530)) ([8e0b508](https://github.com/nuxt/nuxt.js/commit/8e0b508)) +* apply store HMR to whole store ([#4589](https://github.com/nuxt/nuxt.js/issues/4589)) ([81cf09c](https://github.com/nuxt/nuxt.js/commit/81cf09c)) +* correct renderer.noSSR name ([6990efc](https://github.com/nuxt/nuxt.js/commit/6990efc)) +* csp SHA hashes accumulate when using custom script-src rules ([#4519](https://github.com/nuxt/nuxt.js/issues/4519)) ([683dbba](https://github.com/nuxt/nuxt.js/commit/683dbba)) +* detect plugin without extension ([#4579](https://github.com/nuxt/nuxt.js/issues/4579)) ([e7df65b](https://github.com/nuxt/nuxt.js/commit/e7df65b)) +* hotfix for vuex hmr ([#4801](https://github.com/nuxt/nuxt.js/issues/4801)) ([5f0b34f](https://github.com/nuxt/nuxt.js/commit/5f0b34f)) +* **rollup:** temporary ignore rollup-plugin-license deprecated warns ([49a7d0c](https://github.com/nuxt/nuxt.js/commit/49a7d0c)) +* empty error message in dev mode ([3d990fe](https://github.com/nuxt/nuxt.js/commit/3d990fe)) +* enable FriendlyErrorsPlugin when build.friendlyErrors is true ([30fef5d](https://github.com/nuxt/nuxt.js/commit/30fef5d)) +* exit with proper error code on errors ([#4806](https://github.com/nuxt/nuxt.js/issues/4806)) ([a7ba73e](https://github.com/nuxt/nuxt.js/commit/a7ba73e)) +* fall back to default value when `publicPath` is falsy ([#4365](https://github.com/nuxt/nuxt.js/issues/4365)) ([e0537d5](https://github.com/nuxt/nuxt.js/commit/e0537d5)) +* hmr in modern mode ([#4623](https://github.com/nuxt/nuxt.js/issues/4623)) ([df9b32a](https://github.com/nuxt/nuxt.js/commit/df9b32a)) +* improvements for build and dev stability ([#4470](https://github.com/nuxt/nuxt.js/issues/4470)) ([fe05169](https://github.com/nuxt/nuxt.js/commit/fe05169)) +* invalid plugin mode warning for all ([9b3e7be](https://github.com/nuxt/nuxt.js/commit/9b3e7be)) +* keepAliveProps broken in ([#4521](https://github.com/nuxt/nuxt.js/issues/4521)) ([431cc15](https://github.com/nuxt/nuxt.js/commit/431cc15)) +* loading.throttle can not be 0 ([2d74804](https://github.com/nuxt/nuxt.js/commit/2d74804)) +* match subdir under node_module in transpile ([#4850](https://github.com/nuxt/nuxt.js/issues/4850)) ([43ce8e9](https://github.com/nuxt/nuxt.js/commit/43ce8e9)) +* merge route.meta into options.meta ([#4479](https://github.com/nuxt/nuxt.js/issues/4479)) ([5a8e6e4](https://github.com/nuxt/nuxt.js/commit/5a8e6e4)) +* modern=true or false not work as expected ([#4378](https://github.com/nuxt/nuxt.js/issues/4378)) ([4c27088](https://github.com/nuxt/nuxt.js/commit/4c27088)) +* nested-components example ([#4535](https://github.com/nuxt/nuxt.js/issues/4535)) ([6315bd7](https://github.com/nuxt/nuxt.js/commit/6315bd7)) +* no false positives for plugins with index.js ([#4714](https://github.com/nuxt/nuxt.js/issues/4714)) ([eef2af3](https://github.com/nuxt/nuxt.js/commit/eef2af3)), closes [#4713](https://github.com/nuxt/nuxt.js/issues/4713) +* No need to use process.client here ([be5e057](https://github.com/nuxt/nuxt.js/commit/be5e057)) +* **builder:** add lodash inside templates ([#4368](https://github.com/nuxt/nuxt.js/issues/4368)) ([27e79be](https://github.com/nuxt/nuxt.js/commit/27e79be)) +* **builder:** js layout ([#4701](https://github.com/nuxt/nuxt.js/issues/4701)) ([af76e07](https://github.com/nuxt/nuxt.js/commit/af76e07)) +* **builder:** layouts condition ([#4641](https://github.com/nuxt/nuxt.js/issues/4641)) ([6436e3b](https://github.com/nuxt/nuxt.js/commit/6436e3b)) +* **builder, module:** addLayout and nuxt.config precedence over auto-scanned layouts ([#4702](https://github.com/nuxt/nuxt.js/issues/4702)) ([f85ac94](https://github.com/nuxt/nuxt.js/commit/f85ac94)) +* **ci:** [release] manually does not work ([052512e](https://github.com/nuxt/nuxt.js/commit/052512e)) +* **ci:** deprecated --skip-git has been replaced by --no-git-tag-version --no-push ([056704f](https://github.com/nuxt/nuxt.js/commit/056704f)) +* **ci:** env can not be in workflow ([0e9eca2](https://github.com/nuxt/nuxt.js/commit/0e9eca2)) +* **ci:** env in circle is not executable [release] ([a4c503b](https://github.com/nuxt/nuxt.js/commit/a4c503b)) +* **ci:** reduce jest workers i CircleCI ([5ec0c8d](https://github.com/nuxt/nuxt.js/commit/5ec0c8d)) +* **ci:** release edge with push and tag ([678b4ab](https://github.com/nuxt/nuxt.js/commit/678b4ab)) +* **ci:** release is ignored in all commits ([d7bd99e](https://github.com/nuxt/nuxt.js/commit/d7bd99e)) +* **ci:** release is ignored in all commits ([b3ff7a1](https://github.com/nuxt/nuxt.js/commit/b3ff7a1)) +* **ci:** run in bound for now ([89f097e](https://github.com/nuxt/nuxt.js/commit/89f097e)) +* **ci:** setupFilesAfterEnv is array ([6d8da0e](https://github.com/nuxt/nuxt.js/commit/6d8da0e)) +* **ci:** support skip release in commit body ([4eff50f](https://github.com/nuxt/nuxt.js/commit/4eff50f)) +* **ci:** swap COMMIT_MSG between commit and nightly release ([d455408](https://github.com/nuxt/nuxt.js/commit/d455408)) +* **ci:** typo ([#4400](https://github.com/nuxt/nuxt.js/issues/4400)) ([b6b7c43](https://github.com/nuxt/nuxt.js/commit/b6b7c43)) +* **ci:** use full message for COMMIT_MSG ([cc358b5](https://github.com/nuxt/nuxt.js/commit/cc358b5)) +* **ci:** use skip-git for edge release ([5235471](https://github.com/nuxt/nuxt.js/commit/5235471)) +* **circleci:** keep using --forceExit ([085ff82](https://github.com/nuxt/nuxt.js/commit/085ff82)) +* **cli:** disable lerna commit and tag ([955b5d4](https://github.com/nuxt/nuxt.js/commit/955b5d4)) +* **common:** remove extra [@nuxt](https://github.com/nuxt)/config dependency ([a2d4270](https://github.com/nuxt/nuxt.js/commit/a2d4270)) +* **config:** define once default nuxt config filename ([#4814](https://github.com/nuxt/nuxt.js/issues/4814)) ([06a18ca](https://github.com/nuxt/nuxt.js/commit/06a18ca)) +* **deps:** update all non-major dependencies ([#4358](https://github.com/nuxt/nuxt.js/issues/4358)) ([45fdae0](https://github.com/nuxt/nuxt.js/commit/45fdae0)) +* **deps:** update dependency vue-no-ssr to ^1.1.0 ([#4372](https://github.com/nuxt/nuxt.js/issues/4372)) ([e731250](https://github.com/nuxt/nuxt.js/commit/e731250)) +* **dev:** Show correct path when webpack watched files changed ([25dea5f](https://github.com/nuxt/nuxt.js/commit/25dea5f)) +* **dist:** use -edge suffix to require cli ([98c1922](https://github.com/nuxt/nuxt.js/commit/98c1922)) +* **edge, next:** -t ~> --tag ([2b46d3e](https://github.com/nuxt/nuxt.js/commit/2b46d3e)) +* **eslint:** amp tags not support pascal case ([6a4808f](https://github.com/nuxt/nuxt.js/commit/6a4808f)) +* **example:** lint error ([ccf3264](https://github.com/nuxt/nuxt.js/commit/ccf3264)) +* **examples:** add pug dependencies ([#4824](https://github.com/nuxt/nuxt.js/issues/4824)) ([4b32144](https://github.com/nuxt/nuxt.js/commit/4b32144)) +* **examples:** deps [skip ci] ([#4782](https://github.com/nuxt/nuxt.js/issues/4782)) ([f70610b](https://github.com/nuxt/nuxt.js/commit/f70610b)) +* **examples:** deps [skip ci] ([#4827](https://github.com/nuxt/nuxt.js/issues/4827)) ([6542dff](https://github.com/nuxt/nuxt.js/commit/6542dff)) +* **examples:** fix deps on codesandbox ([#4828](https://github.com/nuxt/nuxt.js/issues/4828)) ([ee7ad77](https://github.com/nuxt/nuxt.js/commit/ee7ad77)) +* **examples:** Ugrade `vue-property-decorator` in typescript examples ([#4767](https://github.com/nuxt/nuxt.js/issues/4767)) ([73507b8](https://github.com/nuxt/nuxt.js/commit/73507b8)) +* **examples:** Update config for better mobile handling ([3b7ac3c](https://github.com/nuxt/nuxt.js/commit/3b7ac3c)) +* **examples:** use testURL and module names ([#4777](https://github.com/nuxt/nuxt.js/issues/4777)) ([c83bcb0](https://github.com/nuxt/nuxt.js/commit/c83bcb0)) +* **exmaple:** typescript example ([7cf9f80](https://github.com/nuxt/nuxt.js/commit/7cf9f80)) +* **layout-middleware:** Fix issue [#4724](https://github.com/nuxt/nuxt.js/issues/4724) ([521ac20](https://github.com/nuxt/nuxt.js/commit/521ac20)) +* **nuxt-start:** include all vue-app dependencies to prevent breaking changes ([c664e3d](https://github.com/nuxt/nuxt.js/commit/c664e3d)) +* **pkg:** add serialize-javascript to common/package.json ([#4565](https://github.com/nuxt/nuxt.js/issues/4565)) ([6b95eff](https://github.com/nuxt/nuxt.js/commit/6b95eff)) +* **pkg:** move opencollective dependency nuxt and nuxt-legacy ([#4415](https://github.com/nuxt/nuxt.js/issues/4415)) ([f680e36](https://github.com/nuxt/nuxt.js/commit/f680e36)) +* **pkg:** preferConst -> output.preferConst ([7fc4ba2](https://github.com/nuxt/nuxt.js/commit/7fc4ba2)) +* **pkg:** skip invalid workspace packages ([ba50d3b](https://github.com/nuxt/nuxt.js/commit/ba50d3b)) +* **progress-bar:** allow 0 for values and remove duplicate defaults ([#4397](https://github.com/nuxt/nuxt.js/issues/4397)) ([ecdc7bc](https://github.com/nuxt/nuxt.js/commit/ecdc7bc)) +* **renderer:** ignore invalid sourcemaps ([4b643b9](https://github.com/nuxt/nuxt.js/commit/4b643b9)) +* **resolver:** resolve dir if no index found [#4568](https://github.com/nuxt/nuxt.js/issues/4568) ([#4569](https://github.com/nuxt/nuxt.js/issues/4569)) ([85b5359](https://github.com/nuxt/nuxt.js/commit/85b5359)) +* **resolver:** resolvedPath/index.[ext] resolution ([#4548](https://github.com/nuxt/nuxt.js/issues/4548)) ([b413bc1](https://github.com/nuxt/nuxt.js/commit/b413bc1)) +* **rollup:** set correct output options ([fc1ab1e](https://github.com/nuxt/nuxt.js/commit/fc1ab1e)) +* **scrollBehavior:** emit triggerScroll event after changing layer ([#4399](https://github.com/nuxt/nuxt.js/issues/4399)) ([330301c](https://github.com/nuxt/nuxt.js/commit/330301c)), closes [#4080](https://github.com/nuxt/nuxt.js/issues/4080) +* **server:** allow listening on number 0 port ([#4781](https://github.com/nuxt/nuxt.js/issues/4781)) ([602cf12](https://github.com/nuxt/nuxt.js/commit/602cf12)) +* **server:** allow rendering urls with unicode characters ([#4512](https://github.com/nuxt/nuxt.js/issues/4512)) ([c3128ea](https://github.com/nuxt/nuxt.js/commit/c3128ea)) +* **server:** Cannot read property client of null when webpackHMR & restarting Nuxt ([8a200f7](https://github.com/nuxt/nuxt.js/commit/8a200f7)) +* **server:** delete all non-js assets ([6589670](https://github.com/nuxt/nuxt.js/commit/6589670)) +* **server:** process browser version with non semver versions ([#4673](https://github.com/nuxt/nuxt.js/issues/4673)) ([d3b9396](https://github.com/nuxt/nuxt.js/commit/d3b9396)) +* **server, jsdom:** fix timeout error message ([#4412](https://github.com/nuxt/nuxt.js/issues/4412)) ([ab6367b](https://github.com/nuxt/nuxt.js/commit/ab6367b)) +* **server, vue-app:** allow unicode page names ([#4402](https://github.com/nuxt/nuxt.js/issues/4402)) ([949785f](https://github.com/nuxt/nuxt.js/commit/949785f)) +* **test:** downgrade jest to 23 ([d88e448](https://github.com/nuxt/nuxt.js/commit/d88e448)) +* **test:** fallback to config if no config.default ([2f2ec7a](https://github.com/nuxt/nuxt.js/commit/2f2ec7a)) +* **test:** jest describe.skip does not work fine ([d0aadd4](https://github.com/nuxt/nuxt.js/commit/d0aadd4)) +* **test:** remove local paths ([d02eb2f](https://github.com/nuxt/nuxt.js/commit/d02eb2f)) +* **test:** typescirpt modern mode only check once ([70775e1](https://github.com/nuxt/nuxt.js/commit/70775e1)) +* **test:** wrong route in error-handler-object test ([#4363](https://github.com/nuxt/nuxt.js/issues/4363)) ([0db1f26](https://github.com/nuxt/nuxt.js/commit/0db1f26)) +* **test/utils:** check both ts and js for nuxt.config ([5b66afc](https://github.com/nuxt/nuxt.js/commit/5b66afc)) +* **ts:** Add missing `loading` property to Component options ([#4786](https://github.com/nuxt/nuxt.js/issues/4786)) ([db4001d](https://github.com/nuxt/nuxt.js/commit/db4001d)) +* **ts:** better `tsconfig.json` handling & improve tests ([#4856](https://github.com/nuxt/nuxt.js/issues/4856)) ([f18ce4e](https://github.com/nuxt/nuxt.js/commit/f18ce4e)) +* **ts:** fix `$nuxt.$loading` typedefs ([#4778](https://github.com/nuxt/nuxt.js/issues/4778)) ([6694cf7](https://github.com/nuxt/nuxt.js/commit/6694cf7)) +* **ts:** fix default `tsconfig.json` ([#4842](https://github.com/nuxt/nuxt.js/issues/4842)) ([c39cf84](https://github.com/nuxt/nuxt.js/commit/c39cf84)) +* **ts:** fix missing process type definitions and refactor types tests ([#4798](https://github.com/nuxt/nuxt.js/issues/4798)) ([45afc3f](https://github.com/nuxt/nuxt.js/commit/45afc3f)) +* **ts:** fix nuxt-ts binary when running nuxt commands ([#4844](https://github.com/nuxt/nuxt.js/issues/4844)) ([6e60aa4](https://github.com/nuxt/nuxt.js/commit/6e60aa4)) +* **ts:** keep baseUrl property in generated tsconfig.json ([#4843](https://github.com/nuxt/nuxt.js/issues/4843)) ([55dc7f4](https://github.com/nuxt/nuxt.js/commit/55dc7f4)) +* thread-loader slow building ([4fb220c](https://github.com/nuxt/nuxt.js/commit/4fb220c)) +* **ts:** missing `tsconfig.json` on npm published version ([#4840](https://github.com/nuxt/nuxt.js/issues/4840)) ([e57c20a](https://github.com/nuxt/nuxt.js/commit/e57c20a)) +* **ts:** prevent checking types twice in modern mode & use consola as logger ([#4803](https://github.com/nuxt/nuxt.js/issues/4803)) ([b202361](https://github.com/nuxt/nuxt.js/commit/b202361)) +* **ts:** set ts-node register compilerOptions.module to 'commonjs' ([#4752](https://github.com/nuxt/nuxt.js/issues/4752)) ([e22e14b](https://github.com/nuxt/nuxt.js/commit/e22e14b)) +* watch custom patterns only when it exists ([#4823](https://github.com/nuxt/nuxt.js/issues/4823)) ([3966b26](https://github.com/nuxt/nuxt.js/commit/3966b26)) +* **ts:** switch from babel preset to ts-loader ([#4563](https://github.com/nuxt/nuxt.js/issues/4563)) ([75e3df6](https://github.com/nuxt/nuxt.js/commit/75e3df6)) +* **vue-app:** add type definition for `ComponentOptions.middleware` ([#4531](https://github.com/nuxt/nuxt.js/issues/4531)) ([da0a379](https://github.com/nuxt/nuxt.js/commit/da0a379)) +* **vue-app:** allow passing custom props to error function ([#4462](https://github.com/nuxt/nuxt.js/issues/4462)) ([a6fed0a](https://github.com/nuxt/nuxt.js/commit/a6fed0a)), closes [#4460](https://github.com/nuxt/nuxt.js/issues/4460) +* require serverMiddleware object with path and handler ([#4656](https://github.com/nuxt/nuxt.js/issues/4656)) ([8786ff7](https://github.com/nuxt/nuxt.js/commit/8786ff7)) +* **vue-app:** Call Vue.config.errorHandler instead of simply logging the error ([6c4280f](https://github.com/nuxt/nuxt.js/commit/6c4280f)) +* **vue-app:** Fix default error handler in production ([96892c5](https://github.com/nuxt/nuxt.js/commit/96892c5)) +* **vue-app:** Fix route meta to handle order ([45be638](https://github.com/nuxt/nuxt.js/commit/45be638)) +* **vue-app:** Fix test on size-limit ([4a77de8](https://github.com/nuxt/nuxt.js/commit/4a77de8)) +* **vue-app:** Fix Vuex HMR & refactor for better modules usage ([#4791](https://github.com/nuxt/nuxt.js/issues/4791)) ([deadc48](https://github.com/nuxt/nuxt.js/commit/deadc48)) +* **vue-app:** router.meta is null on extendRoutes([#4478](https://github.com/nuxt/nuxt.js/issues/4478)) ([e2ab1b4](https://github.com/nuxt/nuxt.js/commit/e2ab1b4)), closes [#4154](https://github.com/nuxt/nuxt.js/issues/4154) +* Vue.component(RouterLink) is undefined in vue-router 3.0.0 ([#4668](https://github.com/nuxt/nuxt.js/issues/4668)) ([7ff4058](https://github.com/nuxt/nuxt.js/commit/7ff4058)) +* **vue-app:** Set window. equals to window.{globalName} when defined ([951e745](https://github.com/nuxt/nuxt.js/commit/951e745)) +* **vue-renderer:** improve ready handling ([#4511](https://github.com/nuxt/nuxt.js/issues/4511)) ([f0cb654](https://github.com/nuxt/nuxt.js/commit/f0cb654)) +* **vue-renderer:** parse JSON values before passing to bundle-renderer ([c0721c0](https://github.com/nuxt/nuxt.js/commit/c0721c0)), closes [#4439](https://github.com/nuxt/nuxt.js/issues/4439) +* server build failed in dev mode ([89f8866](https://github.com/nuxt/nuxt.js/commit/89f8866)) +* **webpack:** allow changing devtool with extend ([#4515](https://github.com/nuxt/nuxt.js/issues/4515)) ([33edef2](https://github.com/nuxt/nuxt.js/commit/33edef2)) +* not use deprecated option esm in resolver ([5f6361f](https://github.com/nuxt/nuxt.js/commit/5f6361f)) +* offer a new port and listen if already used, use consola on server error ([#4428](https://github.com/nuxt/nuxt.js/issues/4428)) ([1d78027](https://github.com/nuxt/nuxt.js/commit/1d78027)) +* plugins for modern mode ([#4659](https://github.com/nuxt/nuxt.js/issues/4659)) ([867e8e1](https://github.com/nuxt/nuxt.js/commit/867e8e1)) +* prevent matching native statements in serializeFunction ([#4585](https://github.com/nuxt/nuxt.js/issues/4585)) ([5b58272](https://github.com/nuxt/nuxt.js/commit/5b58272)) +* properly serialize head functions ([#4558](https://github.com/nuxt/nuxt.js/issues/4558)) ([7831e57](https://github.com/nuxt/nuxt.js/commit/7831e57)), closes [#4079](https://github.com/nuxt/nuxt.js/issues/4079) +* remove unnecessary isDev in template/server ([a51ba8d](https://github.com/nuxt/nuxt.js/commit/a51ba8d)) +* replace nuxtDir with module.paths ([#4448](https://github.com/nuxt/nuxt.js/issues/4448)) ([d66e1ec](https://github.com/nuxt/nuxt.js/commit/d66e1ec)) +* require postcss module via resolver ([#4737](https://github.com/nuxt/nuxt.js/issues/4737)) ([4b9e8e7](https://github.com/nuxt/nuxt.js/commit/4b9e8e7)) +* router Expected "0" to be defined ([#4394](https://github.com/nuxt/nuxt.js/issues/4394)) ([39b1b8e](https://github.com/nuxt/nuxt.js/commit/39b1b8e)) +* SafariFix is not injected in client modern mode ([ecf76d9](https://github.com/nuxt/nuxt.js/commit/ecf76d9)) +* tests failed in windows ([8163a9e](https://github.com/nuxt/nuxt.js/commit/8163a9e)) +* thread-loader memory leak ([d34a9e2](https://github.com/nuxt/nuxt.js/commit/d34a9e2)) +* undefined script in modern mode ([0a21d4b](https://github.com/nuxt/nuxt.js/commit/0a21d4b)) +* **webpack:** deepClone before calling extendConfig ([#4464](https://github.com/nuxt/nuxt.js/issues/4464)) ([06ddfbb](https://github.com/nuxt/nuxt.js/commit/06ddfbb)) +* **webpack:** prevent terser mangling html/vue reserved tags ([#4821](https://github.com/nuxt/nuxt.js/issues/4821)) ([6a68f4e](https://github.com/nuxt/nuxt.js/commit/6a68f4e)) +* use case insensitive regex for webpack loader rules ([#4728](https://github.com/nuxt/nuxt.js/issues/4728)) ([68d8d54](https://github.com/nuxt/nuxt.js/commit/68d8d54)) +* use triple equals in loading.throttle [release] ([e77c2db](https://github.com/nuxt/nuxt.js/commit/e77c2db)) +* wait error hook ([36ca945](https://github.com/nuxt/nuxt.js/commit/36ca945)) +* wrong devMiddleware in non-modern dev mode ([3515115](https://github.com/nuxt/nuxt.js/commit/3515115)) +* wrong type checking for loading.duration ([0c15b29](https://github.com/nuxt/nuxt.js/commit/0c15b29)) + + +### Features + +* **builder:** optional typescript support ([#4557](https://github.com/nuxt/nuxt.js/issues/4557)) ([7145c1a](https://github.com/nuxt/nuxt.js/commit/7145c1a)) +* **builder:** validate vue-app dependencies and suggest fix ([#4669](https://github.com/nuxt/nuxt.js/issues/4669)) ([7dd33fe](https://github.com/nuxt/nuxt.js/commit/7dd33fe)) +* **ci:** disable lock bot ([8a11bb8](https://github.com/nuxt/nuxt.js/commit/8a11bb8)) +* **ci:** edge@next ([#4477](https://github.com/nuxt/nuxt.js/issues/4477)) ([76c9d58](https://github.com/nuxt/nuxt.js/commit/76c9d58)) +* **ci:** test typescript types ([#4802](https://github.com/nuxt/nuxt.js/issues/4802)) ([25fd1d8](https://github.com/nuxt/nuxt.js/commit/25fd1d8)) +* **circleci:** add nightly build and manual releases ([ec99922](https://github.com/nuxt/nuxt.js/commit/ec99922)) +* **cli:** add `--devtools` option for build and generate ([#4357](https://github.com/nuxt/nuxt.js/issues/4357)) ([e6f73b5](https://github.com/nuxt/nuxt.js/commit/e6f73b5)) +* **cli:** improvements and external commands ([#4314](https://github.com/nuxt/nuxt.js/issues/4314)) ([0145551](https://github.com/nuxt/nuxt.js/commit/0145551)) +* **common:** add yandex and vivaldi to modern browsers ([#4516](https://github.com/nuxt/nuxt.js/issues/4516)) ([51e4488](https://github.com/nuxt/nuxt.js/commit/51e4488)) +* **modern:** auto detect modern mode ([#4422](https://github.com/nuxt/nuxt.js/issues/4422)) ([fe492d8](https://github.com/nuxt/nuxt.js/commit/fe492d8)) +* **nuxt-link:** Smart prefetching and $nuxt.isOffline ([#4574](https://github.com/nuxt/nuxt.js/issues/4574)) ([f319033](https://github.com/nuxt/nuxt.js/commit/f319033)) +* **nuxt-ts:** typescript support improvements ([#4750](https://github.com/nuxt/nuxt.js/issues/4750)) ([dfaffc0](https://github.com/nuxt/nuxt.js/commit/dfaffc0)) +* **router:** custom route name splitter ([#4598](https://github.com/nuxt/nuxt.js/issues/4598)) ([add8000](https://github.com/nuxt/nuxt.js/commit/add8000)) +* **server:** export Listener ([#4577](https://github.com/nuxt/nuxt.js/issues/4577)) ([2f0ed85](https://github.com/nuxt/nuxt.js/commit/2f0ed85)) +* **server:** timing option for `Server-Timing` header ([#4800](https://github.com/nuxt/nuxt.js/issues/4800)) ([b23f5c9](https://github.com/nuxt/nuxt.js/commit/b23f5c9)) +* **test:** unit tests for core/config module ([#4760](https://github.com/nuxt/nuxt.js/issues/4760)) ([a616c09](https://github.com/nuxt/nuxt.js/commit/a616c09)) +* **ts:** add TSX support ([#4613](https://github.com/nuxt/nuxt.js/issues/4613)) ([4d52742](https://github.com/nuxt/nuxt.js/commit/4d52742)) +* **ts:** auto generate tsconfig.json ([#4776](https://github.com/nuxt/nuxt.js/issues/4776)) ([2a1ee96](https://github.com/nuxt/nuxt.js/commit/2a1ee96)) +* **ts:** provide type checking through `fork-ts-checker-webpack-plugin` ([#4611](https://github.com/nuxt/nuxt.js/issues/4611)) ([f1377a7](https://github.com/nuxt/nuxt.js/commit/f1377a7)) +* **ts:** provide type definitions ([#4164](https://github.com/nuxt/nuxt.js/issues/4164)) ([d5716eb](https://github.com/nuxt/nuxt.js/commit/d5716eb)) +* **ts:** typescript examples + improve `vue-app` typings ([#4695](https://github.com/nuxt/nuxt.js/issues/4695)) ([b38e0aa](https://github.com/nuxt/nuxt.js/commit/b38e0aa)) +* **vue-app:** and component aliases ([#4525](https://github.com/nuxt/nuxt.js/issues/4525)) ([1505197](https://github.com/nuxt/nuxt.js/commit/1505197)) +* **vue-app:** Add deprecating for classic mode and handle mutations/actions HMR to store/index.js ([c8b920a](https://github.com/nuxt/nuxt.js/commit/c8b920a)) +* **vue-app:** add vetur helpers for components auto-complete on VS Code ([#4524](https://github.com/nuxt/nuxt.js/issues/4524)) ([59aee74](https://github.com/nuxt/nuxt.js/commit/59aee74)) +* **vue-app:** support named views ([#4410](https://github.com/nuxt/nuxt.js/issues/4410)) ([b1b9e0b](https://github.com/nuxt/nuxt.js/commit/b1b9e0b)) +* **vue-app, vue-renderer:** support meta `headAttrs` ([#4536](https://github.com/nuxt/nuxt.js/issues/4536)) ([9961453](https://github.com/nuxt/nuxt.js/commit/9961453)) +* **webpack:** add experimental HardSourceWebpackPlugin support ([#4527](https://github.com/nuxt/nuxt.js/issues/4527)) ([c6d820a](https://github.com/nuxt/nuxt.js/commit/c6d820a)) +* use runInNewContext: true for nuxt dev ([#4508](https://github.com/nuxt/nuxt.js/issues/4508)) ([1162f2d](https://github.com/nuxt/nuxt.js/commit/1162f2d)) +* **webpack:** options.build.loaders.vueStyle ([#4837](https://github.com/nuxt/nuxt.js/issues/4837)) ([762305b](https://github.com/nuxt/nuxt.js/commit/762305b)) +* add an option to disable FriendlyErrorsWebpackPlugin ([#4498](https://github.com/nuxt/nuxt.js/issues/4498)) ([f1b2ca3](https://github.com/nuxt/nuxt.js/commit/f1b2ca3)) +* add exclude regex array for generated pages ([#4754](https://github.com/nuxt/nuxt.js/issues/4754)) ([ec17804](https://github.com/nuxt/nuxt.js/commit/ec17804)) +* add process.modern ([#4532](https://github.com/nuxt/nuxt.js/issues/4532)) ([f1ff634](https://github.com/nuxt/nuxt.js/commit/f1ff634)) +* add store module HMR ([#4582](https://github.com/nuxt/nuxt.js/issues/4582)) ([b2eee17](https://github.com/nuxt/nuxt.js/commit/b2eee17)) +* add styleExtensions ([#4671](https://github.com/nuxt/nuxt.js/issues/4671)) ([471a32a](https://github.com/nuxt/nuxt.js/commit/471a32a)) +* allow `lang="postcss"` in Vue SFCs ([#4417](https://github.com/nuxt/nuxt.js/issues/4417)) ([71136fc](https://github.com/nuxt/nuxt.js/commit/71136fc)) +* allow scrollToTop to be explicitly disabled ([#4564](https://github.com/nuxt/nuxt.js/issues/4564)) ([669fecc](https://github.com/nuxt/nuxt.js/commit/669fecc)) +* attach ts-loader options on build.loaders.ts ([#4572](https://github.com/nuxt/nuxt.js/issues/4572)) ([d723e49](https://github.com/nuxt/nuxt.js/commit/d723e49)) +* better stack traces for SSR error, show error with correct URL and use eventsource-polyfill ([#4600](https://github.com/nuxt/nuxt.js/issues/4600)) ([498c4f1](https://github.com/nuxt/nuxt.js/commit/498c4f1)) +* check modern build file in modern mode ([#4467](https://github.com/nuxt/nuxt.js/issues/4467)) ([14fe679](https://github.com/nuxt/nuxt.js/commit/14fe679)) +* disable compressor if set to false/undefined ([#4381](https://github.com/nuxt/nuxt.js/issues/4381)) ([e4140ce](https://github.com/nuxt/nuxt.js/commit/e4140ce)) +* improve SSR bundle ([#4439](https://github.com/nuxt/nuxt.js/issues/4439)) ([0f104aa](https://github.com/nuxt/nuxt.js/commit/0f104aa)), closes [#4225](https://github.com/nuxt/nuxt.js/issues/4225) [#3465](https://github.com/nuxt/nuxt.js/issues/3465) [#1728](https://github.com/nuxt/nuxt.js/issues/1728) [#1601](https://github.com/nuxt/nuxt.js/issues/1601) [#1481](https://github.com/nuxt/nuxt.js/issues/1481) +* mode for plugins ([#4592](https://github.com/nuxt/nuxt.js/issues/4592)) ([e71c455](https://github.com/nuxt/nuxt.js/commit/e71c455)) +* nuxt-ts ([#4658](https://github.com/nuxt/nuxt.js/issues/4658)) ([ee0096b](https://github.com/nuxt/nuxt.js/commit/ee0096b)) +* **webpack:** support `build.hotMiddleware.client` ([#4796](https://github.com/nuxt/nuxt.js/issues/4796)) ([dcdbaba](https://github.com/nuxt/nuxt.js/commit/dcdbaba)) +* **webpack,cli:** standalone build mode ([#4661](https://github.com/nuxt/nuxt.js/issues/4661)) ([bdb6791](https://github.com/nuxt/nuxt.js/commit/bdb6791)) +* preload and push modern resources in modern mode ([#4362](https://github.com/nuxt/nuxt.js/issues/4362)) ([701190d](https://github.com/nuxt/nuxt.js/commit/701190d)) +* replace babel-plugin-transform-vue-jsx with [@vue](https://github.com/vue)/babel-preset-jsx ([#4740](https://github.com/nuxt/nuxt.js/issues/4740)) ([da8a3d8](https://github.com/nuxt/nuxt.js/commit/da8a3d8)) +* upgrade css loader to v2 ([#4503](https://github.com/nuxt/nuxt.js/issues/4503)) ([af9b30c](https://github.com/nuxt/nuxt.js/commit/af9b30c)) + + +### Performance Improvements + +* **pkg:** remove lodash dependency from packages ([#4411](https://github.com/nuxt/nuxt.js/issues/4411)) ([d7851b3](https://github.com/nuxt/nuxt.js/commit/d7851b3)) +* **ssr:** remove extra imprts from server.js ([6178c47](https://github.com/nuxt/nuxt.js/commit/6178c47)) + + + + + ## [2.3.4](https://github.com/nuxt/nuxt.js/compare/v2.3.2...v2.3.4) (2018-11-26) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..71e46feb1c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,3 @@ +# Contributing to Nuxt + +Want to contribute to Nuxt? We provide a **[Contribution Guide](https://nuxtjs.org/guide/contribution-guide)** to help you get started. diff --git a/README.md b/README.md index a6526bc339..ce940cac15 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,9 @@ Support us - +

+

+ Hire Nuxt

> Vue.js Meta Framework to create complex, fast & universal web applications *quickly*. @@ -38,9 +40,14 @@ - Custom layouts with the `layouts/` directory - Middleware - Code splitting for every `pages/` +- Loading just the critical CSS (page-level) Learn more at [nuxtjs.org](https://nuxtjs.org). +## Consulting from the Nuxt team + +Get help with that tough bug or make sure your Nuxt app is ready to deploy. For $200 an hour, get technical support, advice, code reviews, and development from the Nuxt core team: [Hire Nuxt on Otechie](https://otechie.com/nuxt?ref=readme) + ## Professional support with TideLift Professionally supported Nuxt.js is now available! @@ -70,43 +77,10 @@ Support us with a monthly donation and help us continue our activities. [[Become ## Getting started ``` -$ npm install nuxt +$ npx create-nuxt-app ``` -Add a script to your package.json like this: - -```json -{ - "scripts": { - "start": "nuxt" - } -} -``` - -After that, the file-system is the main API. Every .vue file becomes a route that gets automatically processed and rendered. - -Populate `./pages/index.vue` inside your project: - -```html - - - -``` - -And then run: -```bash -npm start -``` - -Go to [http://localhost:3000](http://localhost:3000) +It's as simple as that! ## Templates @@ -207,8 +181,9 @@ Note: we recommend putting `.nuxt` in `.npmignore` or `.gitignore`. -| [
SΓ©bastien Chopin](https://github.com/atinux)
[πŸ“](#blog-Atinux "Blogposts") [πŸ›](https://github.com/Atinux/Nuxt.js/issues?q=author%3AAtinux "Bug reports") [πŸ’»](https://github.com/Atinux/Nuxt.js/commits?author=Atinux "Code") [🎨](#design-Atinux "Design") [πŸ“–](https://github.com/Atinux/Nuxt.js/commits?author=Atinux "Documentation") [πŸ’¬](#question-Atinux "Answering Questions") [πŸ‘€](#review-Atinux "Reviewed Pull Requests") [πŸ“’](#talk-Atinux "Talks") | [
Alexandre Chopin](https://github.com/alexchopin)
[🎨](#design-alexchopin "Design") [πŸ“–](https://github.com/Atinux/Nuxt.js/commits?author=alexchopin "Documentation") [πŸ“‹](#eventOrganizing-alexchopin "Event Organizing") [πŸ“¦](#platform-alexchopin "Packaging/porting to new platform") [πŸ’¬](#question-alexchopin "Answering Questions") [πŸ“’](#talk-alexchopin "Talks") | [
Pooya Parsa](https://github.com/pi0)
[πŸ›](https://github.com/Atinux/Nuxt.js/issues?q=author%3Api0 "Bug reports") [πŸ’»](https://github.com/Atinux/Nuxt.js/commits?author=pi0 "Code") [πŸ”Œ](#plugin-pi0 "Plugin/utility libraries") [πŸ’¬](#question-pi0 "Answering Questions") [πŸ‘€](#review-pi0 "Reviewed Pull Requests") [πŸ”§](#tool-pi0 "Tools") | [
Clark Du](https://github.com/clarkdo)
[πŸ›](https://github.com/Atinux/Nuxt.js/issues?q=author%3Aclarkdo "Bug reports") [πŸ’»](https://github.com/Atinux/Nuxt.js/commits?author=clarkdo "Code") [πŸ’‘](#example-clarkdo "Examples") [πŸ‘€](#review-clarkdo "Reviewed Pull Requests") [⚠️](https://github.com/Atinux/Nuxt.js/commits?author=clarkdo "Tests") [πŸ”§](#tool-clarkdo "Tools") | [
Alexander Lichter](https://github.com/manniL)
[πŸ’¬](#question-manniL "Answering Questions") [πŸ›](https://github.com/Atinux/Nuxt.js/issues?q=author%3AmanniL "Bug reports") [πŸ’»](https://github.com/Atinux/Nuxt.js/commits?author=manniL "Code") [πŸ’‘](#example-manniL "Examples") [πŸ‘€](#review-manniL "Reviewed Pull Requests") [⚠️](https://github.com/Atinux/Nuxt.js/commits?author=manniL "Tests") | [
Jonas Galvez](https://github.com/galvez)
[πŸ’¬](#question-galvez "Answering Questions") [πŸ›](https://github.com/Atinux/Nuxt.js/issues?q=author%3Agalvez "Bug reports") [πŸ’»](https://github.com/Atinux/Nuxt.js/commits?author=galvez "Code") [πŸ’‘](#example-galvez "Examples") [πŸ‘€](#review-galvez "Reviewed Pull Requests") [⚠️](https://github.com/Atinux/Nuxt.js/commits?author=galvez "Tests") | -| :---: | :---: | :---: | :---: | :---: | :---: | +| [
SΓ©bastien Chopin](https://github.com/atinux)
[πŸ“](#blog-Atinux "Blogposts") [πŸ›](https://github.com/Atinux/Nuxt.js/issues?q=author%3AAtinux "Bug reports") [πŸ’»](https://github.com/Atinux/Nuxt.js/commits?author=Atinux "Code") [🎨](#design-Atinux "Design") [πŸ“–](https://github.com/Atinux/Nuxt.js/commits?author=Atinux "Documentation") [πŸ’¬](#question-Atinux "Answering Questions") [πŸ‘€](#review-Atinux "Reviewed Pull Requests") [πŸ“’](#talk-Atinux "Talks") | [
Alexandre Chopin](https://github.com/alexchopin)
[🎨](#design-alexchopin "Design") [πŸ“–](https://github.com/Atinux/Nuxt.js/commits?author=alexchopin "Documentation") [πŸ“‹](#eventOrganizing-alexchopin "Event Organizing") [πŸ“¦](#platform-alexchopin "Packaging/porting to new platform") [πŸ’¬](#question-alexchopin "Answering Questions") [πŸ“’](#talk-alexchopin "Talks") | [
Pooya Parsa](https://github.com/pi0)
[πŸ›](https://github.com/Atinux/Nuxt.js/issues?q=author%3Api0 "Bug reports") [πŸ’»](https://github.com/Atinux/Nuxt.js/commits?author=pi0 "Code") [πŸ”Œ](#plugin-pi0 "Plugin/utility libraries") [πŸ’¬](#question-pi0 "Answering Questions") [πŸ‘€](#review-pi0 "Reviewed Pull Requests") [πŸ”§](#tool-pi0 "Tools") | [
Clark Du](https://github.com/clarkdo)
[πŸ›](https://github.com/Atinux/Nuxt.js/issues?q=author%3Aclarkdo "Bug reports") [πŸ’»](https://github.com/Atinux/Nuxt.js/commits?author=clarkdo "Code") [πŸ’‘](#example-clarkdo "Examples") [πŸ‘€](#review-clarkdo "Reviewed Pull Requests") [⚠️](https://github.com/Atinux/Nuxt.js/commits?author=clarkdo "Tests") [πŸ”§](#tool-clarkdo "Tools") | +| :---: | :---: | :---: | :---: | +| [
Alexander Lichter](https://github.com/manniL)
[πŸ’¬](#question-manniL "Answering Questions") [πŸ›](https://github.com/Atinux/Nuxt.js/issues?q=author%3AmanniL "Bug reports") [πŸ’»](https://github.com/Atinux/Nuxt.js/commits?author=manniL "Code") [πŸ’‘](#example-manniL "Examples") [πŸ‘€](#review-manniL "Reviewed Pull Requests") [⚠️](https://github.com/Atinux/Nuxt.js/commits?author=manniL "Tests") | [
Jonas Galvez](https://github.com/galvez)
[πŸ’¬](#question-galvez "Answering Questions") [πŸ›](https://github.com/Atinux/Nuxt.js/issues?q=author%3Agalvez "Bug reports") [πŸ’»](https://github.com/Atinux/Nuxt.js/commits?author=galvez "Code") [πŸ’‘](#example-galvez "Examples") [πŸ‘€](#review-galvez "Reviewed Pull Requests") [⚠️](https://github.com/Atinux/Nuxt.js/commits?author=galvez "Tests") | [
Dmitry Molotkov](https://github.com/aldarund)
[πŸ’¬](#question-aldarund "Answering Questions") [πŸ›](https://github.com/Atinux/Nuxt.js/issues?q=author%3Aaldarund "Bug reports") [πŸ’»](https://github.com/Atinux/Nuxt.js/commits?author=aldarund "Code") [πŸ€”](#ideas-aldarund "Ideas, Planning, & Feedback") [πŸ‘€](#review-aldarund "Reviewed Pull Requests") | [
Kevin Marrec](https://github.com/kevinmarrec)
[πŸ’»](https://github.com/Atinux/Nuxt.js/commits?author=kevinmarrec "Code") [πŸ€”](#ideas-kevinmarrec "Ideas, Planning, & Feedback") [πŸ“¦](#platform-kevinmarrec "Packaging/porting to new platform") [πŸ‘€](#review-kevinmarrec "Reviewed Pull Requests") | ## Contributors @@ -227,6 +202,11 @@ Thanks to BrowserStack! BrowserStack + +## Security + +If you discover a security vulnerability regarding Nuxt.js, please send an e-mail to the team via security@nuxtjs.org! All security vulnerabilities will be promptly addressed. + ## License [MIT](https://github.com/nuxt/nuxt.js/blob/dev/LICENSE) diff --git a/RELEASE_PLAN.md b/RELEASE_PLAN.md new file mode 100644 index 0000000000..843f05f733 --- /dev/null +++ b/RELEASE_PLAN.md @@ -0,0 +1,49 @@ +## Release Plan + +Starting with version `v2.4`, Nuxt will adhere to a formalized release plan (as good as possible). +Also, an end of life for older major versions is defined with this document + +### Major versions (3.x -> 4.0) + +Nuxt major releases are planned every **6 months**. This depends on a few factors though: + +* If there are no breaking changes waiting for a release, no new major version will be published. Instead, another minor one will be released. +* In case of unexpected major updates of important dependencies like Vue, Webpack, and so on, major versions might be released *earlier* than planned. + +The goal is to provide a **migration guide** for each major version as well, as escape hatches, so existing code +won't "just break". + +### Minor versions (2.1 -> 2.2) + +The release cycle for Nuxt.js minor versions is roughly **4 weeks**. + +Three of the four weeks will be used for actual **feature implementations** while the last week will be used for +**testing, fixing bugs and thorough audits**. + +That also means a *feature freeze* for the next minor version after these three weeks. +Features that aren't ready will be moved to the next cycle. "Waiting" for features +(for a longer time) will be avoided as good as possible to keep releases lean, concise, predictable and digestible. + +### Patch releases (2.2.3 -> 2.2.4) + +The last patch releases were mostly *bundled* fixes or single *hotfixes*. +In the future, fixes will be released **as soon as possible** after the actual PR/commit so people won't have to switch to `nuxt-edge` for bugfixes. This should improve the stability of Nuxt + +Fixes can or will include: + +* Updates of dependencies (for various reasons, like a "faulty/buggy" dependency or an newer versions that works better with the Nuxt.js code) +* Fixes for our code + +Bugfixes for upcoming features won't be ported of course. + +### Edge Release Channel + +After experimenting with `nuxt-edge` releases in the last time, the decisiion to do **nightly releases** for now instead of +releasing a version after *each commit* was made. + +## End of Life + +Starting with `v2.4`, every major Nuxt.js version will have an **End of Life**. +Previous releases will receive security updates and bugfixes **for one year and two weeks**, counted from the first release on. +As Nuxt majors are approximately released once every 6 months, this will allow developers to "skip one major version" without being stuck with a broken or unsecure Nuxt.js dependency. +The EOL also applies to the documentation. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 168b259462..f20e5abe31 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,11 +20,11 @@ steps: displayName: 'Install dependencies' - script: | - set JEST_JUNIT_OUTPUT=test-fixtures-junit.xml&& yarn test:fixtures -w=2 + set JEST_JUNIT_OUTPUT=test-fixtures-junit.xml && set NODE_OPTIONS=--max_old_space_size=4096 && yarn test:fixtures -i displayName: 'Test: Build Fixtures' - script: | - set JEST_JUNIT_OUTPUT=test-unit-junit.xml&& yarn test:unit -w=2 + set JEST_JUNIT_OUTPUT=test-unit-junit.xml && set NODE_OPTIONS=--max_old_space_size=4096 && yarn test:unit -w=2 displayName: 'Test: Run unit tests' - task: PublishTestResults@2 diff --git a/benchmarks/pages/stateless-big.vue b/benchmarks/pages/stateless-big.vue index 2d2418027b..4a3d2d7de3 100644 --- a/benchmarks/pages/stateless-big.vue +++ b/benchmarks/pages/stateless-big.vue @@ -1,5 +1,7 @@ diff --git a/distributions/nuxt-legacy/CHANGELOG.md b/distributions/nuxt-legacy/CHANGELOG.md index aaa1417a42..bec4f68f7d 100644 --- a/distributions/nuxt-legacy/CHANGELOG.md +++ b/distributions/nuxt-legacy/CHANGELOG.md @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.4.0](https://github.com/nuxt/nuxt.js/compare/v2.3.4...v2.4.0) (2019-01-28) + + +### Bug Fixes + +* **dist:** use -edge suffix to require cli ([98c1922](https://github.com/nuxt/nuxt.js/commit/98c1922)) +* **pkg:** move opencollective dependency nuxt and nuxt-legacy ([#4415](https://github.com/nuxt/nuxt.js/issues/4415)) ([f680e36](https://github.com/nuxt/nuxt.js/commit/f680e36)) +* exit with proper error code on errors ([#4806](https://github.com/nuxt/nuxt.js/issues/4806)) ([a7ba73e](https://github.com/nuxt/nuxt.js/commit/a7ba73e)) + + + + + ## [2.3.4](https://github.com/nuxt/nuxt.js/compare/v2.3.2...v2.3.4) (2018-11-26) diff --git a/distributions/nuxt-legacy/bin/nuxt-legacy.js b/distributions/nuxt-legacy/bin/nuxt-legacy.js index 741e63bb38..04043f2f23 100755 --- a/distributions/nuxt-legacy/bin/nuxt-legacy.js +++ b/distributions/nuxt-legacy/bin/nuxt-legacy.js @@ -1,10 +1,8 @@ #!/usr/bin/env node -const register = require('@babel/register') - require('@babel/polyfill') -register({ +require('@babel/register')({ presets: [ [ '@babel/env', { targets: { node: 'current' } } ] ], @@ -24,4 +22,9 @@ register({ ] }) -require('@nuxt/cli').run() +const suffix = require('../package.json').name.includes('-edge') ? '-edge' : '' +require('@nuxt/cli' + suffix).run() + .catch((error) => { + require('consola').fatal(error) + process.exit(2) + }) diff --git a/distributions/nuxt-legacy/package.js b/distributions/nuxt-legacy/package.js index 1548ca75c3..7ec679a347 100644 --- a/distributions/nuxt-legacy/package.js +++ b/distributions/nuxt-legacy/package.js @@ -1,11 +1,11 @@ export default { build: false, - extend(pkg, { load }) { - pkg.on('build:done', () => { - const mono = load('../..') - const nuxt = load('../nuxt') + hooks: { + async 'build:done'(pkg) { + const mono = pkg.load('../..') + const nuxt = pkg.load('../nuxt') - pkg.copyFilesFrom(mono, [ + await pkg.copyFilesFrom(mono, [ 'LICENSE' ]) @@ -17,7 +17,7 @@ export default { 'collective' ]) - pkg.writePackage() - }) + await pkg.writePackage() + } } } diff --git a/distributions/nuxt-legacy/package.json b/distributions/nuxt-legacy/package.json index 56c5249199..dcc12b31f2 100644 --- a/distributions/nuxt-legacy/package.json +++ b/distributions/nuxt-legacy/package.json @@ -1,6 +1,6 @@ { "name": "nuxt-legacy", - "version": "2.3.4", + "version": "2.4.0", "description": "Legacy build of Nuxt.js for Node.js < 8.0.0", "keywords": [ "nuxt", @@ -37,6 +37,12 @@ }, { "name": "Alexander Lichter (@manniL)" + }, + { + "name": "Dmitry Molotkov (@aldarund)" + }, + { + "name": "Kevin Marrec (@kevinmarrec)" } ], "files": [ @@ -44,17 +50,16 @@ ], "bin": "bin/nuxt-legacy.js", "dependencies": { - "@babel/core": "^7.1.6", - "@babel/polyfill": "^7.0.0", - "@babel/preset-env": "^7.1.6", + "@babel/core": "^7.2.2", + "@babel/polyfill": "^7.2.5", + "@babel/preset-env": "^7.3.1", "@babel/register": "^7.0.0", - "@nuxt/builder": "2.3.4", - "@nuxt/cli": "2.3.4", - "@nuxt/common": "2.3.4", - "@nuxt/core": "2.3.4", - "@nuxt/generator": "2.3.4", - "@nuxt/webpack": "2.3.4", - "@nuxtjs/opencollective": "^0.2.0" + "@nuxt/builder": "2.4.0", + "@nuxt/cli": "2.4.0", + "@nuxt/core": "2.4.0", + "@nuxt/generator": "2.4.0", + "@nuxt/opencollective": "^0.2.1", + "@nuxt/webpack": "2.4.0" }, "engines": { "node": ">=6.0.0", diff --git a/distributions/nuxt-start/CHANGELOG.md b/distributions/nuxt-start/CHANGELOG.md index c388535083..f977ecec9a 100644 --- a/distributions/nuxt-start/CHANGELOG.md +++ b/distributions/nuxt-start/CHANGELOG.md @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.4.0](https://github.com/nuxt/nuxt.js/compare/v2.3.4...v2.4.0) (2019-01-28) + + +### Bug Fixes + +* **dist:** use -edge suffix to require cli ([98c1922](https://github.com/nuxt/nuxt.js/commit/98c1922)) +* **nuxt-start:** include all vue-app dependencies to prevent breaking changes ([c664e3d](https://github.com/nuxt/nuxt.js/commit/c664e3d)) +* exit with proper error code on errors ([#4806](https://github.com/nuxt/nuxt.js/issues/4806)) ([a7ba73e](https://github.com/nuxt/nuxt.js/commit/a7ba73e)) + + + + + ## [2.3.4](https://github.com/nuxt/nuxt.js/compare/v2.3.2...v2.3.4) (2018-11-26) **Note:** Version bump only for package nuxt-start diff --git a/distributions/nuxt-start/bin/nuxt-start.js b/distributions/nuxt-start/bin/nuxt-start.js index ad9b96e59e..d3b7f83011 100755 --- a/distributions/nuxt-start/bin/nuxt-start.js +++ b/distributions/nuxt-start/bin/nuxt-start.js @@ -1,8 +1,12 @@ #!/usr/bin/env node -const { name } = require('../package.json') -const isEdge = name.indexOf('-edge') !== -1 -const cli = require(isEdge ? '@nuxt/cli-edge' : '@nuxt/cli') + if (process.argv[2] !== 'start') { process.argv.splice(2, 0, 'start') } -cli.run() + +const suffix = require('../package.json').name.includes('-edge') ? '-edge' : '' +require('@nuxt/cli' + suffix).run() + .catch((error) => { + require('consola').fatal(error) + process.exit(2) + }) diff --git a/distributions/nuxt-start/package.js b/distributions/nuxt-start/package.js index d8ece1e73e..2142a3cbe2 100644 --- a/distributions/nuxt-start/package.js +++ b/distributions/nuxt-start/package.js @@ -1,11 +1,11 @@ export default { build: true, - extend(pkg, { load }) { - pkg.on('build:done', () => { - const mono = load('../..') - const nuxt = load('../nuxt') + hooks: { + async 'build:done'(pkg) { + const mono = pkg.load('../..') + const nuxt = pkg.load('../nuxt') - pkg.copyFilesFrom(mono, [ + await pkg.copyFilesFrom(mono, [ 'LICENSE' ]) @@ -17,7 +17,7 @@ export default { 'engines' ]) - pkg.writePackage() - }) + await pkg.writePackage() + } } } diff --git a/distributions/nuxt-start/package.json b/distributions/nuxt-start/package.json index ece97ea7c9..38642a2911 100644 --- a/distributions/nuxt-start/package.json +++ b/distributions/nuxt-start/package.json @@ -1,6 +1,6 @@ { "name": "nuxt-start", - "version": "2.3.4", + "version": "2.4.0", "description": "Starts Nuxt.js Application in production mode", "keywords": [ "nuxt", @@ -37,6 +37,12 @@ }, { "name": "Alexander Lichter (@manniL)" + }, + { + "name": "Dmitry Molotkov (@aldarund)" + }, + { + "name": "Kevin Marrec (@kevinmarrec)" } ], "files": [ @@ -46,9 +52,13 @@ "main": "dist/nuxt-start.js", "bin": "bin/nuxt-start.js", "dependencies": { - "@nuxt/cli": "2.3.4", - "@nuxt/common": "2.3.4", - "@nuxt/core": "2.3.4" + "@nuxt/cli": "2.4.0", + "@nuxt/core": "2.4.0", + "vue": "^2.5.22", + "vue-meta": "^1.5.8", + "vue-no-ssr": "^1.1.1", + "vue-router": "^3.0.2", + "vuex": "^3.1.0" }, "engines": { "node": ">=8.0.0", diff --git a/distributions/nuxt-ts/CHANGELOG.md b/distributions/nuxt-ts/CHANGELOG.md new file mode 100644 index 0000000000..3f900f5c8c --- /dev/null +++ b/distributions/nuxt-ts/CHANGELOG.md @@ -0,0 +1,21 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [2.4.0](https://github.com/nuxt/nuxt.js/compare/v2.3.4...v2.4.0) (2019-01-28) + + +### Bug Fixes + +* **dist:** use -edge suffix to require cli ([98c1922](https://github.com/nuxt/nuxt.js/commit/98c1922)) +* exit with proper error code on errors ([#4806](https://github.com/nuxt/nuxt.js/issues/4806)) ([a7ba73e](https://github.com/nuxt/nuxt.js/commit/a7ba73e)) +* **ts:** better `tsconfig.json` handling & improve tests ([#4856](https://github.com/nuxt/nuxt.js/issues/4856)) ([f18ce4e](https://github.com/nuxt/nuxt.js/commit/f18ce4e)) +* **ts:** fix nuxt-ts binary when running nuxt commands ([#4844](https://github.com/nuxt/nuxt.js/issues/4844)) ([6e60aa4](https://github.com/nuxt/nuxt.js/commit/6e60aa4)) +* **ts:** set ts-node register compilerOptions.module to 'commonjs' ([#4752](https://github.com/nuxt/nuxt.js/issues/4752)) ([e22e14b](https://github.com/nuxt/nuxt.js/commit/e22e14b)) + + +### Features + +* nuxt-ts ([#4658](https://github.com/nuxt/nuxt.js/issues/4658)) ([ee0096b](https://github.com/nuxt/nuxt.js/commit/ee0096b)) +* **ts:** auto generate tsconfig.json ([#4776](https://github.com/nuxt/nuxt.js/issues/4776)) ([2a1ee96](https://github.com/nuxt/nuxt.js/commit/2a1ee96)) diff --git a/distributions/nuxt-ts/README.md b/distributions/nuxt-ts/README.md new file mode 100644 index 0000000000..21a22a2ec4 --- /dev/null +++ b/distributions/nuxt-ts/README.md @@ -0,0 +1,3 @@ +# nuxt-ts + +> Nuxt With Runtime Typescript Support diff --git a/distributions/nuxt-ts/bin/nuxt-ts.js b/distributions/nuxt-ts/bin/nuxt-ts.js new file mode 100755 index 0000000000..8c736ed77d --- /dev/null +++ b/distributions/nuxt-ts/bin/nuxt-ts.js @@ -0,0 +1,19 @@ +#!/usr/bin/env node + +const { resolve } = require('path') + +// Globally indicate we are running in ts mode +process.env.NUXT_TS = 'true' + +const nuxtCommands = ['dev', 'build', 'generate', 'start'] +const rootDir = (process.argv[2] && !nuxtCommands.includes(process.argv[2])) ? process.argv[2] : process.cwd() +const tsConfigPath = resolve(rootDir, 'tsconfig.json') + +const suffix = require('../package.json').name.includes('-edge') ? '-edge' : '' + +require('@nuxt/typescript' + suffix).setup(tsConfigPath).then(() => { + require('@nuxt/cli' + suffix).run() +}).catch((error) => { + require('consola').fatal(error) + process.exit(2) +}) diff --git a/distributions/nuxt-ts/package.js b/distributions/nuxt-ts/package.js new file mode 100644 index 0000000000..7ec679a347 --- /dev/null +++ b/distributions/nuxt-ts/package.js @@ -0,0 +1,23 @@ +export default { + build: false, + hooks: { + async 'build:done'(pkg) { + const mono = pkg.load('../..') + const nuxt = pkg.load('../nuxt') + + await pkg.copyFilesFrom(mono, [ + 'LICENSE' + ]) + + pkg.copyFieldsFrom(nuxt, [ + 'license', + 'repository', + 'contributors', + 'keywords', + 'collective' + ]) + + await pkg.writePackage() + } + } +} diff --git a/distributions/nuxt-ts/package.json b/distributions/nuxt-ts/package.json new file mode 100644 index 0000000000..dee318d1a8 --- /dev/null +++ b/distributions/nuxt-ts/package.json @@ -0,0 +1,75 @@ +{ + "name": "nuxt-ts", + "version": "2.4.0", + "description": "Nuxt With Runtime Typescript Support", + "keywords": [ + "nuxt", + "nuxt-ts", + "nuxt.js", + "nuxt.ts", + "nuxtjs", + "nuxts", + "ssr", + "vue", + "vue isomorphic", + "vue server side", + "vue ssr", + "vue universal", + "vue versatile", + "vue.js", + "vuejs" + ], + "homepage": "https://github.com/nuxt/nuxt.js#readme", + "repository": "nuxt/nuxt.js", + "license": "MIT", + "contributors": [ + { + "name": "Sebastien Chopin (@Atinux)" + }, + { + "name": "Alexandre Chopin (@alexchopin)" + }, + { + "name": "Pooya Parsa (@pi0)" + }, + { + "name": "Clark Du (@clarkdo)" + }, + { + "name": "Jonas Galvez (@galvez)" + }, + { + "name": "Alexander Lichter (@manniL)" + }, + { + "name": "Dmitry Molotkov (@aldarund)" + }, + { + "name": "Kevin Marrec (@kevinmarrec)" + } + ], + "files": [ + "bin" + ], + "bin": { + "nuxt-ts": "bin/nuxt-ts.js", + "nuxts": "bin/nuxt-ts.js" + }, + "dependencies": { + "@nuxt/builder": "2.4.0", + "@nuxt/cli": "2.4.0", + "@nuxt/core": "2.4.0", + "@nuxt/generator": "2.4.0", + "@nuxt/opencollective": "^0.2.1", + "@nuxt/typescript": "2.4.0", + "@nuxt/webpack": "2.4.0" + }, + "engines": { + "node": ">=6.0.0", + "npm": ">=3.0.0" + }, + "collective": { + "url": "https://opencollective.com/nuxtjs", + "logoUrl": "https://opencollective.com/nuxtjs/logo.txt?reverse=true&variant=variant2" + } +} diff --git a/distributions/nuxt/CHANGELOG.md b/distributions/nuxt/CHANGELOG.md index aaa1417a42..bec4f68f7d 100644 --- a/distributions/nuxt/CHANGELOG.md +++ b/distributions/nuxt/CHANGELOG.md @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.4.0](https://github.com/nuxt/nuxt.js/compare/v2.3.4...v2.4.0) (2019-01-28) + + +### Bug Fixes + +* **dist:** use -edge suffix to require cli ([98c1922](https://github.com/nuxt/nuxt.js/commit/98c1922)) +* **pkg:** move opencollective dependency nuxt and nuxt-legacy ([#4415](https://github.com/nuxt/nuxt.js/issues/4415)) ([f680e36](https://github.com/nuxt/nuxt.js/commit/f680e36)) +* exit with proper error code on errors ([#4806](https://github.com/nuxt/nuxt.js/issues/4806)) ([a7ba73e](https://github.com/nuxt/nuxt.js/commit/a7ba73e)) + + + + + ## [2.3.4](https://github.com/nuxt/nuxt.js/compare/v2.3.2...v2.3.4) (2018-11-26) diff --git a/distributions/nuxt/README.md b/distributions/nuxt/README.md index a6526bc339..779bc99103 100644 --- a/distributions/nuxt/README.md +++ b/distributions/nuxt/README.md @@ -38,6 +38,7 @@ - Custom layouts with the `layouts/` directory - Middleware - Code splitting for every `pages/` +- Loading just the critical CSS (page-level) Learn more at [nuxtjs.org](https://nuxtjs.org). @@ -70,43 +71,10 @@ Support us with a monthly donation and help us continue our activities. [[Become ## Getting started ``` -$ npm install nuxt +$ npx create-nuxt-app ``` -Add a script to your package.json like this: - -```json -{ - "scripts": { - "start": "nuxt" - } -} -``` - -After that, the file-system is the main API. Every .vue file becomes a route that gets automatically processed and rendered. - -Populate `./pages/index.vue` inside your project: - -```html - - - -``` - -And then run: -```bash -npm start -``` - -Go to [http://localhost:3000](http://localhost:3000) +It's as simple as that! ## Templates @@ -227,6 +195,11 @@ Thanks to BrowserStack! BrowserStack + +## Security + +If you discover a security vulnerability regarding Nuxt.js, please send an e-mail to the team via security@nuxtjs.org! All security vulnerabilities will be promptly addressed. + ## License [MIT](https://github.com/nuxt/nuxt.js/blob/dev/LICENSE) diff --git a/distributions/nuxt/bin/nuxt.js b/distributions/nuxt/bin/nuxt.js index 6496c3d2b2..25ea739baf 100755 --- a/distributions/nuxt/bin/nuxt.js +++ b/distributions/nuxt/bin/nuxt.js @@ -1,5 +1,8 @@ #!/usr/bin/env node -const { name } = require('../package.json') -const isEdge = name.indexOf('-edge') !== -1 -const cli = require(isEdge ? '@nuxt/cli-edge' : '@nuxt/cli') -cli.run() + +const suffix = require('../package.json').name.includes('-edge') ? '-edge' : '' +require('@nuxt/cli' + suffix).run() + .catch((error) => { + require('consola').fatal(error) + process.exit(2) + }) diff --git a/distributions/nuxt/package.js b/distributions/nuxt/package.js index 2171515e51..53aeeab1ec 100644 --- a/distributions/nuxt/package.js +++ b/distributions/nuxt/package.js @@ -1,13 +1,13 @@ export default { build: true, - extend(pkg, { load }) { - pkg.on('build:done', () => { - const mono = load('../..') + hooks: { + async 'build:done'(pkg) { + const mono = pkg.load('../..') - pkg.copyFilesFrom(mono, [ + await pkg.copyFilesFrom(mono, [ 'LICENSE', 'README.md' ]) - }) + } } } diff --git a/distributions/nuxt/package.json b/distributions/nuxt/package.json index 1a6164d06d..4dc9b6b7a5 100644 --- a/distributions/nuxt/package.json +++ b/distributions/nuxt/package.json @@ -1,6 +1,6 @@ { "name": "nuxt", - "version": "2.3.4", + "version": "2.4.0", "description": "A minimalistic framework for server-rendered Vue.js applications (inspired by Next.js)", "keywords": [ "nuxt", @@ -36,6 +36,12 @@ }, { "name": "Alexander Lichter (@manniL)" + }, + { + "name": "Dmitry Molotkov (@aldarund)" + }, + { + "name": "Kevin Marrec (@kevinmarrec)" } ], "files": [ @@ -48,13 +54,12 @@ "postinstall": "opencollective || exit 0" }, "dependencies": { - "@nuxt/builder": "2.3.4", - "@nuxt/cli": "2.3.4", - "@nuxt/common": "2.3.4", - "@nuxt/core": "2.3.4", - "@nuxt/generator": "2.3.4", - "@nuxt/webpack": "2.3.4", - "@nuxtjs/opencollective": "^0.2.0" + "@nuxt/builder": "2.4.0", + "@nuxt/cli": "2.4.0", + "@nuxt/core": "2.4.0", + "@nuxt/generator": "2.4.0", + "@nuxt/opencollective": "^0.2.1", + "@nuxt/webpack": "2.4.0" }, "engines": { "node": ">=8.0.0", diff --git a/examples/async-component-injection/layouts/default.vue b/examples/async-component-injection/layouts/default.vue index 82bfa911c9..ceba7c02fe 100644 --- a/examples/async-component-injection/layouts/default.vue +++ b/examples/async-component-injection/layouts/default.vue @@ -1,14 +1,20 @@ diff --git a/examples/async-component-injection/package.json b/examples/async-component-injection/package.json index 2b99de1c0e..7d3f4896f7 100644 --- a/examples/async-component-injection/package.json +++ b/examples/async-component-injection/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt" + "start": "nuxt", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/async-component-injection/pages/_slug.vue b/examples/async-component-injection/pages/_slug.vue index 73ff71e4a9..9ac714694a 100644 --- a/examples/async-component-injection/pages/_slug.vue +++ b/examples/async-component-injection/pages/_slug.vue @@ -1,6 +1,6 @@ diff --git a/examples/async-component-injection/pages/index.vue b/examples/async-component-injection/pages/index.vue index 13636fe492..24525fd6e5 100644 --- a/examples/async-component-injection/pages/index.vue +++ b/examples/async-component-injection/pages/index.vue @@ -2,9 +2,17 @@ diff --git a/examples/async-component-injection/posts/404.vue b/examples/async-component-injection/posts/404.vue index 33f884b536..4965d77953 100644 --- a/examples/async-component-injection/posts/404.vue +++ b/examples/async-component-injection/posts/404.vue @@ -1,3 +1,5 @@ diff --git a/examples/async-component-injection/posts/deep-dive-into-ocean.vue b/examples/async-component-injection/posts/deep-dive-into-ocean.vue index c8023966d6..3cc9c61b90 100644 --- a/examples/async-component-injection/posts/deep-dive-into-ocean.vue +++ b/examples/async-component-injection/posts/deep-dive-into-ocean.vue @@ -1,6 +1,8 @@ diff --git a/examples/async-data/pages/posts/index.vue b/examples/async-data/pages/posts/index.vue index 1015972fa8..7a375b422e 100644 --- a/examples/async-data/pages/posts/index.vue +++ b/examples/async-data/pages/posts/index.vue @@ -4,10 +4,16 @@

Blog

  • - {{ post.title }} + + {{ post.title }} +
-

Back to home page

+

+ + Back to home page + +

diff --git a/examples/auth-jwt/package.json b/examples/auth-jwt/package.json index daec5e9859..863bd2810d 100644 --- a/examples/auth-jwt/package.json +++ b/examples/auth-jwt/package.json @@ -8,6 +8,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/auth-jwt/pages/index.vue b/examples/auth-jwt/pages/index.vue index 8884d93a82..a45edb3063 100644 --- a/examples/auth-jwt/pages/index.vue +++ b/examples/auth-jwt/pages/index.vue @@ -1,13 +1,21 @@ diff --git a/examples/auth-jwt/pages/login.vue b/examples/auth-jwt/pages/login.vue index e39cee8082..5a64ecb8c8 100644 --- a/examples/auth-jwt/pages/login.vue +++ b/examples/auth-jwt/pages/login.vue @@ -8,7 +8,9 @@ - +

The credentials are not verified for the example purpose.

diff --git a/examples/auth-jwt/pages/secret.vue b/examples/auth-jwt/pages/secret.vue index 9f2aacd528..26cfe81019 100644 --- a/examples/auth-jwt/pages/secret.vue +++ b/examples/auth-jwt/pages/secret.vue @@ -1,7 +1,9 @@ diff --git a/examples/auth-routes/package.json b/examples/auth-routes/package.json index c5a1cf23d7..8dacdc7bc6 100644 --- a/examples/auth-routes/package.json +++ b/examples/auth-routes/package.json @@ -10,6 +10,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/auth-routes/pages/index.vue b/examples/auth-routes/pages/index.vue index 401db4150d..a050695b0b 100644 --- a/examples/auth-routes/pages/index.vue +++ b/examples/auth-routes/pages/index.vue @@ -2,19 +2,29 @@

Please login to see the secret content

-

{{ formError }}

+

+ {{ formError }} +

To login, use demo as username and demo as password.

Username:

Password:

- +
Hello {{ $store.state.authUser.username }}!
I am the secret content, I am shown only when the use is connected.

You can also refresh this page, you'll still be connected!

- +
-

Super secret page

+

+ + Super secret page + +

diff --git a/examples/auth-routes/pages/secret.vue b/examples/auth-routes/pages/secret.vue index 30dff34b4e..a004006193 100644 --- a/examples/auth-routes/pages/secret.vue +++ b/examples/auth-routes/pages/secret.vue @@ -2,7 +2,9 @@

Super secret page

If you try to access this URL not connected, you will see the error page telling your that you are not connected.

- Back to the home page + + Back to the home page +
diff --git a/examples/axios/package.json b/examples/axios/package.json index ee2db40cd9..d4fc578194 100644 --- a/examples/axios/package.json +++ b/examples/axios/package.json @@ -9,6 +9,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/cached-components/package.json b/examples/cached-components/package.json index 9fc387b9bd..b6ae221185 100644 --- a/examples/cached-components/package.json +++ b/examples/cached-components/package.json @@ -7,6 +7,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/coffeescript/layouts/default.vue b/examples/coffeescript/layouts/default.vue index acfe1d2cf0..e94a758025 100644 --- a/examples/coffeescript/layouts/default.vue +++ b/examples/coffeescript/layouts/default.vue @@ -1,6 +1,6 @@ diff --git a/examples/coffeescript/package.json b/examples/coffeescript/package.json index df84c75844..8516dd52e1 100644 --- a/examples/coffeescript/package.json +++ b/examples/coffeescript/package.json @@ -7,7 +7,8 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" }, "dependencies": { "nuxt-edge": "latest" diff --git a/examples/custom-build/package.json b/examples/custom-build/package.json index 80ced97849..86f1499dab 100644 --- a/examples/custom-build/package.json +++ b/examples/custom-build/package.json @@ -7,6 +7,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/custom-layouts/layouts/dark.vue b/examples/custom-layouts/layouts/dark.vue index f25b4c2459..5c414543b7 100644 --- a/examples/custom-layouts/layouts/dark.vue +++ b/examples/custom-layouts/layouts/dark.vue @@ -1,6 +1,6 @@ diff --git a/examples/custom-layouts/layouts/default.vue b/examples/custom-layouts/layouts/default.vue index 2b4d5a87f3..1aea542319 100644 --- a/examples/custom-layouts/layouts/default.vue +++ b/examples/custom-layouts/layouts/default.vue @@ -1,7 +1,7 @@ diff --git a/examples/custom-layouts/layouts/error.vue b/examples/custom-layouts/layouts/error.vue index 126edd0af2..b30b3c7912 100644 --- a/examples/custom-layouts/layouts/error.vue +++ b/examples/custom-layouts/layouts/error.vue @@ -1,8 +1,14 @@ diff --git a/examples/custom-layouts/package.json b/examples/custom-layouts/package.json index 09ba1dc997..23c29f0bb4 100644 --- a/examples/custom-layouts/package.json +++ b/examples/custom-layouts/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/custom-layouts/pages/about.vue b/examples/custom-layouts/pages/about.vue index 7f3c014c14..3e88d8577d 100644 --- a/examples/custom-layouts/pages/about.vue +++ b/examples/custom-layouts/pages/about.vue @@ -1,7 +1,9 @@ diff --git a/examples/custom-layouts/pages/index.vue b/examples/custom-layouts/pages/index.vue index bb96d34c35..658ac5ac1d 100644 --- a/examples/custom-layouts/pages/index.vue +++ b/examples/custom-layouts/pages/index.vue @@ -1,6 +1,8 @@ diff --git a/examples/custom-loading/package.json b/examples/custom-loading/package.json index 13ddb7b82c..a2571cdf6a 100644 --- a/examples/custom-loading/package.json +++ b/examples/custom-loading/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/custom-loading/pages/about.vue b/examples/custom-loading/pages/about.vue index c7b8c03f71..504a1b2b0f 100644 --- a/examples/custom-loading/pages/about.vue +++ b/examples/custom-loading/pages/about.vue @@ -1,7 +1,9 @@ diff --git a/examples/custom-loading/pages/index.vue b/examples/custom-loading/pages/index.vue index 43561ba5db..b45f391a70 100644 --- a/examples/custom-loading/pages/index.vue +++ b/examples/custom-loading/pages/index.vue @@ -1,7 +1,9 @@ diff --git a/examples/custom-page-loading/package.json b/examples/custom-page-loading/package.json index d4c36bd54c..33a5faf2a0 100644 --- a/examples/custom-page-loading/package.json +++ b/examples/custom-page-loading/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/custom-page-loading/pages/about.vue b/examples/custom-page-loading/pages/about.vue index 5b9a59be92..ff0d185ed6 100644 --- a/examples/custom-page-loading/pages/about.vue +++ b/examples/custom-page-loading/pages/about.vue @@ -2,8 +2,12 @@

About Page

It should take 5 seconds for the loader to disappear

-

It should take 5 seconds for the route to change after you - click here

+

+ It should take 5 seconds for the route to change after you + + click here + +

diff --git a/examples/custom-page-loading/pages/final.vue b/examples/custom-page-loading/pages/final.vue index 08b5f7d0e1..fca5638c28 100644 --- a/examples/custom-page-loading/pages/final.vue +++ b/examples/custom-page-loading/pages/final.vue @@ -1,7 +1,9 @@ diff --git a/examples/custom-page-loading/pages/index.vue b/examples/custom-page-loading/pages/index.vue index 43561ba5db..b45f391a70 100644 --- a/examples/custom-page-loading/pages/index.vue +++ b/examples/custom-page-loading/pages/index.vue @@ -1,7 +1,9 @@ diff --git a/examples/custom-port-host/package.json b/examples/custom-port-host/package.json index 740a116363..e5b1f7971d 100644 --- a/examples/custom-port-host/package.json +++ b/examples/custom-port-host/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/custom-routes/package.json b/examples/custom-routes/package.json index 94d8fe8272..38d678a47c 100644 --- a/examples/custom-routes/package.json +++ b/examples/custom-routes/package.json @@ -7,6 +7,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/custom-routes/pages/index.vue b/examples/custom-routes/pages/index.vue index 889363ca7c..f70020e355 100644 --- a/examples/custom-routes/pages/index.vue +++ b/examples/custom-routes/pages/index.vue @@ -3,7 +3,9 @@

Users

  • - {{ user.name }} + + {{ user.name }} +
diff --git a/examples/custom-routes/pages/users/_id.vue b/examples/custom-routes/pages/users/_id.vue index f09c9bffc7..05b24b7bf7 100644 --- a/examples/custom-routes/pages/users/_id.vue +++ b/examples/custom-routes/pages/users/_id.vue @@ -3,7 +3,11 @@

{{ name }}

@{{ username }}

Email : {{ email }}

-

List of users

+

+ + List of users + +

diff --git a/examples/custom-server/package.json b/examples/custom-server/package.json index 39ade9acb7..ca15a00e35 100644 --- a/examples/custom-server/package.json +++ b/examples/custom-server/package.json @@ -7,6 +7,7 @@ "scripts": { "dev": "node server.js", "build": "nuxt build", - "start": "NODE_ENV=production node server.js" + "start": "NODE_ENV=production node server.js", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/custom-server/pages/index.vue b/examples/custom-server/pages/index.vue index 58494d6520..b8f045cab6 100644 --- a/examples/custom-server/pages/index.vue +++ b/examples/custom-server/pages/index.vue @@ -1,3 +1,7 @@ diff --git a/examples/dynamic-components/components/image.vue b/examples/dynamic-components/components/image.vue index 9c7cd98ff6..58c2623704 100644 --- a/examples/dynamic-components/components/image.vue +++ b/examples/dynamic-components/components/image.vue @@ -9,21 +9,29 @@ viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="uil-ring" - > + > + + + + + + + + diff --git a/examples/dynamic-components/package.json b/examples/dynamic-components/package.json index a98a3a8d66..992ca12416 100644 --- a/examples/dynamic-components/package.json +++ b/examples/dynamic-components/package.json @@ -9,6 +9,7 @@ "dev": "nuxt", "build": "nuxt build", "start": "nuxt start", - "generate": "nuxt generate" + "generate": "nuxt generate", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/dynamic-components/pages/index.vue b/examples/dynamic-components/pages/index.vue index f1c198626f..87fe2e7df0 100755 --- a/examples/dynamic-components/pages/index.vue +++ b/examples/dynamic-components/pages/index.vue @@ -1,11 +1,11 @@ diff --git a/examples/dynamic-components/pages/ssr.vue b/examples/dynamic-components/pages/ssr.vue index 237eca9773..8ed67f6296 100644 --- a/examples/dynamic-components/pages/ssr.vue +++ b/examples/dynamic-components/pages/ssr.vue @@ -1,11 +1,11 @@ diff --git a/examples/dynamic-layouts/layouts/error.vue b/examples/dynamic-layouts/layouts/error.vue index aa064f32ec..d18a9a7db3 100644 --- a/examples/dynamic-layouts/layouts/error.vue +++ b/examples/dynamic-layouts/layouts/error.vue @@ -1,8 +1,14 @@ diff --git a/examples/dynamic-layouts/layouts/mobile.vue b/examples/dynamic-layouts/layouts/mobile.vue index dbdde9274c..2acd7ccee3 100644 --- a/examples/dynamic-layouts/layouts/mobile.vue +++ b/examples/dynamic-layouts/layouts/mobile.vue @@ -1,7 +1,9 @@ diff --git a/examples/dynamic-layouts/package.json b/examples/dynamic-layouts/package.json index d0ed3f9f74..dea7619e05 100644 --- a/examples/dynamic-layouts/package.json +++ b/examples/dynamic-layouts/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/dynamic-layouts/pages/about.vue b/examples/dynamic-layouts/pages/about.vue index 18d0789771..56bd22bb8b 100644 --- a/examples/dynamic-layouts/pages/about.vue +++ b/examples/dynamic-layouts/pages/about.vue @@ -1,7 +1,9 @@ diff --git a/examples/dynamic-layouts/pages/index.vue b/examples/dynamic-layouts/pages/index.vue index 81b96a923b..fe2bc2d659 100644 --- a/examples/dynamic-layouts/pages/index.vue +++ b/examples/dynamic-layouts/pages/index.vue @@ -1,7 +1,9 @@ diff --git a/examples/global-css/package.json b/examples/global-css/package.json index 7ad2d61c10..73de465f6c 100644 --- a/examples/global-css/package.json +++ b/examples/global-css/package.json @@ -7,6 +7,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/global-css/pages/about.vue b/examples/global-css/pages/about.vue index 33c5802721..ea7a8d6d7f 100644 --- a/examples/global-css/pages/about.vue +++ b/examples/global-css/pages/about.vue @@ -1,7 +1,17 @@ diff --git a/examples/global-css/pages/index.vue b/examples/global-css/pages/index.vue index 97df0b1c22..4ee0a090b8 100644 --- a/examples/global-css/pages/index.vue +++ b/examples/global-css/pages/index.vue @@ -1,7 +1,17 @@ diff --git a/examples/hello-world/nuxt.config.js b/examples/hello-world/nuxt.config.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/examples/hello-world/package.json b/examples/hello-world/package.json index 0cc6a5c7c8..a93a322b71 100644 --- a/examples/hello-world/package.json +++ b/examples/hello-world/package.json @@ -1,11 +1,12 @@ { "name": "example-hello-world", "dependencies": { - "nuxt": "latest" + "nuxt-edge": "latest" }, "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/hello-world/pages/about.vue b/examples/hello-world/pages/about.vue index a4d06cd37f..017574200d 100755 --- a/examples/hello-world/pages/about.vue +++ b/examples/hello-world/pages/about.vue @@ -1,7 +1,9 @@ diff --git a/examples/hello-world/pages/index.vue b/examples/hello-world/pages/index.vue index 43487b0da4..5b3e5ae010 100755 --- a/examples/hello-world/pages/index.vue +++ b/examples/hello-world/pages/index.vue @@ -1,7 +1,9 @@ diff --git a/examples/i18n/layouts/default.vue b/examples/i18n/layouts/default.vue index c11bce81db..7d970a4dd9 100644 --- a/examples/i18n/layouts/default.vue +++ b/examples/i18n/layouts/default.vue @@ -2,24 +2,26 @@
-

Nuxt i18n

+

+ Nuxt i18n +

- +
diff --git a/examples/i18n/package.json b/examples/i18n/package.json index c35861b659..1918a2e69e 100644 --- a/examples/i18n/package.json +++ b/examples/i18n/package.json @@ -8,6 +8,7 @@ "dev": "nuxt", "build": "nuxt build", "start": "nuxt start", - "generate": "nuxt generate" + "generate": "nuxt generate", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/i18n/pages/_lang/about.vue b/examples/i18n/pages/_lang/about.vue index 7325f8e311..6c412c7303 100644 --- a/examples/i18n/pages/_lang/about.vue +++ b/examples/i18n/pages/_lang/about.vue @@ -1,7 +1,9 @@ + + diff --git a/examples/named-views/components/mainTop.vue b/examples/named-views/components/mainTop.vue new file mode 100644 index 0000000000..44b442afb0 --- /dev/null +++ b/examples/named-views/components/mainTop.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/examples/named-views/layouts/default.vue b/examples/named-views/layouts/default.vue new file mode 100644 index 0000000000..20818174fc --- /dev/null +++ b/examples/named-views/layouts/default.vue @@ -0,0 +1,6 @@ + diff --git a/examples/named-views/nuxt.config.js b/examples/named-views/nuxt.config.js new file mode 100644 index 0000000000..a23f24aae9 --- /dev/null +++ b/examples/named-views/nuxt.config.js @@ -0,0 +1,30 @@ +export default { + router: { + extendRoutes(routes, resolve) { + const indexIndex = routes.findIndex(route => route.name === 'index') + let index = routes[indexIndex].children.findIndex(route => route.name === 'index-child-id') + routes[indexIndex].children[index] = { + ...routes[indexIndex].children[index], + components: { + default: routes[indexIndex].children[index].component, + left: resolve(__dirname, 'components/childLeft.vue') + }, + chunkNames: { + left: 'components/childLeft' + } + } + + index = routes.findIndex(route => route.name === 'main') + routes[index] = { + ...routes[index], + components: { + default: routes[index].component, + top: resolve(__dirname, 'components/mainTop.vue') + }, + chunkNames: { + top: 'components/mainTop' + } + } + } + } +} diff --git a/examples/named-views/package.json b/examples/named-views/package.json new file mode 100644 index 0000000000..fb8189c908 --- /dev/null +++ b/examples/named-views/package.json @@ -0,0 +1,12 @@ +{ + "name": "my-app", + "dependencies": { + "nuxt": "latest" + }, + "scripts": { + "dev": "nuxt", + "build": "nuxt build", + "start": "nuxt start", + "post-update": "yarn upgrade --latest" + } +} diff --git a/examples/named-views/pages/index.vue b/examples/named-views/pages/index.vue new file mode 100755 index 0000000000..37f9753ee8 --- /dev/null +++ b/examples/named-views/pages/index.vue @@ -0,0 +1,73 @@ + + + + + diff --git a/examples/named-views/pages/index/child/_id/index.vue b/examples/named-views/pages/index/child/_id/index.vue new file mode 100644 index 0000000000..85ee3b0fa1 --- /dev/null +++ b/examples/named-views/pages/index/child/_id/index.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/examples/named-views/pages/index/section.vue b/examples/named-views/pages/index/section.vue new file mode 100644 index 0000000000..48834ac561 --- /dev/null +++ b/examples/named-views/pages/index/section.vue @@ -0,0 +1,16 @@ + + + + + diff --git a/examples/named-views/pages/main.vue b/examples/named-views/pages/main.vue new file mode 100755 index 0000000000..14ca7e8693 --- /dev/null +++ b/examples/named-views/pages/main.vue @@ -0,0 +1,50 @@ + + + + + diff --git a/examples/nested-components/components/post.vue b/examples/nested-components/components/post.vue index 36a42e70b0..ef9cd8be11 100755 --- a/examples/nested-components/components/post.vue +++ b/examples/nested-components/components/post.vue @@ -1,15 +1,19 @@ diff --git a/examples/nested-components/package.json b/examples/nested-components/package.json index a31c195e59..3bd53e3a76 100644 --- a/examples/nested-components/package.json +++ b/examples/nested-components/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/nested-components/pages/index.vue b/examples/nested-components/pages/index.vue index 95cb81b454..f53870294e 100755 --- a/examples/nested-components/pages/index.vue +++ b/examples/nested-components/pages/index.vue @@ -1,36 +1,36 @@ diff --git a/examples/nested-routes/package.json b/examples/nested-routes/package.json index e0c2566d29..0def519291 100644 --- a/examples/nested-routes/package.json +++ b/examples/nested-routes/package.json @@ -7,6 +7,7 @@ "dev": "nuxt", "build": "nuxt build", "start": "nuxt start", - "generate": "nuxt generate" + "generate": "nuxt generate", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/nested-routes/pages/index.vue b/examples/nested-routes/pages/index.vue index 08322f2f44..ca2d64976c 100644 --- a/examples/nested-routes/pages/index.vue +++ b/examples/nested-routes/pages/index.vue @@ -1,15 +1,21 @@ diff --git a/examples/no-ssr/package.json b/examples/no-ssr/package.json index 9e0a43e9a6..04868bb2d9 100644 --- a/examples/no-ssr/package.json +++ b/examples/no-ssr/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/no-ssr/pages/index.vue b/examples/no-ssr/pages/index.vue index b36a31faa3..a6942c6d24 100755 --- a/examples/no-ssr/pages/index.vue +++ b/examples/no-ssr/pages/index.vue @@ -1,12 +1,12 @@ diff --git a/examples/nuxt-prefetch/README.md b/examples/nuxt-prefetch/README.md new file mode 100644 index 0000000000..9907d2f545 --- /dev/null +++ b/examples/nuxt-prefetch/README.md @@ -0,0 +1,3 @@ +# Example of Nuxt.js prefetching + +Learn more at https://github.com/nuxt/nuxt.js/pull/4574 diff --git a/examples/nuxt-prefetch/assets/check.svg b/examples/nuxt-prefetch/assets/check.svg new file mode 100644 index 0000000000..bb093ca332 --- /dev/null +++ b/examples/nuxt-prefetch/assets/check.svg @@ -0,0 +1 @@ + diff --git a/examples/nuxt-prefetch/layouts/default.vue b/examples/nuxt-prefetch/layouts/default.vue new file mode 100644 index 0000000000..a8c577b30c --- /dev/null +++ b/examples/nuxt-prefetch/layouts/default.vue @@ -0,0 +1,57 @@ + + + diff --git a/examples/nuxt-prefetch/nuxt.config.js b/examples/nuxt-prefetch/nuxt.config.js new file mode 100644 index 0000000000..dc2118bd9c --- /dev/null +++ b/examples/nuxt-prefetch/nuxt.config.js @@ -0,0 +1,22 @@ +export default { + head: { + titleTemplate: '%s - NuxtJS Prefetching', + htmlAttrs: { lang: 'en' }, + meta: [ + { charset: 'utf-8' }, + { name: 'viewport', content: 'width=device-width, initial-scale=1' } + ], + // Support polyfill for browsers that don't support it (Safari Mobile for example) + script: [ + { src: 'https://polyfill.io/v2/polyfill.min.js?features=IntersectionObserver', body: true } + ] + }, + router: { + // To disable prefetching, uncomment the line + // prefetchLinks: false + + // Activate prefetched class (default: false) + // Used to display the check mark next to the prefetched link + linkPrefetchedClass: 'nuxt-link-prefetched' + } +} diff --git a/examples/nuxt-prefetch/package.json b/examples/nuxt-prefetch/package.json new file mode 100644 index 0000000000..6747461236 --- /dev/null +++ b/examples/nuxt-prefetch/package.json @@ -0,0 +1,12 @@ +{ + "name": "example-nuxt-prefetch", + "dependencies": { + "nuxt-edge": "latest" + }, + "scripts": { + "dev": "nuxt", + "build": "nuxt build", + "start": "nuxt start", + "post-update": "yarn upgrade --latest" + } +} diff --git a/examples/nuxt-prefetch/pages/accelerated.vue b/examples/nuxt-prefetch/pages/accelerated.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/accelerated.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/active.vue b/examples/nuxt-prefetch/pages/active.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/active.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/agile.vue b/examples/nuxt-prefetch/pages/agile.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/agile.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/brisk.vue b/examples/nuxt-prefetch/pages/brisk.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/brisk.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/dashing.vue b/examples/nuxt-prefetch/pages/dashing.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/dashing.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/electric.vue b/examples/nuxt-prefetch/pages/electric.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/electric.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/flashing.vue b/examples/nuxt-prefetch/pages/flashing.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/flashing.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/fleet.vue b/examples/nuxt-prefetch/pages/fleet.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/fleet.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/fleeting.vue b/examples/nuxt-prefetch/pages/fleeting.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/fleeting.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/flying.vue b/examples/nuxt-prefetch/pages/flying.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/flying.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/hot.vue b/examples/nuxt-prefetch/pages/hot.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/hot.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/hurried.vue b/examples/nuxt-prefetch/pages/hurried.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/hurried.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/index.vue b/examples/nuxt-prefetch/pages/index.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/index.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/nimble.vue b/examples/nuxt-prefetch/pages/nimble.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/nimble.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/quick.vue b/examples/nuxt-prefetch/pages/quick.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/quick.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/racing.vue b/examples/nuxt-prefetch/pages/racing.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/racing.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/rapid.vue b/examples/nuxt-prefetch/pages/rapid.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/rapid.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/ready.vue b/examples/nuxt-prefetch/pages/ready.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/ready.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/snap.vue b/examples/nuxt-prefetch/pages/snap.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/snap.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/swift.vue b/examples/nuxt-prefetch/pages/swift.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/swift.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/pages/winged.vue b/examples/nuxt-prefetch/pages/winged.vue new file mode 100755 index 0000000000..de9c09d6d0 --- /dev/null +++ b/examples/nuxt-prefetch/pages/winged.vue @@ -0,0 +1,17 @@ + + + diff --git a/examples/nuxt-prefetch/store/index.js b/examples/nuxt-prefetch/store/index.js new file mode 100644 index 0000000000..0295063e7e --- /dev/null +++ b/examples/nuxt-prefetch/store/index.js @@ -0,0 +1,25 @@ +export const state = () => ({ + links: [ + 'index', + 'agile', + 'brisk', + 'hot', + 'nimble', + 'quick', + 'rapid', + 'swift', + 'accelerated', + 'active', + 'dashing', + 'electric', + 'flashing', + 'fleet', + 'fleeting', + 'flying', + 'hurried', + 'racing', + 'ready', + 'snap', + 'winged' + ] +}) diff --git a/examples/plugins-vendor/package.json b/examples/plugins-vendor/package.json index 462fd003ba..a0b64fe62b 100644 --- a/examples/plugins-vendor/package.json +++ b/examples/plugins-vendor/package.json @@ -9,6 +9,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/plugins-vendor/pages/about.vue b/examples/plugins-vendor/pages/about.vue index c0fcbe822c..963a40bf2e 100644 --- a/examples/plugins-vendor/pages/about.vue +++ b/examples/plugins-vendor/pages/about.vue @@ -1,7 +1,11 @@ diff --git a/examples/plugins-vendor/pages/index.vue b/examples/plugins-vendor/pages/index.vue index f30f8f558f..718f199273 100644 --- a/examples/plugins-vendor/pages/index.vue +++ b/examples/plugins-vendor/pages/index.vue @@ -1,7 +1,15 @@ diff --git a/examples/pug/README.md b/examples/pug/README.md new file mode 100644 index 0000000000..8fc6026c97 --- /dev/null +++ b/examples/pug/README.md @@ -0,0 +1,3 @@ +# Nuxt.js with Pug + +No further packages needed. It works out of the box. diff --git a/examples/pug/package.json b/examples/pug/package.json new file mode 100644 index 0000000000..213ddefa3a --- /dev/null +++ b/examples/pug/package.json @@ -0,0 +1,14 @@ +{ + "name": "example-pug", + "dependencies": { + "nuxt-edge": "latest", + "pug": "^2.0.3", + "pug-loader": "^2.4.0" + }, + "scripts": { + "dev": "nuxt", + "build": "nuxt build", + "start": "nuxt start", + "post-update": "yarn upgrade --latest" + } +} diff --git a/examples/pug/pages/about.vue b/examples/pug/pages/about.vue new file mode 100755 index 0000000000..56d127ccbc --- /dev/null +++ b/examples/pug/pages/about.vue @@ -0,0 +1,18 @@ + + + diff --git a/examples/pug/pages/index.vue b/examples/pug/pages/index.vue new file mode 100755 index 0000000000..7029972991 --- /dev/null +++ b/examples/pug/pages/index.vue @@ -0,0 +1,13 @@ + + + diff --git a/examples/routes-meta/layouts/default.vue b/examples/routes-meta/layouts/default.vue index 5012714058..a07cf43941 100644 --- a/examples/routes-meta/layouts/default.vue +++ b/examples/routes-meta/layouts/default.vue @@ -1,11 +1,17 @@ diff --git a/examples/routes-meta/package.json b/examples/routes-meta/package.json index 6415c914b5..e159a20711 100644 --- a/examples/routes-meta/package.json +++ b/examples/routes-meta/package.json @@ -7,6 +7,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/routes-meta/pages/index.vue b/examples/routes-meta/pages/index.vue index 2e31ae4815..0eeec0bb91 100644 --- a/examples/routes-meta/pages/index.vue +++ b/examples/routes-meta/pages/index.vue @@ -1,13 +1,16 @@ diff --git a/examples/routes-meta/pages/parent/blue.vue b/examples/routes-meta/pages/parent/blue.vue index 07ea5f6401..ec654910a4 100644 --- a/examples/routes-meta/pages/parent/blue.vue +++ b/examples/routes-meta/pages/parent/blue.vue @@ -2,8 +2,11 @@

I am the blue page

I am a child of /parent, and the theme is overwritten by myself!

-

Go back to - Parent +

+ Go back to + + Parent +

diff --git a/examples/routes-transitions/package.json b/examples/routes-transitions/package.json index be3c562d44..4fa70badf9 100644 --- a/examples/routes-transitions/package.json +++ b/examples/routes-transitions/package.json @@ -7,6 +7,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/routes-transitions/pages/about.vue b/examples/routes-transitions/pages/about.vue index bfeea07ec2..33199b54d3 100644 --- a/examples/routes-transitions/pages/about.vue +++ b/examples/routes-transitions/pages/about.vue @@ -1,7 +1,9 @@ diff --git a/examples/routes-transitions/pages/index.vue b/examples/routes-transitions/pages/index.vue index fe5ce74005..9e6c927d20 100644 --- a/examples/routes-transitions/pages/index.vue +++ b/examples/routes-transitions/pages/index.vue @@ -1,7 +1,15 @@ diff --git a/examples/routes-transitions/pages/users.vue b/examples/routes-transitions/pages/users.vue index b738da77f1..c1cd619b74 100644 --- a/examples/routes-transitions/pages/users.vue +++ b/examples/routes-transitions/pages/users.vue @@ -1,17 +1,29 @@ @@ -21,7 +33,7 @@ import axios from 'axios' export default { // Watch for $route.query.page to call Component methods (asyncData, fetch, validate, layout, etc.) watchQuery: ['page'], - // Key for (transitions) + // Key for (transitions) key: to => to.fullPath, // Called to know which transition to apply transition(to, from) { diff --git a/examples/scroll-behavior/layouts/default2.vue b/examples/scroll-behavior/layouts/default2.vue new file mode 100644 index 0000000000..5d3ae9c407 --- /dev/null +++ b/examples/scroll-behavior/layouts/default2.vue @@ -0,0 +1,3 @@ + diff --git a/examples/scroll-behavior/nuxt.config.js b/examples/scroll-behavior/nuxt.config.js index 737f516991..c236197313 100644 --- a/examples/scroll-behavior/nuxt.config.js +++ b/examples/scroll-behavior/nuxt.config.js @@ -1,3 +1,4 @@ export default { - css: ['~/assets/main.css'] + css: ['~/assets/main.css'], + modules: ['@nuxtjs/axios'] } diff --git a/examples/scroll-behavior/package.json b/examples/scroll-behavior/package.json index ba290bcd74..19c77bab1d 100644 --- a/examples/scroll-behavior/package.json +++ b/examples/scroll-behavior/package.json @@ -1,13 +1,14 @@ { "name": "example-scroll-behavior", "dependencies": { - "axios": "^0.15.3", + "@nuxtjs/axios": "^5.3.6", "nuxt-edge": "latest", "vue-router": "https://github.com/homerjam/vue-router#dist" }, "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/scroll-behavior/pages/about.vue b/examples/scroll-behavior/pages/about.vue index 79d7d2c09e..837e71361d 100644 --- a/examples/scroll-behavior/pages/about.vue +++ b/examples/scroll-behavior/pages/about.vue @@ -3,14 +3,20 @@

About page

  • - Profile + + Profile +
  • - Contact + + Contact +
- - Home page + + + Home page + diff --git a/examples/scroll-behavior/pages/another-long.vue b/examples/scroll-behavior/pages/another-long.vue new file mode 100644 index 0000000000..365451a6e7 --- /dev/null +++ b/examples/scroll-behavior/pages/another-long.vue @@ -0,0 +1,16 @@ + + + diff --git a/examples/scroll-behavior/pages/index.vue b/examples/scroll-behavior/pages/index.vue index ee81801479..2c108144bc 100644 --- a/examples/scroll-behavior/pages/index.vue +++ b/examples/scroll-behavior/pages/index.vue @@ -1,10 +1,31 @@ diff --git a/examples/scroll-behavior/pages/long.vue b/examples/scroll-behavior/pages/long.vue index eb4fd41ef5..2449147789 100644 --- a/examples/scroll-behavior/pages/long.vue +++ b/examples/scroll-behavior/pages/long.vue @@ -1,7 +1,11 @@ diff --git a/examples/scroll-behavior/pages/users.vue b/examples/scroll-behavior/pages/users.vue index b738da77f1..73885ed5c4 100644 --- a/examples/scroll-behavior/pages/users.vue +++ b/examples/scroll-behavior/pages/users.vue @@ -1,36 +1,47 @@ diff --git a/examples/tailwindcss-purgecss/components/MyComponent.vue b/examples/tailwindcss-purgecss/components/MyComponent.vue index 8c9baf0e9e..bdf92cf1e1 100644 --- a/examples/tailwindcss-purgecss/components/MyComponent.vue +++ b/examples/tailwindcss-purgecss/components/MyComponent.vue @@ -1,5 +1,7 @@ diff --git a/examples/tailwindcss-purgecss/layouts/default.vue b/examples/tailwindcss-purgecss/layouts/default.vue index d89470fb9c..1910dc63f3 100644 --- a/examples/tailwindcss-purgecss/layouts/default.vue +++ b/examples/tailwindcss-purgecss/layouts/default.vue @@ -1,6 +1,8 @@ diff --git a/examples/tailwindcss-purgecss/package.json b/examples/tailwindcss-purgecss/package.json index 0e9a5d4916..5b8c4b9e1b 100644 --- a/examples/tailwindcss-purgecss/package.json +++ b/examples/tailwindcss-purgecss/package.json @@ -8,7 +8,8 @@ "build": "nuxt build", "start": "nuxt start", "generate": "nuxt generate", - "deploy": "surge -p dist/ -d https://nuxt-tailwindcss-purgecss.surge.sh" + "deploy": "surge -p dist/ -d https://nuxt-tailwindcss-purgecss.surge.sh", + "post-update": "yarn upgrade --latest" }, "dependencies": { "nuxt": "^2.2.0" diff --git a/examples/tailwindcss-purgecss/pages/index.vue b/examples/tailwindcss-purgecss/pages/index.vue index 7aa6dc2c35..65bcffecd0 100644 --- a/examples/tailwindcss-purgecss/pages/index.vue +++ b/examples/tailwindcss-purgecss/pages/index.vue @@ -1,8 +1,12 @@ diff --git a/examples/tailwindcss/layouts/default.vue b/examples/tailwindcss/layouts/default.vue index 0ff10c15cd..21ab7eb464 100644 --- a/examples/tailwindcss/layouts/default.vue +++ b/examples/tailwindcss/layouts/default.vue @@ -1,7 +1,7 @@ diff --git a/examples/typescript-vuex/README.md b/examples/typescript-vuex/README.md new file mode 100644 index 0000000000..6a041d9201 --- /dev/null +++ b/examples/typescript-vuex/README.md @@ -0,0 +1,3 @@ +# TypeScript with Vuex example + +https://nuxtjs.org/examples/typescript-vuex diff --git a/examples/typescript/assets/css/main.css b/examples/typescript-vuex/assets/css/main.css similarity index 100% rename from examples/typescript/assets/css/main.css rename to examples/typescript-vuex/assets/css/main.css diff --git a/examples/typescript-vuex/components/Card.vue b/examples/typescript-vuex/components/Card.vue new file mode 100644 index 0000000000..eab608c226 --- /dev/null +++ b/examples/typescript-vuex/components/Card.vue @@ -0,0 +1,28 @@ + + + diff --git a/examples/typescript-vuex/layouts/default.vue b/examples/typescript-vuex/layouts/default.vue new file mode 100644 index 0000000000..a11d79fb00 --- /dev/null +++ b/examples/typescript-vuex/layouts/default.vue @@ -0,0 +1,12 @@ + + + diff --git a/examples/typescript/nuxt.config.js b/examples/typescript-vuex/nuxt.config.ts similarity index 53% rename from examples/typescript/nuxt.config.js rename to examples/typescript-vuex/nuxt.config.ts index 682c251744..985fb1eece 100644 --- a/examples/typescript/nuxt.config.js +++ b/examples/typescript-vuex/nuxt.config.ts @@ -1,23 +1,15 @@ -export default { - env: { - baseUrl: process.env.BASE_URL || 'http://localhost:3000' - }, +const config = { head: { title: 'starter', meta: [ { charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }, - { hid: 'description', name: 'description', content: 'Nuxt.js project' } + { hid: 'description', name: 'description', content: 'Nuxt TS project' } ], link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }] }, - /* - ** Customize the progress-bar color - */ loading: { color: '#3B8070' }, - /* - ** Build configuration - */ - css: ['tachyons/css/tachyons.min.css', '~/assets/css/main.css'], - modules: ['~/modules/typescript'] + css: ['tachyons/css/tachyons.min.css', '~/assets/css/main.css'] } + +export default config diff --git a/examples/typescript-vuex/package.json b/examples/typescript-vuex/package.json new file mode 100644 index 0000000000..9973e39dd6 --- /dev/null +++ b/examples/typescript-vuex/package.json @@ -0,0 +1,22 @@ +{ + "version": "1.0.0", + "private": true, + "dependencies": { + "axios": "^0.18.0", + "nuxt-ts-edge": "latest", + "tachyons": "^4.11.1", + "vue-property-decorator": "^7.3.0", + "vuex-class": "^0.3.1" + }, + "scripts": { + "dev": "nuxt-ts", + "build": "nuxt-ts build", + "start": "nuxt-ts start", + "generate": "nuxt-ts generate", + "lint": "tslint --project .", + "post-update": "yarn upgrade --latest" + }, + "devDependencies": { + "tslint-config-standard": "^8.0.1" + } +} diff --git a/examples/typescript-vuex/pages/index.vue b/examples/typescript-vuex/pages/index.vue new file mode 100644 index 0000000000..7b2869716c --- /dev/null +++ b/examples/typescript-vuex/pages/index.vue @@ -0,0 +1,39 @@ + + + diff --git a/examples/typescript/static/favicon.ico b/examples/typescript-vuex/static/favicon.ico similarity index 100% rename from examples/typescript/static/favicon.ico rename to examples/typescript-vuex/static/favicon.ico diff --git a/examples/typescript/static/random-data.json b/examples/typescript-vuex/static/random-data.json similarity index 100% rename from examples/typescript/static/random-data.json rename to examples/typescript-vuex/static/random-data.json diff --git a/examples/typescript/store/index.ts b/examples/typescript-vuex/store/index.ts similarity index 88% rename from examples/typescript/store/index.ts rename to examples/typescript-vuex/store/index.ts index 5bb3f11913..56e90e9be6 100644 --- a/examples/typescript/store/index.ts +++ b/examples/typescript-vuex/store/index.ts @@ -11,11 +11,7 @@ import * as people from './modules/people' // action: Sync or async operations that commit mutations // mutations: Modify the state -interface ModulesStates { - people: people.State -} - -export type RootState = root.State & ModulesStates +export type RootState = root.State const createStore = () => { return new Vuex.Store({ diff --git a/examples/typescript/store/modules/people.ts b/examples/typescript-vuex/store/modules/people.ts similarity index 87% rename from examples/typescript/store/modules/people.ts rename to examples/typescript-vuex/store/modules/people.ts index 25f3fb6f4a..f6deceb8a0 100644 --- a/examples/typescript/store/modules/people.ts +++ b/examples/typescript-vuex/store/modules/people.ts @@ -52,20 +52,20 @@ export const getters: GetterTree = { } export interface Actions extends ActionTree { - select(context: ActionContext, id: number): void + select (context: ActionContext, id: number): void } export const actions: Actions = { - select({ commit }, id: number) { + select ({ commit }, id: number) { commit(types.SELECT, id) } } export const mutations: MutationTree = { - [types.SELECT](state, id: number) { + [types.SELECT] (state, id: number) { state.selected = id }, - [types.SET](state, people: Person[]) { + [types.SET] (state, people: Person[]) { state.people = people } } diff --git a/examples/typescript/store/root.ts b/examples/typescript-vuex/store/root.ts similarity index 73% rename from examples/typescript/store/root.ts rename to examples/typescript-vuex/store/root.ts index 41f5373e8c..145020363a 100644 --- a/examples/typescript/store/root.ts +++ b/examples/typescript-vuex/store/root.ts @@ -1,5 +1,5 @@ import { GetterTree, ActionContext, ActionTree, MutationTree } from 'vuex' -import axios from '~/plugins/axios' +import axios from 'axios' import { RootState } from 'store' import * as people from './modules/people' @@ -12,12 +12,12 @@ export const state = (): State => ({}) export const getters: GetterTree = {} export interface Actions extends ActionTree { - nuxtServerInit(context: ActionContext): void + nuxtServerInit (context: ActionContext): void } export const actions: Actions = { - async nuxtServerInit({ commit }) { - const response = await axios.get('/random-data.json') + async nuxtServerInit ({ commit }) { + const response = await axios.get('/random-data.json', { proxy: { host: '127.0.0.1', port: 3000 } }) const staticPeople = response.data.slice(0, 10) commit(`${people.name}/${people.types.SET}`, staticPeople, { root: true }) } diff --git a/examples/typescript-vuex/tsconfig.json b/examples/typescript-vuex/tsconfig.json new file mode 100644 index 0000000000..2b98ff6b4b --- /dev/null +++ b/examples/typescript-vuex/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "@nuxt/typescript-edge", + "compilerOptions": { + "baseUrl": ".", + "noImplicitAny": false, + "types": [ + "@types/node", + "@nuxt/vue-app-edge" + ] + } +} diff --git a/examples/typescript-vuex/tslint.json b/examples/typescript-vuex/tslint.json new file mode 100644 index 0000000000..085d45bd4b --- /dev/null +++ b/examples/typescript-vuex/tslint.json @@ -0,0 +1,9 @@ +{ + "defaultSeverity": "error", + "extends": [ + "tslint-config-standard" + ], + "rules": { + "prefer-const": true + } +} diff --git a/examples/typescript/README.md b/examples/typescript/README.md index a72ae8fe82..e14feee334 100644 --- a/examples/typescript/README.md +++ b/examples/typescript/README.md @@ -1,3 +1,3 @@ -# Using typescript within nuxt.js +# TypeScript example -https://github.com/johnlindquist/nuxt-typescript-starter/ +https://codesandbox.io/s/0qmykr7wq0 diff --git a/examples/typescript/components/Card.vue b/examples/typescript/components/Card.vue deleted file mode 100644 index 6632f4b404..0000000000 --- a/examples/typescript/components/Card.vue +++ /dev/null @@ -1,29 +0,0 @@ - - - diff --git a/examples/typescript/components/HelloWorld.vue b/examples/typescript/components/HelloWorld.vue new file mode 100644 index 0000000000..92c06e3df1 --- /dev/null +++ b/examples/typescript/components/HelloWorld.vue @@ -0,0 +1,14 @@ + + + diff --git a/examples/typescript/layouts/default.vue b/examples/typescript/layouts/default.vue deleted file mode 100644 index d531baa1f2..0000000000 --- a/examples/typescript/layouts/default.vue +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/examples/typescript/modules/typescript.js b/examples/typescript/modules/typescript.js deleted file mode 100644 index 0c7f88df45..0000000000 --- a/examples/typescript/modules/typescript.js +++ /dev/null @@ -1,30 +0,0 @@ -export default function () { - // Add .ts extension for store, middleware and more - this.nuxt.options.extensions.push('ts') - // Extend build - this.extendBuild((config) => { - const tsLoader = { - loader: 'ts-loader', - options: { - appendTsSuffixTo: [/\.vue$/] - }, - exclude: [ - /dist/, - /\.temp/ - ] - } - // Add TypeScript loader - config.module.rules.push( - Object.assign( - { - test: /((client|server)\.js)|(\.tsx?)$/ - }, - tsLoader - ) - ) - // Add .ts extension in webpack resolve - if (config.resolve.extensions.indexOf('.ts') === -1) { - config.resolve.extensions.push('.ts') - } - }) -} diff --git a/examples/typescript/nuxt.config.ts b/examples/typescript/nuxt.config.ts new file mode 100644 index 0000000000..f33d7c4e6e --- /dev/null +++ b/examples/typescript/nuxt.config.ts @@ -0,0 +1,3 @@ +export default { + plugins: ['~/plugins/hello'] +} diff --git a/examples/typescript/package.json b/examples/typescript/package.json index 4dcc4f8583..0d28e44bcd 100644 --- a/examples/typescript/package.json +++ b/examples/typescript/package.json @@ -1,22 +1,19 @@ { - "version": "1.0.1", + "version": "1.0.0", "private": true, "dependencies": { - "axios": "^0.17.1", - "nuxt-edge": "latest", - "nuxt-class-component": "^1.1.3", - "tachyons": "^4.9.1", - "vue-property-decorator": "^6.0.0", - "vuex-class": "^0.3.0" + "nuxt-ts-edge": "latest", + "vue-property-decorator": "^7.3.0" }, "scripts": { - "dev": "nuxt", - "build": "nuxt build", - "start": "nuxt start", - "generate": "nuxt generate" + "dev": "nuxt-ts", + "build": "nuxt-ts build", + "start": "nuxt-ts start", + "generate": "nuxt-ts generate", + "lint": "tslint --project .", + "post-update": "yarn upgrade --latest" }, "devDependencies": { - "ts-loader": "^3.2.0", - "typescript": "^2.6.2" + "tslint-config-standard": "^8.0.1" } } diff --git a/examples/typescript/pages/index.vue b/examples/typescript/pages/index.vue index 1480c6c73d..1bfe2bdf0b 100644 --- a/examples/typescript/pages/index.vue +++ b/examples/typescript/pages/index.vue @@ -1,38 +1,15 @@ diff --git a/examples/typescript/plugins/axios.js b/examples/typescript/plugins/axios.js deleted file mode 100644 index 444dd65f50..0000000000 --- a/examples/typescript/plugins/axios.js +++ /dev/null @@ -1,5 +0,0 @@ -import axios from 'axios' - -export default axios.create({ - baseURL: process.env.baseUrl -}) diff --git a/examples/typescript/plugins/hello.ts b/examples/typescript/plugins/hello.ts new file mode 100644 index 0000000000..e37dd192fe --- /dev/null +++ b/examples/typescript/plugins/hello.ts @@ -0,0 +1,3 @@ +export default () => { + console.log(`Hello from ${process.server ? 'Server' : 'Client'} !`) +} diff --git a/examples/typescript/tsconfig.json b/examples/typescript/tsconfig.json index 25539ebd12..b2825067b2 100644 --- a/examples/typescript/tsconfig.json +++ b/examples/typescript/tsconfig.json @@ -1,30 +1,10 @@ { + "extends": "@nuxt/typescript-edge", "compilerOptions": { - "target": "es5", - "lib": [ - "dom", - "es2015" - ], - "module": "es2015", - "moduleResolution": "node", - "experimentalDecorators": true, - "noImplicitAny": false, - "noImplicitThis": false, - "strictNullChecks": true, - "removeComments": true, - "suppressImplicitAnyIndexErrors": true, - "allowSyntheticDefaultImports": true, "baseUrl": ".", - "allowJs": true, - "paths": { - "~/": ["./"], - "~/assets/*": ["./assets/*"], - "~/components/*": ["./components/*"], - "~/middleware/*": ["./middleware/*"], - "~/pages/*": ["./pages/*"], - "~/plugins/*": ["./plugins/*"], - "~/static/*": ["./static/*"], - "~/store/*": ["./store/*"] - } - } + "types": [ + "@types/node", + "@nuxt/vue-app-edge" + ] + }, } diff --git a/examples/typescript/tslint.json b/examples/typescript/tslint.json new file mode 100644 index 0000000000..085d45bd4b --- /dev/null +++ b/examples/typescript/tslint.json @@ -0,0 +1,9 @@ +{ + "defaultSeverity": "error", + "extends": [ + "tslint-config-standard" + ], + "rules": { + "prefer-const": true + } +} diff --git a/examples/uikit/layouts/default.vue b/examples/uikit/layouts/default.vue index 04f11e3238..636babbeea 100644 --- a/examples/uikit/layouts/default.vue +++ b/examples/uikit/layouts/default.vue @@ -1,5 +1,5 @@ diff --git a/examples/uikit/package.json b/examples/uikit/package.json index 80b0ad45dd..ab8bbdce75 100644 --- a/examples/uikit/package.json +++ b/examples/uikit/package.json @@ -8,6 +8,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/uikit/pages/about.vue b/examples/uikit/pages/about.vue index dd5cf8cc66..f80eec84f6 100644 --- a/examples/uikit/pages/about.vue +++ b/examples/uikit/pages/about.vue @@ -4,7 +4,9 @@
- Home page + + Home page + diff --git a/examples/uikit/pages/index.vue b/examples/uikit/pages/index.vue index ab5b67b26a..ae84cbb077 100644 --- a/examples/uikit/pages/index.vue +++ b/examples/uikit/pages/index.vue @@ -1,12 +1,22 @@ diff --git a/examples/vue-apollo/package.json b/examples/vue-apollo/package.json index c77a65bef3..f2344fbc0d 100644 --- a/examples/vue-apollo/package.json +++ b/examples/vue-apollo/package.json @@ -8,6 +8,7 @@ "dev": "nuxt", "build": "nuxt build", "start": "nuxt start", - "generate": "nuxt generate" + "generate": "nuxt generate", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/vue-apollo/pages/car/_id.vue b/examples/vue-apollo/pages/car/_id.vue index b64cfe26f4..0967005465 100644 --- a/examples/vue-apollo/pages/car/_id.vue +++ b/examples/vue-apollo/pages/car/_id.vue @@ -3,7 +3,11 @@

{{ Car.make }} {{ Car.model }}

{{ formatCurrency(Car.price) }}

-

Home page

+

+ + Home page + +

diff --git a/examples/vue-apollo/pages/index.vue b/examples/vue-apollo/pages/index.vue index 6c6e440d36..33d8f6d996 100644 --- a/examples/vue-apollo/pages/index.vue +++ b/examples/vue-apollo/pages/index.vue @@ -3,9 +3,9 @@

Cars

  • - + {{ car.year }} {{ car.make }} {{ car.model }} - +
diff --git a/examples/vue-chartjs/layouts/default.vue b/examples/vue-chartjs/layouts/default.vue index 317c56c0e4..b1d322c34b 100644 --- a/examples/vue-chartjs/layouts/default.vue +++ b/examples/vue-chartjs/layouts/default.vue @@ -1,10 +1,18 @@ diff --git a/examples/vue-chartjs/package.json b/examples/vue-chartjs/package.json index cc3f1d2665..0157c6b051 100644 --- a/examples/vue-chartjs/package.json +++ b/examples/vue-chartjs/package.json @@ -10,6 +10,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/vue-chartjs/pages/contributors.vue b/examples/vue-chartjs/pages/contributors.vue index f4337aeae9..671a981835 100644 --- a/examples/vue-chartjs/pages/contributors.vue +++ b/examples/vue-chartjs/pages/contributors.vue @@ -1,6 +1,6 @@ diff --git a/examples/vue-chartjs/pages/index.vue b/examples/vue-chartjs/pages/index.vue index fd74161569..0814675a55 100755 --- a/examples/vue-chartjs/pages/index.vue +++ b/examples/vue-chartjs/pages/index.vue @@ -1,6 +1,6 @@ diff --git a/examples/vue-class-component/components/Base.vue b/examples/vue-class-component/components/Base.vue index e732d9414d..dce1f2d8d9 100644 --- a/examples/vue-class-component/components/Base.vue +++ b/examples/vue-class-component/components/Base.vue @@ -4,8 +4,14 @@

msg: {{ msg }}

env: {{ env }}

computed msg: {{ computedMsg }}

- -

About page

+ +

+ + About page + +

diff --git a/examples/vue-class-component/components/Child.vue b/examples/vue-class-component/components/Child.vue index cf007c7a42..827eee6f2f 100644 --- a/examples/vue-class-component/components/Child.vue +++ b/examples/vue-class-component/components/Child.vue @@ -4,8 +4,14 @@

msg: {{ msg }}

env: {{ env }}

computed msg: {{ computedMsg }}

- -

About page

+ +

+ + About page + +

diff --git a/examples/vue-class-component/package.json b/examples/vue-class-component/package.json index 3ee600c4d8..6b57af78d7 100644 --- a/examples/vue-class-component/package.json +++ b/examples/vue-class-component/package.json @@ -7,6 +7,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/vue-class-component/pages/about.vue b/examples/vue-class-component/pages/about.vue index cbe04d7fda..57a01449ef 100644 --- a/examples/vue-class-component/pages/about.vue +++ b/examples/vue-class-component/pages/about.vue @@ -1,6 +1,10 @@ diff --git a/examples/vuex-persistedstate/package.json b/examples/vuex-persistedstate/package.json index 4fcdf73950..ede2867060 100644 --- a/examples/vuex-persistedstate/package.json +++ b/examples/vuex-persistedstate/package.json @@ -7,6 +7,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/vuex-persistedstate/pages/index.vue b/examples/vuex-persistedstate/pages/index.vue index 8540d23c60..8734ceb2fb 100644 --- a/examples/vuex-persistedstate/pages/index.vue +++ b/examples/vuex-persistedstate/pages/index.vue @@ -2,8 +2,12 @@

{{ counter }}

- - + +

diff --git a/examples/vuex-store-modules/package.json b/examples/vuex-store-modules/package.json index 9cf23402db..d637bb72d7 100644 --- a/examples/vuex-store-modules/package.json +++ b/examples/vuex-store-modules/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/vuex-store-modules/pages/about.vue b/examples/vuex-store-modules/pages/about.vue index f489bfe089..45fa28a173 100644 --- a/examples/vuex-store-modules/pages/about.vue +++ b/examples/vuex-store-modules/pages/about.vue @@ -1,8 +1,12 @@ diff --git a/examples/vuex-store-modules/pages/index.vue b/examples/vuex-store-modules/pages/index.vue index 24efe70cdd..33316ebce5 100644 --- a/examples/vuex-store-modules/pages/index.vue +++ b/examples/vuex-store-modules/pages/index.vue @@ -1,17 +1,25 @@ diff --git a/examples/vuex-store-modules/pages/todos.vue b/examples/vuex-store-modules/pages/todos.vue index 3ca87b7a0b..5cc5133cef 100644 --- a/examples/vuex-store-modules/pages/todos.vue +++ b/examples/vuex-store-modules/pages/todos.vue @@ -4,11 +4,15 @@
  • - {{ todo.text }} + + {{ todo.text }} +
- Home + + Home + diff --git a/examples/vuex-store-modules/pages/website.vue b/examples/vuex-store-modules/pages/website.vue index d85e4aa00b..0d33e8425a 100644 --- a/examples/vuex-store-modules/pages/website.vue +++ b/examples/vuex-store-modules/pages/website.vue @@ -12,7 +12,9 @@ {{ comment }} - Home + + Home + diff --git a/examples/vuex-store/package.json b/examples/vuex-store/package.json index 61b1996ad7..cd8ae6f989 100644 --- a/examples/vuex-store/package.json +++ b/examples/vuex-store/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "nuxt", "build": "nuxt build", - "start": "nuxt start" + "start": "nuxt start", + "post-update": "yarn upgrade --latest" } } diff --git a/examples/vuex-store/pages/about.vue b/examples/vuex-store/pages/about.vue index f489bfe089..45fa28a173 100644 --- a/examples/vuex-store/pages/about.vue +++ b/examples/vuex-store/pages/about.vue @@ -1,8 +1,12 @@ diff --git a/examples/vuex-store/pages/index.vue b/examples/vuex-store/pages/index.vue index 7406a84dd8..9bd9563c16 100644 --- a/examples/vuex-store/pages/index.vue +++ b/examples/vuex-store/pages/index.vue @@ -1,8 +1,12 @@ diff --git a/examples/web-worker/layouts/default.vue b/examples/web-worker/layouts/default.vue index 85a5090efe..3fec18260f 100644 --- a/examples/web-worker/layouts/default.vue +++ b/examples/web-worker/layouts/default.vue @@ -1,6 +1,6 @@ diff --git a/examples/web-worker/package.json b/examples/web-worker/package.json index 377950b296..b70cd20a47 100644 --- a/examples/web-worker/package.json +++ b/examples/web-worker/package.json @@ -8,7 +8,8 @@ "start": "nuxt start", "generate": "nuxt generate", "lint": "eslint --ext .js,.vue --ignore-path .gitignore .", - "precommit": "npm run lint" + "precommit": "npm run lint", + "post-update": "yarn upgrade --latest" }, "dependencies": { "nuxt-edge": "latest" diff --git a/examples/web-worker/pages/index.vue b/examples/web-worker/pages/index.vue index eb307006c3..8835240495 100644 --- a/examples/web-worker/pages/index.vue +++ b/examples/web-worker/pages/index.vue @@ -1,7 +1,7 @@ diff --git a/test/fixtures/spa/nuxt.config.js b/test/fixtures/spa/nuxt.config.js index d8337c48e8..e3f902b0f4 100644 --- a/test/fixtures/spa/nuxt.config.js +++ b/test/fixtures/spa/nuxt.config.js @@ -4,6 +4,15 @@ export default { render: { http2: { push: true + }, + bundleRenderer: { + shouldPrefetch: () => true + } + }, + build: { + filenames: { + app: '[name].js', + chunk: '[name].js' } }, plugins: [ diff --git a/test/fixtures/ssr/components/test.vue b/test/fixtures/ssr/components/test.vue index d7cbad1722..4120ae1a4b 100644 --- a/test/fixtures/ssr/components/test.vue +++ b/test/fixtures/ssr/components/test.vue @@ -1,7 +1,5 @@ diff --git a/test/fixtures/ssr/pages/data.vue b/test/fixtures/ssr/pages/data.vue index 0c7c69bd2b..4120ae1a4b 100644 --- a/test/fixtures/ssr/pages/data.vue +++ b/test/fixtures/ssr/pages/data.vue @@ -1,5 +1,5 @@ diff --git a/test/fixtures/typescript/middleware/test.ts b/test/fixtures/typescript/middleware/test.ts new file mode 100644 index 0000000000..ead516c976 --- /dev/null +++ b/test/fixtures/typescript/middleware/test.ts @@ -0,0 +1 @@ +export default () => {} diff --git a/test/fixtures/typescript/modules/module.ts b/test/fixtures/typescript/modules/module.ts new file mode 100644 index 0000000000..ead516c976 --- /dev/null +++ b/test/fixtures/typescript/modules/module.ts @@ -0,0 +1 @@ +export default () => {} diff --git a/test/fixtures/typescript/nuxt.config.ts b/test/fixtures/typescript/nuxt.config.ts new file mode 100644 index 0000000000..ab6b0bc663 --- /dev/null +++ b/test/fixtures/typescript/nuxt.config.ts @@ -0,0 +1,13 @@ +const config: any = { + modules: [ + '~/modules/module' + ], + plugins: [ + '~/plugins/plugin' + ], + serverMiddleware: [ + '~/server-middleware/test.ts' + ] +} + +export default config diff --git a/test/fixtures/typescript/pages/about.ts b/test/fixtures/typescript/pages/about.ts new file mode 100644 index 0000000000..1218ba9b58 --- /dev/null +++ b/test/fixtures/typescript/pages/about.ts @@ -0,0 +1,8 @@ +import Vue from 'vue' + +export default Vue.extend({ + name: 'About', + render (h) { + return h('div', 'About Page') + } +}) diff --git a/test/fixtures/typescript/pages/contact.tsx b/test/fixtures/typescript/pages/contact.tsx new file mode 100644 index 0000000000..21879491a8 --- /dev/null +++ b/test/fixtures/typescript/pages/contact.tsx @@ -0,0 +1,9 @@ +import Vue from 'vue' + +export default Vue.extend({ + name: 'Contact', + // @ts-ignore: h not used but needed to compile + render (h) { + return
Contact Page
+ } +}) diff --git a/test/fixtures/typescript/pages/index.vue b/test/fixtures/typescript/pages/index.vue new file mode 100644 index 0000000000..d29cf5e56e --- /dev/null +++ b/test/fixtures/typescript/pages/index.vue @@ -0,0 +1,12 @@ + + + diff --git a/test/fixtures/typescript/pages/interface.vue b/test/fixtures/typescript/pages/interface.vue new file mode 100644 index 0000000000..6e21446eda --- /dev/null +++ b/test/fixtures/typescript/pages/interface.vue @@ -0,0 +1,22 @@ + + + diff --git a/test/fixtures/typescript/plugins/plugin.ts b/test/fixtures/typescript/plugins/plugin.ts new file mode 100644 index 0000000000..ead516c976 --- /dev/null +++ b/test/fixtures/typescript/plugins/plugin.ts @@ -0,0 +1 @@ +export default () => {} diff --git a/test/fixtures/typescript/server-middleware/test.ts b/test/fixtures/typescript/server-middleware/test.ts new file mode 100644 index 0000000000..cdb0ac4668 --- /dev/null +++ b/test/fixtures/typescript/server-middleware/test.ts @@ -0,0 +1,7 @@ +export default { + path: '/api/test', + handler(_, res) { + const message: String = 'Works!' + res.end(message) + } +} diff --git a/test/fixtures/typescript/tsconfig.json b/test/fixtures/typescript/tsconfig.json new file mode 100644 index 0000000000..6b563db445 --- /dev/null +++ b/test/fixtures/typescript/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "@nuxt/typescript", + "compilerOptions": { + "baseUrl": ".", + "noImplicitAny": false, + "types": [ + "@types/node", + "@nuxt/vue-app" + ] + } +} diff --git a/test/fixtures/typescript/typescript.test.js b/test/fixtures/typescript/typescript.test.js new file mode 100644 index 0000000000..0d352b49dd --- /dev/null +++ b/test/fixtures/typescript/typescript.test.js @@ -0,0 +1,3 @@ +import { buildFixture } from '../../utils/build' + +buildFixture('typescript') diff --git a/test/fixtures/with-config/assets/app.css b/test/fixtures/with-config/assets/app.pcss similarity index 100% rename from test/fixtures/with-config/assets/app.css rename to test/fixtures/with-config/assets/app.pcss diff --git a/test/fixtures/with-config/layouts/custom-env.vue b/test/fixtures/with-config/layouts/custom-env.vue index 7067d93782..655c9a3c8d 100644 --- a/test/fixtures/with-config/layouts/custom-env.vue +++ b/test/fixtures/with-config/layouts/custom-env.vue @@ -1,6 +1,6 @@ diff --git a/test/fixtures/with-config/layouts/custom.vue b/test/fixtures/with-config/layouts/custom.vue index 5e254dab79..962b80da74 100644 --- a/test/fixtures/with-config/layouts/custom.vue +++ b/test/fixtures/with-config/layouts/custom.vue @@ -1,6 +1,6 @@ diff --git a/test/fixtures/with-config/layouts/default.vue b/test/fixtures/with-config/layouts/default.vue index f1670a7a2d..25cba134cf 100644 --- a/test/fixtures/with-config/layouts/default.vue +++ b/test/fixtures/with-config/layouts/default.vue @@ -1,6 +1,6 @@ diff --git a/test/fixtures/with-config/layouts/desktop/default.vue b/test/fixtures/with-config/layouts/desktop/default.vue index 649ec36e41..886f28fa54 100644 --- a/test/fixtures/with-config/layouts/desktop/default.vue +++ b/test/fixtures/with-config/layouts/desktop/default.vue @@ -1,6 +1,6 @@ diff --git a/test/fixtures/with-config/layouts/mobile/default.vue b/test/fixtures/with-config/layouts/mobile/default.vue index 7219975d14..0426ae49b3 100644 --- a/test/fixtures/with-config/layouts/mobile/default.vue +++ b/test/fixtures/with-config/layouts/mobile/default.vue @@ -1,6 +1,6 @@ diff --git a/test/fixtures/with-config/nuxt.config.js b/test/fixtures/with-config/nuxt.config.js index 48ccb1e152..404ddee974 100644 --- a/test/fixtures/with-config/nuxt.config.js +++ b/test/fixtures/with-config/nuxt.config.js @@ -6,7 +6,10 @@ export default { srcDir: __dirname, server: { port: 8000, - host: '0.0.0.0' + host: '0.0.0.0', + timing: { + total: true + } }, router: { base: '/test/', @@ -17,7 +20,8 @@ export default { { name: 'about-bis', path: '/about-bis', - component: '~/pages/about.vue' + component: '~/pages/about.vue', + meta: { text: 'test-meta' } }, { path: '/redirect/about-bis', @@ -36,6 +40,10 @@ export default { extensions: 'ts', plugins: [ '~/plugins/test', + '~/plugins/doubled', + { src: '~/plugins/test.plugin', mode: 'abc' }, + '~/plugins/test.client', + '~/plugins/test.server', { src: '~/plugins/only-client.js', ssr: false } ], loading: '~/components/loading', @@ -72,11 +80,11 @@ export default { transpile: 'vue-test', extend(config, options) { return Object.assign({}, config, { - devtool: 'nosources-source-map' + devtool: '#source-map' }) } }, - css: [{ src: '~/assets/app.css' }], + css: [{ src: '~/assets/app' }], render: { csp: true, http2: { diff --git a/test/fixtures/with-config/pages/about.vue b/test/fixtures/with-config/pages/about.vue index 39572c46f1..974128a9c7 100644 --- a/test/fixtures/with-config/pages/about.vue +++ b/test/fixtures/with-config/pages/about.vue @@ -1,12 +1,18 @@ diff --git a/test/fixtures/with-config/pages/env.vue b/test/fixtures/with-config/pages/env.vue index 1c2dd3419e..132b08b263 100644 --- a/test/fixtures/with-config/pages/env.vue +++ b/test/fixtures/with-config/pages/env.vue @@ -3,7 +3,9 @@
{{ env }}

object:

{{ processEnv }}
- Home + + Home + diff --git a/test/fixtures/with-config/pages/index.vue b/test/fixtures/with-config/pages/index.vue index 202ed3e9f6..ab862c7d75 100644 --- a/test/fixtures/with-config/pages/index.vue +++ b/test/fixtures/with-config/pages/index.vue @@ -1,7 +1,9 @@ diff --git a/test/fixtures/with-config/plugins/doubled/index.js b/test/fixtures/with-config/plugins/doubled/index.js new file mode 100644 index 0000000000..ead516c976 --- /dev/null +++ b/test/fixtures/with-config/plugins/doubled/index.js @@ -0,0 +1 @@ +export default () => {} diff --git a/test/fixtures/with-config/plugins/test.client.js b/test/fixtures/with-config/plugins/test.client.js new file mode 100644 index 0000000000..387e7fc54a --- /dev/null +++ b/test/fixtures/with-config/plugins/test.client.js @@ -0,0 +1 @@ +window.__test_plugin_client = 'test_plugin_client' diff --git a/test/fixtures/with-config/plugins/test.plugin.js b/test/fixtures/with-config/plugins/test.plugin.js new file mode 100644 index 0000000000..9d36fa2f97 --- /dev/null +++ b/test/fixtures/with-config/plugins/test.plugin.js @@ -0,0 +1,5 @@ +if (process.client) { + window.__test_plugin_ext = true +} else { + global.__test_plugin_ext = true +} diff --git a/test/fixtures/with-config/plugins/test.server.js b/test/fixtures/with-config/plugins/test.server.js new file mode 100644 index 0000000000..94df4661fa --- /dev/null +++ b/test/fixtures/with-config/plugins/test.server.js @@ -0,0 +1 @@ +global.__test_plugin_server = 'test_plugin_server' diff --git a/test/fixtures/with-config/with-config.test.js b/test/fixtures/with-config/with-config.test.js index 6d1b6da61c..a0ab037806 100644 --- a/test/fixtures/with-config/with-config.test.js +++ b/test/fixtures/with-config/with-config.test.js @@ -14,12 +14,15 @@ const hooks = [ describe('with-config', () => { buildFixture('with-config', () => { - expect(consola.warn).toHaveBeenCalledTimes(4) + expect(consola.warn).toHaveBeenCalledTimes(5) expect(consola.fatal).toHaveBeenCalledTimes(0) expect(consola.warn.mock.calls).toMatchObject([ [ 'Unknown mode: unknown. Falling back to universal' ], + [ + `Invalid plugin mode (server/client/all): 'abc'. Falling back to 'all'` + ], [{ message: 'Found 2 plugins that match the configuration, suggest to specify extension:', additional: expect.stringContaining('plugins/test.json') diff --git a/test/types/index.ts b/test/types/index.ts new file mode 100644 index 0000000000..0375e1c1b9 --- /dev/null +++ b/test/types/index.ts @@ -0,0 +1,2 @@ +import './vue' +import './process' diff --git a/test/types/process.ts b/test/types/process.ts new file mode 100644 index 0000000000..47f2279ce9 --- /dev/null +++ b/test/types/process.ts @@ -0,0 +1,17 @@ +/** + * Test extended type definitions of NodeJS Process interface + * @nuxt/vue-app/types/process.d.ts + */ + +process.browser = true + +process.client = true + +process.mode = 'universal' +process.mode = 'spa' + +process.modern = true + +process.server = true + +process.static = true diff --git a/test/types/tsconfig.json b/test/types/tsconfig.json new file mode 100644 index 0000000000..f842055462 --- /dev/null +++ b/test/types/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "es2015", + "moduleResolution": "node", + "strict": true, + "noEmit": true, + "lib": [ + "es5", + "dom", + "es2015.promise", + "es2015.core" + ] + } +} diff --git a/test/types/vue.ts b/test/types/vue.ts new file mode 100644 index 0000000000..c3be7c69dc --- /dev/null +++ b/test/types/vue.ts @@ -0,0 +1,106 @@ +/** + * Test extended type definitions of Vue interfaces + * @nuxt/vue-app/types/vue.d.ts + */ + +import Vue, { ComponentOptions } from 'vue' +import { Middleware } from '@nuxt/vue-app' + +const options: ComponentOptions = {} + +// asyncData + +options.asyncData = (context) => { + return { + foo: 'bar' + } +} + +options.asyncData = () => undefined + +// fetch + +options.fetch = ({ store }) => { + return Promise.resolve('bar').then(res => { + store.commit('setFoo', res) + }) +} + +options.fetch = async ({ store }) => { + let res = await Promise.resolve('bar') + store.commit('setFoo', res) +} + +// key + +options.key = 'foo' +options.key = (to) => to.fullPath + +// head + +const metaInfo = { + title: 'Home', + meta: [ + { hid: 'description', name: 'description', content: 'My custom description' } + ] +} + +options.head = metaInfo +options.head = () => metaInfo + +// layout + +options.layout = 'foo' +options.layout = (context) => 'foo' + +// loading + +options.loading = true + +// middleware + +const middlewares: Middleware[] = [ + 'foo', + (ctx) => {}, + (ctx, cb) => {}, + async (ctx) => {}, + async (ctx, cb) => {} // unlikely +] + +options.middleware = middlewares +options.middleware = middlewares[0] +options.middleware = middlewares[1] +options.middleware = middlewares[2] + +// scrollToTop + +options.scrollToTop = true + +// transition + +options.transition = 'foo' +options.transition = { name: 'foo' } +options.transition = (to, from) => 'foo' + +// validate + +options.validate = (context) => true +options.validate = async (context) => true + +// watchQuery + +options.watchQuery = true +options.watchQuery = ['foo', 'bar'] + +// $nuxt + +const vm = new Vue(options) + +if (vm.$nuxt.$loading.fail) vm.$nuxt.$loading.fail() +vm.$nuxt.$loading.finish() +if (vm.$nuxt.$loading.increase) vm.$nuxt.$loading.increase(1) +if (vm.$nuxt.$loading.pause) vm.$nuxt.$loading.pause() +vm.$nuxt.$loading.start() + +vm.$nuxt.isOffline = true +vm.$nuxt.isOnline = true diff --git a/test/unit/async-config.size-limit.test.js b/test/unit/async-config.size-limit.test.js index b3ab624447..2ff88a739c 100644 --- a/test/unit/async-config.size-limit.test.js +++ b/test/unit/async-config.size-limit.test.js @@ -34,6 +34,6 @@ describe('size-limit test', () => { const responseSizeBytes = responseSizes.reduce((bytes, responseLength) => bytes + responseLength, 0) const responseSizeKilobytes = Math.ceil(responseSizeBytes / 1024) // Without gzip! - expect(responseSizeKilobytes).toBeLessThanOrEqual(170) + expect(responseSizeKilobytes).toBeLessThanOrEqual(180) }) }) diff --git a/test/unit/basic.config.defaults.test.js b/test/unit/basic.config.defaults.test.js index 857060e71e..fb71787c2a 100644 --- a/test/unit/basic.config.defaults.test.js +++ b/test/unit/basic.config.defaults.test.js @@ -1,8 +1,12 @@ import { resolve } from 'path' import consola from 'consola' +import Glob from 'glob' +import pify from 'pify' import { Nuxt, getNuxtConfig, version } from '../utils' +const glob = pify(Glob) + describe('basic config defaults', () => { test('Nuxt.version is same as package', () => { expect(Nuxt.version).toBe(version) @@ -14,6 +18,11 @@ describe('basic config defaults', () => { expect(options.modulesDir).toContain(currentNodeModulesDir) }) + test('client source map not generated', async () => { + const mapFiles = await glob(resolve(__dirname, '..', 'fixtures/basic/.nuxt/dist/client/*.js.map')) + expect(mapFiles.length).toEqual(0) + }) + test('vendor has been deprecated', () => { const options = getNuxtConfig({ build: { vendor: 'vue' } diff --git a/test/unit/basic.dev.test.js b/test/unit/basic.dev.test.js index 9c977154d9..e3f48dd8b2 100644 --- a/test/unit/basic.dev.test.js +++ b/test/unit/basic.dev.test.js @@ -80,14 +80,14 @@ describe('basic dev', () => { }) test('Config: build.loaders', () => { - expect(Object.keys(loadersOptions)).toHaveLength(12) + expect(Object.keys(loadersOptions)).toHaveLength(14) expect(loadersOptions).toHaveProperty( 'file', 'fontUrl', 'imgUrl', 'pugPlain', 'vue', - 'css', 'cssModules', 'less', 'sass', 'scss', 'stylus', 'vueStyle' + 'css', 'cssModules', 'less', 'sass', 'scss', 'stylus', 'ts', 'tsx', 'vueStyle' ) const { cssModules, vue } = loadersOptions expect(cssModules.localIdentName).toBe('[hash:base64:6]') - expect(vueLoader.options).toBe(vue) + expect(vueLoader.options).toEqual(vue) }) test('Config: cssnano is at then end of postcss plugins', () => { @@ -143,17 +143,6 @@ describe('basic dev', () => { }) }) - test('/error no source-map (Youch)', async () => { - const sourceMaps = nuxt.renderer.resources.serverBundle.maps - nuxt.renderer.resources.serverBundle.maps = {} - - await expect(nuxt.server.renderAndGetWindow(url('/error'))).rejects.toMatchObject({ - statusCode: 500 - }) - - nuxt.renderer.resources.serverBundle.maps = sourceMaps - }) - test('/error should return json format error (Youch)', async () => { const opts = { headers: { diff --git a/test/unit/basic.generate.test.js b/test/unit/basic.generate.test.js index 89ed0ec7f6..371165dd1b 100644 --- a/test/unit/basic.generate.test.js +++ b/test/unit/basic.generate.test.js @@ -103,7 +103,7 @@ describe('basic generate', () => { const element = window.document.querySelector('.red') expect(element).not.toBe(null) - expect(element.textContent).toBe('This is red') + expect(element.textContent).toContain('This is red') expect(element.className).toBe('red') // t.is(window.getComputedStyle(element), 'red') }) diff --git a/test/unit/basic.ssr.csp.test.js b/test/unit/basic.ssr.csp.test.js index f9cee79346..eaedce24b2 100644 --- a/test/unit/basic.ssr.csp.test.js +++ b/test/unit/basic.ssr.csp.test.js @@ -312,5 +312,30 @@ describe('basic ssr csp', () => { expect(uniqueHashes.length).toBe(hashes.length) } ) + test( + 'Not contain old hashes when loading new page', + async () => { + const cspOption = { + enabled: true, + policies: { + 'default-src': [`'self'`], + 'script-src': ['https://example.com', 'https://example.io'] + } + } + nuxt = await startCspDevServer(cspOption) + const { headers: user1Header } = await rp(url('/users/1'), { + resolveWithFullResponse: true + }) + const user1Hashes = user1Header[reportOnlyHeader].split(' ').filter(s => s.startsWith('\'sha256-')) + + const { headers: user2Header } = await rp(url('/users/2'), { + resolveWithFullResponse: true + }) + const user2Hashes = new Set(user2Header[reportOnlyHeader].split(' ').filter(s => s.startsWith('\'sha256-'))) + + const intersection = new Set(user1Hashes.filter(x => user2Hashes.has(x))) + expect(intersection.size).toBe(0) + } + ) }) }) diff --git a/test/unit/basic.ssr.test.js b/test/unit/basic.ssr.test.js index 3e21a1fa2f..9ca12be26c 100644 --- a/test/unit/basic.ssr.test.js +++ b/test/unit/basic.ssr.test.js @@ -35,7 +35,20 @@ describe('basic ssr', () => { const element = window.document.querySelector('.red') expect(element).not.toBe(null) - expect(element.textContent).toBe('This is red') + expect(element.textContent).toContain('This is red') + expect(element.className).toBe('red') + // t.is(window.getComputedStyle(element).color, 'red') + }) + + test('/postcss', async () => { + const window = await nuxt.server.renderAndGetWindow(url('/css')) + + const headHtml = window.document.head.innerHTML + expect(headHtml).toContain('color:red') + + const element = window.document.querySelector('.red') + expect(element).not.toBe(null) + expect(element.textContent).toContain('This is red') expect(element.className).toBe('red') // t.is(window.getComputedStyle(element).color, 'red') }) @@ -57,8 +70,10 @@ describe('basic ssr', () => { test('/store', async () => { const { html } = await nuxt.server.renderRoute('/store') - expect(html).toContain('

Vuex Nested Modules

') - expect(html).toContain('

1

') + expect(html).toContain('

foo/bar/baz: Vuex Nested Modules

') + expect(html).toContain('

index/counter: 1

') + expect(html).toContain('

foo/blarg/getVal: 4

') + expect(html).toContain('

foo/bab/getBabVal: 10

') }) test('/head', async () => { @@ -222,6 +237,7 @@ describe('basic ssr', () => { expect(html).toContain('Custom error') expect(error.message).toContain('Custom error') expect(error.statusCode).toBe(500) + expect(error.customProp).toBe('ezpz') }) test('/error2 status code', async () => { @@ -268,11 +284,6 @@ describe('basic ssr', () => { .rejects.toMatchObject({ statusCode: 304 }) }) - test('/_nuxt/server-bundle.json should return 404', async () => { - await expect(rp(url('/_nuxt/server-bundle.json'))) - .rejects.toMatchObject({ statusCode: 404 }) - }) - test('/_nuxt/ should return 404', async () => { await expect(rp(url('/_nuxt/'))) .rejects.toMatchObject({ statusCode: 404 }) @@ -315,10 +326,18 @@ describe('basic ssr', () => { }) test('/тСст雨 (test non ascii route)', async () => { - const { html } = await nuxt.server.renderRoute('/тСст雨') + const window = await nuxt.server.renderAndGetWindow(url('/тСст雨')) + const html = window.document.body.innerHTML expect(html).toMatch('Hello unicode') }) + test('/custom (js layout)', async () => { + const window = await nuxt.server.renderAndGetWindow(url('/custom')) + const html = window.document.body.innerHTML + expect(html).toMatch('

JS Layout

') + expect(html).toMatch('

custom page

') + }) + // Close server and ask nuxt to stop listening to file changes afterAll(async () => { await nuxt.close() diff --git a/test/unit/cli.test.js b/test/unit/cli.test.js index 3db88d7511..0e40959420 100644 --- a/test/unit/cli.test.js +++ b/test/unit/cli.test.js @@ -20,10 +20,10 @@ const close = async (nuxtInt) => { } } -describe('cli', () => { +describe.skip.win('cli', () => { test('nuxt dev', async () => { let stdout = '' - const env = process.env + const { env } = process env.PORT = port = await getPort() const nuxtDev = spawnNuxt('dev', { env }) @@ -52,7 +52,7 @@ describe('cli', () => { let stdout = '' let error - const env = process.env + const { env } = process env.PORT = port = await getPort() await new Promise((resolve) => { diff --git a/test/unit/extract-css.test.js b/test/unit/extract-css.test.js index 86bbd95ce2..62222be8f2 100644 --- a/test/unit/extract-css.test.js +++ b/test/unit/extract-css.test.js @@ -14,7 +14,7 @@ describe('extract css', () => { await nuxt.server.listen(await getPort(), '0.0.0.0') }) - test.skip('Verify global.css has been extracted and minified', async () => { + test('Verify global.css has been extracted and minified', async () => { const fileName = isWindows ? 'pages_index.css' : 'pages/index.css' const extractedIndexCss = resolve(__dirname, '..', 'fixtures/extract-css/.nuxt/dist/client', fileName) const content = await readFile(extractedIndexCss, 'utf-8') @@ -28,6 +28,8 @@ describe('extract css', () => { test('/about should contain module style', async () => { const { html } = await nuxt.server.renderRoute('/about') - expect(html).toMatch(/

I'm BLUE<\/h1>/) + expect(html).toMatch(/

\s*I'm BLUE\s*<\/h1>/) + // no duplicate inlined style + expect(html).not.toContain('{color:#00f}') }) }) diff --git a/test/unit/fallback.generate.test.js b/test/unit/fallback.generate.test.js index 2afec697e6..0dc16dc501 100644 --- a/test/unit/fallback.generate.test.js +++ b/test/unit/fallback.generate.test.js @@ -75,8 +75,11 @@ describe('fallback generate', () => { }) test('generate.fallback = true is transformed to /404.html', () => { - nuxt.options.generate.fallback = true - const options = getNuxtConfig(nuxt.options) + const options = getNuxtConfig({ + generate: { + fallback: true + } + }) expect(options.generate.fallback).toBe('404.html') }) diff --git a/test/unit/meta-attrs.test.js b/test/unit/meta-attrs.test.js new file mode 100644 index 0000000000..da98008411 --- /dev/null +++ b/test/unit/meta-attrs.test.js @@ -0,0 +1,23 @@ +import { loadFixture, getPort, Nuxt } from '../utils' + +let nuxt = null + +describe('meta-attrs', () => { + beforeAll(async () => { + const options = await loadFixture('meta-attrs') + nuxt = new Nuxt(options) + await nuxt.server.listen(await getPort(), '0.0.0.0') + }) + + test('/', async () => { + const { html } = await nuxt.server.renderRoute('/') + expect(html).toContain('') + expect(html).toContain('') + expect(html).toContain('') + }) + + // Close server and ask nuxt to stop listening to file changes + afterAll(async () => { + await nuxt.close() + }) +}) diff --git a/test/unit/modern.client.test.js b/test/unit/modern.client.test.js index 1918534389..4f2ca88264 100644 --- a/test/unit/modern.client.test.js +++ b/test/unit/modern.client.test.js @@ -1,9 +1,9 @@ -import { loadFixture, getPort, Nuxt, rp } from '../utils' +import { loadFixture, getPort, Nuxt, rp, wChunk } from '../utils' let nuxt, port const url = route => 'http://localhost:' + port + route -describe('modern client mode', () => { +describe('modern client mode (SSR)', () => { beforeAll(async () => { const options = await loadFixture('modern', { modern: 'client' }) nuxt = new Nuxt(options) @@ -13,20 +13,35 @@ describe('modern client mode', () => { test('should contain nomodule legacy resources', async () => { const response = await rp(url('/')) - expect(response).toContain('script nomodule src="/_nuxt/app.js') - expect(response).toContain('script nomodule src="/_nuxt/commons.app.js') + expect(response).toContain('script nomodule crossorigin="use-credentials" src="/_nuxt/app.js') + expect(response).toContain('script nomodule crossorigin="use-credentials" src="/_nuxt/commons.app.js') }) test('should contain module modern resources', async () => { const response = await rp(url('/')) - expect(response).toContain('