Skip to content

Commit 23c50b7

Browse files
chore: update dependencies, fix some bundler errors
Signed-off-by: Henry Gressmann <[email protected]>
1 parent f7deff8 commit 23c50b7

File tree

16 files changed

+135
-31
lines changed

16 files changed

+135
-31
lines changed

bun.lockb

16.7 KB
Binary file not shown.

configs/tsconfig.base.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"lib": [
44
"es2022"
55
],
6-
"module": "es2022",
6+
"module": "ESNext",
77
"target": "es2022",
88
"strict": true,
99
"esModuleInterop": true,
1010
"skipLibCheck": true,
1111
"forceConsistentCasingInFileNames": true,
12-
"moduleResolution": "node",
12+
"moduleResolution": "Bundler",
1313
"allowJs": true,
1414
"allowUnusedLabels": false,
1515
"allowUnreachableCode": false,

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@explodingcamera/esm",
33
"private": true,
4+
"type": "module",
45
"keywords": [],
56
"license": "MIT",
67
"workspaces": [
@@ -15,14 +16,14 @@
1516
"test": "bun test"
1617
},
1718
"devDependencies": {
18-
"@biomejs/biome": "1.4.1",
19-
"@biomejs/cli-linux-x64": "^1.4.1",
19+
"@biomejs/biome": "1.5.0",
20+
"@biomejs/cli-linux-x64": "^1.5.0",
2021
"@changesets/changelog-github": "^0.5.0",
2122
"@changesets/cli": "^2.27.1",
22-
"@types/node": "^20.10.6",
23+
"@types/node": "^20.10.8",
2324
"bun-types": "^1.0.21",
2425
"scripts": "workspace:*",
25-
"turbo": "^1.11.2"
26+
"turbo": "^1.11.3"
2627
},
2728
"dependencies": {
2829
"typescript": "^5.3.3"

packages/minify-literals/lib/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ describe("minifyHTMLLiterals()", () => {
368368
});
369369

370370
it("should use MagicString constructor", async () => {
371-
let msUsed;
371+
let msUsed: MagicStringLike | undefined;
372372
await minifyHTMLLiterals(SOURCE, {
373373
fileName: "test.js",
374374
generateSourceMap(ms) {
@@ -381,7 +381,7 @@ describe("minifyHTMLLiterals()", () => {
381381
});
382382

383383
it("should allow custom MagicStringLike constructor", async () => {
384-
let msUsed;
384+
let msUsed: MagicStringLike | undefined;
385385
await minifyHTMLLiterals(SOURCE, {
386386
fileName: "test.js",
387387
MagicString: MagicStringLike,

packages/spaify/lib/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const init = (opts: Partial<Options> = {}) => {
7070
if (abort.signal) abort.abort();
7171
abort = new AbortController();
7272

73-
let res;
73+
let res: { doc: Document; firstLoad: boolean };
7474
try {
7575
res = await getDoc(to, abort.signal);
7676
} catch (e: unknown) {

packages/touch-grass/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# touch-grass
2+
3+
Go touch some grass.
4+
5+
## Usage
6+
7+
```bash
8+
$ npx touch-grass # node
9+
$ bunx touch-grass # bun
10+
```

packages/touch-grass/bin.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env node
2+
import "./dist/index.js";
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { test, expect } from "bun:test";
2-
import { func } from "./index";
2+
// import {} from "./index.js";
33

44
test("test", async () => {
5-
expect(func()).toMatch("Hello, World!");
5+
expect(1).toBe(1);
66
});

packages/touch-grass/lib/index.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/touch-grass/lib/index.tsx

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import { Box, render, Text, useApp, useInput, useStdin } from "ink";
2+
import { useEffect, useState } from "react";
3+
import useScreenSize from "./screensize.js";
4+
5+
const formatDuration = (seconds: number): string => {
6+
const minutes = Math.floor(seconds / 60);
7+
const remainingSeconds = seconds % 60;
8+
return `${minutes}:${remainingSeconds.toString().padStart(2, "0")}`;
9+
};
10+
11+
const TouchGrass = () => {
12+
const app = useApp();
13+
const { stdin } = useStdin();
14+
const { height, width } = useScreenSize();
15+
16+
const [time, setTime] = useState(0);
17+
18+
useEffect(() => {
19+
const timer = setInterval(() => {
20+
setTime((time) => time + 1);
21+
}, 1000);
22+
return () => clearInterval(timer);
23+
}, []);
24+
25+
useEffect(() => {
26+
stdin.setRawMode(true);
27+
stdin.resume();
28+
stdin.setEncoding("utf8");
29+
}, [stdin]);
30+
31+
useInput((input, key) => {
32+
if (key.escape) {
33+
app.exit();
34+
}
35+
});
36+
37+
return (
38+
<Box width={width} height={height} flexDirection="column">
39+
<Box flexDirection="column" justifyContent="center" alignItems="center" flexGrow={1}>
40+
<Box height={1} />
41+
<Text color="#999999">You can stop sitting at your computer now.</Text>
42+
<Box height={1} />
43+
<Text>
44+
You've been here for <Text bold>{formatDuration(time)}</Text>
45+
</Text>
46+
</Box>
47+
<Box alignSelf="flex-end">
48+
<Text color="#999999">
49+
Press <Text bold>ESC</Text> to exit.
50+
</Text>
51+
</Box>
52+
</Box>
53+
);
54+
};
55+
56+
process.stdout.write("\x1b[?1049h");
57+
const app = render(<TouchGrass />);
58+
await app.waitUntilExit();
59+
process.stdout.write("\x1b[?1049l");
60+
process.stdin.setRawMode(false);
61+
process.exit();

0 commit comments

Comments
 (0)