Skip to content

Commit

Permalink
Patch: updated timekeeper runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Akalanka47000 committed Jul 27, 2024
1 parent 075dc9d commit 700da36
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 100 deletions.
5 changes: 0 additions & 5 deletions packages/timekeeper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@
"test": "rimraf ./babel.config.js && dotenv -- jest --coverage --verbose --runInBand --forceExit"
},
"dependencies": {
"@babel/cli": "7.23.4",
"@babel/core": "7.23.6",
"@babel/preset-env": "7.23.6",
"@colors/colors": "1.5.0",
"@sliit-foss/babel-plugin-transform-trace": "0.1.2",
"@sliit-foss/functions": "2.2.4",
"commander": "11.1.0"
},
"author": "SLIIT FOSS",
Expand Down
15 changes: 4 additions & 11 deletions packages/timekeeper/src/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,17 @@ const config = {
plugins: [["@sliit-foss/babel-plugin-transform-trace"]]
};

const outputDir = path.join(__dirname, "..", "out").replace(/\\/g, path.sep);
const configPath = path.join(__dirname, "..", "babel.config.js").replace(/\\/g, path.sep);

const runner = async (p, options) => {
config.plugins[0].push({
"ignore-functions": options.ignoreFunctions?.split(",") ?? [],
clean: options.clean ?? false
"clean": options.clean ?? false
});

fs.writeFileSync(configPath, `module.exports = ${JSON.stringify(config)}`);

console.info(`[Timekeeper] transpiling...`.green);

await exec(`npx babel ${p} --out-dir ${outputDir} --copy-files --config-file=${configPath}`);

console.info(`[Timekeeper] executing...`.green);

await exec(`node "${outputDir}${path.sep}${path.basename(p)}"`).then(({ stdout, stderr }) => {
await exec(
`npx -p @babel/core@7 -p @babel/node@7 -p @sliit-foss/[email protected] -p @sliit-foss/[email protected] babel-node --config-file=${configPath} ${p}`
).then(({ stdout, stderr }) => {
if (stdout) console.log(stdout);
if (stderr) console.error(stderr.red);
});
Expand Down
84 changes: 0 additions & 84 deletions pnpm-lock.yaml

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

0 comments on commit 700da36

Please sign in to comment.