Skip to content

Commit db4d038

Browse files
committed
vitestを導入, ciのセットアップ
1 parent 76bd878 commit db4d038

File tree

10 files changed

+15444
-8347
lines changed

10 files changed

+15444
-8347
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Runtime Tests CI
2+
on:
3+
pull_request:
4+
paths:
5+
- 'packages/runtime/**'
6+
- '.github/workflows/runtime-tests.yml'
7+
jobs:
8+
test-runtime:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node-version: [22.x]
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: ${{ matrix.node-version }}
18+
cache: 'npm'
19+
- run: npm ci
20+
- run: npm test -w @my-code/runtime

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@ next-env.d.ts
5252

5353
/public/typescript/
5454
/app/m-plus-rounded-1c-nohint/
55+
node_modules

next.config.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import type { NextConfig } from "next";
22
import { initOpenNextCloudflareForDev } from "@opennextjs/cloudflare";
3+
import { PyodidePlugin } from "@pyodide/webpack-plugin";
4+
import { version as pyodideVersion } from "pyodide/package.json";
35

46
initOpenNextCloudflareForDev();
57

@@ -44,13 +46,14 @@ const nextConfig: NextConfig = {
4446
];
4547
},
4648
webpack: (config, { isServer }) => {
47-
if (!isServer) {
48-
config.resolve.fallback = {
49-
child_process: false,
50-
"node:child_process": false,
51-
...config.resolve.fallback,
52-
};
53-
}
49+
config.plugins.push(
50+
new PyodidePlugin({
51+
// public/ 以下に書き出すと404
52+
// ../public/ 以下に書き出すと Uncaught SyntaxError: Invalid or unexpected token (at layout.js:1073:29) エラーになる
53+
// _next/static/ 以下ならとりあえずうごく
54+
outDirectory: `static/pyodide/v${pyodideVersion}`,
55+
})
56+
);
5457
// import hoge from "./file?raw" でfileの中身を文字列としてインポート
5558
for (const rule of config.module.rules) {
5659
if (rule.resourceQuery instanceof RegExp) {

0 commit comments

Comments
 (0)