create-typescript-app 2.7.1 → 2.7.3

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/base.d.ts CHANGED
@@ -9,16 +9,16 @@ declare const zContributor: z.ZodObject<{
9
9
  name: z.ZodString;
10
10
  profile: z.ZodString;
11
11
  }, "strip", z.ZodTypeAny, {
12
- name: string;
13
12
  avatar_url: string;
14
13
  contributions: string[];
15
14
  login: string;
15
+ name: string;
16
16
  profile: string;
17
17
  }, {
18
- name: string;
19
18
  avatar_url: string;
20
19
  contributions: string[];
21
20
  login: string;
21
+ name: string;
22
22
  profile: string;
23
23
  }>;
24
24
  type Contributor = z.infer<typeof zContributor>;
@@ -33,16 +33,16 @@ declare const base: bingo_stratum.Base<{
33
33
  name: z.ZodString;
34
34
  profile: z.ZodString;
35
35
  }, "strip", z.ZodTypeAny, {
36
- name: string;
37
36
  avatar_url: string;
38
37
  contributions: string[];
39
38
  login: string;
39
+ name: string;
40
40
  profile: string;
41
41
  }, {
42
- name: string;
43
42
  avatar_url: string;
44
43
  contributions: string[];
45
44
  login: string;
45
+ name: string;
46
46
  profile: string;
47
47
  }>, "many">>;
48
48
  description: z.ZodDefault<z.ZodString>;
@@ -84,11 +84,11 @@ declare const base: bingo_stratum.Base<{
84
84
  href: z.ZodString;
85
85
  title: z.ZodString;
86
86
  }, "strip", z.ZodTypeAny, {
87
- title: string;
88
87
  href: string;
89
- }, {
90
88
  title: string;
89
+ }, {
91
90
  href: string;
91
+ title: string;
92
92
  }>>;
93
93
  keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
