Rename directory "engines" to "languages"
This commit is contained in:
parent
0bf7c0de3a
commit
e3be5a8a83
@ -3,7 +3,7 @@ import { NextPage } from "next";
|
||||
import Head from "next/head";
|
||||
import { Mainframe } from "../../ui/Mainframe";
|
||||
import { Header } from "../../ui/header";
|
||||
import LangProvider from "../../engines/befunge93";
|
||||
import LangProvider from "../../languages/befunge93";
|
||||
const LANG_ID = "befunge93";
|
||||
const LANG_NAME = "Befunge-93";
|
||||
|
||||
|
@ -3,7 +3,7 @@ import { NextPage } from "next";
|
||||
import Head from "next/head";
|
||||
import { Mainframe } from "../../ui/Mainframe";
|
||||
import { Header } from "../../ui/header";
|
||||
import LangProvider from "../../engines/brainfuck";
|
||||
import LangProvider from "../../languages/brainfuck";
|
||||
const LANG_ID = "brainfuck";
|
||||
const LANG_NAME = "Brainfuck";
|
||||
|
||||
|
@ -3,7 +3,7 @@ import { NextPage } from "next";
|
||||
import Head from "next/head";
|
||||
import { Mainframe } from "../../ui/Mainframe";
|
||||
import { Header } from "../../ui/header";
|
||||
import LangProvider from "../../engines/chef";
|
||||
import LangProvider from "../../languages/chef";
|
||||
const LANG_ID = "chef";
|
||||
const LANG_NAME = "Chef";
|
||||
|
||||
|
@ -3,7 +3,7 @@ import { NextPage } from "next";
|
||||
import Head from "next/head";
|
||||
import { Mainframe } from "../../ui/Mainframe";
|
||||
import { Header } from "../../ui/header";
|
||||
import LangProvider from "../../engines/deadfish";
|
||||
import LangProvider from "../../languages/deadfish";
|
||||
const LANG_ID = "deadfish";
|
||||
const LANG_NAME = "Deadfish";
|
||||
|
||||
|
@ -14,7 +14,7 @@ if (!langId || !langName) {
|
||||
}
|
||||
|
||||
// Check if language provider directory already exists
|
||||
const dir = path.resolve(__dirname, "../engines/", langId);
|
||||
const dir = path.resolve(__dirname, "../languages/", langId);
|
||||
if (fs.existsSync(dir)) {
|
||||
console.log(`Language ID '${langId}' already exists.`);
|
||||
process.exit(0);
|
||||
|
@ -3,11 +3,11 @@ import { CodeEditor, CodeEditorRef } from "../ui/code-editor";
|
||||
import { InputEditor, InputEditorRef } from "../ui/input-editor";
|
||||
import { MainLayout } from "../ui/MainLayout";
|
||||
import { useExecController } from "../ui/use-exec-controller";
|
||||
import { LanguageProvider, StepExecutionResult } from "../engines/types";
|
||||
import { LanguageProvider, StepExecutionResult } from "../languages/types";
|
||||
import { OutputViewer, OutputViewerRef } from "../ui/output-viewer";
|
||||
import { ExecutionControls } from "./execution-controls";
|
||||
import { RendererRef, RendererWrapper } from "./renderer-wrapper";
|
||||
import { WorkerRuntimeError } from "../engines/worker-errors";
|
||||
import { WorkerRuntimeError } from "../languages/worker-errors";
|
||||
|
||||
type Props<RS> = {
|
||||
langName: string;
|
||||
|
@ -5,7 +5,7 @@ import {
|
||||
DocumentEdit,
|
||||
DocumentRange,
|
||||
MonacoTokensProvider,
|
||||
} from "../../engines/types";
|
||||
} from "../../languages/types";
|
||||
import {
|
||||
createHighlightRange,
|
||||
createMonacoDocEdit,
|
||||
@ -16,7 +16,7 @@ import { useEditorBreakpoints } from "./use-editor-breakpoints";
|
||||
import darkTheme from "./themes/dark.json";
|
||||
import lightTheme from "./themes/light.json";
|
||||
import { useDarkMode } from "../providers/dark-mode-provider";
|
||||
import { WorkerParseError } from "../../engines/worker-errors";
|
||||
import { WorkerParseError } from "../../languages/worker-errors";
|
||||
import { useCodeValidator } from "./use-code-validator";
|
||||
|
||||
/** Keeps track of user's original program and modifications done to it */
|
||||
|
@ -1,6 +1,6 @@
|
||||
import monaco from "monaco-editor";
|
||||
import { DocumentEdit, DocumentRange } from "../../engines/types";
|
||||
import { WorkerParseError } from "../../engines/worker-errors";
|
||||
import { DocumentEdit, DocumentRange } from "../../languages/types";
|
||||
import { WorkerParseError } from "../../languages/worker-errors";
|
||||
|
||||
/** Type alias for an instance of Monaco editor */
|
||||
export type EditorInstance = monaco.editor.IStandaloneCodeEditor;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import { WorkerParseError } from "../../engines/worker-errors";
|
||||
import { WorkerParseError } from "../../languages/worker-errors";
|
||||
import {
|
||||
createValidationMarker,
|
||||
EditorInstance,
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import { useMonaco } from "@monaco-editor/react";
|
||||
import { MonacoTokensProvider } from "../../engines/types";
|
||||
import { MonacoTokensProvider } from "../../languages/types";
|
||||
|
||||
type ConfigParams = {
|
||||
languageId: string;
|
||||
|
@ -1,6 +1,9 @@
|
||||
import React from "react";
|
||||
import { Colors, Text } from "@blueprintjs/core";
|
||||
import { WorkerParseError, WorkerRuntimeError } from "../engines/worker-errors";
|
||||
import {
|
||||
WorkerParseError,
|
||||
WorkerRuntimeError,
|
||||
} from "../languages/worker-errors";
|
||||
|
||||
/** Format a ParseError for displaying as output */
|
||||
const formatParseError = (error: WorkerParseError): string => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import { LanguageProvider } from "../engines/types";
|
||||
import { LanguageProvider } from "../languages/types";
|
||||
|
||||
export interface RendererRef<RS> {
|
||||
/** Update runtime state to renderer */
|
||||
|
@ -1,10 +1,13 @@
|
||||
import React from "react";
|
||||
import { StepExecutionResult } from "../engines/types";
|
||||
import { StepExecutionResult } from "../languages/types";
|
||||
import {
|
||||
WorkerRequestData,
|
||||
WorkerResponseData,
|
||||
} from "../engines/worker-constants";
|
||||
import { WorkerParseError, WorkerRuntimeError } from "../engines/worker-errors";
|
||||
} from "../languages/worker-constants";
|
||||
import {
|
||||
WorkerParseError,
|
||||
WorkerRuntimeError,
|
||||
} from "../languages/worker-errors";
|
||||
import { useErrorBoundary } from "./providers/error-boundary-provider";
|
||||
|
||||
/** Possible states for the worker to be in */
|
||||
|
@ -1,14 +1,14 @@
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
|
||||
const langNames = fs.readdirSync("engines").filter((name) => {
|
||||
const stats = fs.statSync(`./engines/${name}`);
|
||||
const langNames = fs.readdirSync("languages").filter((name) => {
|
||||
const stats = fs.statSync(`./languages/${name}`);
|
||||
return stats.isDirectory();
|
||||
});
|
||||
|
||||
const entryPoints = {};
|
||||
for (const lang of langNames) {
|
||||
entryPoints[lang] = `./engines/${lang}/engine.ts`;
|
||||
entryPoints[lang] = `./languages/${lang}/engine.ts`;
|
||||
}
|
||||
|
||||
console.log(path.resolve(__dirname, "worker-pack/tsconfig.json"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user