Skip to content

Commit 3637f5a

Browse files
authored
chore(ci): use biome in codesandbox ci
1 parent f57a9d8 commit 3637f5a

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

.codesandbox/ci.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"buildCommand": "build:ci",
2+
"installCommand": "install:ci",
33
"node": "18"
44
}

package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
"private": false,
55
"version": "0.4.14",
66
"type": "module",
7-
"files": [
8-
"./dist"
9-
],
7+
"files": ["./dist"],
108
"main": "./dist/index.js",
119
"module": "./dist/index.js",
1210
"exports": {
@@ -58,6 +56,7 @@
5856
"access": "public"
5957
},
6058
"scripts": {
59+
"install:ci": "npm ci && ./scripts/pre-ci.sh",
6160
"update-hooks": "simple-git-hooks",
6261
"changeset": "changeset",
6362
"bump": "changeset version 2>/dev/null | grep . && npm i; exit 0",
@@ -75,9 +74,6 @@
7574
"nocheck-chevrotain-types": "tsx ./scripts/nocheck-chevrotain-types.ts",
7675
"copy": "copy-files-from-to",
7776
"postbuild": "tsc --project ./tsconfig.production.json && conc \"npm:add-glob-import-types\" \"npm:nocheck-chevrotain-types\" \"npm:copy\"",
78-
"prebuild:ci": "npm run type-check",
79-
"build:ci": "vite build",
80-
"postbuild:ci": "npm run postbuild",
8177
"test": "vitest",
8278
"test:ui": "vitest --ui",
8379
"preview": "vite preview",

scripts/pre-ci.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
curl -L https://github.com/jqlang/jq/releases/latest/download/jq-linux-amd64 -o jq
4+
chmod a+x jq
5+
6+
BIOME_VERSION=$(npm -j ls | ./jq -r '.dependencies["@biomejs/biome"].version')
7+
npm i -DE biome-cli-codesandbox@$BIOME_VERSION
8+
9+
npm pkg set scripts.lint="BIOME_BINARY=biome-cli-codesandbox/biome $(npm pkg get scripts.lint | ./jq -r)"
10+
npm pkg set scripts['format:biome']="BIOME_BINARY=biome-cli-codesandbox/biome $(npm pkg get scripts['format:biome'] | ./jq -r)"
11+
npm pkg set scripts['check:biome']="BIOME_BINARY=biome-cli-codesandbox/biome $(npm pkg get scripts['check:biome'] | ./jq -r)"
12+
13+
rm jq

0 commit comments

Comments
 (0)