scaffdog
TypeScript icon, indicating that this package has built-in type declarations

4.1.0 • Public • Published

scaffdog

scaffdog is Markdown driven scaffolding tool.

GitHub Workflow Status npm npm MIT LICENSE

scaffdog

asciicast

Multiple files can be output in a document, and flexible scaffolding is possible with a simple but powerful template syntax 🐕

Documentation

Visit https://scaff.dog to view the full documentation.

Features

  • 📝 Markdown driven
    • You can define a template with <h1> and code block.
    • It will be a Documetable template !
    • Define meta information with extended syntax using Front Matter.
  • 🗒️ Intuitive template
    • It provides a simple yet powerful template engine inspired by ECMAScript and Go text/template.
    • Many built-in helper functions required to define templates are also provided.
  • 🚀 Ready to use
    • You can quickly start using $ scaffdog init.
    • Other useful commands are provided for immediate scaffolding.
  • 💅 Prettier Integration
    • Markdown works very well with Prettier, and the templates maintain beautiful code.
    • We also offer a Prettier Plugin for scaffdog's template engine.

Requirements

  • Node.js v18.0.0+

Getting Started

Installation

scaffdog can be installed globally, but we recommend installing it locally on the project.

$ npm install --save-dev scaffdog

Quick Start

In the following tutorial you can start using scaffdog immediately !

Setup

By default, it stores the document file and configuration file in the .scaffdog directory.

Creating directories, configuration file and initial documents can be done with the init subcommand.

$ npx scaffdog init

? Please enter a document name. component

Setup of scaffdog 🐶 is complete!

  ✔ .scaffdog/config.js
  ✔ .scaffdog/component.md

Now you can do scaffold by running `$ scaffdog generate`.

Please refer to the following documents and customize it.
https://scaff.dog/docs/templates

After running the command, the .scaffdog/component.md file should have been generated. Rewrite that file as follows:

---
name: 'component'
root: '.'
output: '.'
questions:
  name: 'Please enter a component name.'
---

# `{{ inputs.name | pascal }}/index.ts`

```typescript
export * from './{{ inputs.name }}';
```

# `{{ inputs.name | pascal }}/{{ inputs.name | pascal }}.tsx`

```typescript
export type Props = React.PropsWithChildren<{}>;

export const {{ inputs.name | pascal }}: React.FC<Props> = ({ children }) => {
  return (
    <div>{children}</div>
  );
};
```

Let's scaffold using the component document!

$ npx scaffdog generate

? Please select a document. component
ℹ Output destination directory: "."
? Please enter a component name. PrettyDog

🐶 Generated 2 files!

     ✔ PrettyDog/index.ts
     ✔ PrettyDog/PrettyDog.tsx

Congratulations 🎉

The first file was generated.

$ cat PrettyDog/index.ts
export * from './PrettyDog';

$ cat PrettyDog/PrettyDog.tsx
export type Props = React.PropsWithChildren<{}>;

export const PrettyDog: React.FC<Props> = ({ children }) => {
  return (
    <div>{children}</div>
  );
};

Check out our documentation site to customize your documentation 👍

Migration

There are important changes in the major update.

See Migration Guide.

Contributing

See CONTRIBUTING.md.

CHANGELOG

See CHANGELOG.md.

License

MIT © wadackel

Thank you for reading!

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
4.1.06,480latest
3.0.0-canary.116canary

Version History

VersionDownloads (Last 7 Days)Published
4.1.06,480
4.0.015,865
3.0.06,927
3.0.0-canary.116
3.0.0-canary.01
2.5.15,040
2.5.02,013
2.5.0-canary.30
2.5.0-canary.20
2.5.0-canary.10
2.5.0-canary.00
2.4.0175
2.4.0-canary.00
2.3.10
2.3.00
2.2.00
2.1.10
2.1.00
2.0.30
2.0.20
2.0.10
2.0.01
2.0.0-canary.70
2.0.0-canary.60
2.0.0-canary.40
2.0.0-canary.30
1.5.0643
1.4.00
1.3.00
1.2.1-canary.10
1.2.1-canary.00
1.2.0230
1.1.00
1.1.0-canary.00
1.0.18
1.0.1-canary.00
1.0.02
1.0.0-canary.80
1.0.0-canary.70
1.0.0-canary.60
1.0.0-canary.50
1.0.0-canary.30
1.0.0-canary.00
0.3.086
0.2.343
0.2.20
0.2.10
0.2.01
0.1.21
0.1.10
0.1.00
0.0.736
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i scaffdog

Weekly Downloads

37,568

Version

4.1.0

License

MIT

Unpacked Size

60.3 kB

Total Files

8

Last publish

Collaborators

  • wadackel