Skip to content

Commit

Permalink
restore semicolons
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjohnsonpint committed Jan 7, 2025
1 parent 9bc3db3 commit b7f37b4
Show file tree
Hide file tree
Showing 18 changed files with 437 additions and 437 deletions.
2 changes: 1 addition & 1 deletion .trunk/configs/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": ["assemblyscript-prettier"],
"semi": false,
"semi": true,
"proseWrap": "always",
"printWidth": 100
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ You write a function.

```ts
export function sayHello(name: string): string {
return `Hello, ${name}!`
return `Hello, ${name}!`;
}
```

Expand Down
6 changes: 3 additions & 3 deletions runtime/explorer/content/ModusIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react"
import React from "react";

const ModusLogo = ({ className }: { className?: string }) => (
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 150" className={className}>
Expand Down Expand Up @@ -29,6 +29,6 @@ const ModusLogo = ({ className }: { className?: string }) => (
/>
<polygon className="cls-2" points="80.95 73.84 84.25 80.74 90.95 76.64 80.95 73.84" />
</svg>
)
);

export default ModusLogo
export default ModusLogo;
46 changes: 23 additions & 23 deletions runtime/explorer/content/main.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React, { useEffect, useState } from "react"
import { createRoot } from "react-dom/client"
import { ApiExplorer } from "@hypermode/react-api-explorer"
import ModusIcon from "./ModusIcon"
import "@hypermode/react-api-explorer/styles.css"
import "./index.css"
import React, { useEffect, useState } from "react";
import { createRoot } from "react-dom/client";
import { ApiExplorer } from "@hypermode/react-api-explorer";
import ModusIcon from "./ModusIcon";
import "@hypermode/react-api-explorer/styles.css";
import "./index.css";

const rootElement = document.getElementById("root")
const rootElement = document.getElementById("root");
if (!rootElement) {
throw new Error("Root element not found")
throw new Error("Root element not found");
}
const root = createRoot(rootElement)
const root = createRoot(rootElement);

function App() {
const modusTheme = {
Expand All @@ -32,29 +32,29 @@ function App() {
border: "150 35% 17%",
input: "150 35% 17%",
ring: "150 60% 39%",
}
const [endpoints, setEndpoints] = useState<string[]>(["http://localhost:8686/graphql"])
};
const [endpoints, setEndpoints] = useState<string[]>(["http://localhost:8686/graphql"]);

useEffect(() => {
// Fetch endpoints when component mounts
const fetchEndpoints = async () => {
try {
const response = await fetch("/explorer/api/endpoints")
const data = await response.json()
const response = await fetch("/explorer/api/endpoints");
const data = await response.json();

const origin = window.location.origin
const origin = window.location.origin;
const ep = data.map((endpoint: { path: string }) => {
return endpoint.path.startsWith("/") ? `${origin}${endpoint.path}` : endpoint.path
})
return endpoint.path.startsWith("/") ? `${origin}${endpoint.path}` : endpoint.path;
});

setEndpoints(ep)
setEndpoints(ep);
} catch (error) {
console.error("Failed to fetch endpoints:", error)
console.error("Failed to fetch endpoints:", error);
}
}
};

fetchEndpoints()
}, [])
fetchEndpoints();
}, []);

return (
<div className="bg-black p-2 h-dvh flex flex-col">
Expand All @@ -69,7 +69,7 @@ function App() {
}
/>
</div>
)
);
}

root.render(<App />)
root.render(<App />);
2 changes: 1 addition & 1 deletion runtime/explorer/content/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export default {
tailwindcss: {},
autoprefixer: {},
},
}
};
2 changes: 1 addition & 1 deletion runtime/explorer/content/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export default {
extend: {},
},
plugins: [],
}
};
8 changes: 4 additions & 4 deletions runtime/explorer/content/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from "vite"
import react from "@vitejs/plugin-react"
import { resolve } from "path"
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { resolve } from "path";

export default defineConfig({
plugins: [react()],
Expand All @@ -26,4 +26,4 @@ export default defineConfig({
chunkSizeWarningLimit: 1000,
},
base: "/explorer/",
})
});
26 changes: 13 additions & 13 deletions runtime/languages/assemblyscript/testdata/assembly/arraybuffers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
*/

export function testArrayBufferInput(buffer: ArrayBuffer): void {
const view = Uint8Array.wrap(buffer)
assert(view.length == 4)
assert(view[0] == 1)
assert(view[1] == 2)
assert(view[2] == 3)
assert(view[3] == 4)
const view = Uint8Array.wrap(buffer);
assert(view.length == 4);
assert(view[0] == 1);
assert(view[1] == 2);
assert(view[2] == 3);
assert(view[3] == 4);
}

