This commit is contained in:
peli 2020-06-29 17:34:37 -07:00
Родитель 3f845a7cfc
Коммит 0812bd3eb2
9 изменённых файлов: 11 добавлений и 32 удалений

Просмотреть файл

@ -1,5 +1,5 @@
import React from "react";
import JacdacContext from "./Context";
import JacdacContext from "../../../src/react/Context";
import ConnectButton from "./ConnectButton"
const JacdacComponent = ({ children }) => {

Просмотреть файл

@ -1,6 +1,6 @@
import React from "react";
import { Button } from "gatsby-theme-material-ui";
import JacdacContext from "./Context";
import JacdacContext from "../../../src/react/Context";
function ConnectButton() {
return <JacdacContext.Consumer>

Просмотреть файл

@ -1,19 +0,0 @@
import React from "react";
import { Bus } from "../../../src/dom/bus";
const JacdacContext = React.createContext<{
bus: Bus,
connected: boolean,
connecting: boolean,
connectAsync: () => Promise<void>,
disconnectAsync: () => Promise<void>
}>({
bus: undefined,
connected: false,
connecting: false,
connectAsync: undefined,
disconnectAsync: undefined
});
JacdacContext.displayName = "jacdac";
export default JacdacContext;

Просмотреть файл

@ -2,7 +2,7 @@
import React, { useEffect, useState } from 'react';
import { List, ListItem, ListItemText } from '@material-ui/core';
import DeviceListItem from './DeviceListItem';
import { Device } from "../../../src/device";
import { Device } from "../../../src/dom/device";
import { useQuery } from './Query';
const DeviceList = () => {

Просмотреть файл

@ -1,7 +1,7 @@
import React from 'react';
import { ListItem, ListItemText } from '@material-ui/core';
import { Device } from '../../../src/device';
import { Device } from '../../../src/dom/device';
const DeviceListItem = (props: { device: Device }) => <ListItem>

Просмотреть файл

@ -1,7 +1,7 @@
import React, { useState } from 'react'
import { useContext } from "react";
import JacdacContext from "./Context"
import { queryAsync, getSchema } from "../../../src/graphql"
import JacdacContext from "../../../src/react/Context";
import { queryAsync, getSchema } from "../../../src/graphql/graphql"
// tslint:disable-next-line: no-import-side-effect no-submodule-imports
import "graphiql/graphiql.min.css";
import GraphiQL from 'graphiql';

Просмотреть файл

@ -1,7 +1,7 @@
import React, { useState, useEffect, useContext } from "react";
import { Bus } from "../../../src/bus";
import { createUSBBus } from "../../../src/webusb";
import JacdacContext from "./Context";
import { Bus } from "../../../src/dom/bus";
import { createUSBBus } from "../../../src/dom/webusb";
import JacdacContext from "../../../src/react/Context";
const JacdacProvider = ({ children }) => {
const [bus] = useState<Bus>(createUSBBus());

Просмотреть файл

@ -1,6 +1,6 @@
import { useContext, useState, useEffect, useCallback } from "react";
import JacdacContext from "./Context";
import { queryAsync} from "../../../src/graphql"
import JacdacContext from "../../../src/react/Context";
import { queryAsync} from "../../../src/graphql/graphql"
export type OperationVariables = { [name: string]: any; };

Просмотреть файл

@ -22,8 +22,6 @@
"scripts": {
"postinstall": "cd docs && npm install",
"lint": "node node_modules/tslint/bin/tslint --project tsconfig.json -t codeFrame 'src/**/*.ts' 'test/**/*.ts'",
"prebuild": "rm -rf dist",
"build": "tsc",
"predist": "rm -rf dist",
"dist": "node node_modules/rollup/bin/rollup -c rollup.config.ts",
"predistdocs": "cd docs && node node_modules/gatsby/cli.js clean",