Skip to content

Commit

Permalink
build: switch to Bun
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym committed Dec 9, 2023
1 parent dee4404 commit 148b8b7
Show file tree
Hide file tree
Showing 12 changed files with 493 additions and 3,119 deletions.
39 changes: 27 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,37 @@ on:
branches: [master]

jobs:
test:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1

- name: Build and test the library
run: |
bun install
bun run build:lib
bun run build
bun run package
bun run check & bun run test
test-e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
id: yarn-cache
env:
cache-name: cache-node-modules
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Build and test the library
- name: e2e tests
run: |
yarn
yarn playwright install --with-deps
yarn build:lib
yarn build
yarn package
yarn run check & yarn test
yarn test:e2e
npm install
npm run playwright install --with-deps
npm run test:e2e
Binary file added bun.lockb
Binary file not shown.
2 changes: 0 additions & 2 deletions demo/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@
<SideNavItems>
{#each Object.entries(routes) as [href, text]}
<SideNavLink
sveltekit:reload
sveltekit:prefetch
href="{base}{href}"
text={href === "/" ? "Getting Started" : text}
isSelected={pathname === href}
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
"package": "svelte-package",
"postpackage": "node scripts/postpackage.js",
"check": "svelte-check --workspace tests",
"test": "vitest",
"test": "bun test tests/*.ts",
"test:e2e": "playwright test",
"format": "prettier --ignore-path .gitignore --write ."
"format": "prettier --write .",
"playwright": "playwright"
},
"dependencies": {
"highlight.js": "11.9.0"
Expand All @@ -29,13 +30,12 @@
"@sveltejs/kit": "1.27.7",
"@sveltejs/package": "^1.0.2",
"@sveltejs/vite-plugin-svelte": "^3.0.1",
"@testing-library/svelte": "^4.0.5",
"@testing-library/user-event": "^14.5.1",
"@types/node": "^20.10.4",
"@types/prettier": "^3.0.0",
"bun-types": "latest",
"carbon-components-svelte": "^0.82.4",
"carbon-icons-svelte": "^12.4.0",
"carbon-preprocess-svelte": "^0.10.0",
"jsdom": "^23.0.1",
"prettier": "^3.1.0",
"prettier-plugin-svelte": "^3.1.2",
"svelte": "^4.2.8",
Expand All @@ -44,8 +44,7 @@
"svelte2tsx": "^0.6.27",
"totalist": "^3.0.1",
"typescript": "^5.3.3",
"vite": "^5.0.7",
"vitest": "^1.0.4"
"vite": "^5.0.7"
},
"repository": {
"type": "git",
Expand Down
198 changes: 198 additions & 0 deletions tests/__snapshots__/languages.test.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
// Bun Snapshot v1, https://goo.gl/fbAQLP

exports[`Languages 1`] = `
[
"_1c",
"abnf",
"accesslog",
"actionscript",
"ada",
"angelscript",
"apache",
"applescript",
"arcade",
"arduino",
"armasm",
"asciidoc",
"aspectj",
"autohotkey",
"autoit",
"avrasm",
"awk",
"axapta",
"bash",
"basic",
"bnf",
"brainfuck",
"c",
"cal",
"capnproto",
"ceylon",
"clean",
"clojure",
"clojureRepl",
"cmake",
"coffeescript",
"coq",
"cos",
"cpp",
"crmsh",
"crystal",
"csharp",
"csp",
"css",
"d",
"dart",
"delphi",
"diff",
"django",
"dns",
"dockerfile",
"dos",
"dsconfig",
"dts",
"dust",
"ebnf",
"elixir",
"elm",
"erb",
"erlang",
"erlangRepl",
"excel",
"fix",
"flix",
"fortran",
"fsharp",
"gams",
"gauss",
"gcode",
"gherkin",
"glsl",
"gml",
"go",
"golo",
"gradle",
"graphql",
"groovy",
"haml",
"handlebars",
"haskell",
"haxe",
"hsp",
"http",
"hy",
"inform7",
"ini",
"irpf90",
"isbl",
"java",
"javascript",
"jbossCli",
"json",
"julia",
"juliaRepl",
"kotlin",
"lasso",
"latex",
"ldif",
"leaf",
"less",
"lisp",
"livecodeserver",
"livescript",
"llvm",
"lsl",
"lua",
"makefile",
"markdown",
"mathematica",
"matlab",
"maxima",
"mel",
"mercury",
"mipsasm",
"mizar",
"mojolicious",
"monkey",
"moonscript",
"n1ql",
"nestedtext",
"nginx",
"nim",
"nix",
"nodeRepl",
"nsis",
"objectivec",
"ocaml",
"openscad",
"oxygene",
"parser3",
"perl",
"pf",
"pgsql",
"php",
"phpTemplate",
"plaintext",
"pony",
"powershell",
"processing",
"profile",
"prolog",
"properties",
"protobuf",
"puppet",
"purebasic",
"python",
"pythonRepl",
"q",
"qml",
"r",
"reasonml",
"rib",
"roboconf",
"routeros",
"rsl",
"ruby",
"ruleslanguage",
"rust",
"sas",
"scala",
"scheme",
"scilab",
"scss",
"shell",
"smali",
"smalltalk",
"sml",
"sqf",
"sql",
"stan",
"stata",
"step21",
"stylus",
"subunit",
"swift",
"taggerscript",
"tap",
"tcl",
"thrift",
"tp",
"twig",
"typescript",
"vala",
"vbnet",
"vbscript",
"vbscriptHtml",
"verilog",
"vhdl",
"vim",
"wasm",
"wren",
"x86asm",
"xl",
"xml",
"xquery",
"yaml",
"zephir",
]
`;
Loading

0 comments on commit 148b8b7

Please sign in to comment.