create-windy 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js
CHANGED
|
@@ -1307,6 +1307,10 @@ var templatePaths = [
|
|
|
1307
1307
|
...templateDirectories,
|
|
1308
1308
|
...templateDocumentationFiles
|
|
1309
1309
|
];
|
|
1310
|
+
var npmTemplateAliases = {
|
|
1311
|
+
".gitignore": "_gitignore",
|
|
1312
|
+
"bunfig.toml": "_bunfig.toml"
|
|
1313
|
+
};
|
|
1310
1314
|
function generationTemplatePaths(includeExample, includeOxc = true) {
|
|
1311
1315
|
return templatePaths.filter((path) => (includeExample || path !== "packages/example-work-order") && (includeOxc || path !== ".oxfmtrc.json" && path !== ".oxlintrc.json"));
|
|
1312
1316
|
}
|
|
@@ -1392,7 +1396,7 @@ async function generateProject(input) {
|
|
|
1392
1396
|
const templateMetadata = await readTemplateMetadata(input.sourceRoot);
|
|
1393
1397
|
const selectedModules = input.selectedModules ?? templateMetadata.modules.filter(({ name }) => includeExample || name !== "work-order").map(({ name }) => name);
|
|
1394
1398
|
for (const relativePath2 of generationTemplatePaths(true, includeOxc)) {
|
|
1395
|
-
await copyTree(
|
|
1399
|
+
await copyTree(await resolveTemplateSource(input.sourceRoot, relativePath2), join7(input.targetDirectory, relativePath2));
|
|
1396
1400
|
}
|
|
1397
1401
|
await materializeSelectedModules(input.targetDirectory, selectedModules);
|
|
1398
1402
|
const packagePath = join7(input.targetDirectory, "package.json");
|
|
@@ -1410,6 +1414,20 @@ async function generateProject(input) {
|
|
|
1410
1414
|
await rm3(join7(input.targetDirectory, "bun.lock"), { force: true });
|
|
1411
1415
|
await writeManagedFilesManifest(input.targetDirectory, templateMetadata.generatorVersion);
|
|
1412
1416
|
}
|
|
1417
|
+
async function resolveTemplateSource(sourceRoot, relativePath2) {
|
|
1418
|
+
const source = join7(sourceRoot, relativePath2);
|
|
1419
|
+
try {
|
|
1420
|
+
await lstat3(source);
|
|
1421
|
+
return source;
|
|
1422
|
+
} catch (error) {
|
|
1423
|
+
if (!isMissing2(error))
|
|
1424
|
+
throw error;
|
|
1425
|
+
}
|
|
1426
|
+
const alias = npmTemplateAliases[relativePath2];
|
|
1427
|
+
if (!alias)
|
|
1428
|
+
return source;
|
|
1429
|
+
return join7(sourceRoot, alias);
|
|
1430
|
+
}
|
|
1413
1431
|
async function assertGeneratedProjectIsClean(targetDirectory) {
|
|
1414
1432
|
const violations = [];
|
|
1415
1433
|
await walk(targetDirectory, async (path) => {
|
package/package.json
CHANGED
|
File without changes
|