uetchy / create-create-app

⚡️ Create your own `create-something` app.
MIT License
96 stars 24 forks source link

Feature: Export copy function from template.ts for library use #66

Open aarondill opened 1 year ago

aarondill commented 1 year ago

The copy function defined in template.ts would be extremely helpful for more complicated create-app. This change could be made by a single addition in index.ts:

+ export { copy } from "./template";
aarondill commented 1 year ago

This would allow use cases such as my own:

import {copy} from 'create-create-app';
copy({
        sourceDir: globalTemplateDir,
        targetDir: packageDir,
        view: { ...answers, year, packageManager },
    });

In this example, I am creating a templates-global folder to store code that is the same between all of my templates, and I am calling copy to handle the handlebars execution.