create-create-app icon indicating copy to clipboard operation
create-create-app copied to clipboard

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

Open aarondill opened this issue 2 years ago • 1 comments

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 avatar Feb 17 '23 17:02 aarondill

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.

aarondill avatar Feb 17 '23 17:02 aarondill