Skip to content

Commit

Permalink
Merge branch 'develop' into tgriesser/chore/improve-ci
Browse files Browse the repository at this point in the history
* develop:
  fix flaky e2e record passes test (#16043)
  chore: switch lolex to new name @sinonjs/fake-timers (#15595)
  add pwa example (#15970)
  fix starting cdp screencast when video:false (#15985)
  fix(deps): update dependency ansi_up to version 5.x 🌟 (#15440)
  fix: run-ct does not hang on windows anymore (#16022)
  docs: in vite-dev-server example don't require the config (#15866)
  • Loading branch information
tgriesser committed Apr 19, 2021
2 parents 0f389a9 + 738193f commit f2f19da
Show file tree
Hide file tree
Showing 39 changed files with 397 additions and 45 deletions.
1 change: 1 addition & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ commands:
command: |
. ./scripts/load-nvm.sh
yarn --prefer-offline --frozen-lockfile
no_output_timeout: 20m
- run: node scripts/circle-cache.js --action prepare
- save_cache:
name: Saving node modules for root, cli, and all globbed workspace packages
Expand Down
8 changes: 5 additions & 3 deletions npm/vite-dev-server/cypress/plugins.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { startDevServer } from '@cypress/vite-dev-server'
import viteConfig from '../vite.config'
const path = require('path')
const { startDevServer } = require('../dist')

module.exports = (on, config) => {
on('dev-server:start', async (options) => {
return startDevServer({
options,
viteConfig,
viteConfig: {
configFile: path.resolve(__dirname, '..', 'vite.config.ts'),
},
})
})

Expand Down
13 changes: 10 additions & 3 deletions npm/vite-dev-server/src/startServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@ interface Options {
}

export interface StartDevServer {
/* this is the Cypress options object */
/**
* the Cypress options object
*/
options: Options
/* support passing a path to the user's webpack config */
viteConfig?: UserConfig // TODO: implement taking in the user's vite configuration. Right now we don't
/**
* By default, vite will use your vite.config file to
* Start the server. If you need additional plugins or
* to override some options, you can do so using this.
* @optional
*/
viteConfig?: UserConfig
}

const resolveServerConfig = async ({ viteConfig, options }: StartDevServer): Promise<InlineConfig> => {
Expand Down
File renamed without changes.
14 changes: 13 additions & 1 deletion npm/vue/examples/vue-cli/cypress/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,21 @@ const webpackConfig = require('@vue/cli-service/webpack.config')
*/
module.exports = (on, config) => {
on('dev-server:start', (options) => {
// HtmlPwaPlugin is coupled to a hook in HtmlWebpackPlugin
// that was deprecated after 3.x. We currently only support
// HtmlWebpackPlugin 4.x and 5.x.
// TODO: Figure out how to deal with 2 major versions old HtmlWebpackPlugin
// which is still in widespread usage.
const modifiedWebpackConfig = {
...webpackConfig,
plugins: (webpackConfig.plugins || []).filter((x) => {
return x.constructor.name !== 'HtmlPwaPlugin'
}),
}

return startDevServer({
options,
webpackConfig,
webpackConfig: modifiedWebpackConfig,
})
})

Expand Down
4 changes: 3 additions & 1 deletion npm/vue/examples/vue-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
"version": "0.1.0",
"private": true,
"scripts": {
"build": "vue-cli-service build",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"cy:open": "node ../../../../scripts/cypress open-ct",
"test": "node ../../../../scripts/cypress run-ct"
},
"dependencies": {
"core-js": "^3.6.5",
"register-service-worker": "^1.7.1",
"vue": "^2.6.11"
},
"devDependencies": {
"@cypress/vue": "file:../../dist",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-pwa": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"cypress-circleci-reporter": "0.2.0",
"vue-template-compiler": "^2.6.11"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions npm/vue/examples/vue-cli/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow:
1 change: 1 addition & 0 deletions npm/vue/examples/vue-cli/src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'

Vue.config.productionTip = false

Expand Down
32 changes: 32 additions & 0 deletions npm/vue/examples/vue-cli/src/registerServiceWorker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* eslint-disable no-console */

import { register } from 'register-service-worker'

if (process.env.NODE_ENV === 'production') {
register(`${process.env.BASE_URL}service-worker.js`, {
ready () {
console.log(
'App is being served from cache by a service worker.\n' +
'For more details, visit https://goo.gl/AFskqB',
)
},
registered () {
console.log('Service worker has been registered.')
},
cached () {
console.log('Content has been cached for offline use.')
},
updatefound () {
console.log('New content is downloading.')
},
updated () {
console.log('New content is available; please refresh.')
},
offline () {
console.log('No internet connection found. App is running in offline mode.')
},
error (error) {
console.error('Error during service worker registration:', error)
},
})
}
Loading

0 comments on commit f2f19da

Please sign in to comment.