Skip to content

Commit

Permalink
Merge branch 'typescript-5'
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Mar 21, 2023
2 parents a70b53f + 2e2cef3 commit 3992552
Show file tree
Hide file tree
Showing 80 changed files with 927 additions and 1,340 deletions.
1,950 changes: 751 additions & 1,199 deletions package-lock.json

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,36 +53,36 @@
}
},
"dependencies": {
"@types/three": "^0.146.0",
"@types/three": "^0.149.0",
"@types/web-bluetooth": "^0.0.16",
"comlink": "^4.3.1",
"comlink": "^4.4.1",
"random-uint-below": "^2.0.0",
"three": "^0.147.0"
"three": "^0.150.1"
},
"devDependencies": {
"@esm-bundle/chai": "^4.3.4-fix.0",
"@types/chai": "^4.3.4",
"@types/dom-speech-recognition": "^0.0.1",
"@types/mocha": "^10.0.1",
"@types/node": "^18.11.13",
"@types/node": "^18.15.5",
"@types/node-fetch": "^2.6.2",
"@types/yargs": "^17.0.17",
"@web/dev-server-esbuild": "^0.3.3",
"@web/test-runner": "^0.15.0",
"@types/yargs": "^17.0.23",
"@web/dev-server-esbuild": "^0.3.4",
"@web/test-runner": "^0.15.1",
"@web/test-runner-playwright": "^0.9.0",
"barely-a-dev-server": "^0.4.9",
"barely-a-dev-server": "^0.4.11",
"chai": "^4.3.7",
"esbuild": "^0.16.4",
"esbuild": "^0.16.17",
"jszip": "^3.10.1",
"mocha": "^10.2.0",
"node-fetch": "^3.3.0",
"peggy": "^2.0.1",
"playwright": "^1.28.1",
"node-fetch": "^3.3.1",
"peggy": "^3.0.1",
"playwright": "^1.31.2",
"rome": "^11.0.0-nightly.fab5440",
"tsup": "^6.5.0",
"typedoc": "^0.23.22",
"typescript": "^4.9.4",
"yargs": "^17.6.2"
"tsup": "^6.7.0",
"typedoc": "^0.23.28",
"typescript": "^5.0.2",
"yargs": "^17.7.1"
},
"minimalDevDependencies": [
"barely-a-dev-server",
Expand Down
2 changes: 1 addition & 1 deletion src/cubing/alg/Alg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AlgCommon, Comparable } from "./common";
import { experimentalIs, experimentalIsAlgNode } from "./is";
import { direct, IterationDirection, reverse } from "./iteration";
import { parseAlg } from "./parseAlg";
import { simplify, SimplifyOptions } from "./simplify";
import { simplify, type SimplifyOptions } from "./simplify";
import { Grouping, Pause } from "./alg-nodes";
import { LineComment } from "./alg-nodes/leaves/LineComment";
import { Move } from "./alg-nodes/leaves/Move";
Expand Down
2 changes: 1 addition & 1 deletion src/cubing/alg/alg-nodes/containers/Commutator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Alg, experimentalEnsureAlg, FlexibleAlgSource } from "../../Alg";
import { Alg, experimentalEnsureAlg, type FlexibleAlgSource } from "../../Alg";
import { AlgCommon, Comparable } from "../../common";
import { IterationDirection } from "../../iteration";
import type { AlgLeaf } from "../AlgNode";
Expand Down
2 changes: 1 addition & 1 deletion src/cubing/alg/alg-nodes/containers/Conjugate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Alg, experimentalEnsureAlg, FlexibleAlgSource } from "../../Alg";
import { Alg, experimentalEnsureAlg, type FlexibleAlgSource } from "../../Alg";
import { AlgCommon, Comparable } from "../../common";
import { IterationDirection } from "../../iteration";
import type { AlgLeaf } from "../AlgNode";
Expand Down
2 changes: 1 addition & 1 deletion src/cubing/alg/alg-nodes/containers/Grouping.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Alg, experimentalEnsureAlg, FlexibleAlgSource } from "../../Alg";
import { Alg, experimentalEnsureAlg, type FlexibleAlgSource } from "../../Alg";
import { AlgCommon, Comparable } from "../../common";
import { IterationDirection } from "../../iteration";
import { Move, QuantumMove } from "../leaves/Move";
Expand Down
2 changes: 1 addition & 1 deletion src/cubing/alg/alg-nodes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export { Newline } from "./leaves/Newline";
export { Pause } from "./leaves/Pause";
import type { AlgNode } from "./AlgNode";

