create-typescript-app 1.29.15 → 1.29.16

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/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  <a href="#contributors" target="_blank">
7
7
  <!-- prettier-ignore-start -->
8
8
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
9
- <img alt="All Contributors: 22 🤝" src="https://img.shields.io/badge/all_contributors-22_🤝-21bb42.svg" />
9
+ <img alt="All Contributors: 23 🤝" src="https://img.shields.io/badge/all_contributors-23_🤝-21bb42.svg" />
10
10
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
11
11
  <!-- prettier-ignore-end -->
12
12
  </a>
@@ -102,10 +102,11 @@ Thanks! 💖
102
102
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/RebeccaStevens"><img src="https://avatars.githubusercontent.com/u/7224206?v=4?s=100" width="100px;" alt="Rebecca Stevens"/><br /><sub><b>Rebecca Stevens</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=RebeccaStevens" title="Code">💻</a> <a href="#infra-RebeccaStevens" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
103
103
  <td align="center" valign="top" width="14.28%"><a href="https://linktr.ee/ronbraha"><img src="https://avatars.githubusercontent.com/u/45559220?v=4?s=100" width="100px;" alt="Ron Braha"/><br /><sub><b>Ron Braha</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=RNR1" title="Code">💻</a> <a href="#design-RNR1" title="Design">🎨</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=RNR1" title="Tests">⚠️</a></td>
104
104
  <td align="center" valign="top" width="14.28%"><a href="http://ronjeanfrancois.com"><img src="https://avatars.githubusercontent.com/u/105710107?v=4?s=100" width="100px;" alt="Ron Jean-Francois"/><br /><sub><b>Ron Jean-Francois</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=ronthetech" title="Code">💻</a> <a href="#infra-ronthetech" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
105
+ <td align="center" valign="top" width="14.28%"><a href="https://ryota-murakami.github.io/"><img src="https://avatars.githubusercontent.com/u/5501268?v=4?s=100" width="100px;" alt="Ryota Murakami"/><br /><sub><b>Ryota Murakami</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=ryota-murakami" title="Code">💻</a></td>
105
106
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/the-lazy-learner"><img src="https://avatars.githubusercontent.com/u/13695177?v=4?s=100" width="100px;" alt="Sudhansu"/><br /><sub><b>Sudhansu</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=the-lazy-learner" title="Code">💻</a></td>
106
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/tungbq"><img src="https://avatars.githubusercontent.com/u/85242618?v=4?s=100" width="100px;" alt="Tung Bui (Leo)"/><br /><sub><b>Tung Bui (Leo)</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=tungbq" title="Code">💻</a></td>
107
107
  </tr>
108
108
  <tr>
109
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/tungbq"><img src="https://avatars.githubusercontent.com/u/85242618?v=4?s=100" width="100px;" alt="Tung Bui (Leo)"/><br /><sub><b>Tung Bui (Leo)</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=tungbq" title="Code">💻</a></td>
109
110
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/TAKANOME-DEV"><img src="https://avatars.githubusercontent.com/u/79809121?v=4?s=100" width="100px;" alt="takanomedev"/><br /><sub><b>takanomedev</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=TAKANOME-DEV" title="Code">💻</a></td>
110
111
  </tr>
111
112
  </tbody>
@@ -1,3 +1,8 @@
1
- declare function getExistingEquivalentLabel(existingLabels: string[], outcomeLabel: string): string | undefined;
1
+ interface GhLabelData {
2
+ color: string;
3
+ description: string;
4
+ name: string;
5
+ }
6
+ declare function getExistingEquivalentLabel(existingLabels: GhLabelData[], outcomeLabel: string): GhLabelData | undefined;
2
7
 
3
- export { getExistingEquivalentLabel };
8
+ export { GhLabelData, getExistingEquivalentLabel };
@@ -4,8 +4,8 @@ const aliases = /* @__PURE__ */ new Map([
4
4
  ]);
