Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F10361296
setup.mjs
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
setup.mjs
View Options
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/file-manager"
,
"sealious"
,
"@sealcode/simplemde"
,
"@sealcode/sealgen"
,
"koa-responsive-image-router"
,
"@sealcode/show-first-row"
,
],
}),
Module
.
playgroundFork
(
"sealious-testground"
,
"ssh://git@hub.sealcode.org/source/sealious-testground.git"
,
),
Module
.
playgroundFork
(
"agro-contracts"
,
"ssh://git@hub.sealcode.org/source/agro-contracts.git"
,
),
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"
,
dependsOn
:
[
"@sealcode/file-manager"
],
}),
new
Module
({
npmName
:
"@sealcode/jdd"
,
repo
:
"ssh://git@hub.sealcode.org/source/jdd.git"
,
dependsOn
:
[
"sealious"
,
"koa-responsive-image-router"
,
"@sealcode/file-manager"
,
],
}),
new
Module
({
npmName
:
"@sealcode/sealgen"
,
repo
:
"ssh://git@hub.sealcode.org/source/sealgen.git"
,
dependsOn
:
[
"sealious"
,
"@sealcode/file-manager"
],
}),
new
Module
({
repo
:
"ssh://git@hub.sealcode.org/diffusion/JDDE/jdd-editor.git"
,
npmName
:
"@sealcode/jdd-editor"
,
dependsOn
:
[
"sealious"
,
"@sealcode/jdd"
,
"@sealcode/file-manager"
,
"@sealcode/monaco-wrapper"
,
"@sealcode/sealgen"
,
"koa-responsive-image-router"
,
],
}),
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"
,
}),
new
Module
({
npmName
:
"@sealcode/show-first-row"
,
repo
:
"ssh://git@hub.sealcode.org/diffusion/173/show-first-row.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
Details
Attached
Mime Type
text/x-java
Expires
Sat, Nov 8, 12:34 (11 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1034586
Default Alt Text
setup.mjs (4 KB)
Attached To
Mode
rSUPER Superseal
Attached
Detach File
Event Timeline
Log In to Comment