complete-cli 1.0.9 → 1.0.11

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.
@@ -1,8 +1,9 @@
1
1
  import chalk from "chalk";
2
2
  import { Command, Option } from "clipanion";
3
3
  import { ReadonlySet } from "complete-common";
4
- import { $, deleteFileOrDirectoryAsync, fatalError, isDirectory, isFileAsync, readFile, readFileAsync, writeFileAsync, } from "complete-node";
4
+ import { $, deleteFileOrDirectoryAsync, fatalError, isDirectory, isFileAsync, readFileAsync, writeFileAsync, } from "complete-node";
5
5
  import klawSync from "klaw-sync";
6
+ import os from "node:os";
6
7
  import path from "node:path";
7
8
  import { ACTION_YML, ACTION_YML_TEMPLATE_PATH, CWD, TEMPLATES_DYNAMIC_DIR, TEMPLATES_STATIC_DIR, } from "../constants.js";
8
9
  import { getTruncatedText } from "./check/getTruncatedText.js";
@@ -108,8 +109,8 @@ async function compareTextFiles(projectFilePath, templateFilePath, verbose) {
108
109
  console.log(`The contents of the following file do not match: ${chalk.red(projectFilePath)}`);
109
110
  printTemplateLocation(templateFilePath);
110
111
  if (verbose) {
111
- const originalTemplateFile = readFile(templateFilePath);
112
- const originalProjectFile = readFile(projectFilePath);
112
+ const originalTemplateFile = await readFileAsync(templateFilePath);
113
+ const originalProjectFile = await readFileAsync(projectFilePath);
113
114
  console.log("--- Original template file: ---\n");
114
115
  console.log(originalTemplateFile);
115
116
  console.log();
@@ -123,8 +124,9 @@ async function compareTextFiles(projectFilePath, templateFilePath, verbose) {
123
124
  console.log(projectFileObject.text);
124
125
  console.log();
125
126
  }
126
- const tempProjectFilePath = path.join(CWD, "tempProjectFile.txt");
127
- const tempTemplateFilePath = path.join(CWD, "tempTemplateFile.txt");
127
+ const tempDir = os.tmpdir();
128
+ const tempProjectFilePath = path.join(tempDir, "tempProjectFile.txt");
129
+ const tempTemplateFilePath = path.join(tempDir, "tempTemplateFile.txt");
128
130
  await writeFileAsync(tempProjectFilePath, projectFileObject.text);
129
131
  await writeFileAsync(tempTemplateFilePath, templateFileObject.text);
130
132
  await $ `diff ${tempProjectFilePath} ${tempTemplateFilePath} --ignore-blank-lines`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "complete-cli",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "A command line tool for bootstrapping TypeScript projects.",
5
5
  "keywords": [
6
6
  "typescript"
@@ -38,7 +38,7 @@
38
38
  "chalk": "5.4.1",
39
39
  "clipanion": "4.0.0-rc.4",
40
40
  "complete-common": "^1.1.1",
41
- "complete-node": "^3.1.0",
41
+ "complete-node": "^3.1.1",
42
42
  "klaw-sync": "6.0.0",
43
43
  "yaml": "2.7.0"
44
44
  },
@@ -49,7 +49,7 @@
49
49
  "ts-loader": "9.5.2",
50
50
  "tsconfig-paths-webpack-plugin": "^4.2.0",
51
51
  "typescript": "5.7.3",
52
- "typescript-eslint": "8.24.1",
52
+ "typescript-eslint": "8.25.0",
53
53
  "webpack": "5.98.0",
54
54
  "webpack-cli": "6.0.1",
55
55
  "webpack-shebang-plugin": "^1.1.8"
@@ -7,11 +7,11 @@ import {
7
7
  fatalError,
8
8
  isDirectory,
9
9
  isFileAsync,
10
- readFile,
11
10
  readFileAsync,
12
11
  writeFileAsync,
13
12
  } from "complete-node";
14
13
  import klawSync from "klaw-sync";
14
+ import os from "node:os";
15
15
  import path from "node:path";
16
16
  import {
17
17
  ACTION_YML,
@@ -203,8 +203,8 @@ async function compareTextFiles(
203
203
  printTemplateLocation(templateFilePath);
204
204
 
205
205
  if (verbose) {
206
- const originalTemplateFile = readFile(templateFilePath);
207
- const originalProjectFile = readFile(projectFilePath);
206
+ const originalTemplateFile = await readFileAsync(templateFilePath);
207
+ const originalProjectFile = await readFileAsync(projectFilePath);
208
208
 
209
209
  console.log("--- Original template file: ---\n");
210
210
  console.log(originalTemplateFile);
@@ -220,8 +220,9 @@ async function compareTextFiles(
220
220
  console.log();
221
221
  }
222
222
 
223
- const tempProjectFilePath = path.join(CWD, "tempProjectFile.txt");
224
- const tempTemplateFilePath = path.join(CWD, "tempTemplateFile.txt");
223
+ const tempDir = os.tmpdir();
224
+ const tempProjectFilePath = path.join(tempDir, "tempProjectFile.txt");
225
+ const tempTemplateFilePath = path.join(tempDir, "tempTemplateFile.txt");
225
226
 
226
227
  await writeFileAsync(tempProjectFilePath, projectFileObject.text);
227
228
  await writeFileAsync(tempTemplateFilePath, templateFileObject.text);