Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use chalk for node <= 20 support #417

Merged
merged 2 commits into from
Sep 4, 2024
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
1 change: 1 addition & 0 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@remix-run/css-bundle": "*",
"@remix-run/node": "*",
"@remix-run/react": "*",
"chalk": "^5.3.0",
"cross-env": "^7.0.3",
"fastify": "^4.28.1",
"get-port": "^7.1.0",
Expand Down
7 changes: 3 additions & 4 deletions examples/basic/server.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from "node:fs";
import path from "node:path";
import url from "node:url";
import { styleText } from "node:util";
import chalk from "chalk";
import fastify from "fastify";
import { createRequestHandler } from "@mcansh/remix-fastify";
import { broadcastDevReady, installGlobals } from "@remix-run/node";
Expand Down Expand Up @@ -110,14 +110,13 @@ let { port: usedPort } = new URL(address);

if (usedPort !== String(desiredPort)) {
console.warn(
styleText(
"yellow",
chalk.yellow(
`⚠️ Port ${desiredPort} is not available, using ${usedPort} instead.`,
),
);
}

console.log(`✅ app ready: ${address}`);
console.log(chalk.green(`✅ app ready: ${address}`));

if (process.env.NODE_ENV === "development") {
await broadcastDevReady(initialBuild);
Expand Down
1 change: 1 addition & 0 deletions examples/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@mcansh/remix-fastify": "workspace:*",
"@remix-run/node": "*",
"@remix-run/react": "*",
"chalk": "^5.3.0",
"fastify": "^4.28.1",
"get-port": "^7.1.0",
"isbot": "^5.1.11",
Expand Down
6 changes: 3 additions & 3 deletions examples/playground/server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { styleText } from 'node:util'
import chalk from "chalk";
import { remixFastify } from "@mcansh/remix-fastify";
import { installGlobals } from "@remix-run/node";
import { fastify } from "fastify";
Expand Down Expand Up @@ -30,8 +30,8 @@ let parsedAddress = new URL(address);

if (parsedAddress.port !== String(desiredPort)) {
console.warn(
styleText('yellow', `⚠️ Port ${desiredPort} is not available, using ${parsedAddress.port} instead.`,)
chalk.yellow(`⚠️ Port ${desiredPort} is not available, using ${parsedAddress.port} instead.`)
)
}

console.log(`✅ app ready: ${address}`);
console.log(chalk.green(`✅ app ready: ${address}`));
1 change: 1 addition & 0 deletions examples/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@mcansh/remix-fastify": "3.4.0",
"@remix-run/node": "*",
"@remix-run/react": "*",
"chalk": "^5.3.0",
"cross-env": "^7.0.3",
"fastify": "^4.28.1",
"get-port": "^7.1.0",
Expand Down
7 changes: 3 additions & 4 deletions examples/vite/server/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import process from "node:process";
import { styleText } from "node:util";
import chalk from "chalk";
import { remixFastify } from "@mcansh/remix-fastify";
import { installGlobals } from "@remix-run/node";
import { fastify } from "fastify";
Expand All @@ -24,11 +24,10 @@ let { port: usedPort } = new URL(address);

if (usedPort !== String(desiredPort)) {
console.warn(
styleText(
"yellow",
chalk.yellow(
`⚠️ Port ${desiredPort} is not available, using ${usedPort} instead.`,
),
);
}

console.log(styleText("green", `✅ app ready: ${address}`));
console.log(chalk.green(`✅ app ready: ${address}`));
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@
"@changesets/[email protected]": "patches/@[email protected]"
}
},
"packageManager": "pnpm@9.8.0+sha512.8e4c3550fb500e808dbc30bb0ce4dd1eb614e30b1c55245f211591ec2cdf9c611cabd34e1364b42f564bd54b3945ed0f49d61d1bbf2ec9bd74b866fcdc723276"
"packageManager": "pnpm@9.9.0+sha512.60c18acd138bff695d339be6ad13f7e936eea6745660d4cc4a776d5247c540d0edee1a563695c183a66eb917ef88f2b4feb1fc25f32a7adcadc7aaf3438e99c1"
}
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.