Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
cyco130 committed Aug 28, 2023
1 parent 663a0d1 commit 217c02a
Show file tree
Hide file tree
Showing 10 changed files with 4,197 additions and 2,019 deletions.
19 changes: 19 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base", "schedule:weekly", "group:allNonMajor"],
"ignorePresets": ["ignorePaths"],
"ignorePaths": ["**/node_modules/**", "**/dist/**"],
"labels": ["dependencies"],
"rangeStrategy": "bump",
"packageRules": [
{
"depTypeList": ["peerDependencies"],
"enabled": false
},
{
"matchPackageNames": ["vfile"],
"allowedVersions": "5"
}
],
"ignoreDeps": []
}
19 changes: 0 additions & 19 deletions .github/renovate.json5

This file was deleted.

75 changes: 54 additions & 21 deletions ci/ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import path from "path";
import fs from "fs";
import { spawn, ChildProcess } from "child_process";
import fetch from "node-fetch";
import kill from "kill-port";
import psTreeCb from "ps-tree";
import { promisify } from "util";
import { kill } from "process";

const TEST_HOST = "http://localhost:5173";
const psTree = promisify(psTreeCb);

const TEST_HOST = "http://localhost:5174";

const browser = await puppeteer.launch({
headless: "new",
Expand Down Expand Up @@ -35,41 +39,76 @@ describe.each(cases)("$framework - $env", ({ framework, env }) => {
framework.toLowerCase(),
);

let cp: ChildProcess;
let cp: ChildProcess | undefined;

beforeAll(async () => {
await kill(5173, "tcp").catch(() => {
// Do nothing
});

const command =
env === "development"
? "pnpm exec vite serve --strictPort --port 5173"
: "pnpm exec vite build && pnpm exec vite preview --strictPort --port 5173";
? "pnpm exec vite serve --strictPort --port 5174"
: "pnpm exec vite build && pnpm exec vite preview --strictPort --port 5174";

cp = spawn(command, {
shell: true,
stdio: "inherit",
cwd: dir,
});

// Wait until server is ready
await new Promise<void>((resolve) => {
const interval = setInterval(() => {
fetch(TEST_HOST)
// eslint-disable-next-line no-async-promise-executor
await new Promise<void>(async (resolve, reject) => {
cp!.on("error", (error) => {
cp = undefined;
reject(error);
});

cp!.on("exit", (code) => {
if (code !== 0) {
cp = undefined;
reject(new Error(`Process exited with code ${code}`));
}
});

for (;;) {
let doBreak = false;
await fetch(TEST_HOST)
.then(async (r) => {
if (r.status === 200) {
clearInterval(interval);
resolve();
doBreak = true;
}
})
.catch(() => {
// Ignore error
});
}, 250);

if (doBreak) {
break;
}

await new Promise((resolve) => setTimeout(resolve, 250));
}
}).catch((error) => {
console.error(error);
process.exit(1);
});
}, 60_000);

afterAll(async () => {
if (!cp || cp.exitCode || !cp.pid) {
return;
}

const tree = await psTree(cp.pid);
const pids = [cp.pid, ...tree.map((p) => +p.PID)];

for (const pid of pids) {
kill(+pid, "SIGINT");
}

await new Promise((resolve) => {
cp!.on("exit", resolve);
});
});

test("renders MDX", async () => {
await page.goto(TEST_HOST + "/");
await page.waitForFunction(
Expand Down Expand Up @@ -115,12 +154,6 @@ describe.each(cases)("$framework - $env", ({ framework, env }) => {
}
}, 60_000);
}

afterAll(async () => {
await kill(5173, "tcp").catch(() => {
// Do nothing
});
});
});

afterAll(async () => {
Expand Down
9 changes: 5 additions & 4 deletions ci/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
"ci": "vitest --no-threads --reporter=verbose run"
},
"dependencies": {
"@types/node": "^20.5.0",
"@types/node": "^20.5.7",
"kill-port": "^2.0.1",
"node-fetch": "^3.3.2",
"puppeteer": "^20.9.0",
"typescript": "^5.1.6",
"vitest": "^0.34.1"
"ps-tree": "^1.2.0",
"puppeteer": "^21.1.1",
"typescript": "^5.2.2",
"vitest": "^0.34.3"
}
}
6 changes: 3 additions & 3 deletions examples/preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"start": "vite preview"
},
"dependencies": {
"preact": "^10.16.0"
"preact": "^10.17.1"
},
"devDependencies": {
"@babel/core": "^7.22.10",
"@babel/core": "^7.22.11",
"@cyco130/vite-plugin-mdx": "0.0.3",
"@preact/preset-vite": "^2.5.0",
"typescript": "^5.1.6",
"typescript": "^5.2.2",
"vite": "^4.4.9"
}
}
4 changes: 2 additions & 2 deletions examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
},
"devDependencies": {
"@cyco130/vite-plugin-mdx": "0.0.3",
"@types/react": "^18.2.20",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@vitejs/plugin-react": "4.0.4",
"typescript": "^5.1.6",
"typescript": "^5.2.2",
"vite": "^4.4.9"
}
}
4 changes: 2 additions & 2 deletions examples/solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
},
"devDependencies": {
"@cyco130/vite-plugin-mdx": "0.0.3",
"solid-jsx": "^0.9.1",
"typescript": "^5.1.6",
"solid-jsx": "^1.1.4",
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vite-plugin-solid": "^2.7.0"
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
},
"devDependencies": {
"husky": "^8.0.3",
"lint-staged": "^13.3.0",
"prettier": "^3.0.1",
"typescript": "^5.1.6"
"lint-staged": "^14.0.1",
"prettier": "^3.0.2",
"typescript": "^5.2.2"
}
}
14 changes: 7 additions & 7 deletions packages/vite-plugin-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@
"vite": "3 || 4"
},
"devDependencies": {
"@cyco130/eslint-config": "^3.3.1",
"@types/node": "^20.5.0",
"eslint": "^8.47.0",
"publint": "^0.2.0",
"@cyco130/eslint-config": "^3.3.2",
"@types/node": "^20.5.7",
"eslint": "^8.48.0",
"publint": "^0.2.2",
"tsup": "^7.2.0",
"typescript": "^5.1.6",
"typescript": "^5.2.2",
"vite": "^4.4.9"
},
"dependencies": {
"@mdx-js/mdx": "^2.3.0",
"@rollup/pluginutils": "^5.0.3",
"@rollup/pluginutils": "^5.0.4",
"source-map": "^0.7.4",
"vfile": "^5.0.0"
"vfile": "^5.3.7"
}
}
Loading

0 comments on commit 217c02a

Please sign in to comment.