Skip to content

Commit

Permalink
logs cleanup for dwrangler
Browse files Browse the repository at this point in the history
  • Loading branch information
theoephraim committed Dec 17, 2024
1 parent 11e39f6 commit b6bf705
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
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

0 comments on commit b6bf705

Please sign in to comment.