Skip to content

Commit 8cad818

Browse files
committed
clean up formatting to satisfy biome. remove dist dependency changes by using esbuild instead of typescript rollup plugin.
1 parent 1501401 commit 8cad818

31 files changed

+942
-781
lines changed

js/bun.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"name": "moq",
66
"devDependencies": {
77
"concurrently": "^9.2.1",
8+
"rollup-plugin-esbuild": "^6.2.1",
89
},
910
},
1011
"hang": {
@@ -882,6 +883,8 @@
882883

883884
"rollup": ["[email protected]", "", { "dependencies": { "@types/estree": "1.0.8" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.53.3", "@rollup/rollup-android-arm64": "4.53.3", "@rollup/rollup-darwin-arm64": "4.53.3", "@rollup/rollup-darwin-x64": "4.53.3", "@rollup/rollup-freebsd-arm64": "4.53.3", "@rollup/rollup-freebsd-x64": "4.53.3", "@rollup/rollup-linux-arm-gnueabihf": "4.53.3", "@rollup/rollup-linux-arm-musleabihf": "4.53.3", "@rollup/rollup-linux-arm64-gnu": "4.53.3", "@rollup/rollup-linux-arm64-musl": "4.53.3", "@rollup/rollup-linux-loong64-gnu": "4.53.3", "@rollup/rollup-linux-ppc64-gnu": "4.53.3", "@rollup/rollup-linux-riscv64-gnu": "4.53.3", "@rollup/rollup-linux-riscv64-musl": "4.53.3", "@rollup/rollup-linux-s390x-gnu": "4.53.3", "@rollup/rollup-linux-x64-gnu": "4.53.3", "@rollup/rollup-linux-x64-musl": "4.53.3", "@rollup/rollup-openharmony-arm64": "4.53.3", "@rollup/rollup-win32-arm64-msvc": "4.53.3", "@rollup/rollup-win32-ia32-msvc": "4.53.3", "@rollup/rollup-win32-x64-gnu": "4.53.3", "@rollup/rollup-win32-x64-msvc": "4.53.3", "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-w8GmOxZfBmKknvdXU1sdM9NHcoQejwF/4mNgj2JuEEdRaHwwF12K7e9eXn1nLZ07ad+du76mkVsyeb2rKGllsA=="],
884885

886+
"rollup-plugin-esbuild": ["[email protected]", "", { "dependencies": { "debug": "^4.4.0", "es-module-lexer": "^1.6.0", "get-tsconfig": "^4.10.0", "unplugin-utils": "^0.2.4" }, "peerDependencies": { "esbuild": ">=0.18.0", "rollup": "^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0" } }, "sha512-jTNOMGoMRhs0JuueJrJqbW8tOwxumaWYq+V5i+PD+8ecSCVkuX27tGW7BXqDgoULQ55rO7IdNxPcnsWtshz3AA=="],
887+
885888
"rollup-plugin-string": ["[email protected]", "", { "dependencies": { "rollup-pluginutils": "^2.4.1" } }, "sha512-vqyzgn9QefAgeKi+Y4A7jETeIAU1zQmS6VotH6bzm/zmUQEnYkpIGRaOBPY41oiWYV4JyBoGAaBjYMYuv+6wVw=="],
886889

887890
"rollup-pluginutils": ["[email protected]", "", { "dependencies": { "estree-walker": "^0.6.1" } }, "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ=="],
@@ -996,6 +999,8 @@
996999

9971000
"unplugin-solid": ["[email protected]", "", { "dependencies": { "@babel/core": "^7.28.3", "@rollup/pluginutils": "^5.2.0", "babel-preset-solid": "^1.9.9", "merge-anything": "^6.0.6", "solid-refresh": "^0.7.5", "unplugin": "^2.3.10", "vitefu": "^1.1.1" }, "peerDependencies": { "solid-js": "^1.9.9" } }, "sha512-pv1CS3XMtf3WwX8Dq9Bvo4qH6mfjN2xOgbaPcnqW1dLhyP/JQCvueGEsN0dYIZ4JvxaD/G/Ot1JnBzNQGHkfeA=="],
9981001

1002+
"unplugin-utils": ["[email protected]", "", { "dependencies": { "pathe": "^2.0.3", "picomatch": "^4.0.3" } }, "sha512-gwXJnPRewT4rT7sBi/IvxKTjsms7jX7QIDLOClApuZwR49SXbrB1z2NLUZ+vDHyqCj/n58OzRRqaW+B8OZi8vg=="],
1003+
9991004
"update-browserslist-db": ["[email protected]", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A=="],
10001005

10011006
"util-deprecate": ["[email protected]", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],

js/bun.lockb

1.08 KB
Binary file not shown.

js/deno.lock

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/hang-ui/biome.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.0.5/schema.json",
3-
"formatter": {
4-
"enabled": true
5-
},
6-
"javascript": {
7-
"formatter": {
8-
"lineWidth": 80,
9-
"indentStyle": "space",
10-
"indentWidth": 4,
11-
"lineEnding": "lf",
12-
"quoteStyle": "single",
13-
"quoteProperties": "asNeeded",
14-
"trailingCommas": "es5",
15-
"bracketSpacing": true,
16-
"arrowParentheses": "always",
17-
"semicolons": "always"
18-
}
19-
}
2+
"$schema": "https://biomejs.dev/schemas/2.0.5/schema.json",
3+
"formatter": {
4+
"enabled": true
5+
},
6+
"javascript": {
7+
"formatter": {
8+
"lineWidth": 80,
9+
"indentStyle": "space",
10+
"indentWidth": 4,
11+
"lineEnding": "lf",
12+
"quoteStyle": "single",
13+
"quoteProperties": "asNeeded",
14+
"trailingCommas": "es5",
15+
"bracketSpacing": true,
16+
"arrowParentheses": "always",
17+
"semicolons": "always"
18+
}
19+
}
2020
}

js/hang-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
},
1414
"scripts": {
1515
"build": "npm run clean && rollup -c",
16+
"check": "biome check --write src",
1617
"clean": "rimraf dist"
1718
},
1819
"devDependencies": {
1920
"@rollup/plugin-node-resolve": "^16.0.3",
20-
"@rollup/plugin-typescript": "^12.3.0",
2121
"rollup": "^4.53.3",
2222
"rollup-plugin-string": "^3.0.0",
2323
"solid-element": "^1.9.1",

js/hang-ui/rollup.config.mjs

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,43 @@
1-
import solid from "unplugin-solid/rollup";
2-
import nodeResolve from "@rollup/plugin-node-resolve";
3-
import typescript from "@rollup/plugin-typescript";
4-
import { string } from "rollup-plugin-string";
1+
import nodeResolve from '@rollup/plugin-node-resolve';
2+
import esbuild from 'rollup-plugin-esbuild';
3+
import { string } from 'rollup-plugin-string';
4+
import solid from 'unplugin-solid/rollup';
55

66
export default [
7-
{
8-
input: "src/Components/publish/element.tsx",
9-
output: {
10-
file: "dist/publish-controls.esm.js",
11-
format: "es",
12-
sourcemap: true,
13-
},
14-
plugins: [
15-
string({ include: "**/*.css" }),
16-
solid({ dev: false, hydratable: false }),
17-
nodeResolve({ extensions: [".js", ".ts", ".tsx"] }),
18-
typescript(),
19-
],
20-
},
21-
{
22-
input: "src/Components/watch/element.tsx",
23-
output: {
24-
file: "dist/watch-controls.esm.js",
25-
format: "es",
26-
sourcemap: true,
27-
},
28-
plugins: [
29-
string({ include: "**/*.css" }),
30-
solid({ dev: false, hydratable: false }),
31-
nodeResolve({ extensions: [".js", ".ts", ".tsx"] }),
32-
typescript(),
33-
],
34-
},
7+
{
8+
input: 'src/Components/publish/element.tsx',
9+
output: {
10+
file: 'dist/publish-controls.esm.js',
11+
format: 'es',
12+
sourcemap: true,
13+
},
14+
plugins: [
15+
string({ include: '**/*.css' }),
16+
solid({ dev: false, hydratable: false }),
17+
esbuild({
18+
include: /\.[jt]sx?$/, // .js, .ts, .jsx, .tsx
19+
jsx: 'preserve', // let unplugin-solid handle JSX
20+
tsconfig: 'tsconfig.json', // optional; mainly for paths/aliases
21+
}),
22+
nodeResolve({ extensions: ['.js', '.ts', '.tsx'] }),
23+
],
24+
},
25+
{
26+
input: 'src/Components/watch/element.tsx',
27+
output: {
28+
file: 'dist/watch-controls.esm.js',
29+
format: 'es',
30+
sourcemap: true,
31+
},
32+
plugins: [
33+
string({ include: '**/*.css' }),
34+
solid({ dev: false, hydratable: false }),
35+
esbuild({
36+
include: /\.[jt]sx?$/, // .js, .ts, .jsx, .tsx
37+
jsx: 'preserve', // let unplugin-solid handle JSX
38+
tsconfig: 'tsconfig.json', // optional; mainly for paths/aliases
39+
}),
40+
nodeResolve({ extensions: ['.js', '.ts', '.tsx'] }),
41+
],
42+
},
3543
];
Lines changed: 43 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,50 @@
1-
import MediaSourceSourceSelector from "./MediaSourceSelector";
2-
import { Show, useContext } from "solid-js";
3-
import { PublishControlsContext } from "./PublishControlsContextProvider";
1+
import { Show, useContext } from 'solid-js';
2+
import MediaSourceSourceSelector from './MediaSourceSelector';
3+
import { PublishControlsContext } from './PublishControlsContextProvider';
44

55
export default function CameraSourceButton() {
6-
const context = useContext(PublishControlsContext);
7-
const onClick = () => {
8-
const hangPublishEl = context?.hangPublish();
9-
if (!hangPublishEl) return;
6+
const context = useContext(PublishControlsContext);
7+
const onClick = () => {
8+
const hangPublishEl = context?.hangPublish();
9+
if (!hangPublishEl) return;
1010

11-
if (hangPublishEl.source === "camera") {
12-
// Camera already selected, toggle video.
13-
hangPublishEl.video = !hangPublishEl.video;
14-
} else {
15-
hangPublishEl.source = "camera";
16-
hangPublishEl.video = true;
17-
}
18-
};
11+
if (hangPublishEl.source === 'camera') {
12+
// Camera already selected, toggle video.
13+
hangPublishEl.video = !hangPublishEl.video;
14+
} else {
15+
hangPublishEl.source = 'camera';
16+
hangPublishEl.video = true;
17+
}
18+
};
1919

20-
const onSourceSelected = (sourceId: MediaDeviceInfo["deviceId"]) => {
21-
const hangPublishEl = context?.hangPublish();
22-
if (!hangPublishEl) return;
20+
const onSourceSelected = (sourceId: MediaDeviceInfo['deviceId']) => {
21+
const hangPublishEl = context?.hangPublish();
22+
if (!hangPublishEl) return;
2323

24-
hangPublishEl.videoDevice = sourceId;
25-
};
24+
hangPublishEl.videoDevice = sourceId;
25+
};
2626

27-
return (
28-
<div class="publishSourceButtonContainer">
29-
<button
30-
type="button"
31-
title="Camera"
32-
class={`publishSourceButton ${context?.cameraActive?.() ? "active" : ""}`}
33-
onClick={onClick}
34-
>
35-
📷
36-
</button>
37-
<Show when={context?.cameraActive?.() && context?.cameraDevices().length}>
38-
<MediaSourceSourceSelector
39-
sources={context?.cameraDevices()}
40-
selectedSource={context?.selectedCameraSource?.()}
41-
onSelected={onSourceSelected}
42-
/>
43-
</Show>
44-
</div>
45-
);
27+
return (
28+
<div class="publishSourceButtonContainer">
29+
<button
30+
type="button"
31+
title="Camera"
32+
class={`publishButton publishSourceButton ${context?.cameraActive?.() ? 'active' : ''}`}
33+
onClick={onClick}
34+
>
35+
📷
36+
</button>
37+
<Show
38+
when={
39+
context?.cameraActive?.() && context?.cameraDevices().length
40+
}
41+
>
42+
<MediaSourceSourceSelector
43+
sources={context?.cameraDevices()}
44+
selectedSource={context?.selectedCameraSource?.()}
45+
onSelected={onSourceSelected}
46+
/>
47+
</Show>
48+
</div>
49+
);
4650
}
Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
1-
import { createSignal, useContext } from "solid-js";
2-
import { PublishControlsContext } from "./PublishControlsContextProvider";
1+
import { createSignal, useContext } from 'solid-js';
2+
import { PublishControlsContext } from './PublishControlsContextProvider';
33

44
export default function FileSourceButton() {
5-
const [fileInputRef, setFileInputRef] = createSignal<HTMLInputElement | undefined>();
6-
const context = useContext(PublishControlsContext);
7-
const onClick = () => fileInputRef()?.click();
8-
const onChange = (event: Event) => {
9-
const castedInputEl = event.target as HTMLInputElement;
10-
const file = castedInputEl.files?.[0];
5+
const [fileInputRef, setFileInputRef] = createSignal<
6+
HTMLInputElement | undefined
7+
>();
8+
const context = useContext(PublishControlsContext);
9+
const onClick = () => fileInputRef()?.click();
10+
const onChange = (event: Event) => {
11+
const castedInputEl = event.target as HTMLInputElement;
12+
const file = castedInputEl.files?.[0];
1113

12-
if (file) {
13-
context?.setFile(file);
14-
castedInputEl.value = "";
15-
}
16-
};
14+
if (file) {
15+
context?.setFile(file);
16+
castedInputEl.value = '';
17+
}
18+
};
1719

18-
return (
19-
<>
20-
<input
21-
ref={setFileInputRef}
22-
onClick={onClick}
23-
onChange={onChange}
24-
type="file"
25-
class="hidden"
26-
accept="video/*,audio/*,image/*"
27-
></input>
28-
<button
29-
type="button"
30-
title="Upload File"
31-
onClick={onClick}
32-
class={`publishSourceButton ${context?.fileActive?.() ? "active" : ""}`}
33-
>
34-
📁
35-
</button>
36-
</>
37-
);
20+
return (
21+
<>
22+
<input
23+
ref={setFileInputRef}
24+
onClick={onClick}
25+
onChange={onChange}
26+
type="file"
27+
class="hidden"
28+
accept="video/*,audio/*,image/*"
29+
></input>
30+
<button
31+
type="button"
32+
title="Upload File"
33+
onClick={onClick}
34+
class={`publishButton publishSourceButton ${context?.fileActive?.() ? 'active' : ''}`}
35+
>
36+
📁
37+
</button>
38+
</>
39+
);
3840
}

js/hang-ui/src/Components/publish/MediaSourceSelector.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ export default function MediaSourceSelector(props: MediaSourceSelectorProps) {
1919

2020
return (
2121
<>
22-
<span
22+
<button
23+
type="button"
2324
onClick={toggleSourcesVisible}
24-
class="mediaSourceVisibilityToggle"
25+
class="publishButton mediaSourceVisibilityToggle"
2526
title="Show Sources"
2627
>
2728
{sourcesVisible() ? '▼' : '▲'}
28-
</span>
29+
</button>
2930
<Show when={sourcesVisible()}>
3031
<select
3132
value={props.selectedSource}

0 commit comments

Comments
 (0)