Skip to content

Commit

Permalink
[package.json] Switch to cmd-ts-too.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Nov 8, 2024
1 parent 37ad7d9 commit aa33f25
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
Binary file modified bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
"@web/test-runner": "^0.19.0",
"@web/test-runner-playwright": "^0.11.0",
"barely-a-dev-server": "latest",
"cmd-ts": "^0.13.0",
"chai": "^5.1.1",
"cmd-ts-too": "0.14.4",
"esbuild": "latest",
"getbuiltinmodule-ponyfill": "^1.0.1",
"jszip": "^3.10.1",
Expand All @@ -90,7 +90,7 @@
"esbuild",
"jszip",
"@biomejs/biome",
"cmd-ts"
"cmd-ts-too"
],
"engines": {
"node": ">=20.16.0",
Expand Down
4 changes: 2 additions & 2 deletions script/bin/screenshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
positional,
run,
type Type,
} from "cmd-ts";
} from "cmd-ts-too";
import { Alg } from "cubing/alg";

// We would use named imports, but that doesn't seem to be an option.
Expand Down Expand Up @@ -76,7 +76,7 @@ const app = command({
long: "debug",
}),
outFile: option({
// TODO: implement a file path that does *not* exist: https://cmd-ts.vercel.app/batteries_file_system.html
// TODO: implement a file path that does *not* exist: https://cmd-ts-too.vercel.app/batteries_file_system.html
type: optional(cmdString),
long: "out-file",
}),
Expand Down
8 changes: 4 additions & 4 deletions script/test/src/import-restrictions/allowedImports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ export const mainAllowedImports: AllowedImports = {
"esbuild",
"node-fetch",
"playwright",
"cmd-ts",
"cmd-ts-too",
],
dynamic: ["cubing", "node:repl"],
},
// src/bin
"src/bin": {
static: ["cubing"],
dynamic: ["cmd-ts"],
dynamic: ["cmd-ts-too"],
},
"src/bin/guards/cmd-ts-guard.ts": {
"src/bin/guards/cmd-ts-too-guard.ts": {
static: ["node:process"],
dynamic: ["cmd-ts"],
dynamic: ["cmd-ts-too"],
},
// src/lib
"src/cubing/alg": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { exit } from "node:process";

try {
await import("cmd-ts");
await import("cmd-ts-too");
} catch (e) {
// Note that this doesn't fail when installed using `bun install --global`, as `bun` automatically loads deps.
console.error(
`Could not import \`cmd-ts\`. This is not automatically installed as a regular dependency of \`cubing\`.
`Could not import \`cmd-ts-too\`. This is not automatically installed as a regular dependency of \`cubing\`.
If you are installing globally, consider using \`bun\`: https://bun.sh/
bun install --global cubing
If you are installing using \`npx\` globally, run:
npm install --global cubing cmd-ts
npm install --global cubing cmd-ts-too
If you are using \`npx\` within a repo, run:
npm install cubing cmd-ts
npm install cubing cmd-ts-too
`,
);
exit(1);
Expand Down
6 changes: 3 additions & 3 deletions src/bin/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import { KPuzzle } from "cubing/kpuzzle";
import { getPuzzleGeometryByName } from "cubing/puzzle-geometry";
import { puzzles } from "cubing/puzzles";

import type { Type } from "cmd-ts";
import "./guards/cmd-ts-guard";
import type { Type } from "cmd-ts-too";
import "./guards/cmd-ts-too-guard";

const {
binary,
string: cmdString,
command,
positional,
run,
} = await import("cmd-ts");
} = await import("cmd-ts-too");

// TODO: dedup with `screenshot` implementation.
const ReadAlg: Type<string, Alg> = {
Expand Down
6 changes: 3 additions & 3 deletions src/bin/scramble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { Alg } from "cubing/alg";
import { eventInfo } from "cubing/puzzles";
import { randomScrambleForEvent } from "cubing/scramble";
import { setSearchDebug } from "cubing/search";
import "./guards/cmd-ts-guard";
import "./guards/cmd-ts-too-guard";

const {
binary,
Expand All @@ -22,7 +22,7 @@ const {
optional,
positional,
run,
} = await import("cmd-ts");
} = await import("cmd-ts-too");

// TODO: file an issue about printing these values.
const outputFormats = ["text", "link", "json-text"] as const;
Expand Down Expand Up @@ -52,7 +52,7 @@ const app = command({
}),
text: flag({
description: "Convenient shorthand for `--format text`.",
long: "t", // TODO: https://github.com/Schniz/cmd-ts/issues/221
long: "t", // TODO: https://github.com/lgarron/cmd-ts-too/issues/6
short: "t",
}),
eventID: positional({
Expand Down

0 comments on commit aa33f25

Please sign in to comment.