export function testArrayBufferOutput(): ArrayBuffer {
const buffer = new ArrayBuffer(4)
const view = Uint8Array.wrap(buffer)
view[0] = 1
view[1] = 2
view[2] = 3
view[3] = 4
return buffer
const buffer = new ArrayBuffer(4);
const view = Uint8Array.wrap(buffer);
view[0] = 1;
view[1] = 2;
view[2] = 3;
view[3] = 4;
return buffer;
}
84 changes: 42 additions & 42 deletions runtime/languages/assemblyscript/testdata/assembly/arrays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,95 +8,95 @@
*/

export function testArrayOutput_i8(): i8[] {
return [1, 2, 3]
return [1, 2, 3];
}

export function testArrayInput_i8(arr: i8[]): void {
assert(arr.length == 3)
assert(arr[0] == 1)
assert(arr[1] == 2)
assert(arr[2] == 3)
assert(arr.length == 3);
assert(arr[0] == 1);
assert(arr[1] == 2);
assert(arr[2] == 3);
}

export function testArrayOutput_i8_empty(): i8[] {
return []
return [];
}

export function testArrayInput_i8_empty(arr: i8[]): void {
assert(arr.length == 0)
assert(arr.length == 0);
}

export function testArrayOutput_i8_null(): i8[] | null {
return null
return null;
}

export function testArrayInput_i8_null(arr: i8[] | null): void {
assert(arr == null)
assert(arr == null);
}

export function testArrayInput_i32(arr: i32[]): void {
assert(arr.length == 3)
assert(arr[0] == 1)
assert(arr[1] == 2)
assert(arr[2] == 3)
assert(arr.length == 3);
assert(arr[0] == 1);
assert(arr[1] == 2);
assert(arr[2] == 3);
}

export function testArrayOutput_i32(): i32[] {
return [1, 2, 3]
return [1, 2, 3];
}

export function testArrayInput_f32(arr: f32[]): void {
assert(arr.length == 3)
assert(arr[0] == 1)
assert(arr[1] == 2)
assert(arr[2] == 3)
assert(arr.length == 3);
assert(arr[0] == 1);
assert(arr[1] == 2);
assert(arr[2] == 3);
}

export function testArrayOutput_f32(): f32[] {
return [1, 2, 3]
return [1, 2, 3];
}

export function testArrayInput_string(arr: string[]): void {
assert(arr.length == 3)
assert(arr[0] == "abc")
assert(arr[1] == "def")
assert(arr[2] == "ghi")
assert(arr.length == 3);
assert(arr[0] == "abc");
assert(arr[1] == "def");
assert(arr[2] == "ghi");
}

export function testArrayOutput_string(): string[] {
return ["abc", "def", "ghi"]
return ["abc", "def", "ghi"];
}

export function testArrayInput_string_2d(arr: string[][]): void {
assert(arr.length == 3)
assert(arr[0].length == 3)
assert(arr[0][0] == "abc")
assert(arr[0][1] == "def")
assert(arr[0][2] == "ghi")
assert(arr[1].length == 3)
assert(arr[1][0] == "jkl")
assert(arr[1][1] == "mno")
assert(arr[1][2] == "pqr")
assert(arr[2].length == 3)
assert(arr[2][0] == "stu")
assert(arr[2][1] == "vwx")
assert(arr[2][2] == "yz")
assert(arr.length == 3);
assert(arr[0].length == 3);
assert(arr[0][0] == "abc");
assert(arr[0][1] == "def");
assert(arr[0][2] == "ghi");
assert(arr[1].length == 3);
assert(arr[1][0] == "jkl");
assert(arr[1][1] == "mno");
assert(arr[1][2] == "pqr");
assert(arr[2].length == 3);
assert(arr[2][0] == "stu");
assert(arr[2][1] == "vwx");
assert(arr[2][2] == "yz");
}

export function testArrayOutput_string_2d(): string[][] {
return [
["abc", "def", "ghi"],
["jkl", "mno", "pqr"],
["stu", "vwx", "yz"],
]
];
}

export function testArrayInput_string_2d_empty(arr: string[][]): void {
assert(arr.length == 0)
assert(arr.length == 0);
}

export function testArrayOutput_string_2d_empty(): string[][] {
return []
return [];
}

class TestObject1 {
Expand All @@ -108,7 +108,7 @@ class TestObject1 {

export function testArrayIteration(arr: TestObject1[]): void {
for (let i = 0; i < arr.length; i++) {
let obj = arr[i]
console.log(`[${i}]: a=${obj.a}, b=${obj.b}`)
let obj = arr[i];
console.log(`[${i}]: a=${obj.a}, b=${obj.b}`);
}
}
Loading

0 comments on commit b7f37b4

Please sign in to comment.