Skip to content

Commit

Permalink
organize scripts and update test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
astudentinearth committed Feb 2, 2025
1 parent dfb80fa commit fbf7ccd
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 30 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- "packages/*/package.json"
- "!*.md"
- "!./**/*.md"
- ".github/workflows/test-unit.yml"
workflow_dispatch:

env:
Expand All @@ -29,26 +30,30 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Enable corepack
run: corepack enable

- name: Install dependencies
run: yarn
run: bun install

- name: Build @darkwrite/common
run: yarn build:common
run: bun run --filter "@darkwrite/common" build

- name: Build @darkwrite/ui
run: yarn build:ui
run: bun run --filter "@darkwrite/ui" build

- name: Run tests
run: yarn test:all
run: bun run test
continue-on-error: true

- name: Check types
run: yarn tscheck:all
run: bun typecheck
continue-on-error: true

- name: Lint
run: yarn lint
run: bun lint
continue-on-error: true
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
"name": "darkwrite",
"version": "0.4.0-alpha.3",
"description": "",
"private": true,
"scripts": {
"test:all": "yarn workspaces foreach -A run test",
"tscheck:all": "yarn workspaces foreach -A run tscheck",
"coverage:all": "yarn workspaces foreach -A run test:coverage",
"dev": "concurrently \" yarn workspace @darkwrite/common watch \" \" yarn workspace @darkwrite/app-desktop dev \"",
"test": "bun run --filter '*' test",
"typecheck": "yarn workspaces foreach -A run tscheck",
"coverage": "yarn workspaces foreach -A run test:coverage",
"dev": "bun run --filter '@darkwrite/common' --filter '@darkwrite/app-desktop' dev",
"build:desktop": "yarn workspace @darkwrite/app-desktop build",
"build:common": "yarn workspace @darkwrite/common build",
"build:ui": "yarn workspace @darkwrite/ui build",
"lint": "eslint -c eslint.config.mjs . --max-warnings 0",
"format": "prettier . --write"
},
Expand All @@ -34,5 +33,6 @@
},
"workspaces": [
"packages/*"
]
],
"packageManager": "yarn@4.6.0"
}
1 change: 1 addition & 0 deletions packages/app-desktop/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
13 changes: 8 additions & 5 deletions packages/app-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@
"type": "module",
"license": "AGPL-3.0-or-later",
"main": "dist-electron/main.js",
"installConfig": {
"hoistingLimits": "workspaces"
},
"scripts": {
"dev": "vite",
"build": "node ./darkwrite-builder.js",
"build": "bun ./darkwrite-builder.js",
"build:pre": "npm-run-all --serial licenses build:common build:vite",
"build:common": "yarn workspace @darkwrite/common build",
"build:vite": "vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"format": "prettier . --write",
"test": "vitest run",
"test:watch": "vitest watch",
"test:coverage": "vitest run --coverage",
"coverage": "vitest run --coverage",
"licenses": "generate-license-file --input package.json --output THIRDPARTY.txt --overwrite",
"_postinstall": "electron-builder install-app-deps",
"install_app_deps": "electron-builder install-app-deps",
Expand All @@ -33,11 +36,11 @@
"rebuild": "electron-rebuild -f -w better-sqlite3",
"tscheck:app": "tsc --noEmit --project tsconfig.app.json",
"tscheck:main": "tsc --noEmit --project tsconfig.node.json",
"tscheck": "npm-run-all --serial tscheck:app tscheck:main"
"typecheck": "npm-run-all --serial tscheck:app tscheck:main"
},
"dependencies": {
"@darkwrite/common": "workspace:^",
"@darkwrite/ui": "workspace:^",
"@darkwrite/common": "*",
"@darkwrite/ui": "*",
"@electron-toolkit/preload": "^3.0.1",
"@electron-toolkit/utils": "^3.0.0",
"@emoji-mart/data": "^1.2.1",
Expand Down
5 changes: 3 additions & 2 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "@darkwrite/common",
"version": "0.4.0-alpha.3",
"version": "0.0.0",
"types": "./dist/index.d.ts",
"main": "./dist/index.js",
"private": true,
"scripts": {
"test": "vitest run",
"test:watch": "vitest watch",
"test:coverage": "vitest run --coverage",
"coverage": "vitest run --coverage",
"build": "tsup src/index.ts --dts --format esm,cjs",
"watch": "tsup src/index.ts --dts --format esm,cjs --watch",
"format": "prettier . --write",
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@darkwrite/ui",
"private": true,
"version": "1.0.0-alpha.1",
"version": "0.0.0",
"type": "module",
"main": "./dist/ui.js",
"types": "./dist/index.d.ts",
Expand All @@ -13,7 +13,7 @@
"build:vite": "vite build",
"build:tsc": "tsc -b ./tsconfig.lib.json",
"dev": "vite build --watch",
"tscheck": "tsc --noEmit --project tsconfig.lib.json"
"typecheck": "tsc --noEmit --project tsconfig.lib.json"
},
"dependencies": {
"@radix-ui/react-slot": "^1.1.1",
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1361,8 +1361,8 @@ __metadata:
"@babel/plugin-proposal-decorators": "npm:^7.25.9"
"@babel/preset-env": "npm:^7.26.0"
"@babel/preset-typescript": "npm:^7.26.0"
"@darkwrite/common": "workspace:^"
"@darkwrite/ui": "workspace:^"
"@darkwrite/common": "npm:*"
"@darkwrite/ui": "npm:*"
"@electron-toolkit/preload": "npm:^3.0.1"
"@electron-toolkit/tsconfig": "npm:^1.0.1"
"@electron-toolkit/utils": "npm:^3.0.0"
Expand Down Expand Up @@ -1478,7 +1478,7 @@ __metadata:
languageName: unknown
linkType: soft

"@darkwrite/common@workspace:^, @darkwrite/common@workspace:packages/common":
"@darkwrite/common@npm:*, @darkwrite/common@workspace:packages/common":
version: 0.0.0-use.local
resolution: "@darkwrite/common@workspace:packages/common"
dependencies:
Expand All @@ -1494,7 +1494,7 @@ __metadata:
languageName: unknown
linkType: soft

"@darkwrite/ui@workspace:^, @darkwrite/ui@workspace:packages/ui":
"@darkwrite/ui@npm:*, @darkwrite/ui@workspace:packages/ui":
version: 0.0.0-use.local
resolution: "@darkwrite/ui@workspace:packages/ui"
dependencies:
Expand Down Expand Up @@ -19143,21 +19143,21 @@ __metadata:

"typescript@patch:typescript@npm%3A^5.5.3#optional!builtin<compat/typescript>":
version: 5.7.2
resolution: "typescript@patch:typescript@npm%3A5.7.2#optional!builtin<compat/typescript>::version=5.7.2&hash=cef18b"
resolution: "typescript@patch:typescript@npm%3A5.7.2#optional!builtin<compat/typescript>::version=5.7.2&hash=5786d5"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10c0/c891ccf04008bc1305ba34053db951f8a4584b4a1bf2f68fd972c4a354df3dc5e62c8bfed4f6ac2d12e5b3b1c49af312c83a651048f818cd5b4949d17baacd79
checksum: 10c0/f3b8082c9d1d1629a215245c9087df56cb784f9fb6f27b5d55577a20e68afe2a889c040aacff6d27e35be165ecf9dca66e694c42eb9a50b3b2c451b36b5675cb
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A^5.7.3#optional!builtin<compat/typescript>":
version: 5.7.3
resolution: "typescript@patch:typescript@npm%3A5.7.3#optional!builtin<compat/typescript>::version=5.7.3&hash=cef18b"
resolution: "typescript@patch:typescript@npm%3A5.7.3#optional!builtin<compat/typescript>::version=5.7.3&hash=5786d5"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10c0/3b56d6afa03d9f6172d0b9cdb10e6b1efc9abc1608efd7a3d2f38773d5d8cfb9bbc68dfb72f0a7de5e8db04fc847f4e4baeddcd5ad9c9feda072234f0d788896
checksum: 10c0/6fd7e0ed3bf23a81246878c613423730c40e8bdbfec4c6e4d7bf1b847cbb39076e56ad5f50aa9d7ebd89877999abaee216002d3f2818885e41c907caaa192cc4
languageName: node
linkType: hard

Expand Down

0 comments on commit fbf7ccd

Please sign in to comment.