Skip to content

Commit c5d5be2

Browse files
author
Shawn Taylor
authored
Merge branch '10.0-release' into fix/reporter-styles
2 parents cdfc6f2 + 0665e13 commit c5d5be2

File tree

39 files changed

+23121
-22793
lines changed

39 files changed

+23121
-22793
lines changed

circle.yml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,26 +1097,26 @@ jobs:
10971097
- restore_cached_workspace
10981098
- run: yarn test-npm-package-release-script
10991099

1100+
lint-types:
1101+
<<: *defaults
1102+
parallelism: 1
1103+
resource_class: medium
1104+
steps:
1105+
- restore_cached_workspace
1106+
- run:
1107+
command: ls -la types
1108+
working_directory: cli
1109+
- run:
1110+
command: ls -la chai
1111+
working_directory: cli/types
1112+
- run:
1113+
name: "Lint types 🧹"
1114+
command: yarn workspace cypress dtslint
11001115
# todo(lachlan): do we need this? yarn check-ts does something very similar
1101-
# lint-types:
1102-
# <<: *defaults
1103-
# parallelism: 1
1104-
# resource_class: medium
1105-
# steps:
1106-
# - restore_cached_workspace
1107-
# - run:
1108-
# command: ls -la types
1109-
# working_directory: cli
1110-
# - run:
1111-
# command: ls -la chai
1112-
# working_directory: cli/types
1113-
# - run:
1114-
# name: "Lint types 🧹"
1115-
# command: yarn workspace cypress dtslint
11161116
# - run:
11171117
# name: "TypeScript check 🧩"
11181118
# command: yarn type-check --ignore-progress
1119-
# - store-npm-logs
1119+
- store-npm-logs
11201120

11211121
server-unit-tests:
11221122
<<: *defaults
@@ -2159,10 +2159,9 @@ linux-workflow: &linux-workflow
21592159
required_env_var: PERCY_TOKEN # skips job if not defined (external PR)
21602160
requires:
21612161
- build
2162-
# todo(lachlan): do we need this? yarn check-ts does something very similar
2163-
# - lint-types:
2164-
# requires:
2165-
# - build
2162+
- lint-types:
2163+
requires:
2164+
- build
21662165
# unit, integration and e2e tests
21672166
- cli-visual-tests:
21682167
requires:

