-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
303 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,6 @@ jobs: | |
|
||
- name: Run e2e tests | ||
run: bun run test.e2e | ||
|
||
- name: Run lint | ||
run: bun run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"printWidth": 99, | ||
"semi": true, | ||
"useTabs": false, | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"bracketSpacing": true, | ||
"arrowParens": "always", | ||
"quoteProps": "preserve" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import globals from 'globals'; | ||
import pluginJs from '@eslint/js'; | ||
import pluginPrettier from 'eslint-plugin-prettier/recommended'; | ||
|
||
export default [ | ||
{ | ||
files: ['**/*.js'], | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
...globals.browser, | ||
Bun: 'readonly', | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
}, | ||
}, | ||
}, | ||
pluginJs.configs.recommended, | ||
pluginPrettier, | ||
{ | ||
ignores: ['node_modules/*', 'dist/*'], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import build from "./helpers/build.js"; | ||
import build from './helpers/build.js'; | ||
|
||
const startAt = Date.now(); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,27 @@ | ||
import fs from "node:fs"; | ||
import path from "node:path"; | ||
import fs from 'node:fs'; | ||
import path from 'node:path'; | ||
|
||
import { SOURCE_PATH, DIST_PATH } from "./paths.js"; | ||
import { SOURCE_PATH, DIST_PATH } from './paths.js'; | ||
|
||
export default async function build({ debug = false } = {}) { | ||
fs.rmSync(DIST_PATH, { recursive: true, force: true }); | ||
fs.mkdirSync(DIST_PATH); | ||
fs.copyFileSync( | ||
path.join(SOURCE_PATH, "index.html"), | ||
path.join(DIST_PATH, "index.html") | ||
); | ||
fs.copyFileSync(path.join(SOURCE_PATH, 'index.html'), path.join(DIST_PATH, 'index.html')); | ||
|
||
const result = await Bun.build({ | ||
entrypoints: [path.join(SOURCE_PATH, "index.js")], | ||
entrypoints: [path.join(SOURCE_PATH, 'index.js')], | ||
outdir: DIST_PATH, | ||
target: "browser", | ||
target: 'browser', | ||
minify: !debug, | ||
sourcemap: debug ? "inline" : "external", | ||
sourcemap: debug ? 'inline' : 'external', | ||
}); | ||
|
||
if (!result.success) { | ||
console.error("Build failed"); | ||
console.error('Build failed'); | ||
for (const message of result.logs) { | ||
// Bun will pretty print the message object | ||
console.error(message); | ||
} | ||
throw new Error(result.logs.join('\n')); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import path from "node:path"; | ||
import path from 'node:path'; | ||
|
||
export const ROOT_PATH = path.join(import.meta.dir, "..", ".."); | ||
export const DIST_PATH = path.join(ROOT_PATH, "dist"); | ||
export const SOURCE_PATH = path.join(ROOT_PATH, "src"); | ||
export const ROOT_PATH = path.join(import.meta.dir, '..', '..'); | ||
export const DIST_PATH = path.join(ROOT_PATH, 'dist'); | ||
export const SOURCE_PATH = path.join(ROOT_PATH, 'src'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.