Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Install Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: lts/*

- name: Setup pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v6
with:
version: 'latest'
run_install: false

- name: Cache dependencies
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: |
**/node_modules
~/.pnpm-store
~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
${{ runner.os }}-node-

- name: Install Dependencies
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Playwright E2E

on:
push:
branches:
- master
- main
workflow_dispatch:

concurrency:
group: playwright-${{ github.ref }}
cancel-in-progress: true

jobs:
e2e:
if: ${{ hashFiles('wiki/tiddlers/tests/playwright/**/*.ts') != '' }}
runs-on: ubuntu-latest
timeout-minutes: 20
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: lts/*

- name: Setup pnpm
uses: pnpm/action-setup@v6
with:
version: latest
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v5
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-

- name: Install dependencies
run: pnpm install

- name: Install Playwright browser
run: pnpm exec playwright install --with-deps chromium

- name: Run Playwright tests
run: pnpm test:playwright

- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v7
with:
name: playwright-report
path: playwright-report/
retention-days: 7
106 changes: 106 additions & 0 deletions .github/workflows/pr-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: PR Validation - Test and Build

on:
pull_request:
branches:
- master
- main
paths-ignore:
- '*.md'
- '.vscode/**'
- '.idea/**'
workflow_dispatch:

concurrency:
group: pr-validation-${{ github.ref }}
cancel-in-progress: true

jobs:
validate:
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: lts/*

- name: Setup pnpm
uses: pnpm/action-setup@v6
with:
version: 'latest'
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v5
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-

- name: Install Dependencies
run: pnpm install

- name: Install Playwright Browser
if: ${{ hashFiles('wiki/tiddlers/tests/playwright/**/*.ts') != '' }}
run: pnpm exec playwright install --with-deps chromium

- name: Lint Code
run: pnpm exec eslint ./src --max-warnings 0
continue-on-error: true
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint Code is marked continue-on-error: true, so the workflow can report success even when linting fails. If this workflow is meant to validate PRs, consider removing continue-on-error (or gating it behind an input) so lint failures correctly fail the check.

Suggested change
continue-on-error: true

Copilot uses AI. Check for mistakes.

- name: Run Tests
run: pnpm run test

- name: Run Playwright E2E Tests
if: ${{ hashFiles('wiki/tiddlers/tests/playwright/**/*.ts') != '' }}
run: pnpm run test:playwright

- name: Build Plugins
run: pnpm run build

- name: Build Static Website
run: pnpm run publish

- name: Upload Build Artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: build-artifacts
path: dist/
retention-days: 5

- name: Comment PR with Results
if: failure() && github.event_name == 'pull_request'
uses: actions/github-script@v9
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ PR validation failed. Please check the workflow logs for details.'
})

- name: Comment PR with Success
if: success() && github.event_name == 'pull_request'
uses: actions/github-script@v9
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '✅ PR validation passed successfully!'
})
Comment on lines +84 to +106
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow posts a new PR comment on every run for both success and failure, which can quickly spam PR threads on frequent pushes. Consider removing these steps or switching to a "sticky" comment/update pattern (or relying on GitHub Checks / job summaries) to avoid repeated comments.

Suggested change
- name: Comment PR with Results
if: failure() && github.event_name == 'pull_request'
uses: actions/github-script@v9
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ PR validation failed. Please check the workflow logs for details.'
})
- name: Comment PR with Success
if: success() && github.event_name == 'pull_request'
uses: actions/github-script@v9
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '✅ PR validation passed successfully!'
})
- name: Update PR validation comment
if: always() && github.event_name == 'pull_request'
uses: actions/github-script@v9
env:
VALIDATION_STATUS: ${{ job.status }}
with:
script: |
const marker = '<!-- pr-validation-status -->';
const status = process.env.VALIDATION_STATUS;
const body = status === 'success'
? `${marker}\n✅ PR validation passed successfully!`
: `${marker}\n❌ PR validation failed. Please check the workflow logs for details.`;
const { data: comments } = await github.rest.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 100
});
const existingComment = comments.find(comment =>
comment.user?.type === 'Bot' && comment.body?.includes(marker)
);
if (existingComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existingComment.id,
body
});
} else {
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body
});
}

Copilot uses AI. Check for mistakes.
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Install Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: lts/*

- name: Setup pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v6
with:
version: 'latest'
run_install: false

- name: Cache dependencies
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: |
**/node_modules
~/.pnpm-store
~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
${{ runner.os }}-node-

- name: Install Dependencies
Expand All @@ -71,7 +71,7 @@ jobs:
run: pnpm run build

