Skip to content

Commit 0174950

Browse files
authored
Merge pull request #8 from r74tech/fix/test-fixtures
fix/test-fixtures: テストフィクスチャ修正とセキュリティ改善
2 parents 948df30 + 8038ef2 commit 0174950

File tree

154 files changed

+6460
-2671
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+6460
-2671
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@ name: Release
22

33
on:
44
push:
5-
branches: [release]
5+
tags:
6+
- "v*"
67

7-
concurrency: ${{ github.workflow }}-${{ github.ref }}
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: false
811

912
jobs:
1013
release:
1114
runs-on: ubuntu-latest
1215
permissions:
1316
contents: write
14-
issues: write
15-
pull-requests: write
1617
id-token: write
1718
steps:
1819
- uses: actions/checkout@v4
@@ -32,8 +33,29 @@ jobs:
3233

3334
- run: bun run build
3435

35-
- name: Release
36-
run: bun run release
36+
- name: Resolve workspace dependencies
37+
run: |
38+
for pkg in packages/*/; do
39+
if [ -f "$pkg/package.json" ]; then
40+
echo "Resolving deps for $pkg"
41+
(cd "$pkg" && node ../../scripts/resolve-workspace-deps.js)
42+
fi
43+
done
44+
45+
- name: Publish to npm
46+
run: |
47+
for pkg in packages/*/; do
48+
if [ -f "$pkg/package.json" ]; then
49+
echo "Publishing $pkg"
50+
(cd "$pkg" && npm publish --access public --provenance)
51+
fi
52+
done
53+
env:
54+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
55+
56+
- name: Create GitHub Release
57+
uses: softprops/action-gh-release@v2
58+
with:
59+
generate_release_notes: true
3760
env:
3861
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39-
NPM_CONFIG_PROVENANCE: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
3232

3333
# Finder (MacOS) folder config
3434
.DS_Store
35+
36+
# vscode
37+
.vscode

.vscode/settings.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

bun.lock

Lines changed: 111 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bunfig.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[test]
2+
coverageSkipTestFiles = true
3+
coveragePathIgnorePatterns = [
4+
"**/dist/**",
5+
"**/node_modules/**"
6+
]

bunup.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ export default defineWorkspace([
4545
dts: true,
4646
minify: false,
4747
clean: true,
48+
external: ["hfmath"],
49+
target: "browser",
4850
},
4951
},
5052
]);

examples/wdmock-cf/apps/main/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "vite build && vite build --mode client",
8+
"build": "vite build --mode client && vite build",
99
"preview": "wrangler pages dev",
1010
"deploy": "bun run build && wrangler pages deploy dist",
1111
"typecheck": "bunx tsc --noEmit"
@@ -16,6 +16,7 @@
1616
"@wdprlib/parser": "workspace:*",
1717
"@wdprlib/render": "workspace:*",
1818
"@wdprlib/runtime": "workspace:*",
19+
"hfmath": "^0.0.2",
1920
"hono": "^4.7.5"
2021
},
2122
"devDependencies": {

examples/wdmock-cf/apps/main/src/client-manifest.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,14 @@ type ManifestEntry = {
77
isEntry?: boolean;
88
};
99

10-
let manifest: Record<string, ManifestEntry> | null = null;
10+
type Manifest = Record<string, ManifestEntry>;
1111

12-
try {
13-
// @ts-expect-error manifest.json only exists after build
14-
manifest = await import("../dist/.vite/manifest.json");
15-
} catch {
16-
// Ignore - manifest doesn't exist during development/typecheck
17-
}
12+
// @ts-expect-error manifest.json only exists after client build
13+
import manifest from "../dist/.vite/manifest.json" with { type: "json" };
1814

1915
export function getClientScriptPath(): string {
20-
if (!manifest) {
21-
throw new Error("Manifest not found - run build first");
22-
}
23-
const entry = manifest["src/client/main.ts"];
16+
const m = manifest as Manifest;
17+
const entry = m["src/client/main.ts"];
2418
if (!entry) {
2519
throw new Error("Client entry not found in manifest");
2620
}

examples/wdmock-cf/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
],
88
"type": "module",
99
"scripts": {
10+
"clean": "rm -rf apps/*/dist apps/*/.wrangler",
1011
"dev": "bun run --filter @wdmock/main dev",
1112
"dev:files": "bun run --filter @wdmock/files dev",
1213
"dev:all": "bun run dev & bun run dev:files",

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
],
1414
"scripts": {
1515
"build": "bunup",
16+
"clean": "rm -rf packages/**/dist",
1617
"dev": "bunup --watch",
1718
"test": "bun test",
1819
"test:unit": "bun test tests/unit",

0 commit comments

Comments
 (0)