Skip to content

Commit c8154b7

Browse files
committed
chore(deps|ci): better workflow and bump dependencies
1 parent e85fb5b commit c8154b7

10 files changed

+1155
-854
lines changed

.github/workflows/ci.yaml

+38-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
uses: pnpm/action-setup@v4
3131
with:
3232
run_install: false
33-
version: '9.5.0'
3433

3534
- name: Obtain pnpm store directory
3635
shell: bash
@@ -51,6 +50,44 @@ jobs:
5150
- name: Lint
5251
run: pnpm run lint
5352

53+
typecheck:
54+
name: Type Check
55+
permissions:
56+
pull-requests: write
57+
runs-on: ubuntu-22.04
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v4
61+
62+
- name: Install Node.js 22.x
63+
uses: actions/setup-node@v3
64+
with:
65+
node-version: 22.x
66+
67+
- name: Install pnpm
68+
uses: pnpm/action-setup@v4
69+
with:
70+
run_install: false
71+
72+
- name: Obtain pnpm store directory
73+
shell: bash
74+
run: |
75+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
76+
77+
- name: Obtain pnpm store cache
78+
uses: actions/cache@v4
79+
with:
80+
path: ${{ env.STORE_PATH }}
81+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
82+
restore-keys: |
83+
${{ runner.os }}-pnpm-store-
84+
85+
- name: Install dependencies
86+
run: pnpm install --frozen-lockfile
87+
88+
- name: Type Check
89+
run: pnpm run typecheck
90+
5491
build-test:
5592
name: Build Test
5693
permissions:
@@ -69,7 +106,6 @@ jobs:
69106
uses: pnpm/action-setup@v4
70107
with:
71108
run_install: false
72-
version: '9.5.0'
73109

74110
- name: Obtain pnpm store directory
75111
shell: bash

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ node_modules
44
# Don't include the compiled main.js file in the repo.
55
# They should be uploaded to GitHub releases instead.
66
main.js
7+
manifest.json
78

89
# Exclude sourcemaps
910
*.map

build.config.ts

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { exec } from 'node:child_process'
2-
import { promisify } from 'node:util'
3-
import { env } from 'node:process'
1+
import { copyFile, rm } from 'node:fs/promises'
2+
import { join } from 'node:path'
43

5-
import { defineBuildConfig } from 'unbuild'
4+
import { cwd } from 'node:process'
65
import builtins from 'builtin-modules'
6+
import { defineBuildConfig } from 'unbuild'
77

8-
const execAsync = promisify(exec)
8+
import { generateObsidianPluginManifest } from './scripts/manifest'
9+
import { toErrorable } from './scripts/utils'
910

1011
export default defineBuildConfig({
1112
outDir: './dist',
@@ -39,7 +40,7 @@ export default defineBuildConfig({
3940
output: {
4041
dir: './dist',
4142
format: 'cjs',
42-
sourcemap: env.NODE_ENV === 'development' ? 'inline' : false,
43+
sourcemap: 'inline',
4344
entryFileNames: 'main.js',
4445
},
4546
// required for unocss, ofetch, etc.
@@ -50,8 +51,11 @@ export default defineBuildConfig({
5051
},
5152
hooks: {
5253
'build:done': async () => {
53-
await execAsync('rm -rf ./main.js')
54-
await execAsync('cp ./dist/main.js ./main.js')
54+
await toErrorable(async () => await rm(join(cwd(), 'main.js')))
55+
await toErrorable(async () => await rm(join(cwd(), 'manifest.json')))
56+
await generateObsidianPluginManifest()
57+
await copyFile(join(cwd(), 'dist', 'main.js'), join(cwd(), 'main.js'))
58+
await copyFile(join(cwd(), 'dist', 'manifest.json'), join(cwd(), 'manifest.json'))
5559
},
5660
},
5761
})

cspell.config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ words:
66
- antfu
77
- codemirror
88
- collab
9+
- Errorable
910
- importmap
1011
- lezer
1112
- nolebase

manifest.json

-10
This file was deleted.

package.json

+16-15
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "obsidian-plugin-vue",
33
"type": "module",
44
"version": "0.1.0",
5-
"packageManager": "pnpm@9.5.0",
5+
"packageManager": "pnpm@9.14.2",
66
"description": "An Obsidian plugin that enables you to use Vue.js components in your notes.",
77
"author": {
88
"name": "Nólëbase",
@@ -22,28 +22,29 @@
2222
"dist"
2323
],
2424
"scripts": {
25-
"build:dev": "NODE_ENV=development unbuild",
2625
"build": "unbuild",
27-
"lint": "eslint --cache ."
26+
"lint": "eslint --cache .",
27+
"lint:fix": "eslint --cache --fix .",
28+
"typecheck": "tsc --noEmit"
2829
},
2930
"devDependencies": {
30-
"@antfu/eslint-config": "^2.21.0",
31-
"@codemirror/view": "^6.28.4",
32-
"@types/node": "^20.14.10",
33-
"@vue/compiler-sfc": "^3.4.31",
31+
"@antfu/eslint-config": "^3.9.2",
32+
"@codemirror/view": "^6.35.0",
33+
"@types/node": "^22.9.3",
34+
"@vue/compiler-sfc": "^3.5.13",
3435
"builtin-modules": "^3.3.0",
35-
"eslint": "^8.57.0",
36-
"hast-util-to-html": "^9.0.1",
37-
"obsidian": "^1.5.7",
38-
"ofetch": "^1.3.4",
36+
"eslint": "^9.15.0",
37+
"hast-util-to-html": "^9.0.3",
38+
"obsidian": "^1.7.2",
39+
"ofetch": "^1.4.1",
3940
"rehype-raw": "^7.0.0",
40-
"rehype-stringify": "^10.0.0",
41+
"rehype-stringify": "^10.0.1",
4142
"remark-parse": "^11.0.0",
42-
"remark-rehype": "^11.1.0",
43-
"typescript": "^5.5.3",
43+
"remark-rehype": "^11.1.1",
44+
"typescript": "^5.7.2",
4445
"unbuild": "^2.0.0",
4546
"unified": "^11.0.5",
4647
"unist-util-remove": "^4.0.0",
47-
"vue": "^3.4.31"
48+
"vue": "^3.5.13"
4849
}
4950
}

0 commit comments

Comments
 (0)