Skip to content
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

chore(gatsby): Convert repl to typescript #22037

Merged
merged 1 commit into from
Mar 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
const repl = require(`repl`)
const { graphql } = require(`graphql`)
const bootstrap = require(`../bootstrap`)
const { trackCli } = require(`gatsby-telemetry`)
const {
loadNodeContent,
getNodes,
getNode,
getNodesByType,
} = require(`../db/nodes`)
const { store } = require(`../redux`)
import repl from "repl"
import { graphql } from "graphql"
import bootstrap from "../bootstrap"
import { trackCli } from "gatsby-telemetry"
import { loadNodeContent, getNodes, getNode, getNodesByType } from "../db/nodes"
import { store } from "../redux"
import { IProgram } from "./types"

module.exports = async program => {
module.exports = async (program: IProgram): Promise<void> => {
trackCli(`REPL_START`)
// run bootstrap
await bootstrap(program)
Expand All @@ -27,7 +23,7 @@ module.exports = async program => {

const nodes = getNodes()

const query = async query => {
const query = async (query: string): Promise<void> => {
const result = await graphql(schema, query, {}, {}, {})
console.log(`query result: ${JSON.stringify(result)}`)
}
Expand Down
2 changes: 2 additions & 0 deletions packages/gatsby/src/redux/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export interface IReduxState {
proxy: any
}
pageData: any
pages: any
babelrc: any
}

export interface ICachedReduxState {
Expand Down