Skip to content

Commit

Permalink
Merge branch 'unified-desktop-gui' into lmiller1990/unified-desktop-g…
Browse files Browse the repository at this point in the history
…ui/add-context-code-review

* unified-desktop-gui:
  feat: Structuring context & schema so it can be used on the client (#17489)
  fix: vue 3 types, beta suffix & component name (#17508)
  fix: last test skipped with top navigation and already run suite (#17498)
  chore: Update Chrome (beta) to 93.0.4577.18 (#17536)
  fix: use process.geteuid and catch uid errors in file util (#17488)
  build: make vite build strict (#17509)
  release 8.1.0
  fix(server): correctly include projectRoot when adding a CI project from GUI (#17514)
  fix(types): update cy.shadow docs url (#17506)
  chore(npm/webpack-preprocessor): fix CI pipeline (#17515)
  fix: test runner reporter performance (#17243)
  chore: release @cypress/vue-v3.0.0-beta.4
  chore: release @cypress/vite-dev-server-v2.0.3
  fix: make vite re-run on supportFile change (#17485)
  • Loading branch information
tgriesser committed Aug 2, 2021
2 parents 78d5623 + e2f395e commit db8ec2e
Show file tree
Hide file tree
Showing 71 changed files with 1,326 additions and 396 deletions.
15 changes: 14 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,20 @@
"rules": {
"prefer-spread": "off",
"prefer-rest-params": "off",
"no-useless-constructor": "off"
"no-useless-constructor": "off",
"no-restricted-properties": [
"error",
{
"object": "process",
"property": "geteuid",
"message": "process.geteuid() will throw on Windows. Do not use it unless you catch any potential errors."
},
{
"object": "os",
"property": "userInfo",
"message": "os.userInfo() will throw when there is not an `/etc/passwd` entry for the current user (like when running with --user 12345 in Docker). Do not use it unless you catch any potential errors."
}
]
},
"settings": {
"react": {
Expand Down
2 changes: 1 addition & 1 deletion browser-versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"chrome:beta": "92.0.4515.107",
"chrome:beta": "93.0.4577.18",
"chrome:stable": "92.0.4515.107"
}
10 changes: 7 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1291,9 +1291,6 @@ jobs:
- run:
name: Build
command: yarn workspace @cypress/webpack-preprocessor build
- run:
name: Run tests
command: yarn workspace @cypress/webpack-preprocessor test
- run:
name: Test babelrc
command: yarn test
Expand All @@ -1319,6 +1316,9 @@ jobs:
name: Test React app
command: yarn test
working_directory: npm/webpack-preprocessor/examples/react-app
- run:
name: Run tests
command: yarn workspace @cypress/webpack-preprocessor test
- store-npm-logs

npm-webpack-dev-server:
Expand Down Expand Up @@ -1359,6 +1359,10 @@ jobs:
- run:
name: Build
command: yarn workspace @cypress/vue build
- run:
name: Type Check
command: yarn typecheck
working_directory: npm/vue
- run:
name: Run component tests
command: yarn test:ci:ct
Expand Down
1 change: 1 addition & 0 deletions cli/test/lib/tasks/verify_spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-restricted-properties */
require('../../spec_helper')

const path = require('path')
Expand Down
2 changes: 1 addition & 1 deletion cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,7 @@ declare namespace Cypress {
* .shadow()
* .find('.my-button')
* .click()
* @see https://on.cypress.io/experimental
* @see https://on.cypress.io/shadow
*/
shadow(): Chainable<Subject>

Expand Down
7 changes: 6 additions & 1 deletion npm/design-system/src/core/button/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as React from 'react'
import { action } from '@storybook/addon-actions'
// TODO: This is causing a "module not defined error"
// Find out why and fix it
// import { action } from '@storybook/addon-actions'

import { createStory, createStorybookConfig } from 'stories/util'

Expand All @@ -11,6 +13,9 @@ import { TextSize } from 'css'
import { PaddedBox } from '../surface/paddedBox/PaddedBox'
import { Icon } from '../icon/Icon'

// stub it for now
const action = (action: string) => undefined

export default createStorybookConfig({
title: 'Core/Button',
})
Expand Down
2 changes: 1 addition & 1 deletion npm/design-system/src/core/input/IconInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type IconSettings = {
['aria-label']: string
} | {
onPress?: undefined
['aria-label']?: undefined
['aria-label']?: string | undefined
})

export type IconInputProps = InputProps<{
Expand Down
25 changes: 14 additions & 11 deletions npm/design-system/src/core/input/Input.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ import * as React from 'react'
import { composeStories } from '@storybook/testing-react'
import * as stories from './Input.stories'
import { mountAndSnapshot } from 'util/testing'
import { iconSizesWithSizes } from './Input.stories'
// import { iconSizesWithSizes } from './Input.stories'

const { Input, Icon } = composeStories(stories)
const {
Input,
// Icon
} = composeStories(stories)

// TODO: Autogenerate from stories
describe('<Input />', () => {
Expand All @@ -13,16 +16,16 @@ describe('<Input />', () => {
})

it('IconInput', () => {
mountAndSnapshot(<Icon />)
// mountAndSnapshot(<Icon />)
})

it('IconInput sizes', () => {
const IconInput = () => (
<>
{iconSizesWithSizes(['xs', 's', 'ms', 'm', 'ml', 'l', 'xl', '2xl'])}
</>
)
// it('IconInput sizes', () => {
// const IconInput = () => (
// <>
// {iconSizesWithSizes(['xs', 's', 'ms', 'm', 'ml', 'l', 'xl', '2xl'])}
// </>
// )

mountAndSnapshot(<IconInput />)
})
// mountAndSnapshot(<IconInput />)
// })
})
40 changes: 22 additions & 18 deletions npm/design-system/src/core/input/Input.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import * as React from 'react'
import { action } from '@storybook/addon-actions'
// TODO: This is causing a "module not defined error"
// Find out why and fix it
// import { action } from '@storybook/addon-actions'

import { createStory, createStorybookConfig } from 'stories/util'
import { createStory, createStorybookConfig } from '../../stories/util'

import { Input as InputComponent } from './Input'
import { IconInput as IconInputComponent } from './IconInput'

import typography from 'css/derived/jsTypography.scss'
import { TextSize } from 'css'

// stub it for now
const action = (action: string) => undefined

export default createStorybookConfig({
title: 'Core/Input',
excludeStories: ['iconSizesWithSizes'],
Expand Down Expand Up @@ -38,12 +42,12 @@ export const Icon = createStory(() => (
label={{ type: 'aria', contents: 'full width input' }}
prefixIcon={{
icon: 'home',
onPress: action('onPrefixClick'),
// onPress: action('onPrefixClick'),
'aria-label': 'onPrefixClick',
}}
suffixIcon={{
icon: 'times',
onPress: action('onSuffixClick'),
// onPress: action('onSuffixClick'),
'aria-label': 'onSuffixClick',
}}
/>
Expand All @@ -53,7 +57,7 @@ export const Icon = createStory(() => (
label={{ type: 'aria', contents: '500px width input' }}
suffixIcon={{
icon: 'times',
onPress: action('onSuffixClick'),
// onPress: action('onSuffixClick'),
'aria-label': 'onSuffixClick',
}}
value="This is a very long string in an IconInput. This displays the padding on the input section"
Expand All @@ -62,7 +66,7 @@ export const Icon = createStory(() => (
label={{ type: 'aria', contents: '500px width input' }}
prefixIcon={{
icon: 'home',
onPress: action('onPrefixClick'),
// onPress: action('onPrefixClick'),
'aria-label': 'onPrefixClick',
}}
value="This is a very long string in an IconInput. This displays the padding on the input section"
Expand All @@ -74,12 +78,12 @@ export const Icon = createStory(() => (
}}
prefixIcon={{
icon: 'home',
onPress: action('onPrefixClick'),
// onPress: action('onPrefixClick'),
'aria-label': 'onPrefixClick',
}}
suffixIcon={{
icon: 'times',
onPress: action('onSuffixClick'),
// onPress: action('onSuffixClick'),
'aria-label': 'onSuffixClick',
}}
/>
Expand All @@ -90,7 +94,7 @@ export const Icon = createStory(() => (
}}
suffixIcon={{
icon: 'times',
onPress: action('onSuffixClick'),
// onPress: action('onSuffixClick'),
'aria-label': 'onSuffixClick',
}}
placeholder="The leading icon isn't a button"
Expand All @@ -99,7 +103,7 @@ export const Icon = createStory(() => (
label={{ type: 'aria', contents: 'leading button only' }}
prefixIcon={{
icon: 'home',
onPress: action('onPrefixClick'),
// onPress: action('onPrefixClick'),
'aria-label': 'onPrefixClick',
}}
suffixIcon={{
Expand Down Expand Up @@ -133,10 +137,10 @@ export const iconSizesWithSizes = (sizes: string[]) => sizes.map((key) => {
)
})

export const IconSizes = createStory(() => (
<div>
<div style={{ width: 500 }}>
{iconSizesWithSizes(Object.keys(typography).filter((key) => key !== 'type' && !key.startsWith('line-height') && !key.startsWith('text-mono') && key !== 'text-3xl' && key !== 'text-4xl'))}
</div>
</div>
))
// export const IconSizes = createStory(() => (
// <div>
// <div style={{ width: 500 }}>
// {iconSizesWithSizes(Object.keys(typography).filter((key) => key !== 'type' && !key.startsWith('line-height') && !key.startsWith('text-mono') && key !== 'text-3xl' && key !== 'text-4xl'))}
// </div>
// </div>
// ))
7 changes: 7 additions & 0 deletions npm/vite-dev-server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [@cypress/vite-dev-server-v2.0.3](https://github.com/cypress-io/cypress/compare/@cypress/vite-dev-server-v2.0.2...@cypress/vite-dev-server-v2.0.3) (2021-07-27)


### Bug Fixes

* make vite re-run on supportFile change ([#17485](https://github.com/cypress-io/cypress/issues/17485)) ([6cbf4c3](https://github.com/cypress-io/cypress/commit/6cbf4c38296d6287fbcbb0ef5ecd21cf63606153))

# [@cypress/vite-dev-server-v2.0.2](https://github.com/cypress-io/cypress/compare/@cypress/vite-dev-server-v2.0.1...@cypress/vite-dev-server-v2.0.2) (2021-07-15)


Expand Down
3 changes: 3 additions & 0 deletions npm/vite-dev-server/cypress/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
color: indigo;
}
1 change: 1 addition & 0 deletions npm/vite-dev-server/cypress/support.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import '@testing-library/cypress/add-commands'
import './styles.css'

before(() => {
window.supportFileWasLoaded = true
Expand Down
2 changes: 1 addition & 1 deletion npm/vite-dev-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"mocha-multi-reporters": "^1.5.1",
"react": "17.0.2",
"vite": "^2.4.4",
"vue": "3.1.1"
"vue": "3.2.0-beta.7"
},
"peerDependencies": {
"vite": ">= 2.1.3"
Expand Down
10 changes: 5 additions & 5 deletions npm/vite-dev-server/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { debug as debugFn } from 'debug'
import { start as createDevServer, StartDevServer } from './startServer'
import { start as createDevServer, StartDevServerOptions } from './startServer'
const debug = debugFn('cypress:vite-dev-server:vite')

export { StartDevServer }
export { StartDevServerOptions }

type DoneCallback = () => unknown

Expand All @@ -11,13 +11,13 @@ export interface ResolvedDevServerConfig {
close: (done?: DoneCallback) => void
}

export async function startDevServer (startDevServerArgs: StartDevServer): Promise<ResolvedDevServerConfig> {
export async function startDevServer (startDevServerArgs: StartDevServerOptions): Promise<ResolvedDevServerConfig> {
const viteDevServer = await createDevServer(startDevServerArgs)

const app = await viteDevServer.listen()
const port = app.config.server.port
const port = app.config.server.port!

debug('Component testing vite server started on port', port)

return { port, close: app.httpServer.close }
return { port, close: app.httpServer!.close }
}
15 changes: 10 additions & 5 deletions npm/vite-dev-server/src/makeCypressPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ const INIT_FILEPATH = resolve(__dirname, '../client/initCypressTests.js')

const HMR_DEPENDENCY_LOOKUP_MAX_ITERATION = 50

function getSpecsSet (specs: Spec[]) {
return new Set<string>(specs.map((spec) => spec.absolute))
function getSpecsPathsSet (specs: Spec[], supportFile?: string | null) {
return new Set<string>(
supportFile
? [...specs.map((spec) => spec.absolute), supportFile]
: specs.map((spec) => spec.absolute),
)
}

interface Spec{
Expand All @@ -38,10 +42,10 @@ export const makeCypressPlugin = (
): Plugin => {
let base = '/'

let specsPathsSet = getSpecsSet(specs)
let specsPathsSet = getSpecsPathsSet(specs, supportFilePath)

devServerEvents.on('dev-server:specs:changed', (specs: Spec[]) => {
specsPathsSet = getSpecsSet(specs)
specsPathsSet = getSpecsPathsSet(specs, supportFilePath)
})

const posixSupportFilePath = supportFilePath ? convertPathToPosix(resolve(projectRoot, supportFilePath)) : undefined
Expand Down Expand Up @@ -101,7 +105,8 @@ export const makeCypressPlugin = (

// as soon as we find one of the specs, we trigger the re-run of tests
for (const mod of moduleImporters.values()) {
if (specsPathsSet.has(mod.file)) {
debug('handleHotUpdate - mod.file', mod.file)
if (mod.file && specsPathsSet.has(mod.file)) {
debug('handleHotUpdate - compile success')
devServerEvents.emit('dev-server:compile:success', { specFile: mod.file })

Expand Down
8 changes: 4 additions & 4 deletions npm/vite-dev-server/src/startServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface Options {
[key: string]: unknown
}

export interface StartDevServer {
export interface StartDevServerOptions {
/**
* the Cypress options object
*/
Expand All @@ -27,7 +27,7 @@ export interface StartDevServer {
viteConfig?: UserConfig
}

const resolveServerConfig = async ({ viteConfig, options }: StartDevServer): Promise<InlineConfig> => {
const resolveServerConfig = async ({ viteConfig, options }: StartDevServerOptions): Promise<InlineConfig> => {
const { projectRoot, supportFile } = options.config

const requiredOptions: InlineConfig = {
Expand All @@ -37,7 +37,7 @@ const resolveServerConfig = async ({ viteConfig, options }: StartDevServer): Pro

const finalConfig: InlineConfig = { ...viteConfig, ...requiredOptions }

finalConfig.plugins = [...(viteConfig.plugins || []), makeCypressPlugin(projectRoot, supportFile, options.devServerEvents, options.specs)]
finalConfig.plugins = [...(finalConfig.plugins || []), makeCypressPlugin(projectRoot, supportFile, options.devServerEvents, options.specs)]

// This alias is necessary to avoid a "prefixIdentifiers" issue from slots mounting
// only cjs compiler-core accepts using prefixIdentifiers in slots which vue test utils use.
Expand Down Expand Up @@ -66,7 +66,7 @@ const resolveServerConfig = async ({ viteConfig, options }: StartDevServer): Pro
return finalConfig
}

export async function start (devServerOptions: StartDevServer): Promise<ViteDevServer> {
export async function start (devServerOptions: StartDevServerOptions): Promise<ViteDevServer> {
if (!devServerOptions.viteConfig) {
debug('User did not pass in any Vite dev server configuration')
devServerOptions.viteConfig = {}
Expand Down
2 changes: 1 addition & 1 deletion npm/vite-dev-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */

/* Strict Type-Checking Options */
"strict": false /* Enable all strict type-checking options. */,
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": false,

/* Module Resolution Options */
Expand Down
2 changes: 1 addition & 1 deletion npm/vue/.releaserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ module.exports = {
// this line forces releasing 2.X releases on the latest channel
{ name: 'npm/vue/v2', range: '2.X.X' },
// this one releases v3 on master as beta on the next channel
{ name: 'master', channel: 'next', prerelease: 'beta' },
{ name: 'master', channel: 'next' },
],
}
Loading

0 comments on commit db8ec2e

Please sign in to comment.