Page MenuHomeSealhub

cli.ts
No OneTemporary

#!/usr/bin/env node
import { addCollection } from "./add-collection";
import { addRoute } from "./add-route";
import { buildProject } from "./build";
import { generateScssIncludes } from "./find-scss-includes";
import { generateCollections } from "./generate-collections";
import { generateRoutes } from "./generate-routes";
import { makeEnv } from "./make-env";
const actions: Record<
string,
(args: Record<string, string | boolean>) => Promise<void> | undefined
> = {
"add-collection": addCollection,
"add-route": addRoute,
"generate-collections": generateCollections,
"generate-routes": generateRoutes,
"generate-scss-includes": generateScssIncludes,
build: buildProject,
default: async function () {
console.log("Usage: `sealscript <action>`");
console.log(
`Available actions: ${Object.keys(actions)
.filter((e) => e != "default")
.join(", ")}`
);
},
"make-env": makeEnv,
};
void (async function () {
const action = process.argv.at(2);
actions;
const fn = actions[action || "default"] || actions.default;
await fn(require("yargs").argv);
})();

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 14:06 (19 m, 56 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
557354
Default Alt Text
cli.ts (1 KB)

Event Timeline