cli/scripts/post-install.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ filesToUncomment.forEach((file) => {
9090
const str = fs.readFileSync(filePath).toString()
9191

9292
const result = str.split('\n').map((line) => {
93-
return line.startsWith('// ') ? line.substring(3) : line
93+
return line.startsWith('//z ') ? line.substring(4) : line
9494
}).join('\n')
9595

9696
fs.writeFileSync(filePath, result)

packages/data-context/src/actions/AppActions.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ export class AppActions {
3535
browser = (await this.ctx._apis.appApi.ensureAndGetByNameOrPath(browserNameOrPath)) as FoundBrowser | undefined
3636
} catch (err: unknown?) {
3737
this.ctx.debug('Error getting browser by name or path (%s): %s', browserNameOrPath, err?.stack || err)
38-
this.ctx.coreData.wizard.browserErrorMessage = `The browser '${browserNameOrPath}' was not found on your system or is not supported by Cypress. Choose a browser below.`
38+
const message = err.details ? `${err.message}\n\n\`\`\`\n${err.details}\n\`\`\`` : err.message
39+
40+
this.ctx.coreData.wizard.warnings.push({
41+
title: 'Warning: Browser Not Found',
42+
message,
43+
setupStep: 'setupComplete',
44+
})
3945
}
4046

4147
if (browser) {

packages/data-context/src/data/coreDataShape.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BUNDLERS, FoundBrowser, FoundSpec, FullConfig, Preferences, DevicePreferences, devicePreferenceDefaults, Editor } from '@packages/types'
1+
import { BUNDLERS, FoundBrowser, FoundSpec, FullConfig, Preferences, DevicePreferences, devicePreferenceDefaults, Editor, Warning } from '@packages/types'
22
import type { NexusGenEnums, TestingTypeEnum } from '@packages/graphql/src/gen/nxs.gen'
33
import type { BrowserWindow } from 'electron'
44
import type { ChildProcess } from 'child_process'
@@ -73,7 +73,7 @@ export interface WizardDataShape {
7373
chosenLanguage: NexusGenEnums['CodeLanguageEnum']
7474
chosenManualInstall: boolean
7575
chosenBrowser: FoundBrowser | null
76-
browserErrorMessage: string | null
76+
warnings: Warning[]
7777
}
7878

7979
export interface ElectronShape {
@@ -132,7 +132,7 @@ export function makeCoreData (): CoreDataShape {
132132
allBundlers: BUNDLERS,
133133
history: ['welcome'],
134134
chosenBrowser: null,
135-
browserErrorMessage: null,
135+
warnings: [],
136136
},
137137
user: null,
138138
electron: {

packages/frontend-shared/cypress/support/mock-graphql/clientTestContext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export interface ClientTestContext {
3737
allBundlers: WizardBundler[]
3838
history: WizardStep[]
3939
chosenBrowser: null
40-
browserErrorMessage: null
40+
warnings: []
4141
}
4242
user: AuthenticatedUserShape | null
4343
cloudTypes: typeof cloudTypes
@@ -87,7 +87,7 @@ export function makeClientTestContext (): ClientTestContext {
8787
allBundlers,
8888
history: ['welcome'],
8989
chosenBrowser: null,
90-
browserErrorMessage: null,
90+
warnings: [],
9191
},
9292
user: null,
9393
cloudTypes,

packages/frontend-shared/cypress/support/mock-graphql/stubgql-Wizard.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const stubWizard: MaybeResolver<Wizard> = {
4646
...testNodeId('WizardSampleConfigFile'),
4747
filePath: 'cypress/fixtures/example.json',
4848
description: 'Please do the necessary changes to your file',
49-
content: dedent`{
49+
content: dedent`{
5050
"foo": 1,
5151
"bar": 42
5252
}`,
@@ -97,4 +97,5 @@ export const stubWizard: MaybeResolver<Wizard> = {
9797
isSelected: idx === 0,
9898
}
9999
}),
100+
warnings: [],
100101
}

packages/graphql/schemas/schema.graphql

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,6 @@ type ProjectPreferences {
598598
type Query {
599599
baseError: BaseError
600600

601-
"""An error related to finding a browser"""
602-
browserErrorMessage: String
603-
604601
"""Returns an object conforming to the Relay spec"""
605602
cloudNode(
606603
"""An ID for a Node conforming to the Relay spec"""
@@ -758,6 +755,13 @@ type VersionData {
758755
latest: Version!
759756
}
760757

758+
"""A warning"""
759+
type Warning {
760+
message: String!
761+
setupStep: String
762+
title: String!
763+
}
764+
761765
"""
762766
The Wizard is a container for any state associated with initial onboarding to Cypress
763767
"""
@@ -809,6 +813,9 @@ type Wizard {
809813

810814
"""The title of the page, given the current step of the wizard"""
811815
title: String
816+
817+
"""A list of warnings"""
818+
warnings: [Warning!]!
812819
}
813820

814821
"""Wizard bundler"""

packages/graphql/src/schemaTypes/objectTypes/gql-Query.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,6 @@ export const Query = objectType({
4848
resolve: (root, args, ctx) => ctx.appData.projects,
4949
})
5050

51-
t.string('browserErrorMessage', {
52-
description: 'An error related to finding a browser',
53-
resolve: (source, args, ctx) => {
54-
return ctx.wizardData.browserErrorMessage
55-
},
56-
})
57-
5851
t.nonNull.boolean('isInGlobalMode', {
5952
description: 'Whether the app is in global mode or not',
6053
resolve: (source, args, ctx) => !ctx.currentProject,

packages/graphql/src/schemaTypes/objectTypes/gql-Wizard.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ import { TestingTypeEnum, WizardStepEnum } from '../enumTypes/gql-WizardEnums'
77
import { WizardCodeLanguage } from './gql-WizardCodeLanguage'
88
import { WizardSampleConfigFile } from './gql-WizardSampleConfigFile'
99

10+
const Warning = objectType({
11+
name: 'Warning',
12+
description: 'A warning',
13+
definition (t) {
14+
t.nonNull.string('title')
15+
t.nonNull.string('message')
16+
t.string('setupStep')
17+
},
18+
sourceType: {
19+
module: '@packages/types',
20+
export: 'Warning',
21+
},
22+
})
23+
1024
export const Wizard = objectType({
1125
name: 'Wizard',
1226
description: 'The Wizard is a container for any state associated with initial onboarding to Cypress',
@@ -98,6 +112,14 @@ export const Wizard = objectType({
98112
description: 'The title of the page, given the current step of the wizard',
99113
resolve: (source, args, ctx) => ctx.wizard.title ?? null,
100114
})
115+
116+
t.nonNull.list.nonNull.field('warnings', {
117+
type: Warning,
118+
description: 'A list of warnings',
119+
resolve: (source, args, ctx) => {
120+
return ctx.coreData.wizard.warnings
121+
},
122+
})
101123
},
102124
sourceType: {
103125
module: '@packages/data-context/src/data/coreDataShape',

packages/launchpad/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"scripts": {
66
"check-ts": "vue-tsc --noEmit",
77
"build-prod-ui": "cross-env NODE_ENV=production vite build",
8+
"postinstall": "patch-package",
89
"clean": "rimraf dist && rimraf ./node_modules/.vite && rimraf dist-e2e && echo 'cleaned'",
910
"clean-deps": "rimraf node_modules",
1011
"test": "yarn cypress:run:ct && yarn types",
@@ -28,6 +29,7 @@
2829
"@packages/frontend-shared": "0.0.0-development",
2930
"@percy/cypress": "^3.1.0",
3031
"@testing-library/cypress": "8.0.0",
32+
"@toycode/markdown-it-class": "1.2.4",
3133
"@urql/core": "2.3.1",
3234
"@urql/devtools": "2.0.3",
3335
"@urql/vue": "0.4.3",
@@ -46,6 +48,7 @@
4648
"graphql-tag": "^2.12.5",
4749
"gravatar": "1.8.0",
4850
"javascript-time-ago": "2.3.8",
51+
"markdown-it": "12.2.0",
4952
"rimraf": "3.0.2",
5053
"rollup-plugin-polyfill-node": "^0.7.0",
5154
"type-fest": "^2.3.4",
@@ -71,6 +74,11 @@
7174
"script",
7275
"src"
7376
],
77+
"workspaces": {
78+
"nohoist": [
79+
"@toycode/markdown-it-class"
80+
]
81+
},
7482
"vite": {
7583
"optimizeDeps": {
7684
"include": [

0 commit comments

Comments
 (0)