@book000/create-ts 0.1.56 → 0.1.57

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/index.mjs CHANGED
@@ -73,8 +73,8 @@ function patchTsConfig(tsconfig, options) {
73
73
  */
74
74
  function patchDockerWorkflow(content, org, repo) {
75
75
  let result = content;
76
- result = result.replaceAll("tomacheese/twitter-dm-memo", `${org.toLowerCase()}/${repo.toLowerCase()}`);
77
- result = result.replaceAll("packageName: \"twitter-dm-memo\"", `packageName: "${repo}"`);
76
+ result = result.replaceAll("tomacheese/twitter-dm-memo", () => `${org.toLowerCase()}/${repo.toLowerCase()}`);
77
+ result = result.replaceAll("packageName: \"twitter-dm-memo\"", () => `packageName: "${repo}"`);
78
78
  return result;
79
79
  }
80
80
  /**
@@ -325,7 +325,7 @@ function displaySummary(options) {
325
325
  */
326
326
  async function confirmOverwrite(outDir) {
327
327
  const confirmed = await confirm({ message: `${outDir} に既存のファイルがあります。上書きしますか?` });
328
- if (isCancel(confirmed) || !confirmed) {
328
+ if (!confirmed || isCancel(confirmed)) {
329
329
  cancel("セットアップを中断しました");
330
330
  process.exit(0);
331
331
  }
@@ -444,7 +444,7 @@ async function main() {
444
444
  try {
445
445
  const licenseRes = await fetch(`https://api.github.com/licenses/${options.license.toLowerCase()}`);
446
446
  if (!licenseRes.ok) throw new Error(`HTTP ${licenseRes.status}`);
447
- const licenseText = (await licenseRes.json()).body.replaceAll("[year]", String((/* @__PURE__ */ new Date()).getFullYear())).replaceAll("[fullname]", options.author);
447
+ const licenseText = (await licenseRes.json()).body.replaceAll("[year]", () => String((/* @__PURE__ */ new Date()).getFullYear())).replaceAll("[fullname]", () => options.author);
448
448
  writeFileSync(path.join(outDir, "LICENSE"), licenseText, "utf8");
449
449
  s.stop("LICENSE を生成しました");
450
450
  } catch {
@@ -57,8 +57,8 @@ export function patchTsConfig(tsconfig, options) {
57
57
  */
58
58
  export function patchDockerWorkflow(content, org, repo) {
59
59
  let result = content;
60
- result = result.replaceAll('tomacheese/twitter-dm-memo', `${org.toLowerCase()}/${repo.toLowerCase()}`);
61
- result = result.replaceAll('packageName: "twitter-dm-memo"', `packageName: "${repo}"`);
60
+ result = result.replaceAll('tomacheese/twitter-dm-memo', () => `${org.toLowerCase()}/${repo.toLowerCase()}`);
61
+ result = result.replaceAll('packageName: "twitter-dm-memo"', () => `packageName: "${repo}"`);
62
62
  return result;
63
63
  }
64
64
  /**
package/dist/src/index.js CHANGED
@@ -177,8 +177,8 @@ async function main() {
177
177
  throw new Error(`HTTP ${licenseRes.status}`);
178
178
  const licenseJson = (await licenseRes.json());
179
179
  const licenseText = licenseJson.body
180
- .replaceAll('[year]', String(new Date().getFullYear()))
181
- .replaceAll('[fullname]', options.author);
180
+ .replaceAll('[year]', () => String(new Date().getFullYear()))
181
+ .replaceAll('[fullname]', () => options.author);
182
182
  writeFileSync(path.join(outDir, 'LICENSE'), licenseText, 'utf8');
183
183
  s.stop('LICENSE を生成しました');
184
184
  }
@@ -227,7 +227,7 @@ export async function confirmOverwrite(outDir) {
227
227
  const confirmed = await confirm({
228
228
  message: `${outDir} に既存のファイルがあります。上書きしますか?`,
229
229
  });
230
- if (isCancel(confirmed) || !confirmed) {
230
+ if (!confirmed || isCancel(confirmed)) {
231
231
  cancel('セットアップを中断しました');
232
232
  // eslint-disable-next-line unicorn/no-process-exit
233
233
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@book000/create-ts",
3
- "version": "0.1.56",
3
+ "version": "0.1.57",
4
4
  "description": "Create book000-style TypeScript projects",
5
5
  "repository": {
6
6
  "type": "git",