5
5
  function getExistingEquivalentLabel(existingLabels, outcomeLabel) {
6
6
  const outcomeTrimmed = outcomeLabel.replace(/\w+: (\w+)/, "$1");
7
- return existingLabels.find((existingLabel) => {
8
- return existingLabel === outcomeLabel || existingLabel === outcomeTrimmed || aliases.get(existingLabel) === outcomeLabel || existingLabel.replace(/\w+: (\w+)/, "$1") === outcomeLabel;
7
+ return existingLabels.find(({ name: existingName }) => {
8
+ return existingName === outcomeLabel || existingName === outcomeTrimmed || aliases.get(existingName) === outcomeLabel || existingName.replace(/\w+: (\w+)/, "$1") === outcomeLabel;
9
9
  });
10
10
  }
11
11
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/steps/initializeGitHubRepository/labels/getExistingEquivalentLabel.ts"],"sourcesContent":["const aliases = new Map([\n\t[\"enhancement\", \"type: feature\"],\n\t[\"help wanted\", \"status: accepting prs\"],\n]);\n\nexport function getExistingEquivalentLabel(\n\texistingLabels: string[],\n\toutcomeLabel: string,\n) {\n\tconst outcomeTrimmed = outcomeLabel.replace(/\\w+: (\\w+)/, \"$1\");\n\n\treturn existingLabels.find((existingLabel) => {\n\t\treturn (\n\t\t\texistingLabel === outcomeLabel ||\n\t\t\texistingLabel === outcomeTrimmed ||\n\t\t\taliases.get(existingLabel) === outcomeLabel ||\n\t\t\texistingLabel.replace(/\\w+: (\\w+)/, \"$1\") === outcomeLabel\n\t\t);\n\t});\n}\n"],"mappings":"AAAA,MAAM,UAAU,oBAAI,IAAI;AAAA,EACvB,CAAC,eAAe,eAAe;AAAA,EAC/B,CAAC,eAAe,uBAAuB;AACxC,CAAC;AAEM,SAAS,2BACf,gBACA,cACC;AACD,QAAM,iBAAiB,aAAa,QAAQ,cAAc,IAAI;AAE9D,SAAO,eAAe,KAAK,CAAC,kBAAkB;AAC7C,WACC,kBAAkB,gBAClB,kBAAkB,kBAClB,QAAQ,IAAI,aAAa,MAAM,gBAC/B,cAAc,QAAQ,cAAc,IAAI,MAAM;AAAA,EAEhD,CAAC;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/steps/initializeGitHubRepository/labels/getExistingEquivalentLabel.ts"],"sourcesContent":["const aliases = new Map([\n\t[\"enhancement\", \"type: feature\"],\n\t[\"help wanted\", \"status: accepting prs\"],\n]);\n\nexport interface GhLabelData {\n\tcolor: string;\n\tdescription: string;\n\tname: string;\n}\n\nexport function getExistingEquivalentLabel(\n\texistingLabels: GhLabelData[],\n\toutcomeLabel: string,\n) {\n\tconst outcomeTrimmed = outcomeLabel.replace(/\\w+: (\\w+)/, \"$1\");\n\n\treturn existingLabels.find(({ name: existingName }) => {\n\t\treturn (\n\t\t\texistingName === outcomeLabel ||\n\t\t\texistingName === outcomeTrimmed ||\n\t\t\taliases.get(existingName) === outcomeLabel ||\n\t\t\texistingName.replace(/\\w+: (\\w+)/, \"$1\") === outcomeLabel\n\t\t);\n\t});\n}\n"],"mappings":"AAAA,MAAM,UAAU,oBAAI,IAAI;AAAA,EACvB,CAAC,eAAe,eAAe;AAAA,EAC/B,CAAC,eAAe,uBAAuB;AACxC,CAAC;AAQM,SAAS,2BACf,gBACA,cACC;AACD,QAAM,iBAAiB,aAAa,QAAQ,cAAc,IAAI;AAE9D,SAAO,eAAe,KAAK,CAAC,EAAE,MAAM,aAAa,MAAM;AACtD,WACC,iBAAiB,gBACjB,iBAAiB,kBACjB,QAAQ,IAAI,YAAY,MAAM,gBAC9B,aAAa,QAAQ,cAAc,IAAI,MAAM;AAAA,EAE/C,CAAC;AACF;","names":[]}
@@ -1,29 +1,25 @@
1
1
  import { $ } from "execa";
2
- import { getExistingEquivalentLabel } from "./getExistingEquivalentLabel.js";
2
+ import {
3
+ getExistingEquivalentLabel
4
+ } from "./getExistingEquivalentLabel.js";
3
5
  import { outcomeLabels } from "./outcomeLabels.js";
4
6
  async function initializeRepositoryLabels() {
5
- const getLabelName = (label) => label.name;
6
7
  const existingLabels = JSON.parse(
7
- (await $`gh label list --json name`).stdout || "[]"
8
- ).map(getLabelName);
9
- const allowedLabels = new Set(outcomeLabels.map(getLabelName));
8
+ (await $`gh label list --json color,description,name`).stdout || "[]"
9
+ );
10
10
  for (const outcome of outcomeLabels) {
11
11
  const existingEquivalent = getExistingEquivalentLabel(
12
12
  existingLabels,
13
13
  outcome.name
14
14
  );
15
15
  if (existingEquivalent) {
16
- allowedLabels.add(existingEquivalent);
17
- await $`gh label edit ${existingEquivalent} --color ${outcome.color} --description ${outcome.description} --name ${outcome.name}`;
16
+ if (outcome.color !== existingEquivalent.color || outcome.description !== existingEquivalent.description) {
17
+ await $`gh label edit ${existingEquivalent.name} --color ${outcome.color} --description ${outcome.description} --name ${outcome.name}`;
18
+ }
18
19
  } else {
19
20
  await $`gh label create ${outcome.name} --color ${outcome.color} --description ${outcome.description}`;
20
21
  }
21
22
  }
22
- for (const existingLabel of existingLabels) {
23
- if (!allowedLabels.has(existingLabel)) {
24
- await $`gh label delete ${existingLabel} --yes`;
25
- }
26
- }
27
23
  }
28
24
  export {
29
25
  initializeRepositoryLabels
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport { getExistingEquivalentLabel } from \"./getExistingEquivalentLabel.js\";\nimport { outcomeLabels } from \"./outcomeLabels.js\";\n\ninterface GhLabelData {\n\tname: string;\n}\n\nexport async function initializeRepositoryLabels() {\n\tconst getLabelName = (label: { name: string }) => label.name;\n\n\tconst existingLabels = (\n\t\tJSON.parse(\n\t\t\t(await $`gh label list --json name`).stdout || \"[]\",\n\t\t) as GhLabelData[]\n\t).map(getLabelName);\n\tconst allowedLabels = new Set(outcomeLabels.map(getLabelName));\n\n\tfor (const outcome of outcomeLabels) {\n\t\tconst existingEquivalent = getExistingEquivalentLabel(\n\t\t\texistingLabels,\n\t\t\toutcome.name,\n\t\t);\n\n\t\tif (existingEquivalent) {\n\t\t\tallowedLabels.add(existingEquivalent);\n\t\t\tawait $`gh label edit ${existingEquivalent} --color ${outcome.color} --description ${outcome.description} --name ${outcome.name}`;\n\t\t} else {\n\t\t\tawait $`gh label create ${outcome.name} --color ${outcome.color} --description ${outcome.description}`;\n\t\t}\n\t}\n\n\tfor (const existingLabel of existingLabels) {\n\t\tif (!allowedLabels.has(existingLabel)) {\n\t\t\tawait $`gh label delete ${existingLabel} --yes`;\n\t\t}\n\t}\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAElB,SAAS,kCAAkC;AAC3C,SAAS,qBAAqB;AAM9B,eAAsB,6BAA6B;AAClD,QAAM,eAAe,CAAC,UAA4B,MAAM;AAExD,QAAM,iBACL,KAAK;AAAA,KACH,MAAM,8BAA8B,UAAU;AAAA,EAChD,EACC,IAAI,YAAY;AAClB,QAAM,gBAAgB,IAAI,IAAI,cAAc,IAAI,YAAY,CAAC;AAE7D,aAAW,WAAW,eAAe;AACpC,UAAM,qBAAqB;AAAA,MAC1B;AAAA,MACA,QAAQ;AAAA,IACT;AAEA,QAAI,oBAAoB;AACvB,oBAAc,IAAI,kBAAkB;AACpC,YAAM,kBAAkB,kBAAkB,YAAY,QAAQ,KAAK,kBAAkB,QAAQ,WAAW,WAAW,QAAQ,IAAI;AAAA,IAChI,OAAO;AACN,YAAM,oBAAoB,QAAQ,IAAI,YAAY,QAAQ,KAAK,kBAAkB,QAAQ,WAAW;AAAA,IACrG;AAAA,EACD;AAEA,aAAW,iBAAiB,gBAAgB;AAC3C,QAAI,CAAC,cAAc,IAAI,aAAa,GAAG;AACtC,YAAM,oBAAoB,aAAa;AAAA,IACxC;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../src/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport {\n\tGhLabelData,\n\tgetExistingEquivalentLabel,\n} from \"./getExistingEquivalentLabel.js\";\nimport { outcomeLabels } from \"./outcomeLabels.js\";\n\nexport async function initializeRepositoryLabels() {\n\tconst existingLabels = JSON.parse(\n\t\t(await $`gh label list --json color,description,name`).stdout || \"[]\",\n\t) as GhLabelData[];\n\n\tfor (const outcome of outcomeLabels) {\n\t\tconst existingEquivalent = getExistingEquivalentLabel(\n\t\t\texistingLabels,\n\t\t\toutcome.name,\n\t\t);\n\n\t\tif (existingEquivalent) {\n\t\t\tif (\n\t\t\t\toutcome.color !== existingEquivalent.color ||\n\t\t\t\toutcome.description !== existingEquivalent.description\n\t\t\t) {\n\t\t\t\tawait $`gh label edit ${existingEquivalent.name} --color ${outcome.color} --description ${outcome.description} --name ${outcome.name}`;\n\t\t\t}\n\t\t} else {\n\t\t\tawait $`gh label create ${outcome.name} --color ${outcome.color} --description ${outcome.description}`;\n\t\t}\n\t}\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAElB;AAAA,EAEC;AAAA,OACM;AACP,SAAS,qBAAqB;AAE9B,eAAsB,6BAA6B;AAClD,QAAM,iBAAiB,KAAK;AAAA,KAC1B,MAAM,gDAAgD,UAAU;AAAA,EAClE;AAEA,aAAW,WAAW,eAAe;AACpC,UAAM,qBAAqB;AAAA,MAC1B;AAAA,MACA,QAAQ;AAAA,IACT;AAEA,QAAI,oBAAoB;AACvB,UACC,QAAQ,UAAU,mBAAmB,SACrC,QAAQ,gBAAgB,mBAAmB,aAC1C;AACD,cAAM,kBAAkB,mBAAmB,IAAI,YAAY,QAAQ,KAAK,kBAAkB,QAAQ,WAAW,WAAW,QAAQ,IAAI;AAAA,MACrI;AAAA,IACD,OAAO;AACN,YAAM,oBAAoB,QAAQ,IAAI,YAAY,QAAQ,KAAK,kBAAkB,QAAQ,WAAW;AAAA,IACrG;AAAA,EACD;AACD;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-typescript-app",
3
- "version": "1.29.15",
3
+ "version": "1.29.16",
4
4
  "description": "A quickstart-friendly TypeScript template with comprehensive formatting, linting, releases, testing, and other great tooling built-in. ✨",
5
5
  "repository": {
6
6
  "type": "git",