Skip to content

Commit

Permalink
refactor(core): move files to outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
NWYLZW committed Aug 12, 2023
1 parent 2e73749 commit af08697
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
6 changes: 4 additions & 2 deletions core/src/plugins/outputs/devtools.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { defineDevtools, elBridgeC } from '@power-playground/core'

import { Files } from '../../eval-logs/files'

import { JSPanel } from './panels/javascript'
import { DTSPanel } from './panels/typescript'
import { Files } from './files'

// @ts-ignore
window.require = function (name) {
Expand Down Expand Up @@ -38,6 +37,9 @@ elBridgeC.on('run', () => {
})
})

// TODO More Panel
// Errors
// AST
export default defineDevtools({
panels: [JSPanel, DTSPanel]
})
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useSyncExternalStore } from 'react'
import * as Babel from '@babel/standalone'

import type { EvalLogsIframeParentEvent } from './bridge.ts'
import { elBridgeC } from './bridge.ts'
import type { EvalLogsIframeParentEvent } from '../../eval-logs/bridge'
import { elBridgeC } from '../../eval-logs/bridge'

export let Files: (
& Extract<EvalLogsIframeParentEvent, { type: 'compile-completed' }>['data'][number]
Expand Down
4 changes: 0 additions & 4 deletions core/src/plugins/outputs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import { definePlugin } from '../index'

import { Run } from './Run'

// TODO More Panel
// Errors
// AST

let compileResult: monacoEditor.languages.typescript.EmitOutput | undefined

export default definePlugin({
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/outputs/panels/javascript.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useMemo } from 'react'
import { defineDevtoolsPanel } from '@power-playground/core'

import { useFiles } from '../../../eval-logs/files.ts'
import CodeHighlighter from '../code-highlighter.tsx'
import { useFiles } from '../files.ts'

export const JSPanel = defineDevtoolsPanel('outputs.js', '.JS', 'react', ({ UI, devtoolsWindow: { simport } }) => {
const files = useFiles()
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/outputs/panels/typescript.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useMemo } from 'react'
import { defineDevtoolsPanel } from '@power-playground/core'

import { useFiles } from '../../../eval-logs/files.ts'
import CodeHighlighter from '../code-highlighter.tsx'
import { useFiles } from '../files.ts'

export const DTSPanel = defineDevtoolsPanel('outputs.d.ts', '.D.TS', 'react', ({ UI, devtoolsWindow: { simport } }) => {
const files = useFiles()
Expand Down

0 comments on commit af08697

Please sign in to comment.