Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

Commit

Permalink
wip - setting up config with CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
NicHaley committed Oct 5, 2023
1 parent f882bcd commit e54ef1d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"typescript": "^5.2.2"
},
"dependencies": {
"@floe/config": "workspace:*",
"@floe/markdoc": "workspace:*",
"@inquirer/checkbox": "^1.3.11",
"@inquirer/confirm": "^2.0.12",
Expand Down
15 changes: 6 additions & 9 deletions packages/cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ export function init(program: Command) {
message: "What do you want to use this project for?",
choices: [
{ name: "📖 Docs", value: "docs" },
{ name: "📚 Wiki", value: "wiki" },
{ name: "🚀 Changelog", value: "changelog" },
{ name: "✍️ Blog", value: "blog" },
{ name: "🙋‍♀️ FAQ", value: "faq" },
{ name: "🤝 Help center", value: "help" },
] as { name: string; value: keyof typeof templateSamples }[],
});

Expand Down Expand Up @@ -103,17 +103,14 @@ export function init(program: Command) {
const file = templateSamples[item];

if (item === "docs") {
fs.mkdirSync(".floe/docs", { recursive: true });
fs.writeFileSync(resolve(".floe", "docs/index.md"), docSample);
fs.writeFileSync(
resolve(".floe", "docs/getting-started.md"),
docSample2
);
fs.mkdirSync("docs", { recursive: true });
fs.writeFileSync(resolve("docs/index.md"), docSample);
fs.writeFileSync(resolve("docs/getting-started.md"), docSample2);
return;
}

fs.mkdirSync(`.floe/${item}`, { recursive: true });
fs.writeFileSync(resolve(".floe", `${item}/sample.md`), file);
fs.mkdirSync(item, { recursive: true });
fs.writeFileSync(resolve(`${item}/sample.md`), file);
});

await sleep(1500);
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/commands/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export function validate(program: Command) {
.action(async () => {
console.log(chalk.bold("Validating files..."));

const files = await glob(".floe/**/*.{md,mdoc}");
// TODO: Consider supporting mdoc format in the future
const files = await glob("**/*.{md}");

if (files.length === 0) {
console.log(
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e54ef1d

Please sign in to comment.