2023-05-23 18:53:53 +00:00
|
|
|
import { esbuild, flags, path } from "./plugos/deps.ts";
|
|
|
|
import { compileManifests } from "./plugos/compile.ts";
|
|
|
|
import { builtinPlugNames } from "./plugs/builtin_plugs.ts";
|
2023-01-22 17:53:14 +00:00
|
|
|
|
|
|
|
if (import.meta.main) {
|
|
|
|
const args = flags.parse(Deno.args, {
|
|
|
|
boolean: ["debug", "watch", "reload", "info"],
|
|
|
|
alias: { w: "watch" },
|
|
|
|
});
|
|
|
|
|
2023-05-23 18:53:53 +00:00
|
|
|
const manifests = builtinPlugNames.map((name) =>
|
|
|
|
`./plugs/${name}/${name}.plug.yaml`
|
|
|
|
);
|
2023-01-22 17:53:14 +00:00
|
|
|
|
2023-05-23 18:53:53 +00:00
|
|
|
const targetDir = path.join("dist_plug_bundle", "_plug");
|
|
|
|
Deno.mkdirSync(targetDir, { recursive: true });
|
|
|
|
Deno.mkdirSync("dist", { recursive: true });
|
2023-01-22 17:53:14 +00:00
|
|
|
|
2023-05-23 18:53:53 +00:00
|
|
|
// Build the other plugs
|
|
|
|
await compileManifests(
|
2023-01-22 17:53:14 +00:00
|
|
|
manifests,
|
2023-05-23 18:53:53 +00:00
|
|
|
targetDir,
|
2023-01-22 17:53:14 +00:00
|
|
|
args.watch,
|
|
|
|
{
|
|
|
|
debug: args.debug,
|
|
|
|
reload: args.reload,
|
|
|
|
info: args.info,
|
|
|
|
},
|
|
|
|
);
|
|
|
|
esbuild.stop();
|
|
|
|
}
|