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(join7(input.sourceRoot, relativePath2), join7(input.targetDirectory, relativePath2));
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-windy",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "创建单组织、单租户、私有部署优先的 Windy 企业 Dashboard Starter",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "templateCommit": "978723871860407331aadc164a1d1ed937cd945c",
4
- "generatorVersion": "0.1.0",
3
+ "templateCommit": "be4b0cfbdc66c8c5b597b43c46e813925c950f13",
4
+ "generatorVersion": "0.1.1",
5
5
  "modules": [
6
6
  {
7
7
  "name": "system",
@@ -0,0 +1,7 @@
1
+ .env
2
+ .DS_Store
3
+ node_modules/
4
+ dist/
5
+ packages/create-windy/template/
6
+ .tmp/
7
+ *.tsbuildinfo
File without changes