94
94
  logo: z.ZodOptional<z.ZodObject<{
package/lib/base.js CHANGED
@@ -25,7 +25,6 @@ import { readNpmDefaults } from "./options/readNpmDefaults.js";
25
25
  import { readOwner } from "./options/readOwner.js";
26
26
  import { readPackageAuthor } from "./options/readPackageAuthor.js";
27
27
  import { readPackageData } from "./options/readPackageData.js";
28
- import { readPackageDataFull } from "./options/readPackageDataFull.js";
29
28
  import { readPnpm } from "./options/readPnpm.js";
30
29
  import { readRepository } from "./options/readRepository.js";
31
30
  import { readRulesetId } from "./options/readRulesetId.js";
@@ -101,19 +100,17 @@ const base = createBase({
101
100
  version: z.string().optional().describe("package version to publish as and store in `package.json`")
102
101
  },
103
102
  prepare({ options, take }) {
104
- const getAccess = lazyValue(
105
- async () => await readAccess(getPackageDataFull)
106
- );
103
+ const getAccess = lazyValue(async () => await readAccess(getPackageData));
107
104
  const getAllContributors = lazyValue(
108
105
  async () => await readAllContributors(take)
109
106
  );
110
107
  const getAuthor = lazyValue(
111
108
  async () => await readAuthor(getPackageAuthor, getNpmDefaults, options.owner)
112
109
  );
113
- const getBin = lazyValue(async () => (await getPackageDataFull()).bin);
110
+ const getBin = lazyValue(async () => (await getPackageData()).bin);
114
111
  const getEmoji = lazyValue(async () => await readEmoji(getDescription));
115
112
  const getDescription = lazyValue(
116
- async () => await readDescription(getPackageDataFull, getReadme)
113
+ async () => await readDescription(getPackageData, getReadme)
117
114
  );
118
115
  const getDocumentation = lazyValue(
119
116
  async () => await readDocumentation(take)
@@ -140,14 +137,9 @@ const base = createBase({
140
137
  const getGitDefaults = lazyValue(async () => await readGitDefaults(take));
141
138
  const getGuide = lazyValue(async () => await readGuide(take));
142
139
  const getLogo = lazyValue(async () => await readLogo(getReadme));
143
- const getPackageData = lazyValue(
144
- async () => await readPackageData(getPackageDataFull)
145
- );
146
- const getPackageDataFull = lazyValue(
147
- async () => await readPackageDataFull(take)
148
- );
140
+ const getPackageData = lazyValue(async () => await readPackageData(take));
149
141
  const getNode = lazyValue(
150
- async () => await readNode(getNvmrc, getPackageDataFull)
142
+ async () => await readNode(getNvmrc, getPackageData)
151
143
  );
152
144
  const getNpmDefaults = lazyValue(
153
145
  async () => await readNpmDefaults(getNpmWhoami)
@@ -164,14 +156,14 @@ const base = createBase({
164
156
  async () => await readOwner(take, getGitDefaults, getPackageAuthor)
165
157
  );
166
158
  const getPackageAuthor = lazyValue(
167
- async () => await readPackageAuthor(getPackageDataFull)
159
+ async () => await readPackageAuthor(getPackageData)
168
160
  );
169
- const getPnpm = lazyValue(async () => await readPnpm(getPackageDataFull));
161
+ const getPnpm = lazyValue(async () => await readPnpm(getPackageData));
170
162
  const getReadme = lazyValue(
171
163
  async () => await readFileSafe("README.md", "")
172
164
  );
173
165
  const getRepository = lazyValue(
174
- async () => await readRepository(getGitDefaults, getPackageDataFull, options)
166
+ async () => await readRepository(getGitDefaults, getPackageData, options)
175
167
  );
176
168
  const getRulesetId = lazyValue(
177
169
  async () => await readRulesetId(take, getOwner, getRepository)
@@ -182,9 +174,7 @@ const base = createBase({
182
174
  const getUsage = lazyValue(
183
175
  async () => await readUsage(getEmoji, getReadme, getRepository)
184
176
  );
185
- const getVersion = lazyValue(
186
- async () => (await getPackageDataFull()).version
187
- );
177
+ const getVersion = lazyValue(async () => (await getPackageData()).version);
188
178
  return {
189
179
  access: getAccess,
190
180
  author: getAuthor,
@@ -8,10 +8,10 @@ const blockESLintPackageJson = base.createBlock({
8
8
  return {
9
9
  addons: [
10
10
  blockESLint({
11
- extensions: ["packageJson"],
11
+ extensions: ["packageJson.configs.recommended"],
12
12
  imports: [
13
13
  {
14
- source: "eslint-plugin-package-json/configs/recommended",
14
+ source: "eslint-plugin-package-json",
15
15
  specifier: "packageJson"
16
16
  }
17
17
  ]
@@ -1,5 +1,6 @@
1
1
  import * as htmlToText from "html-to-text";
2
2
  import removeUndefinedObjects from "remove-undefined-objects";
3
+ import semver from "semver";
3
4
  import sortPackageJson from "sort-package-json";
4
5
  import { z } from "zod";
5
6
  import { PackageJson } from "zod-package-json";
@@ -14,14 +15,17 @@ const blockPackageJson = base.createBlock({
14
15
  properties: PackageJson.partial().default({})
15
16
  },
16
17
  produce({ addons, offline, options }) {
17
- const dependencies = {
18
+ const dependencies = useLargerVersions(options.packageData?.dependencies, {
18
19
  ...options.packageData?.dependencies,
19
20
  ...addons.properties.dependencies
20
- };
21
- const devDependencies = {
22
- ...options.packageData?.devDependencies,
23
- ...addons.properties.devDependencies
24
- };
21
+ });
22
+ const devDependencies = useLargerVersions(
23
+ options.packageData?.devDependencies,
24
+ {
25
+ ...options.packageData?.devDependencies,
26
+ ...addons.properties.devDependencies
27
+ }
28
+ );
25
29
  const description = htmlToText.convert(options.description, {
26
30
  wordwrap: false
27
31
  });
@@ -93,6 +97,26 @@ const blockPackageJson = base.createBlock({
93
97
  };
94
98
  }
95
99
  });
100
+ function removeRangePrefix(version) {
101
+ return version.replaceAll(/[\^~><=]/gu, "").split(" ")[0];
102
+ }
103
+ function useLargerVersion(existing, replacement) {
104
+ if (!existing) {
105
+ return replacement;
106
+ }
107
+ return semver.gt(removeRangePrefix(existing), removeRangePrefix(replacement)) ? existing : replacement;
108
+ }
109
+ function useLargerVersions(existing, replacements) {
110
+ if (!existing) {
111
+ return replacements;
112
+ }
113
+ return Object.fromEntries(
114
+ Object.entries(replacements).map(([key, replacement]) => [
115
+ key,
116
+ useLargerVersion(existing[key], replacement)
117
+ ])
118
+ );
119
+ }
96
120
  export {
97
121
  blockPackageJson
98
122
  };
@@ -1,5 +1,5 @@
1
1
  var name = "create-typescript-app";
2
- var version = "2.7.0";
2
+ var version = "2.7.2";
3
3
  var description = "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 🎁";
4
4
  var repository = {
5
5
  type: "git",
@@ -54,6 +54,7 @@ var dependencies = {
54
54
  "parse-package-name": "^1.0.0",
55
55
  "remove-dependencies": "^0.1.0",
56
56
  "remove-undefined-objects": "^6.0.0",
57
+ semver: "^7.7.1",
57
58
  "set-github-repository-labels": "^0.2.0",
58
59
  "sort-keys": "^5.1.0",
59
60
  "sort-package-json": "^3.0.0",
@@ -63,7 +64,7 @@ var dependencies = {
63
64
  };
64
65
  var devDependencies = {
65
66
  "@eslint-community/eslint-plugin-eslint-comments": "4.4.1",
66
- "@eslint/js": "9.21.0",
67
+ "@eslint/js": "9.22.0",
67
68
  "@prettier/sync": "^0.5.2",
68
69
  "@release-it/conventional-changelog": "10.0.0",
69
70
  "@types/eslint-plugin-markdown": "2.0.2",
@@ -71,9 +72,10 @@ var devDependencies = {
71
72
  "@types/html-to-text": "9.0.4",
72
73
  "@types/js-yaml": "4.0.9",
73
74
  "@types/lodash": "4.17.16",
74
- "@types/node": "22.13.9",
75
+ "@types/node": "22.13.10",
75
76
  "@types/parse-author": "2.0.3",
76
- "@vitest/coverage-v8": "3.0.7",
77
+ "@types/semver": "^7.5.8",
78
+ "@vitest/coverage-v8": "3.0.9",
77
79
  "@vitest/eslint-plugin": "1.1.38",
78
80
  "all-contributors-cli": "6.26.1",
79
81
  "bingo-requests": "^0.5.4",
@@ -81,18 +83,18 @@ var devDependencies = {
81
83
  "bingo-testers": "^0.5.6",
82
84
  "console-fail-test": "0.5.0",
83
85
  cspell: "8.17.5",
84
- eslint: "9.21.0",
85
- "eslint-plugin-jsdoc": "50.6.3",
86
+ eslint: "9.22.0",
87
+ "eslint-plugin-jsdoc": "50.6.8",
86
88
  "eslint-plugin-jsonc": "2.19.1",
87
89
  "eslint-plugin-markdown": "5.1.0",
88
90
  "eslint-plugin-n": "17.16.2",
89
- "eslint-plugin-package-json": "0.26.2",
90
- "eslint-plugin-perfectionist": "4.10.0",
91
+ "eslint-plugin-package-json": "0.29.0",
92
+ "eslint-plugin-perfectionist": "4.10.1",
91
93
  "eslint-plugin-regexp": "2.7.0",
92
94
  "eslint-plugin-yml": "1.17.0",
93
95
  husky: "9.1.7",
94
- knip: "5.45.0",
95
- "lint-staged": "15.4.3",
96
+ knip: "5.46.0",
97
+ "lint-staged": "15.5.0",
96
98
  lodash: "^4.17.21",
97
99
  markdownlint: "0.37.4",
98
100
  "markdownlint-cli": "0.44.0",
@@ -104,10 +106,10 @@ var devDependencies = {
104
106
  "sentences-per-line": "0.3.0",
105
107
  tsup: "8.4.0",
106
108
  typescript: "5.8.2",
107
- "typescript-eslint": "8.26.0",
108
- vitest: "3.0.7"
109
+ "typescript-eslint": "8.26.1",
110
+ vitest: "3.0.9"
109
111
  };
110
- var packageManager = "pnpm@10.6.0";
112
+ var packageManager = "pnpm@10.6.4";
111
113
  var engines = {
112
114
  node: ">=18.3.0"
113
115
  };
@@ -1,9 +1,6 @@
1
+ import { TakeInput } from 'bingo';
1
2
  import { PartialPackageData } from '../types.js';
2
3
 
3
- declare function readPackageData(getPackageDataFull: () => Promise<PartialPackageData>): Promise<{
4
- dependencies: Record<string, string> | undefined;
5
- devDependencies: Record<string, string> | undefined;
6
- scripts: Record<string, string> | undefined;
7
- }>;
4
+ declare function readPackageData(take: TakeInput): Promise<PartialPackageData>;
8
5
 
9
6
  export { readPackageData };
@@ -1,10 +1,11 @@
1
- async function readPackageData(getPackageDataFull) {
2
- const original = await getPackageDataFull();
3
- return {
4
- dependencies: original.dependencies,
5
- devDependencies: original.devDependencies,
6
- scripts: original.scripts
7
- };
1
+ import { inputFromFileJSON } from "input-from-file-json";
2
+ import { swallowError } from "../utils/swallowError.js";
3
+ async function readPackageData(take) {
4
+ return swallowError(
5
+ await take(inputFromFileJSON, {
6
+ filePath: "./package.json"
7
+ })
8
+ ) || {};
8
9
  }
9
10
  export {
10
11
  readPackageData
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-typescript-app",
3
- "version": "2.7.1",
3
+ "version": "2.7.3",
4
4
  "description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 🎁",
5
5
  "repository": {
6
6
  "type": "git",
@@ -58,6 +58,7 @@
58
58
  "parse-package-name": "^1.0.0",
59
59
  "remove-dependencies": "^0.1.0",
60
60
  "remove-undefined-objects": "^6.0.0",
61
+ "semver": "^7.7.1",
61
62
  "set-github-repository-labels": "^0.2.0",
62
63
  "sort-keys": "^5.1.0",
63
64
  "sort-package-json": "^3.0.0",
@@ -67,7 +68,7 @@
67
68
  },
68
69
  "devDependencies": {
69
70
  "@eslint-community/eslint-plugin-eslint-comments": "4.4.1",
70
- "@eslint/js": "9.21.0",
71
+ "@eslint/js": "9.22.0",
71
72
  "@prettier/sync": "^0.5.2",
72
73
  "@release-it/conventional-changelog": "10.0.0",
73
74
  "@types/eslint-plugin-markdown": "2.0.2",
@@ -75,9 +76,10 @@
75
76
  "@types/html-to-text": "9.0.4",
76
77
  "@types/js-yaml": "4.0.9",
77
78
  "@types/lodash": "4.17.16",
78
- "@types/node": "22.13.9",
79
+ "@types/node": "22.13.10",
79
80
  "@types/parse-author": "2.0.3",
80
- "@vitest/coverage-v8": "3.0.7",
81
+ "@types/semver": "^7.5.8",
82
+ "@vitest/coverage-v8": "3.0.9",
81
83
  "@vitest/eslint-plugin": "1.1.38",
82
84
  "all-contributors-cli": "6.26.1",
83
85
  "bingo-requests": "^0.5.4",
@@ -85,18 +87,18 @@
85
87
  "bingo-testers": "^0.5.6",
86
88
  "console-fail-test": "0.5.0",
87
89
  "cspell": "8.17.5",
88
- "eslint": "9.21.0",
89
- "eslint-plugin-jsdoc": "50.6.3",
90
+ "eslint": "9.22.0",
91
+ "eslint-plugin-jsdoc": "50.6.8",
90
92
  "eslint-plugin-jsonc": "2.19.1",
91
93
  "eslint-plugin-markdown": "5.1.0",
92
94
  "eslint-plugin-n": "17.16.2",
93
- "eslint-plugin-package-json": "0.26.2",
94
- "eslint-plugin-perfectionist": "4.10.0",
95
+ "eslint-plugin-package-json": "0.29.0",
96
+ "eslint-plugin-perfectionist": "4.10.1",
95
97
  "eslint-plugin-regexp": "2.7.0",
96
98
  "eslint-plugin-yml": "1.17.0",
97
99
  "husky": "9.1.7",
98
- "knip": "5.45.0",
99
- "lint-staged": "15.4.3",
100
+ "knip": "5.46.0",
101
+ "lint-staged": "15.5.0",
100
102
  "lodash": "^4.17.21",
101
103
  "markdownlint": "0.37.4",
102
104
  "markdownlint-cli": "0.44.0",
@@ -108,10 +110,10 @@
108
110
  "sentences-per-line": "0.3.0",
109
111
  "tsup": "8.4.0",
110
112
  "typescript": "5.8.2",
111
- "typescript-eslint": "8.26.0",
112
- "vitest": "3.0.7"
113
+ "typescript-eslint": "8.26.1",
114
+ "vitest": "3.0.9"
113
115
  },
114
- "packageManager": "pnpm@10.6.0",
116
+ "packageManager": "pnpm@10.6.4",
115
117
  "engines": {
116
118
  "node": ">=18.3.0"
117
119
  },
@@ -1,6 +0,0 @@
1
- import { TakeInput } from 'bingo';
2
- import { PartialPackageData } from '../types.js';
3
-
4
- declare function readPackageDataFull(take: TakeInput): Promise<PartialPackageData>;
5
-
6
- export { readPackageDataFull };
@@ -1,9 +0,0 @@
1
- import { inputFromFileJSON } from "input-from-file-json";
2
- async function readPackageDataFull(take) {
3
- return await take(inputFromFileJSON, {
4
- filePath: "./package.json"
5
- }) ?? {};
6
- }
7
- export {
8
- readPackageDataFull
9
- };