UNPKG

onlykit

Version:

Because it's the only dependency you'll need.

43 lines (40 loc) 1.52 kB
import path from "node:path"; import { ensureDir, pathExists, remove } from "fs-extra"; //#region src/bin/constants/index.ts const INIT_TEMPLATES = ["cli", "server"]; const TS_CONFIG = { extends: "onlykit/dev/tsconfig", compilerOptions: { typeRoots: ["node_modules/@types", "node_modules/onlykit/dist"] }, include: ["src/**/*.ts", "./tsdown.config.ts"] }; const BIOME_CONFIG = { $schema: "https://biomejs.dev/schemas/2.2.2/schema.json", extends: ["onlykit/dev/biome"] }; const LogSprites = { ARROW: "»" }; const REGEX = { ANSI: /\x1B\[[0-?]*[ -/]*[@-~]/g }; const STANDALONE_ENVIRONMENT_FOLDER = ".onlykit"; //#endregion //#region src/bin/standalone/index.ts var StandaloneEnvironment = class { standalonePath; standaloneOutputPath; standaloneOutputEntryPoint; constructor(cwd) { this.standalonePath = path.join(cwd, STANDALONE_ENVIRONMENT_FOLDER); this.standaloneOutputPath = path.join(this.standalonePath, "dist"); this.standaloneOutputEntryPoint = path.join(this.standaloneOutputPath, "index.mjs"); } async setup() { const doesStandaloneEnvExist = await pathExists(this.standaloneOutputPath); if (!doesStandaloneEnvExist) await ensureDir(this.standaloneOutputPath); } async clean() { const doesStandaloneEnvExist = await pathExists(this.standalonePath); if (!doesStandaloneEnvExist) return; await remove(this.standalonePath); } }; //#endregion export { BIOME_CONFIG, INIT_TEMPLATES, LogSprites, REGEX, StandaloneEnvironment, TS_CONFIG }; //# sourceMappingURL=standalone-i4nISoV8.js.map