export { AlgNode };
export type { AlgNode };
/** @deprecated */
export type Unit = AlgNode;
2 changes: 1 addition & 1 deletion src/cubing/alg/simplify/append.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Alg } from "../Alg";
import type { AlgNode } from "../alg-nodes";
import type { AlgLeaf } from "../alg-nodes/AlgNode";
import { Move } from "../alg-nodes/leaves/Move";
import { AppendOptions, AppendOptionsHelper } from "./options";
import { type AppendOptions, AppendOptionsHelper } from "./options";

function areSameDirection(direction: -1 | 1, move2: Move): boolean {
// This multiplication has two properties:
Expand Down
2 changes: 1 addition & 1 deletion src/cubing/alg/simplify/simplify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { Newline } from "../alg-nodes/leaves/Newline";
import { Pause } from "../alg-nodes/leaves/Pause";
import { functionFromTraversal, TraversalDownUp } from "../traversal";
import { experimentalAppendNode } from "./append";
import { AppendOptionsHelper, SimplifyOptions } from "./options";
import { AppendOptionsHelper, type SimplifyOptions } from "./options";

// TODO: Test that inverses are bijections.
class Simplify extends TraversalDownUp<SimplifyOptions, Generator<AlgNode>> {
Expand Down
2 changes: 1 addition & 1 deletion src/cubing/bluetooth/smart-puzzle/Heykube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "../../protocol";
import { puzzles } from "../../puzzles";
import { debugLog } from "../debug";
import { BluetoothConfig, BluetoothPuzzle } from "./bluetooth-puzzle";
import { type BluetoothConfig, BluetoothPuzzle } from "./bluetooth-puzzle";
import { flipBitOrder } from "./endianness";

// TODO: Short IDs
Expand Down
5 changes: 4 additions & 1 deletion src/cubing/bluetooth/smart-puzzle/bluetooth-puzzle.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import type { AlgLeaf } from "../../alg/alg-nodes/AlgNode";
import type { KState } from "../../kpuzzle/KState";
import { BasicRotationTransformer, StreamTransformer } from "../transformer";
import {
BasicRotationTransformer,
type StreamTransformer,
} from "../transformer";

/******** BluetoothPuzzle ********/

Expand Down
2 changes: 1 addition & 1 deletion src/cubing/bluetooth/smart-puzzle/connect.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bluetoothConnect, BluetoothConnectOptions } from "../connect";
import { bluetoothConnect, type BluetoothConnectOptions } from "../connect";
import type { BluetoothPuzzle } from "./bluetooth-puzzle";
import { ganConfig } from "./gan";
import { giiKERConfig } from "./giiker";
Expand Down
2 changes: 1 addition & 1 deletion src/cubing/bluetooth/smart-puzzle/gan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
unsafeDecryptBlock,
} from "../../vendor/public-domain/unsafe-raw-aes/unsafe-raw-aes";
import { debugLog } from "../debug";
import { BluetoothConfig, BluetoothPuzzle } from "./bluetooth-puzzle";
import { type BluetoothConfig, BluetoothPuzzle } from "./bluetooth-puzzle";

// This needs to be short enough to capture 6 moves (OBQTM).
const DEFAULT_INTERVAL_MS = 150;
Expand Down
4 changes: 2 additions & 2 deletions src/cubing/bluetooth/smart-puzzle/giiker.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* tslint:disable no-bitwise */

import { Move } from "../../alg";
import { KState, KStateData } from "../../kpuzzle";
import { KState, type KStateData } from "../../kpuzzle";
import { experimental3x3x3KPuzzle } from "../../puzzles/cubing-private";
import { debugLog } from "../debug";
import { BluetoothConfig, BluetoothPuzzle } from "./bluetooth-puzzle";
import { type BluetoothConfig, BluetoothPuzzle } from "./bluetooth-puzzle";

const MESSAGE_LENGTH = 20;

Expand Down
2 changes: 1 addition & 1 deletion src/cubing/bluetooth/smart-puzzle/gocube.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Quaternion } from "three";
import { Alg, experimentalAppendMove, Move } from "../../alg";
import { debugLog } from "../debug";
import { BluetoothConfig, BluetoothPuzzle } from "./bluetooth-puzzle";
import { type BluetoothConfig, BluetoothPuzzle } from "./bluetooth-puzzle";

const UUIDs = {
goCubeService: "6e400001-b5a3-f393-e0a9-e50e24dcca9e",
Expand Down
2 changes: 1 addition & 1 deletion src/cubing/bluetooth/smart-robot/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bluetoothConnect, BluetoothConnectOptions } from "../connect";
import { bluetoothConnect, type BluetoothConnectOptions } from "../connect";
import type { BluetoothConfig } from "../smart-puzzle/bluetooth-puzzle";
import { GanRobot, ganTimerConfig } from "./GanRobot";

