Page MenuHomeSealhub

cli.ts
No OneTemporary

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

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 23, 19:19 (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
601502
Default Alt Text
cli.ts (1 KB)

Event Timeline