Page MenuHomeSealhub

setup.mjs
No OneTemporary

Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None

setup.mjs

import "zx/globals";
import { Module, KoaModule, Registry } from "./module.mjs";
import { OUTPUT_DIR } from "./config.mjs";
import { getReposAndDiffsForTask } from "./arcanist.mjs";
$.verbose = true;
import fs from "node:fs";
await $`mkdir -p ${OUTPUT_DIR}`;
const [action, ...args] = process.argv.slice(
process.argv.findIndex((e) => e.endsWith("/setup.mjs")) + 1,
);
const koaModule = new KoaModule();
const modules = [
new Module({
dirname: "sealious-playground",
repo: "ssh://git@hub.sealcode.org/source/sealious-playground.git",
dependsOn: [
"@sealcode/jdd",
"@sealcode/monaco-wrapper",
"@sealcode/jdd-editor",
"@sealcode/add-to-head",
"@sealcode/ansi-html-stream",
"@sealcode/crud-ui",
"@sealcode/file-manager",
"sealious",
"@sealcode/simplemde",
"@sealcode/sealgen",
"koa-responsive-image-router",
],
}),
new Module({
npmName: "@sealcode/file-manager",
repo: "ssh://git@hub.sealcode.org/diffusion/FM/file-manager.git",
}),
new Module({
npmName: "@sealcode/simplemde",
repo: "ssh://git@hub.sealcode.org/source/sealmde-markdown-editor.git",
}),
new Module({
npmName: "sealious",
repo: "ssh://git@hub.sealcode.org/source/sealious.git",
}),
new Module({
npmName: "@sealcode/crud-ui",
repo: "ssh://git@hub.sealcode.org/diffusion/CUI/crud-ui.git",
dependsOn: ["@sealcode/sealgen", "sealious"],
}),
new Module({
npmName: "@sealcode/jdd",
repo: "ssh://git@hub.sealcode.org/source/jdd.git",
dependsOn: ["sealious", "koa-responsive-image-router"],
}),
new Module({
npmName: "@sealcode/sealgen",
repo: "ssh://git@hub.sealcode.org/source/sealgen.git",
dependsOn: ["sealious"],
}),
new Module({
repo: "ssh://git@hub.sealcode.org/diffusion/JDDE/jdd-editor.git",
npmName: "@sealcode/jdd-editor",
dependsOn: [
"sealious",
"@sealcode/jdd",
"@sealcode/monaco-wrapper",
"@sealcode/sealgen",
],
}),
new Module({
npmName: "@sealcode/monaco-wrapper",
repo: "ssh://git@hub.sealcode.org/source/monaco-wrapper.git",
}),
new Module({
npmName: "@sealcode/add-to-head",
repo: "ssh://git@hub.sealcode.org/source/add-to-head.git",
}),
new Module({
npmName: "@sealcode/ansi-html-stream",
repo: "ssh://git@hub.sealcode.org/source/ansi-html-stream.git",
}),
new Module({
npmName: "koa-responsive-image-router",
repo: "ssh://git@hub.sealcode.org/diffusion/RIMAGEROUTER/koa-responsive-image-router.git",
}),
new Module({
npmName: "@sealcode/sortable",
repo: "ssh://git@hub.sealcode.org/source/sortable.git",
}),
koaModule,
];
if (action == "clone" || action == undefined) {
for (const module of modules) {
await module.clone();
await module.install();
await module.build();
}
}
if (action == "link" || action == undefined) {
for (const module of modules) {
await module.linkDeps();
}
}
if (action == "task") {
if (args.length == 0) {
console.error(
"No task specified. Pass a task ID like this: `npm run task T1234`",
);
process.exit(1);
}
const repos_and_diffs = await getReposAndDiffsForTask(args[0]);
for (const { repository, revision } of repos_and_diffs) {
await Registry.findByNpmName(repository).applyRevision(revision);
}
await koaModule.linkDeps();
for (const { repository } of repos_and_diffs) {
await Registry.findByNpmName(repository).build();
}
}
if (action == "find-by-dep") {
const dep_name = args[0];
const result = await Registry.findAllThatDependOn(dep_name);
console.log("Modules that have", dep_name, "as dependency:");
for (const module of result) {
console.log(" - ", module.npmName || module.dirname);
}
}
if (action == "graph") {
console.log(Registry.getGraph());
}

File Metadata

Mime Type
application/javascript
Expires
Sat, Nov 28, 01:20 (10 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1229917
Default Alt Text
setup.mjs (3 KB)

Event Timeline