create-typescript-app 1.29.26 → 1.29.28
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/lib/migrate/migrateWithOptions.js +1 -1
- package/lib/migrate/migrateWithOptions.js.map +1 -1
- package/lib/steps/detectExistingContributors.d.ts +3 -1
- package/lib/steps/detectExistingContributors.js +3 -3
- package/lib/steps/detectExistingContributors.js.map +1 -1
- package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabels.d.ts +8 -0
- package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabels.js +14 -0
- package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabels.js.map +1 -0
- package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js +14 -8
- package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js.map +1 -1
- package/package.json +1 -1
- package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabel.d.ts +0 -8
- package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabel.js +0 -14
- package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabel.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/migrate/migrateWithOptions.ts"],"sourcesContent":["import { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { OctokitAndOptions } from \"../shared/options/readOptions.js\";\nimport { clearUnnecessaryFiles } from \"../steps/clearUnnecessaryFiles.js\";\nimport { detectExistingContributors } from \"../steps/detectExistingContributors.js\";\nimport { finalizeDependencies } from \"../steps/finalizeDependencies.js\";\nimport { initializeGitHubRepository } from \"../steps/initializeGitHubRepository/index.js\";\nimport { runCommands } from \"../steps/runCommands.js\";\nimport { updateAllContributorsTable } from \"../steps/updateAllContributorsTable.js\";\nimport { updateLocalFiles } from \"../steps/updateLocalFiles.js\";\nimport { writeReadme } from \"../steps/writeReadme.js\";\nimport { writeStructure } from \"../steps/writing/writeStructure.js\";\n\nexport async function migrateWithOptions({\n\toctokit,\n\toptions,\n}: OctokitAndOptions) {\n\tawait withSpinners(\"Migrating repository structure\", [\n\t\t[\"Clearing unnecessary files\", clearUnnecessaryFiles],\n\t\t[\n\t\t\t\"Writing structure\",\n\t\t\tasync () => {\n\t\t\t\tawait writeStructure(options);\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\t\"Writing README.md\",\n\t\t\tasync () => {\n\t\t\t\tawait writeReadme(options);\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\t\"Updating local files\",\n\t\t\tasync () => {\n\t\t\t\tawait updateLocalFiles(options);\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\t\"Updating all-contributors table\",\n\t\t\tasync () => {\n\t\t\t\tawait updateAllContributorsTable(options);\n\t\t\t},\n\t\t],\n\t]);\n\n\tif (octokit) {\n\t\tawait withSpinner(\"Initializing GitHub repository\", async () => {\n\t\t\tawait initializeGitHubRepository(octokit, options);\n\t\t});\n\t}\n\n\tif (!options.excludeContributors) {\n\t\tawait withSpinner(\
|
|
1
|
+
{"version":3,"sources":["../../src/migrate/migrateWithOptions.ts"],"sourcesContent":["import { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { OctokitAndOptions } from \"../shared/options/readOptions.js\";\nimport { clearUnnecessaryFiles } from \"../steps/clearUnnecessaryFiles.js\";\nimport { detectExistingContributors } from \"../steps/detectExistingContributors.js\";\nimport { finalizeDependencies } from \"../steps/finalizeDependencies.js\";\nimport { initializeGitHubRepository } from \"../steps/initializeGitHubRepository/index.js\";\nimport { runCommands } from \"../steps/runCommands.js\";\nimport { updateAllContributorsTable } from \"../steps/updateAllContributorsTable.js\";\nimport { updateLocalFiles } from \"../steps/updateLocalFiles.js\";\nimport { writeReadme } from \"../steps/writeReadme.js\";\nimport { writeStructure } from \"../steps/writing/writeStructure.js\";\n\nexport async function migrateWithOptions({\n\toctokit,\n\toptions,\n}: OctokitAndOptions) {\n\tawait withSpinners(\"Migrating repository structure\", [\n\t\t[\"Clearing unnecessary files\", clearUnnecessaryFiles],\n\t\t[\n\t\t\t\"Writing structure\",\n\t\t\tasync () => {\n\t\t\t\tawait writeStructure(options);\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\t\"Writing README.md\",\n\t\t\tasync () => {\n\t\t\t\tawait writeReadme(options);\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\t\"Updating local files\",\n\t\t\tasync () => {\n\t\t\t\tawait updateLocalFiles(options);\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\t\"Updating all-contributors table\",\n\t\t\tasync () => {\n\t\t\t\tawait updateAllContributorsTable(options);\n\t\t\t},\n\t\t],\n\t]);\n\n\tif (octokit) {\n\t\tawait withSpinner(\"Initializing GitHub repository\", async () => {\n\t\t\tawait initializeGitHubRepository(octokit, options);\n\t\t});\n\t}\n\n\tif (!options.excludeContributors) {\n\t\tawait withSpinner(\"Detecting existing contributors\", async () =>\n\t\t\tdetectExistingContributors(options),\n\t\t);\n\t}\n\n\tif (!options.skipInstall) {\n\t\tawait withSpinner(\"Installing packages\", async () =>\n\t\t\tfinalizeDependencies(options),\n\t\t);\n\t}\n\n\tawait runCommands(\"Cleaning up files\", [\n\t\t\"pnpm lint --fix\",\n\t\t\"pnpm format --write\",\n\t]);\n}\n"],"mappings":"AAAA,SAAS,aAAa,oBAAoB;AAE1C,SAAS,6BAA6B;AACtC,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AACrC,SAAS,kCAAkC;AAC3C,SAAS,mBAAmB;AAC5B,SAAS,kCAAkC;AAC3C,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAE/B,eAAsB,mBAAmB;AAAA,EACxC;AAAA,EACA;AACD,GAAsB;AACrB,QAAM,aAAa,kCAAkC;AAAA,IACpD,CAAC,8BAA8B,qBAAqB;AAAA,IACpD;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,eAAe,OAAO;AAAA,MAC7B;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,YAAY,OAAO;AAAA,MAC1B;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,iBAAiB,OAAO;AAAA,MAC/B;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,2BAA2B,OAAO;AAAA,MACzC;AAAA,IACD;AAAA,EACD,CAAC;AAED,MAAI,SAAS;AACZ,UAAM,YAAY,kCAAkC,YAAY;AAC/D,YAAM,2BAA2B,SAAS,OAAO;AAAA,IAClD,CAAC;AAAA,EACF;AAEA,MAAI,CAAC,QAAQ,qBAAqB;AACjC,UAAM;AAAA,MAAY;AAAA,MAAmC,YACpD,2BAA2B,OAAO;AAAA,IACnC;AAAA,EACD;AAEA,MAAI,CAAC,QAAQ,aAAa;AACzB,UAAM;AAAA,MAAY;AAAA,MAAuB,YACxC,qBAAqB,OAAO;AAAA,IAC7B;AAAA,EACD;AAEA,QAAM,YAAY,qBAAqB;AAAA,IACtC;AAAA,IACA;AAAA,EACD,CAAC;AACF;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getAllContributorsForRepository } from "all-contributors-for-repository";
|
|
2
2
|
import { $ } from "execa";
|
|
3
|
-
async function detectExistingContributors() {
|
|
3
|
+
async function detectExistingContributors(options) {
|
|
4
4
|
const contributors = await getAllContributorsForRepository({
|
|
5
|
-
owner:
|
|
6
|
-
repo:
|
|
5
|
+
owner: options.owner,
|
|
6
|
+
repo: options.repository
|
|
7
7
|
});
|
|
8
8
|
for (const [contributor, contributions] of Object.entries(contributors)) {
|
|
9
9
|
const contributionTypes = Object.keys(contributions).join(",");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/detectExistingContributors.ts"],"sourcesContent":["import { getAllContributorsForRepository } from \"all-contributors-for-repository\";\nimport { $ } from \"execa\";\n\nexport async function detectExistingContributors() {\n\tconst contributors = await getAllContributorsForRepository({\n\t\towner:
|
|
1
|
+
{"version":3,"sources":["../../src/steps/detectExistingContributors.ts"],"sourcesContent":["import { getAllContributorsForRepository } from \"all-contributors-for-repository\";\nimport { $ } from \"execa\";\n\nimport { Options } from \"../shared/types.js\";\n\nexport async function detectExistingContributors(\n\toptions: Pick<Options, \"owner\" | \"repository\">,\n) {\n\tconst contributors = await getAllContributorsForRepository({\n\t\towner: options.owner,\n\t\trepo: options.repository,\n\t});\n\n\tfor (const [contributor, contributions] of Object.entries(contributors)) {\n\t\tconst contributionTypes = Object.keys(contributions).join(\",\");\n\t\tawait $`npx -y all-contributors-cli add ${contributor} ${contributionTypes}`;\n\t}\n}\n"],"mappings":"AAAA,SAAS,uCAAuC;AAChD,SAAS,SAAS;AAIlB,eAAsB,2BACrB,SACC;AACD,QAAM,eAAe,MAAM,gCAAgC;AAAA,IAC1D,OAAO,QAAQ;AAAA,IACf,MAAM,QAAQ;AAAA,EACf,CAAC;AAED,aAAW,CAAC,aAAa,aAAa,KAAK,OAAO,QAAQ,YAAY,GAAG;AACxE,UAAM,oBAAoB,OAAO,KAAK,aAAa,EAAE,KAAK,GAAG;AAC7D,UAAM,oCAAoC,WAAW,IAAI,iBAAiB;AAAA,EAC3E;AACD;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const aliases = /* @__PURE__ */ new Map([
|
|
2
|
+
["enhancement", "type: feature"],
|
|
3
|
+
["help wanted", "status: accepting prs"]
|
|
4
|
+
]);
|
|
5
|
+
function getExistingEquivalentLabels(existingLabels, outcomeLabelName) {
|
|
6
|
+
const outcomeTrimmed = outcomeLabelName.replace(/\w+: (\w+)/, "$1");
|
|
7
|
+
return existingLabels.filter(({ name: existingName }) => {
|
|
8
|
+
return existingName === outcomeLabelName || existingName === outcomeTrimmed || aliases.get(existingName) === outcomeLabelName || existingName.replace(/\w+: (\w+)/, "$1") === outcomeLabelName;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
getExistingEquivalentLabels
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=getExistingEquivalentLabels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/initializeGitHubRepository/labels/getExistingEquivalentLabels.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 getExistingEquivalentLabels(\n\texistingLabels: GhLabelData[],\n\toutcomeLabelName: string,\n) {\n\tconst outcomeTrimmed = outcomeLabelName.replace(/\\w+: (\\w+)/, \"$1\");\n\n\treturn existingLabels.filter(({ name: existingName }) => {\n\t\treturn (\n\t\t\texistingName === outcomeLabelName ||\n\t\t\texistingName === outcomeTrimmed ||\n\t\t\taliases.get(existingName) === outcomeLabelName ||\n\t\t\texistingName.replace(/\\w+: (\\w+)/, \"$1\") === outcomeLabelName\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,4BACf,gBACA,kBACC;AACD,QAAM,iBAAiB,iBAAiB,QAAQ,cAAc,IAAI;AAElE,SAAO,eAAe,OAAO,CAAC,EAAE,MAAM,aAAa,MAAM;AACxD,WACC,iBAAiB,oBACjB,iBAAiB,kBACjB,QAAQ,IAAI,YAAY,MAAM,oBAC9B,aAAa,QAAQ,cAAc,IAAI,MAAM;AAAA,EAE/C,CAAC;AACF;","names":[]}
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import { $ } from "execa";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./
|
|
3
|
+
getExistingEquivalentLabels
|
|
4
|
+
} from "./getExistingEquivalentLabels.js";
|
|
5
5
|
import { outcomeLabels } from "./outcomeLabels.js";
|
|
6
6
|
async function initializeRepositoryLabels() {
|
|
7
7
|
const existingLabels = JSON.parse(
|
|
8
8
|
(await $`gh label list --json color,description,name`).stdout || "[]"
|
|
9
9
|
);
|
|
10
10
|
for (const outcome of outcomeLabels) {
|
|
11
|
-
const
|
|
11
|
+
const existingEquivalents = getExistingEquivalentLabels(
|
|
12
12
|
existingLabels,
|
|
13
13
|
outcome.name
|
|
14
14
|
);
|
|
15
|
-
if (
|
|
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
|
-
}
|
|
19
|
-
} else {
|
|
15
|
+
if (!existingEquivalents.length) {
|
|
20
16
|
await $`gh label create ${outcome.name} --color ${outcome.color} --description ${outcome.description}`;
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
for (const existingEquivalent of existingEquivalents) {
|
|
20
|
+
if (existingEquivalent.name !== outcome.name && existingLabels.some((existing) => existing.name === outcome.name)) {
|
|
21
|
+
await $`gh label delete ${existingEquivalent.name} --yes`;
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (outcome.color !== existingEquivalent.color || outcome.description !== existingEquivalent.description || outcome.name !== existingEquivalent.name) {
|
|
25
|
+
await $`gh label edit ${existingEquivalent.name} --color ${outcome.color} --description ${outcome.description} --name ${outcome.name} --yes`;
|
|
26
|
+
}
|
|
21
27
|
}
|
|
22
28
|
}
|
|
23
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport {\n\tGhLabelData,\n\
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport {\n\tGhLabelData,\n\tgetExistingEquivalentLabels,\n} from \"./getExistingEquivalentLabels.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 existingEquivalents = getExistingEquivalentLabels(\n\t\t\texistingLabels,\n\t\t\toutcome.name,\n\t\t);\n\n\t\t// Case: the repo has neither of the two label types\n\t\tif (!existingEquivalents.length) {\n\t\t\tawait $`gh label create ${outcome.name} --color ${outcome.color} --description ${outcome.description}`;\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (const existingEquivalent of existingEquivalents) {\n\t\t\t// Case: the repo already has both prefixed and non-prefixed label name types\n\t\t\t// E.g. both \"area: documentation\" and \"documentation\"\n\t\t\tif (\n\t\t\t\texistingEquivalent.name !== outcome.name &&\n\t\t\t\texistingLabels.some((existing) => existing.name === outcome.name)\n\t\t\t) {\n\t\t\t\tawait $`gh label delete ${existingEquivalent.name} --yes`;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Case: the repo has one of the two label types, with >=1 different property\n\t\t\t// E.g. \"documentation\" and the same color and description\n\t\t\t// E.g. \"area: documentation\" but with a different color\n\t\t\tif (\n\t\t\t\toutcome.color !== existingEquivalent.color ||\n\t\t\t\toutcome.description !== existingEquivalent.description ||\n\t\t\t\toutcome.name !== existingEquivalent.name\n\t\t\t) {\n\t\t\t\tawait $`gh label edit ${existingEquivalent.name} --color ${outcome.color} --description ${outcome.description} --name ${outcome.name} --yes`;\n\t\t\t}\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,sBAAsB;AAAA,MAC3B;AAAA,MACA,QAAQ;AAAA,IACT;AAGA,QAAI,CAAC,oBAAoB,QAAQ;AAChC,YAAM,oBAAoB,QAAQ,IAAI,YAAY,QAAQ,KAAK,kBAAkB,QAAQ,WAAW;AACpG;AAAA,IACD;AAEA,eAAW,sBAAsB,qBAAqB;AAGrD,UACC,mBAAmB,SAAS,QAAQ,QACpC,eAAe,KAAK,CAAC,aAAa,SAAS,SAAS,QAAQ,IAAI,GAC/D;AACD,cAAM,oBAAoB,mBAAmB,IAAI;AACjD;AAAA,MACD;AAKA,UACC,QAAQ,UAAU,mBAAmB,SACrC,QAAQ,gBAAgB,mBAAmB,eAC3C,QAAQ,SAAS,mBAAmB,MACnC;AACD,cAAM,kBAAkB,mBAAmB,IAAI,YAAY,QAAQ,KAAK,kBAAkB,QAAQ,WAAW,WAAW,QAAQ,IAAI;AAAA,MACrI;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-typescript-app",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.28",
|
|
4
4
|
"description": "Quickstart-friendly TypeScript template with comprehensive formatting, linting, releases, testing, and other great tooling built-in. ✨",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const aliases = /* @__PURE__ */ new Map([
|
|
2
|
-
["enhancement", "type: feature"],
|
|
3
|
-
["help wanted", "status: accepting prs"]
|
|
4
|
-
]);
|
|
5
|
-
function getExistingEquivalentLabel(existingLabels, outcomeLabel) {
|
|
6
|
-
const outcomeTrimmed = outcomeLabel.replace(/\w+: (\w+)/, "$1");
|
|
7
|
-
return existingLabels.find(({ name: existingName }) => {
|
|
8
|
-
return existingName === outcomeLabel || existingName === outcomeTrimmed || aliases.get(existingName) === outcomeLabel || existingName.replace(/\w+: (\w+)/, "$1") === outcomeLabel;
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
getExistingEquivalentLabel
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=getExistingEquivalentLabel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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":[]}
|