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

logs cleanup for dwrangler #187

Merged
merged 1 commit into from
Dec 25, 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
5 changes: 5 additions & 0 deletions .changeset/purple-zebras-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@dmno/cloudflare-platform": patch
---

clean up logs for dwrangler
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import AstroLogo from "~icons/logos/astro";
import TabbedCode from '@/components/TabbedCode.astro';
import BugReportLink from '@/components/BugReportLink.astro';

At DMNO we _love_ [Netlify](https://netlify.com/). This very site is hosted on it! That's why we're very excited to make it easier and safer to use environment variables in all of your Netlify-hosted projects.

This platform integration exposes a pre-made config schema and underlying types to interact with the env vars that Netlify injects while on their platform.

It also exposes a Netlify build plugin - which injects your resolved DMNO config into functions and edge functions. You may not need to use this plugin if you already have a build process that injects config values into your functions code before deployment.
Expand Down
31 changes: 15 additions & 16 deletions packages/platforms/cloudflare/src/dwrangler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ let wranglerProcess: ChildProcess | undefined;

if (isDevMode) {
dmnoServer.enableWatchMode(async () => {
console.log('reload!!!');
console.log('reload triggered by DMNO config change');
dmnoHasTriggeredReload = true;
if (wranglerProcess) {
// wranglerProcess.kill(15);
Expand Down Expand Up @@ -173,7 +173,7 @@ async function restartWrangler() {
}
// always inject static items using --define
const allReplacements = { ...staticReplacements.dmnoConfig, ...staticReplacements.dmnoPublicConfig };
console.log(allReplacements);
debug('define replacements', allReplacements);
for (const k in allReplacements) {
wranglerBuildArgs.push('--define', `${k}:${allReplacements[k]}`);
}
Expand Down Expand Up @@ -205,7 +205,6 @@ async function restartWrangler() {

console.log('1 - CREATING NEW VERSION');


const multiStepDeployEnv = {
FORCE_COLOR: 'true',
...process.env,
Expand Down Expand Up @@ -290,7 +289,7 @@ async function restartWrangler() {
// console.log('error!', data);
// });
wranglerProcess.on('exit', (code, signal) => {
console.log('wranglerProcess exit', { code, signal });
debug('wranglerProcess exit', { code, signal });
// we are seeing wrangler exit code 0 and no signal both when
// the user hits CTRL+C and when we restart the process
// so we have to track whether we restarted it and ignore the close signal we get right after
Expand All @@ -305,18 +304,18 @@ async function restartWrangler() {
process.exit(exitCode);
}
});
// wranglerProcess.on('close', () => {
// console.log('wrangler process - close');
// });
// wranglerProcess.on('disconnect', () => {
// console.log('wrangler process - disconnect');
// });
// wranglerProcess.on('error', () => {
// console.log('wrangler process - error');
// });
// wranglerProcess.on('message', () => {
// console.log('wrangler process - message');
// });
// wranglerProcess.on('close', () => {
// console.log('wrangler process - close');
// });
// wranglerProcess.on('disconnect', () => {
// console.log('wrangler process - disconnect');
// });
// wranglerProcess.on('error', () => {
// console.log('wrangler process - error');
// });
// wranglerProcess.on('message', () => {
// console.log('wrangler process - message');
// });
}
}

Expand Down
Loading