Skip to content

Commit 9932935

Browse files
committed
rebase and fix graphql types
1 parent c804972 commit 9932935

File tree

6 files changed

+24
-22
lines changed

6 files changed

+24
-22
lines changed

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ import type { MutationAddProjectArgs, MutationAppCreateConfigFileArgs, SpecType
22
import type { FindSpecs, FoundBrowser, FoundSpec, FullConfig, LaunchArgs, LaunchOpts, OpenProjectLaunchOptions } from '@packages/types'
33
import path from 'path'
44
import type { Maybe, ProjectShape } from '../data/coreDataShape'
5-
import fs from 'fs-extra'
65

76
import type { DataContext } from '..'
8-
import { generateSpecFromStory } from '../data'
7+
import { generateSpecFromStory } from '../data/util/storybook'
98

109
export interface ProjectApiShape {
1110
getConfig(projectRoot: string): Promise<FullConfig>
@@ -186,7 +185,7 @@ export class ProjectActions {
186185
if (this.ctx.activeProject?.isFirstTimeCT) {
187186
const indexHtmlPath = path.resolve(this.ctx.activeProject.projectRoot, 'cypress/component/support/index.html')
188187

189-
fs.outputFileSync(indexHtmlPath, template)
188+
this.ctx.fs.outputFileSync(indexHtmlPath, template)
190189
}
191190
}
192191

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

+3
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,7 @@ export const stubMutation: MaybeResolver<Mutation> = {
4040

4141
return ctx.app
4242
},
43+
generateSpecFromStory (source, args, ctx) {
44+
return ctx.wizard
45+
},
4346
}

packages/graphql/schemas/schema.graphql

+13-13
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,18 @@ enum SpecType {
506506
integration
507507
}
508508

509+
"""Storybook"""
510+
type Storybook {
511+
"""Whether this is the selected framework bundler"""
512+
configured: Boolean
513+
514+
"""Most recent generated spec"""
515+
generatedSpec: String
516+
517+
"""List of all Storybook stories"""
518+
stories: [String!]!
519+
}
520+
509521
"""The bundlers that we can use with Cypress"""
510522
enum SupportedBundlers {
511523
vite
@@ -563,7 +575,7 @@ type Wizard {
563575
"""IndexHtml file based on bundler and framework of choice"""
564576
sampleTemplate: String
565577
step: WizardStep!
566-
storybook: WizardStorybook
578+
storybook: Storybook
567579

568580
"""
569581
The testing type we are setting in the wizard, null if this has not been chosen
@@ -641,15 +653,3 @@ enum WizardStep {
641653
setupComplete
642654
welcome
643655
}
644-
645-
"""Wizard Storybook"""
646-
type WizardStorybook {
647-
"""Whether this is the selected framework bundler"""
648-
configured: Boolean
649-
650-
"""Most recent generated spec"""
651-
generatedSpec: String
652-
653-
"""List of all Storybook stories"""
654-
stories: [String!]!
655-
}

packages/graphql/src/schemaTypes/objectTypes/gql-WizardStorybook.ts packages/graphql/src/schemaTypes/objectTypes/gql-Storybook.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { objectType } from 'nexus'
22

3-
export const WizardStorybook = objectType({
4-
name: 'WizardStorybook',
5-
description: 'Wizard Storybook',
3+
export const Storybook = objectType({
4+
name: 'Storybook',
5+
description: 'Storybook',
66
definition (t) {
77
t.boolean('configured', {
88
description: 'Whether this is the selected framework bundler',

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { WizardNpmPackage } from './gql-WizardNpmPackage'
55
import { arg, nonNull, objectType } from 'nexus'
66
import { BUNDLERS, FRONTEND_FRAMEWORKS, TESTING_TYPES } from '@packages/types'
77
import { TestingTypeEnum, WizardCodeLanguageEnum, WizardStepEnum } from '../enumTypes/gql-WizardEnums'
8-
import { WizardStorybook } from './gql-WizardStorybook'
8+
import { Storybook } from './gql-Storybook'
99

1010
export const Wizard = objectType({
1111
name: 'Wizard',
@@ -99,7 +99,7 @@ export const Wizard = objectType({
9999
})
100100

101101
t.field('storybook', {
102-
type: WizardStorybook,
102+
type: Storybook,
103103
resolve: (source, args, ctx) => ctx.wizard.storybook,
104104
})
105105
},

packages/graphql/src/schemaTypes/objectTypes/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export * from './gql-NavigationMenu'
1010
export * from './gql-Project'
1111
export * from './gql-Query'
1212
export * from './gql-Spec'
13+
export * from './gql-Storybook'
1314
export * from './gql-TestingTypeInfo'
1415
export * from './gql-Wizard'
1516
export * from './gql-WizardBundler'
1617
export * from './gql-WizardFrontendFramework'
1718
export * from './gql-WizardNpmPackage'
18-
export * from './gql-WizardStorybook'

0 commit comments

Comments
 (0)