- name: Create Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
Expand Down
28 changes: 17 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,20 @@ public-dist
# for TiddlyWiki
dist/
output/
wiki/tiddlers/$__language.tid
wiki/tiddlers/$__StoryList.tid
wiki/tiddlers/$__StoryList_*.tid
wiki/tiddlers/$__keepstate_*
wiki/tiddlers/$__Import.tid
wiki/tiddlers/$__UpgradeLibrary
wiki/tiddlers/$__UpgradeLibrary_List
wiki/tiddlers/$__temp_*
wiki/tiddlers/$__view.tid
wiki/tiddlers/$__config_Navigation_openLinkFromInsideRiver.tid
wiki/tiddlers/$__config_Navigation_openLinkFromOutsideRiver.tid
wiki/**/$__language.tid
wiki/**/$__StoryList.tid
wiki/**/$__StoryList_*.tid
wiki/**/$__palette.tid
wiki/**/$__layout.tid
wiki/**/$__keepstate_*
wiki/**/$__Import.tid
wiki/**/$__UpgradeLibrary
wiki/**/$__UpgradeLibrary_List
wiki/**/$__temp_*
wiki/**/$__view.tid
wiki/**/$__config_Navigation_openLinkFromInsideRiver.tid
wiki/**/$__config_Navigation_openLinkFromOutsideRiver.tid

# Playwright outputs
playwright-report/
test-results/
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "avoid"
}
6 changes: 3 additions & 3 deletions dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
],
"excludes": ["**/node_modules", "**/*-lock.json"],
"plugins": [
"https://plugins.dprint.dev/typescript-0.95.0.wasm",
"https://plugins.dprint.dev/json-0.20.0.wasm",
"https://plugins.dprint.dev/markdown-0.18.0.wasm"
"https://plugins.dprint.dev/typescript-0.95.12.wasm",
"https://plugins.dprint.dev/json-0.21.0.wasm",
"https://plugins.dprint.dev/markdown-0.20.0.wasm"
]
}
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default [
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ['./*.js', './*.mjs'],
allowDefaultProject: ['./*.js', './*.mjs', './wiki/tiddlers/tests/playwright/*.ts'],
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new Playwright tests path is added as ./wiki/tiddlers/tests/playwright/*.ts, which only matches files directly under that folder. If tests are organized into subfolders (and the workflow uses **/*.ts), ESLint's projectService may not pick them up; consider switching this glob to ./wiki/tiddlers/tests/playwright/**/*.ts.

Suggested change
allowDefaultProject: ['./*.js', './*.mjs', './wiki/tiddlers/tests/playwright/*.ts'],
allowDefaultProject: ['./*.js', './*.mjs', './wiki/tiddlers/tests/playwright/**/*.ts'],

Copilot uses AI. Check for mistakes.
},
tsconfigRootDir: __dirname,
},
Expand Down
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
"publish": "npm run clean && tiddlywiki-plugin-dev publish",
"reset": "rimraf ./**/node_modules",
"clean": "rimraf dist",
"prepare": "husky install",
"prepare": "husky",
"update": "npm-check-updates -u && dprint config update",
"new": "tiddlywiki-plugin-dev new",
"build:library": "npm run clean && tiddlywiki-plugin-dev build --library --output dist/library",
"publish:offline": "npm run clean && tiddlywiki-plugin-dev publish --offline"
"publish:offline": "npm run clean && tiddlywiki-plugin-dev publish --offline",
"test:playwright": "playwright test",
"test:playwright:headed": "playwright test --headed",
"test:playwright:debug": "playwright test --debug"
},
"engines": {
"node": ">=20"
Expand Down Expand Up @@ -48,16 +51,12 @@
"rimraf": "^6.1.3",
"ts-node": "^10.9.2",
"tw5-typed": "^1.1.5",
"typescript": "^6.0.2"
"typescript": "^6.0.2",
"@playwright/test": "^1.59.1"
},
"dependencies": {
"npm-check-updates": "^20.0.1",
"tiddlywiki": "^5.3.8",
"tiddlywiki-plugin-dev": "^0.4.4"
},
"pnpm": {
"overrides": {
"esbuild-plugin-browserslist": "1.0.2"
}
"tiddlywiki-plugin-dev": "^0.5.7"
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After removing the pnpm.overrides pin and bumping tiddlywiki-plugin-dev, the lockfile now resolves esbuild-plugin-browserslist@2.0.0 which declares a peer dependency on esbuild ~0.27.0, but the lockfile also resolves esbuild@0.28.0. Even with strict-peer-dependencies=false, this peer mismatch can cause subtle build issues; consider aligning versions (pin esbuild to 0.27.x, add an override, or bump to a plugin version that supports 0.28.x).

Suggested change
"tiddlywiki-plugin-dev": "^0.5.7"
"tiddlywiki-plugin-dev": "^0.5.7"
},
"pnpm": {
"overrides": {
"esbuild": "~0.27.0"
}

Copilot uses AI. Check for mistakes.
}
}
30 changes: 30 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { defineConfig, devices } from '@playwright/test';

const baseURL = process.env.PLAYWRIGHT_BASE_URL ?? 'http://127.0.0.1:8080';

export default defineConfig({
testDir: './wiki/tiddlers/tests/playwright',
timeout: 30 * 1000,
expect: {
timeout: 10 * 1000,
},
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
reporter: [['list'], ['html', { open: 'never' }]],
use: {
baseURL,
trace: 'on-first-retry',
},
webServer: {
command: 'pnpm dev',
url: baseURL,
reuseExistingServer: !process.env.CI,
timeout: 120 * 1000,
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
});
Loading
Loading