Expand Down
2 changes: 1 addition & 1 deletion src/cubing/bluetooth/smart-timer/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bluetoothConnect, BluetoothConnectOptions } from "../connect";
import { bluetoothConnect, type BluetoothConnectOptions } from "../connect";
import type { BluetoothConfig } from "../smart-puzzle/bluetooth-puzzle";
import { GanTimer, ganTimerConfig } from "./GanTimer";

Expand Down
5 changes: 4 additions & 1 deletion src/cubing/puzzle-geometry/Options.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { parsePuzzleDescription, PuzzleDescription } from "./PuzzleGeometry";
import {
parsePuzzleDescription,
type PuzzleDescription,
} from "./PuzzleGeometry";

export function parseOptions(argv: string[]): {
puzzleDescription: PuzzleDescription | null;
Expand Down
16 changes: 10 additions & 6 deletions src/cubing/puzzle-geometry/PuzzleGeometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import {
FaceRenamingMapper,
FTONotationMapper,
MegaminxScramblingNotationMapper,
NotationMapper,
type NotationMapper,
NullMapper,
NxNxNCubeMapper,
PyraminxNotationMapper,
SkewbNotationMapper,
TetraminxNotationMapper,
} from "./notation-mapping";
import {
BaseFaceCount,
FaceBasedOrientationDescription,
FaceBasedOrientationDescriptionLookup,
type BaseFaceCount,
type FaceBasedOrientationDescription,
type FaceBasedOrientationDescriptionLookup,
PuzzleGeometryFullOptions,
PuzzleGeometryOptions,
type PuzzleGeometryOptions,
} from "./Options";
import { iota, Perm, zeros } from "./Perm";
import {
Expand All @@ -29,7 +29,11 @@ import {
showcanon,
VisibleState,
} from "./PermOriSet";
import { PGPuzzles, PuzzleDescriptionString, PuzzleName } from "./PGPuzzles";
import {
PGPuzzles,
type PuzzleDescriptionString,
type PuzzleName,
} from "./PGPuzzles";
import {
closure,
cube,
Expand Down
8 changes: 6 additions & 2 deletions src/cubing/puzzles/async/async-pg3d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KPuzzle, KPuzzleDefinition } from "../../kpuzzle";
import { KPuzzle, type KPuzzleDefinition } from "../../kpuzzle";
import type { PuzzleGeometry } from "../../puzzle-geometry";
import type { ExperimentalStickering, PuzzleID } from "../../twisty";
import type { PuzzleLoader } from "../PuzzleLoader";
Expand All @@ -8,7 +8,11 @@ import {
cubeLikeStickeringMask,
} from "../stickerings/cube-like-stickerings";
import { getCached } from "./lazy-cached";
import { Move, PuzzleSpecificSimplifyOptions, QuantumMove } from "../../alg";
import {
Move,
type PuzzleSpecificSimplifyOptions,
QuantumMove,
} from "../../alg";
import { PLazy } from "../../vendor/mit/p-lazy/p-lazy";

// TODO: modify this to handle TwistyPlayer options
Expand Down
2 changes: 1 addition & 1 deletion src/cubing/puzzles/customPGPuzzleLoader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KPuzzle, KPuzzleDefinition } from "../kpuzzle";
import { KPuzzle, type KPuzzleDefinition } from "../kpuzzle";
import type { PuzzleGeometry } from "../puzzle-geometry";
import type { PuzzleDescriptionString } from "../puzzle-geometry/PGPuzzles";
import { puzzleSpecificSimplifyOptionsPromise } from "./async/async-pg3d";
Expand Down
4 changes: 2 additions & 2 deletions src/cubing/puzzles/stickerings/cube-like-stickerings.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { ExperimentalStickering, PuzzleID } from "../../twisty";
import type { PuzzleLoader } from "../PuzzleLoader";
import {
PieceSet,
type PieceSet,
PieceStickering,
StickeringMask,
type StickeringMask,
PuzzleStickering,
StickeringManager,
} from "./mask";
Expand Down
4 changes: 2 additions & 2 deletions src/cubing/puzzles/stickerings/fto-stickerings.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { ExperimentalStickering } from "../../twisty";
import type { PuzzleLoader } from "../PuzzleLoader";
import {
StickeringMask,
type StickeringMask,
PuzzleStickering,
StickeringManager,
PieceSet,
type PieceSet,
PieceStickering,
} from "./mask";

Expand Down
4 changes: 2 additions & 2 deletions src/cubing/search/inside/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Alg } from "../../alg";
import { KPuzzleDefinition, KState, KStateData } from "../../kpuzzle";
import { type KPuzzleDefinition, KState, type KStateData } from "../../kpuzzle";
import { puzzles } from "../../puzzles";
import { setIsInsideWorker } from "./inside-worker";
import {
Expand Down Expand Up @@ -35,7 +35,7 @@ import {
solveSkewb,
} from "./solve/puzzles/skewb";
import { getRandomSquare1Scramble } from "./solve/puzzles/sq1";
import { solveTwsearch, TwsearchOptions } from "./solve/twsearch";
import { solveTwsearch, type TwsearchOptions } from "./solve/twsearch";

const IDLE_PREFETCH_TIMEOUT_MS = 1000;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cube2x2x2 } from "../../../../../../puzzles";
import { parseSGS, SGSCachedData } from "../../../parseSGS";
import { parseSGS, type SGSCachedData } from "../../../parseSGS";

