# @scaffdog/types

> scaffdog's type declarations.

Latest version **4.1.0** (published 2024-09-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @scaffdog/types
pnpm add @scaffdog/types
yarn add @scaffdog/types
bun add @scaffdog/types
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.1.0 |
| Published | 2024-09-16 |
| First published | 2021-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | wadackel |
| Maintainers | wadackel |
| Keywords | scaffdog, markdown, template |

## Links

- npm: https://www.npmjs.com/package/@scaffdog/types
- Repository: https://github.com/scaffdog/scaffdog
- Homepage: https://github.com/scaffdog/scaffdog/tree/main/packages/@scaffdog/types
- Issues: https://github.com/scaffdog/scaffdog/issues
- npm.io page: https://npm.io/package/@scaffdog/types

## Dependencies (1)

- [type-fest](https://npm.io/package/type-fest.md) 4.26.1

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 4.1.0 (latest) — 2024-09-16
- 3.0.0-canary.1 (canary) — 2023-07-17
- 4.0.0 — 2024-04-28
- 3.0.0 — 2023-07-30
- 3.0.0-canary.0 — 2023-07-15
- 2.5.1 — 2023-06-25
- 2.5.0 — 2023-02-25
- 2.5.0-canary.3 — 2023-02-25
- 2.5.0-canary.2 — 2023-02-25
- 2.5.0-canary.1 — 2023-02-23
- 2.5.0-canary.0 — 2023-02-19
- 2.4.0 — 2022-09-25
- 2.4.0-canary.0 — 2022-09-24
- 2.3.1 — 2022-09-22
- 2.3.0 — 2022-09-20
- … 29 more at https://npm.io/package/@scaffdog/types/versions

## README

![scaffdog](https://github.com/scaffdog/artwork/raw/main/repo-banner.png)

<p align="center">
  scaffdog is Markdown driven scaffolding tool.
</p>

<p align="center">
  <a href="https://github.com/scaffdog/scaffdog/actions?workflow=CI"><img src="https://img.shields.io/github/actions/workflow/status/scaffdog/scaffdog/ci.yml?branch=canary&logo=github&style=flat-square" alt="GitHub Workflow Status" /></a>
  <a href="https://npmcharts.com/compare/scaffdog?minimal=true"><img alt="npm" src="https://img.shields.io/npm/dm/scaffdog?style=flat-square"></a>
  <a href="https://www.npmjs.com/package/scaffdog"><img src="https://img.shields.io/npm/v/scaffdog?style=flat-square" alt="npm" /></a>
  <a href="./LICENSE"><img src="https://img.shields.io/github/license/scaffdog/scaffdog?label=license&style=flat-square" alt="MIT LICENSE" /></a>
</p>

# scaffdog

[![asciicast](https://asciinema.org/a/Az6hGIB1NWBZlKs3hhpYYu3XX.svg)](https://asciinema.org/a/Az6hGIB1NWBZlKs3hhpYYu3XX)

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](https://jekyllrb.com/docs/front-matter/).
- :spiral_notepad: **Intuitive template**
  - It provides a simple yet powerful template engine inspired by [ECMAScript](https://tc39.es/ecma262/) and [Go text/template](https://pkg.go.dev/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 v18.0.0+

## Getting Started

### Installation

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

```bash
$ 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.

```bash
$ 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:

````markdown
---
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!

```bash
$ 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.

```bash
$ 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](https://scaff.dog/docs/templates) to customize your documentation :+1:

## Migration

There are important changes in the major update.

- [To v4 from v3](/MIGRATION.md#to-v4-from-v3)
- [To v3 from v2](/MIGRATION.md#to-v3-from-v2)
- [To v2 from v1](/MIGRATION.md#to-v2-from-v1)
- [To v1 from v0](/MIGRATION.md#to-v1-from-v0)

See [Migration Guide](/MIGRATION.md).

## Contributing

See [CONTRIBUTING.md](/CONTRIBUTING.md).

## CHANGELOG

See [CHANGELOG.md](/packages/scaffdog/CHANGELOG.md).

## License

[MIT © wadackel](/LICENSE)

![Thank you for reading!](https://github.com/scaffdog/artwork/raw/main/repo-footer.png)

---
_Source: https://npm.io/package/@scaffdog/types · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
