3.0.0 ā€¢ Published 9 months ago

scaffdog v3.0.0

Weekly downloads
4,341
License
MIT
Repository
github
Last release
9 months ago

scaffdog

scaffdog

asciicast

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

Documentation

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

Features

  • :pencil: 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.
  • :spiral_notepad: 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.
  • :rocket: Ready to use
    • You can quickly start using $ scaffdog init.
    • Other useful commands are provided for immediate scaffolding.
  • :nail_care: 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 v16.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 :tada:

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 :+1:

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!

3.0.0

9 months ago

3.0.0-canary.1

9 months ago

3.0.0-canary.0

10 months ago

2.5.1

10 months ago

2.5.0-canary.0

1 year ago

2.5.0-canary.1

1 year ago

2.5.0-canary.2

1 year ago

2.5.0-canary.3

1 year ago

2.5.0

1 year ago

2.0.3

2 years ago

2.2.0

2 years ago

2.4.0

2 years ago

2.4.0-canary.0

2 years ago

2.3.0

2 years ago

2.1.1

2 years ago

2.3.1

2 years ago

2.1.0

2 years ago

1.2.1-canary.0

2 years ago

2.0.0-canary.7

2 years ago

2.0.0-canary.4

2 years ago

2.0.0-canary.3

2 years ago

2.0.0-canary.6

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

1.2.1-canary.1

2 years ago

2.0.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.1.0-canary.0

2 years ago

1.0.1

3 years ago

1.0.1-canary.0

3 years ago

1.0.0

3 years ago

1.0.0-canary.8

3 years ago

1.0.0-canary.7

3 years ago

1.0.0-canary.6

3 years ago

1.0.0-canary.5

3 years ago

1.0.0-canary.3

3 years ago

1.0.0-canary.0

3 years ago

0.3.0

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago