Skip to content

Commit f694c0c

Browse files
authored
chore: sync Modern.TiddlyDev standard and bump tiddlywiki-plugin-dev to ^0.5.7 (#13)
1 parent a1c0774 commit f694c0c

14 files changed

Lines changed: 1197 additions & 844 deletions

.github/workflows/gh-pages.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,29 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout repository
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v6
2222

2323
- name: Install Node.js
24-
uses: actions/setup-node@v4
24+
uses: actions/setup-node@v6
2525
with:
2626
node-version: lts/*
2727

2828
- name: Setup pnpm
29-
uses: pnpm/action-setup@v4
29+
uses: pnpm/action-setup@v6
3030
with:
3131
version: 'latest'
3232
run_install: false
3333

3434
- name: Cache dependencies
35-
uses: actions/cache@v4
35+
uses: actions/cache@v5
3636
with:
3737
path: |
3838
**/node_modules
3939
~/.pnpm-store
4040
~/.npm
41-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
41+
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
4242
restore-keys: |
43-
${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
43+
${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
4444
${{ runner.os }}-node-
4545
4646
- name: Install Dependencies

.github/workflows/playwright.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Playwright E2E
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: playwright-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
e2e:
16+
if: ${{ hashFiles('wiki/tiddlers/tests/playwright/**/*.ts') != '' }}
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 20
19+
env:
20+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v6
25+
26+
- name: Install Node.js
27+
uses: actions/setup-node@v6
28+
with:
29+
node-version: lts/*
30+
31+
- name: Setup pnpm
32+
uses: pnpm/action-setup@v6
33+
with:
34+
version: latest
35+
run_install: false
36+
37+
- name: Get pnpm store directory
38+
id: pnpm-cache
39+
shell: bash
40+
run: |
41+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
42+
43+
- name: Cache dependencies
44+
uses: actions/cache@v5
45+
with:
46+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
47+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
48+
restore-keys: |
49+
${{ runner.os }}-pnpm-
50+
51+
- name: Install dependencies
52+
run: pnpm install
53+
54+
- name: Install Playwright browser
55+
run: pnpm exec playwright install --with-deps chromium
56+
57+
- name: Run Playwright tests
58+
run: pnpm test:playwright
59+
60+
- name: Upload Playwright report
61+
if: always()
62+
uses: actions/upload-artifact@v7
63+
with:
64+
name: playwright-report
65+
path: playwright-report/
66+
retention-days: 7

.github/workflows/pr-validate.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: PR Validation - Test and Build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- main
8+
paths-ignore:
9+
- '*.md'
10+
- '.vscode/**'
11+
- '.idea/**'
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: pr-validation-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
validate:
20+
runs-on: ubuntu-latest
21+
env:
22+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v6
26+
27+
- name: Install Node.js
28+
uses: actions/setup-node@v6
29+
with:
30+
node-version: lts/*
31+
32+
- name: Setup pnpm
33+
uses: pnpm/action-setup@v6
34+
with:
35+
version: 'latest'
36+
run_install: false
37+
38+
- name: Get pnpm store directory
39+
id: pnpm-cache
40+
shell: bash
41+
run: |
42+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
43+
44+
- name: Cache dependencies
45+
uses: actions/cache@v5
46+
with:
47+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
48+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
49+
restore-keys: |
50+
${{ runner.os }}-pnpm-
51+
52+
- name: Install Dependencies
53+
run: pnpm install
54+
55+
- name: Install Playwright Browser
56+
if: ${{ hashFiles('wiki/tiddlers/tests/playwright/**/*.ts') != '' }}
57+
run: pnpm exec playwright install --with-deps chromium
58+
59+
- name: Lint Code
60+
run: pnpm exec eslint ./src --max-warnings 0
61+
continue-on-error: true
62+
63+
- name: Run Tests
64+
run: pnpm run test
65+
66+
- name: Run Playwright E2E Tests
67+
if: ${{ hashFiles('wiki/tiddlers/tests/playwright/**/*.ts') != '' }}
68+
run: pnpm run test:playwright
69+
70+
- name: Build Plugins
71+
run: pnpm run build
72+
73+
- name: Build Static Website
74+
run: pnpm run publish
75+
76+
- name: Upload Build Artifacts
77+
if: always()
78+
uses: actions/upload-artifact@v7
79+
with:
80+
name: build-artifacts
81+
path: dist/
82+
retention-days: 5
83+
84+
- name: Comment PR with Results
85+
if: failure() && github.event_name == 'pull_request'
86+
uses: actions/github-script@v9
87+
with:
88+
script: |
89+
github.rest.issues.createComment({
90+
issue_number: context.issue.number,
91+
owner: context.repo.owner,
92+
repo: context.repo.repo,
93+
body: '❌ PR validation failed. Please check the workflow logs for details.'
94+
})
95+
96+
- name: Comment PR with Success
97+
if: success() && github.event_name == 'pull_request'
98+
uses: actions/github-script@v9
99+
with:
100+
script: |
101+
github.rest.issues.createComment({
102+
issue_number: context.issue.number,
103+
owner: context.repo.owner,
104+
repo: context.repo.repo,
105+
body: '✅ PR validation passed successfully!'
106+
})

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,29 @@ jobs:
3636
runs-on: ubuntu-latest
3737
steps:
3838
- name: Checkout repository
39-
uses: actions/checkout@v4
39+
uses: actions/checkout@v6
4040

4141
- name: Install Node.js
42-
uses: actions/setup-node@v4
42+
uses: actions/setup-node@v6
4343
with:
4444
node-version: lts/*
4545

4646
- name: Setup pnpm
47-
uses: pnpm/action-setup@v4
47+
uses: pnpm/action-setup@v6
4848
with:
4949
version: 'latest'
5050
run_install: false
5151

5252
- name: Cache dependencies
53-
uses: actions/cache@v4
53+
uses: actions/cache@v5
5454
with:
5555
path: |
5656
**/node_modules
5757
~/.pnpm-store
5858
~/.npm
59-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
59+
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
6060
restore-keys: |
61-
${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
61+
${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
6262
${{ runner.os }}-node-
6363
6464
- name: Install Dependencies
@@ -71,7 +71,7 @@ jobs:
7171
run: pnpm run build
7272

7373
- name: Create Release
74-
uses: softprops/action-gh-release@v1
74+
uses: softprops/action-gh-release@v2
7575
if: startsWith(github.ref, 'refs/tags/')
7676
with:
7777
files: |

.gitignore

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,20 @@ public-dist
130130
# for TiddlyWiki
131131
dist/
132132
output/
133-
wiki/tiddlers/$__language.tid
134-
wiki/tiddlers/$__StoryList.tid
135-
wiki/tiddlers/$__StoryList_*.tid
136-
wiki/tiddlers/$__keepstate_*
137-
wiki/tiddlers/$__Import.tid
138-
wiki/tiddlers/$__UpgradeLibrary
139-
wiki/tiddlers/$__UpgradeLibrary_List
140-
wiki/tiddlers/$__temp_*
141-
wiki/tiddlers/$__view.tid
142-
wiki/tiddlers/$__config_Navigation_openLinkFromInsideRiver.tid
143-
wiki/tiddlers/$__config_Navigation_openLinkFromOutsideRiver.tid
133+
wiki/**/$__language.tid
134+
wiki/**/$__StoryList.tid
135+
wiki/**/$__StoryList_*.tid
136+
wiki/**/$__palette.tid
137+
wiki/**/$__layout.tid
138+
wiki/**/$__keepstate_*
139+
wiki/**/$__Import.tid
140+
wiki/**/$__UpgradeLibrary
141+
wiki/**/$__UpgradeLibrary_List
142+
wiki/**/$__temp_*
143+
wiki/**/$__view.tid
144+
wiki/**/$__config_Navigation_openLinkFromInsideRiver.tid
145+
wiki/**/$__config_Navigation_openLinkFromOutsideRiver.tid
146+
147+
# Playwright outputs
148+
playwright-report/
149+
test-results/

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
dist/

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"arrowParens": "avoid"
5+
}

dprint.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
],
1616
"excludes": ["**/node_modules", "**/*-lock.json"],
1717
"plugins": [
18-
"https://plugins.dprint.dev/typescript-0.95.0.wasm",
19-
"https://plugins.dprint.dev/json-0.20.0.wasm",
20-
"https://plugins.dprint.dev/markdown-0.18.0.wasm"
18+
"https://plugins.dprint.dev/typescript-0.95.12.wasm",
19+
"https://plugins.dprint.dev/json-0.21.0.wasm",
20+
"https://plugins.dprint.dev/markdown-0.20.0.wasm"
2121
]
2222
}

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default [
1111
languageOptions: {
1212
parserOptions: {
1313
projectService: {
14-
allowDefaultProject: ['./*.js', './*.mjs'],
14+
allowDefaultProject: ['./*.js', './*.mjs', './wiki/tiddlers/tests/playwright/*.ts'],
1515
},
1616
tsconfigRootDir: __dirname,
1717
},

package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@
1414
"publish": "npm run clean && tiddlywiki-plugin-dev publish",
1515
"reset": "rimraf ./**/node_modules",
1616
"clean": "rimraf dist",
17-
"prepare": "husky install",
17+
"prepare": "husky",
1818
"update": "npm-check-updates -u && dprint config update",
1919
"new": "tiddlywiki-plugin-dev new",
2020
"build:library": "npm run clean && tiddlywiki-plugin-dev build --library --output dist/library",
21-
"publish:offline": "npm run clean && tiddlywiki-plugin-dev publish --offline"
21+
"publish:offline": "npm run clean && tiddlywiki-plugin-dev publish --offline",
22+
"test:playwright": "playwright test",
23+
"test:playwright:headed": "playwright test --headed",
24+
"test:playwright:debug": "playwright test --debug"
2225
},
2326
"engines": {
2427
"node": ">=20"
@@ -48,16 +51,12 @@
4851
"rimraf": "^6.1.3",
4952
"ts-node": "^10.9.2",
5053
"tw5-typed": "^1.1.5",
51-
"typescript": "^6.0.2"
54+
"typescript": "^6.0.2",
55+
"@playwright/test": "^1.59.1"
5256
},
5357
"dependencies": {
5458
"npm-check-updates": "^20.0.1",
5559
"tiddlywiki": "^5.3.8",
56-
"tiddlywiki-plugin-dev": "^0.4.4"
57-
},
58-
"pnpm": {
59-
"overrides": {
60-
"esbuild-plugin-browserslist": "1.0.2"
61-
}
60+
"tiddlywiki-plugin-dev": "^0.5.7"
6261
}
6362
}

0 commit comments

Comments
 (0)