Co-authored-by: Vadim Smirnov <smirnou.vadzim@gmail.com> Co-authored-by: zakariasaad <zakaria.elas@gmail.com> Co-authored-by: Vilfred Sikker <vilfredsikker@gmail.com> Co-authored-by: Kasper <kasper@medusa-commerce.com> Co-authored-by: Sebastian Rindom <skrindom@gmail.com> Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
43 lines
876 B
JavaScript
Executable File
43 lines
876 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
const execa = require("execa");
|
|
|
|
const installDeps = async () => {
|
|
await execa("yarn", ["install"], {
|
|
cwd: "./reference",
|
|
stdio: "inherit",
|
|
});
|
|
|
|
await execa("yarn", ["install"], {
|
|
cwd: "./docs",
|
|
stdio: "inherit",
|
|
});
|
|
};
|
|
|
|
const buildGatsby = async () => {
|
|
await execa("./node_modules/.bin/gatsby", ["build"], {
|
|
cwd: "./reference",
|
|
stdio: "inherit",
|
|
});
|
|
};
|
|
|
|
const buildDocusaurus = async () => {
|
|
await execa("./node_modules/.bin/docusaurus", ["build"], {
|
|
cwd: "./docs",
|
|
stdio: "inherit",
|
|
});
|
|
};
|
|
|
|
const buildSite = async () => {
|
|
await installDeps();
|
|
await buildGatsby();
|
|
await buildDocusaurus();
|
|
|
|
await execa("rm", ["-rf", "build"]);
|
|
await execa("mkdir", ["build"]);
|
|
await execa("cp", ["-a", `reference/public/.`, `build/`]);
|
|
await execa("cp", ["-a", `docs/build/.`, `build/`]);
|
|
};
|
|
|
|
buildSite();
|