Skip to content

Commit a64567f

Browse files
Tim Roesdanidelvalle-frontiers
authored andcommitted
🪟 🔧 Improve Output when overwriting experiments (airbytehq#22409)
* Improve Output when overwriting experiments * FIx file name in log * Update pnpm lockfile
1 parent 0ce6f03 commit a64567f

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

airbyte-webapp/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133
"@vitejs/plugin-basic-ssl": "^1.0.1",
134134
"@vitejs/plugin-react": "^3.0.1",
135135
"babel-jest": "^29.3.1",
136+
"chalk": "^4.1.2",
136137
"dotenv": "^16.0.3",
137138
"eslint": "^8.32.0",
138139
"eslint-config-prettier": "^8.6.0",

airbyte-webapp/pnpm-lock.yaml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
const fs = require("fs");
2+
const { isMainThread } = require("node:worker_threads");
23
const path = require("path");
34

5+
const chalk = require("chalk");
6+
47
const EXPERIMENTS_FILE = path.resolve(__dirname, "../.experiments.json");
58

69
if (fs.existsSync(EXPERIMENTS_FILE)) {
7-
console.log("\nOverwriting experiments from .experiments.json ...");
810
const overwrites = require(EXPERIMENTS_FILE);
911

1012
if (Object.keys(overwrites).length) {
11-
console.log(`Overwriting experiments with the following values:\n\n${JSON.stringify(overwrites, null, 2)}`);
13+
if (isMainThread) {
14+
// Only print the message in the main thread, so it's not showing up in all the worker threads of vite-plugin-checker
15+
console.log(chalk.bold(`🧪 Overwriting experiments via ${chalk.green(".experiments.json")}`));
16+
Object.entries(overwrites).forEach(([key, value]) => {
17+
console.log(` ➜ ${chalk.cyan(key)}: ${JSON.stringify(value)}`);
18+
});
19+
}
1220
process.env.REACT_APP_EXPERIMENT_OVERWRITES = JSON.stringify(overwrites);
1321
}
1422
}

airbyte-webapp/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export default defineConfig(({ mode }) => {
5555
],
5656
// Use `REACT_APP_` as a prefix for environment variables that should be accessible from within FE code.
5757
envPrefix: ["REACT_APP_"],
58+
clearScreen: false,
5859
build: {
5960
outDir: "build/app",
6061
},

0 commit comments

Comments
 (0)