let cachedData: Promise<SGSCachedData> | null = null;
export async function cachedData222() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { KPuzzle } from "../../../../../../kpuzzle";
import { parseSGS, SGSCachedData } from "../../../parseSGS";
import { parseSGS, type SGSCachedData } from "../../../parseSGS";

async function megaminxKPuzzleWithoutMO(): Promise<KPuzzle> {
const { getPuzzleGeometryByName, ExperimentalPGNotation } = await import(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { puzzles } from "../../../../../../puzzles";
import { parseSGS, SGSCachedData } from "../../../parseSGS";
import { parseSGS, type SGSCachedData } from "../../../parseSGS";

let cachedData: Promise<SGSCachedData> | null = null;
export async function sgsDataPyraminx() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { KPuzzle } from "../../../../../../kpuzzle";
import { parseSGS, SGSCachedData } from "../../../parseSGS";
import { parseSGS, type SGSCachedData } from "../../../parseSGS";

async function skewbKPuzzleWithoutMO(): Promise<KPuzzle> {
const { getPuzzleGeometryByName, ExperimentalPGNotation } = await import(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { puzzles } from "../../../../../../puzzles";
import { parseSGS, SGSCachedData } from "../../../parseSGS";
import { parseSGS, type SGSCachedData } from "../../../parseSGS";

let cachedData: Promise<SGSCachedData> | null = null;
export async function sgsDataFTO() {
Expand Down
6 changes: 3 additions & 3 deletions src/cubing/search/inside/solve/twsearch.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Alg } from "../../../alg";
import {
KPuzzle,
KPuzzleDefinition,
KStateData,
KTransformationData,
type KPuzzleDefinition,
type KStateData,
type KTransformationData,
} from "../../../kpuzzle";
import { from } from "../../../vendor/mit/p-lazy/p-lazy";

Expand Down
2 changes: 1 addition & 1 deletion src/cubing/search/instantiator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
constructWorker,
wrap,
} from "../vendor/apache/comlink-everywhere/outside";
import { insideAPI, WorkerInsideAPI } from "./inside/api";
import { insideAPI, type WorkerInsideAPI } from "./inside/api";
import { getWorkerEntryFileURL } from "./inside/search-worker-ts-entry-path-getter";
import { searchOutsideDebugGlobals } from "./outside";

Expand Down
2 changes: 1 addition & 1 deletion src/cubing/search/outside.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { randomClockScrambleString } from "./inside/solve/puzzles/clock"; // TOD
import { randomMegaminxScrambleString } from "./inside/solve/puzzles/wca-minx"; // TODO: don't reach into `inside` code.
import type { TwsearchOptions } from "./inside/solve/twsearch";
import {
InsideOutsideAPI,
type InsideOutsideAPI,
instantiateWorker,
mapToAllWorkers,
} from "./instantiator";
Expand Down
4 changes: 2 additions & 2 deletions src/cubing/twisty/controllers/TwistyAnimationController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {
BoundaryType,
Direction,
directionScalar,
MillisecondTimestamp,
TimeRange,
type MillisecondTimestamp,
type TimeRange,
} from "./AnimationTypes";
import { RenderScheduler } from "./RenderScheduler";
import type {
Expand Down
2 changes: 1 addition & 1 deletion src/cubing/twisty/controllers/TwistyPlayerController.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { TwistyPlayerModel } from "../model/TwistyPlayerModel";
import {
TwistyAnimationController,
TwistyAnimationControllerDelegate,
type TwistyAnimationControllerDelegate,
} from "./TwistyAnimationController";

export class TwistyPlayerController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import type { KPuzzle, KTransformation } from "../../../../kpuzzle";
import type { KState } from "../../../../kpuzzle/KState";
import {
Direction,
Duration,
PuzzlePosition,
Timestamp,
type Duration,
type PuzzlePosition,
type Timestamp,
} from "../../AnimationTypes";
import type { CurrentMove, CurrentMoveInfo } from "../AlgIndexer";
import {
AnimatedLeafAlgNode,
AnimLeafWithRange,
type AnimatedLeafAlgNode,
type AnimLeafWithRange,
simulMoves,
} from "./simul-moves";

Expand Down
Loading

0 comments on commit 3992552

Please sign in to comment.