Skip to content

Feature/update server #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jan 11, 2020
Prev Previous commit
Next Next commit
update typings
  • Loading branch information
ShMcK committed Jan 10, 2020
commit 660d4b1f70347e411666d3218ec630ea78c9802d
3 changes: 1 addition & 2 deletions src/actions/setupActions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as T from 'typings'
import * as G from 'typings/graphql'
import * as vscode from 'vscode'
import * as git from '../services/git'
import loadWatchers from './utils/loadWatchers'
Expand All @@ -8,7 +7,7 @@ import runCommands from './utils/runCommands'

const setupActions = async (
workspaceRoot: vscode.WorkspaceFolder,
actions: G.StepActions,
actions: T.StepActions,
send: (action: T.Action) => void, // send messages to client
): Promise<void> => {
const { commands, commits, files, watchers } = actions
Expand Down
3 changes: 1 addition & 2 deletions src/actions/solutionActions.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import * as T from 'typings'
import * as G from 'typings/graphql'
import * as vscode from 'vscode'
import * as git from '../services/git'
import setupActions from './setupActions'

const solutionActions = async (
workspaceRoot: vscode.WorkspaceFolder,
stepActions: G.StepActions,
stepActions: T.StepActions,
send: (action: T.Action) => void,
): Promise<void> => {
await git.clear()
Expand Down
2 changes: 1 addition & 1 deletion src/actions/tutorialConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import languageMap from '../editor/languageMap'
import * as git from '../services/git'

interface TutorialConfigParams {
config: G.TutorialConfig
config: T.TutorialConfig
alreadyConfigured?: boolean
onComplete?(): void
}
Expand Down
2 changes: 1 addition & 1 deletion src/channel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class Channel implements Channel {
if (!tutorialContinue) {
throw new Error('Invalid tutorial to continue')
}
const continueConfig: G.TutorialConfig = tutorialContinue.version.data.config
const continueConfig: T.TutorialConfig = tutorialContinue.version.data.config
tutorialConfig(
{
config: continueConfig,
Expand Down
4 changes: 2 additions & 2 deletions src/editor/commands.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as G from 'typings/graphql'
import * as T from 'typings'
import * as vscode from 'vscode'
import createTestRunner, { Payload } from '../services/testRunner'
import createWebView from '../webview'
Expand Down Expand Up @@ -52,7 +52,7 @@ export const createCommands = ({ extensionPath, workspaceState, workspaceRoot }:
// setup 1x1 horizontal layout
webview.createOrShow()
},
[COMMANDS.CONFIG_TEST_RUNNER]: (config: G.TutorialTestRunner) => {
[COMMANDS.CONFIG_TEST_RUNNER]: (config: T.TutorialTestRunner) => {
testRunner = createTestRunner(config, {
onSuccess: (payload: Payload) => {
// send test pass message back to client
Expand Down
10 changes: 2 additions & 8 deletions typings/graphql.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export type Tutorial = {
__typename?: 'Tutorial'
id: Scalars['ID']
createdBy?: Maybe<User>
latestVersion: TutorialVersion
version: TutorialVersion
versions?: Maybe<Array<TutorialVersion>>
summary: TutorialSummary
}
Expand Down Expand Up @@ -524,7 +524,7 @@ export type TutorialResolvers<
> = {
id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>
createdBy?: Resolver<Maybe<ResolversTypes['User']>, ParentType, ContextType>
latestVersion?: Resolver<ResolversTypes['TutorialVersion'], ParentType, ContextType>
version?: Resolver<ResolversTypes['TutorialVersion'], ParentType, ContextType>
versions?: Resolver<Maybe<Array<ResolversTypes['TutorialVersion']>>, ParentType, ContextType>
summary?: Resolver<ResolversTypes['TutorialSummary'], ParentType, ContextType>
}
Expand Down Expand Up @@ -615,9 +615,3 @@ export interface IntrospectionResultData {
}[]
}
}
const result: IntrospectionResultData = {
__schema: {
types: [],
},
}
export default result
23 changes: 23 additions & 0 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,26 @@ export interface ProcessEvent {
description: string
status: 'RUNNING' | 'SUCCESS' | 'FAIL' | 'ERROR'
}

export interface StepActions {
id: string
commands: string[]
commits: string[]
files: string[]
watchers: string[]
}

export interface TutorialTestRunner {
command: string
fileFormats: string[]
}

export interface TutorialRepo {
uri: string
branch: string
}

export interface TutorialConfig {
testRunner: TutorialTestRunner
repo: TutorialRepo
}