create-typescript-app 1.67.0 → 1.67.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.
|
@@ -112,12 +112,11 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
112
112
|
skipUninstall: z.ZodOptional<z.ZodBoolean>;
|
|
113
113
|
title: z.ZodOptional<z.ZodString>;
|
|
114
114
|
}, "strip", z.ZodTypeAny, {
|
|
115
|
-
mode?: "create" | "initialize" | "migrate" | undefined;
|
|
116
|
-
auto?: boolean | undefined;
|
|
117
|
-
offline?: boolean | undefined;
|
|
118
115
|
description?: string | undefined;
|
|
116
|
+
offline?: boolean | undefined;
|
|
119
117
|
access?: "public" | "restricted" | undefined;
|
|
120
118
|
author?: string | undefined;
|
|
119
|
+
auto?: boolean | undefined;
|
|
121
120
|
base?: "common" | "everything" | "minimal" | "prompt" | undefined;
|
|
122
121
|
bin?: string | undefined;
|
|
123
122
|
directory?: string | undefined;
|
|
@@ -129,6 +128,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
129
128
|
guide?: string | undefined;
|
|
130
129
|
keywords?: string[] | undefined;
|
|
131
130
|
logo?: string | undefined;
|
|
131
|
+
mode?: "create" | "initialize" | "migrate" | undefined;
|
|
132
132
|
owner?: string | undefined;
|
|
133
133
|
repository?: string | undefined;
|
|
134
134
|
title?: string | undefined;
|
|
@@ -161,12 +161,11 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
161
161
|
guideTitle?: string | undefined;
|
|
162
162
|
logoAlt?: string | undefined;
|
|
163
163
|
}, {
|
|
164
|
-
mode?: "create" | "initialize" | "migrate" | undefined;
|
|
165
|
-
auto?: boolean | undefined;
|
|
166
|
-
offline?: boolean | undefined;
|
|
167
164
|
description?: string | undefined;
|
|
165
|
+
offline?: boolean | undefined;
|
|
168
166
|
access?: "public" | "restricted" | undefined;
|
|
169
167
|
author?: string | undefined;
|
|
168
|
+
auto?: boolean | undefined;
|
|
170
169
|
base?: "common" | "everything" | "minimal" | "prompt" | undefined;
|
|
171
170
|
bin?: string | undefined;
|
|
172
171
|
directory?: string | undefined;
|
|
@@ -178,6 +177,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
178
177
|
guide?: string | undefined;
|
|
179
178
|
keywords?: string[] | undefined;
|
|
180
179
|
logo?: string | undefined;
|
|
180
|
+
mode?: "create" | "initialize" | "migrate" | undefined;
|
|
181
181
|
owner?: string | undefined;
|
|
182
182
|
repository?: string | undefined;
|
|
183
183
|
title?: string | undefined;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { existingBadgeMatcherCreators } from "./findExistingBadges.js";
|
|
2
2
|
function findIntroSectionClose(contents) {
|
|
3
|
+
const projectLogoMatch = /<img align="right" alt="Project logo.+" src=".+">/.exec(contents);
|
|
4
|
+
if (projectLogoMatch) {
|
|
5
|
+
return contents.indexOf("\n", projectLogoMatch.index) + 2;
|
|
6
|
+
}
|
|
3
7
|
const indexOfH2OrCodeBlock = contents.search(/## |<\s*h2|```/);
|
|
4
8
|
if (indexOfH2OrCodeBlock !== -1) {
|
|
5
9
|
return indexOfH2OrCodeBlock - 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/steps/writeReadme/findIntroSectionClose.ts"],"sourcesContent":["import { existingBadgeMatcherCreators } from \"./findExistingBadges.js\";\n\nexport function findIntroSectionClose(contents: string) {\n\t// Highest priority
|
|
1
|
+
{"version":3,"sources":["../../../src/steps/writeReadme/findIntroSectionClose.ts"],"sourcesContent":["import { existingBadgeMatcherCreators } from \"./findExistingBadges.js\";\n\nexport function findIntroSectionClose(contents: string) {\n\t// Highest priority: after an existing create-typescript-app-style logo\n\tconst projectLogoMatch =\n\t\t/<img align=\"right\" alt=\"Project logo.+\" src=\".+\">/.exec(contents);\n\tif (projectLogoMatch) {\n\t\treturn contents.indexOf(\"\\n\", projectLogoMatch.index) + 2;\n\t}\n\n\t// Next: before a first code block or h2, presumably following badges\n\tconst indexOfH2OrCodeBlock = contents.search(/## |<\\s*h2|```/);\n\n\tif (indexOfH2OrCodeBlock !== -1) {\n\t\treturn indexOfH2OrCodeBlock - 2;\n\t}\n\n\t// Failing those, if any badges are found, go after the last of them\n\tfor (const createMatcher of existingBadgeMatcherCreators) {\n\t\tconst lastMatch = [...contents.matchAll(createMatcher())].at(-1);\n\n\t\tif (lastMatch?.index) {\n\t\t\treturn lastMatch.index + lastMatch[0].length + 2;\n\t\t}\n\t}\n\n\t// Lastly, go for the second line altogether\n\treturn contents.indexOf(\"\\n\", 1) + 1;\n}\n"],"mappings":"AAAA,SAAS,oCAAoC;AAEtC,SAAS,sBAAsB,UAAkB;AAEvD,QAAM,mBACL,oDAAoD,KAAK,QAAQ;AAClE,MAAI,kBAAkB;AACrB,WAAO,SAAS,QAAQ,MAAM,iBAAiB,KAAK,IAAI;AAAA,EACzD;AAGA,QAAM,uBAAuB,SAAS,OAAO,gBAAgB;AAE7D,MAAI,yBAAyB,IAAI;AAChC,WAAO,uBAAuB;AAAA,EAC/B;AAGA,aAAW,iBAAiB,8BAA8B;AACzD,UAAM,YAAY,CAAC,GAAG,SAAS,SAAS,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE;AAE/D,QAAI,WAAW,OAAO;AACrB,aAAO,UAAU,QAAQ,UAAU,CAAC,EAAE,SAAS;AAAA,IAChD;AAAA,EACD;AAGA,SAAO,SAAS,QAAQ,MAAM,CAAC,IAAI;AACpC;","names":[]}
|