-
-
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.
Added tooling, worked on styles, xterm
- Loading branch information
Showing
10 changed files
with
674 additions
and
31 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
* @james-pre |
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,50 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
workflow_call: | ||
pull_request: | ||
|
||
jobs: | ||
ci: | ||
name: CI | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
id-token: write | ||
pages: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deploy.outputs.page_url }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Formatting | ||
run: npm run format:check | ||
|
||
- name: Linting | ||
run: npm run lint | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./build | ||
|
||
- name: Deploy | ||
id: deploy | ||
uses: actions/deploy-pages@v4 |
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,3 +1,4 @@ | ||
node_modules | ||
tmp | ||
dist | ||
dist | ||
build |
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,48 @@ | ||
#!/usr/bin/env node | ||
import { build, context, type BuildOptions } from 'esbuild'; | ||
import { parseArgs } from 'node:util'; | ||
|
||
const { | ||
values: { mode = 'build' }, | ||
} = parseArgs({ | ||
options: { | ||
mode: { short: 'm', type: 'string', default: 'build' }, | ||
}, | ||
strict: false, | ||
allowPositionals: true, | ||
}); | ||
|
||
const outdir = 'build'; | ||
|
||
const config: BuildOptions = { | ||
entryPoints: ['src/index.ts', 'src/index.html', 'src/styles.css'], | ||
target: 'es2021', | ||
outdir, | ||
loader: { | ||
'.html': 'copy', | ||
}, | ||
sourcemap: true, | ||
keepNames: true, | ||
bundle: true, | ||
format: 'esm', | ||
platform: 'browser', | ||
}; | ||
|
||
switch (mode) { | ||
case 'watch': { | ||
const ctx = await context(config); | ||
console.log('Watching for changes...'); | ||
await ctx.watch(); | ||
break; | ||
} | ||
case 'dev': { | ||
const ctx = await context(config); | ||
await ctx.watch(); | ||
const { host, port } = await ctx.serve({ servedir: outdir }); | ||
console.log(`Development server started at http://${['127.0.0.1', '0.0.0.0'].includes(host) ? 'localhost' : host}:${port}`); | ||
break; | ||
} | ||
case 'build': | ||
default: | ||
await build(config); | ||
} |
Oops, something went wrong.