Skip to content

Commit

Permalink
Fix compilation orden error
Browse files Browse the repository at this point in the history
  • Loading branch information
jcarlosn committed Jul 9, 2024
1 parent a1233b7 commit cc95db0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 1 addition & 2 deletions apps/admin-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"dev-full": "FULL_DEV=1 NODE_ENV=development ts-node --files --project tsconfig.json src/index.ts",
"dev-standalone": "NODE_ENV=development node -r module-alias/register dist/apps/admin-api/src/index.js",
"prod-standalone": "NODE_ENV=production && node -r module-alias/register dist/apps/admin-api/src/index.js",
"package": "echo nothing to package",
"build": "tsc && shx mkdir -p dist/packages/protolib/lib && shx cp ../../packages/protolib/lib/RemoteTransport.ts dist/packages/protolib/lib/RemoteTransport.ts && shx cp ../../system.js dist/",
"package": "tsc && shx mkdir -p dist/packages/protolib/lib && shx cp ../../packages/protolib/lib/RemoteTransport.ts dist/packages/protolib/lib/RemoteTransport.ts && shx cp ../../system.js dist/",
"prepare-dev": "node prepare.js",
"clean": "shx rm -rf dist"
},
Expand Down
15 changes: 14 additions & 1 deletion apps/admin-api/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,17 @@ if(!fs.existsSync('./../../.env')) {
if(!fileContent.includes('TOKEN_SECRET')) {
fs.appendFileSync(content)
}
}
}

if (!fs.existsSync('./../next-compiled/.next')) {
//run yarn package
const { exec } = require('child_process');
console.log("Compiling admin-api...")
exec('yarn package', (err, stdout, stderr) => {
if (err) {
console.error(err);
return;
}
console.log(stdout);
});
}

0 comments on commit cc95db0

Please sign in to comment.