Stub out checkmate react app

This commit is contained in:
Ayaz Hafiz 2023-07-16 13:54:50 -05:00
parent 271d2a3219
commit 27dd9d03aa
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
11 changed files with 18910 additions and 0 deletions

View file

@ -0,0 +1,17 @@
/node_modules
/.pnp
.pnp.js
/coverage
/build
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,45 @@
{
"name": "checkmate",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"scripts": {
"start": "react-scripts start",
"build": "build:codegen && react-scripts build",
"build:codegen": "node ./scripts/gen_schema_dts.js",
"check": "tsc",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.38",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"json-schema-to-typescript": "^13.0.2",
"react-scripts": "5.0.1",
"tailwindcss": "^3.3.3",
"typescript": "^4.9.5"
}
}

View file

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="checkmate in N" />
<title>Checkmate</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>

View file

@ -0,0 +1,24 @@
const {compileFromFile} = require("json-schema-to-typescript");
const fs = require("node:fs/promises");
const path = require("node:path");
const SCHEMA_PATH = path.resolve(
__dirname,
"..",
"..",
"schema.json"
);
const DTS_PATH = path.resolve(
__dirname,
"..",
"src",
"schema.d.ts"
);
async function main() {
const result = await compileFromFile(SCHEMA_PATH);
await fs.writeFile(DTS_PATH, result);
}
main().catch(console.error);

View file

@ -0,0 +1,13 @@
import React from "react";
export default function App() {
return (
<div className="App">
<header className="App-header">
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
</header>
</div>
);
}

View file

@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View file

@ -0,0 +1,13 @@
import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement
);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);

View file

@ -0,0 +1,245 @@
/* eslint-disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export type Event =
| (
| {
from: Variable;
to: Variable;
type: "Unify";
[k: string]: unknown;
}
| {
content?: Content | null;
rank?: Rank | null;
type: "SetDescriptor";
variable: Variable;
[k: string]: unknown;
}
)
| {
left: Variable;
mode: UnificationMode;
right: Variable;
subevents: Event[];
success?: boolean | null;
type: "Unification";
[k: string]: unknown;
};
export type Variable = number;
export type Content =
| {
name?: string | null;
type: "Flex";
[k: string]: unknown;
}
| {
name: string;
type: "Rigid";
[k: string]: unknown;
}
| {
abilities: Symbol[];
name?: string | null;
type: "FlexAble";
[k: string]: unknown;
}
| {
abilities: Symbol[];
name: string;
type: "RigidAble";
[k: string]: unknown;
}
| {
name?: string | null;
structure: Variable;
type: "Recursive";
[k: string]: unknown;
}
| {
ambient_function: Variable;
recursion_var?: Variable | null;
solved: ClosureType[];
type: "LambdaSet";
unspecialized: UnspecializedClosureType[];
[k: string]: unknown;
}
| {
kind: AliasKind;
name: Symbol;
real_variable: Variable;
type: "Alias";
variables: AliasTypeVariables;
[k: string]: unknown;
}
| {
symbol: Symbol;
type: "Apply";
variables: Variable[];
[k: string]: unknown;
}
| {
arguments: Variable[];
lambda_type: Variable;
ret: Variable;
type: "Function";
[k: string]: unknown;
}
| {
extension: Variable;
fields: {
[k: string]: RecordField;
};
type: "Record";
[k: string]: unknown;
}
| {
elements: {
[k: string]: Variable;
};
extension: Variable;
type: "Tuple";
[k: string]: unknown;
}
| {
extension: TagUnionExtension;
tags: {
[k: string]: Variable[];
};
type: "TagUnion";
[k: string]: unknown;
}
| {
extension: TagUnionExtension;
functions: Symbol[];
tags: string[];
type: "FunctionOrTagUnion";
[k: string]: unknown;
}
| {
extension: TagUnionExtension;
recursion_var: Variable;
tags: {
[k: string]: Variable[];
};
type: "RecursiveTagUnion";
[k: string]: unknown;
}
| {
type: "EmptyRecord";
[k: string]: unknown;
}
| {
type: "EmptyTuple";
[k: string]: unknown;
}
| {
type: "EmptyTagUnion";
[k: string]: unknown;
}
| {
range: NumericRange;
type: "RangedNumber";
[k: string]: unknown;
}
| {
type: "Error";
[k: string]: unknown;
};
export type Symbol = string;
export type AliasKind =
| {
type: "Structural";
[k: string]: unknown;
}
| {
type: "Opaque";
[k: string]: unknown;
};
export type RecordFieldKind =
| {
type: "Demanded";
[k: string]: unknown;
}
| {
rigid: boolean;
type: "Required";
[k: string]: unknown;
}
| {
rigid: boolean;
type: "Optional";
[k: string]: unknown;
};
export type TagUnionExtension =
| (
| {
type: "Openness";
[k: string]: unknown;
}
| number
)
| (
| {
type: "Any";
[k: string]: unknown;
}
| number
);
export type NumericRangeKind =
| {
type: "Int";
[k: string]: unknown;
}
| {
type: "AnyNum";
[k: string]: unknown;
};
export type Rank = number;
export type UnificationMode =
| {
type: "Eq";
[k: string]: unknown;
}
| {
type: "Present";
[k: string]: unknown;
}
| {
type: "LambdaSetSpecialization";
[k: string]: unknown;
};
export type AllEvents = Event[];
export interface ClosureType {
environment: Variable[];
function: Symbol;
[k: string]: unknown;
}
export interface UnspecializedClosureType {
ability_member: Symbol;
lambda_set_region: number;
specialization: Variable;
[k: string]: unknown;
}
export interface AliasTypeVariables {
infer_ext_in_output_position_variables: Variable[];
lambda_set_variables: Variable[];
type_variables: Variable[];
[k: string]: unknown;
}
export interface RecordField {
field_type: Variable;
kind: RecordFieldKind;
[k: string]: unknown;
}
export interface NumericRange {
kind: NumericRangeKind;
min_width: number;
signed: boolean;
[k: string]: unknown;
}

View file

@ -0,0 +1,12 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
mode: 'jit',
content: [
"./src/**/*.{js,jsx,ts,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}

View file

@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": ["src"]
}