Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into node_version_bump
Browse files Browse the repository at this point in the history
  • Loading branch information
tonycoco committed Mar 22, 2024
2 parents 374d151 + 7e60e38 commit 5175921
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
15 changes: 4 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"json5": "^2.1.3",
"meow": "^9.0.0",
"ncp": "^2.0.0",
"prettier": "3.1.1",
"prettier": "3.2.5",
"rimraf": "3.0.2",
"write-file-atomic": "^4.0.0"
},
Expand All @@ -64,7 +64,6 @@
"@types/mocha": "^10.0.0",
"@types/ncp": "^2.0.4",
"@types/node": "20.11.30",
"@types/prettier": "^2.1.1",
"@types/rimraf": "^3.0.0",
"@types/sinon": "^17.0.0",
"@types/tmp": "^0.2.0",
Expand Down
6 changes: 3 additions & 3 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import * as inquirer from 'inquirer';
import * as path from 'path';
import {ncp} from 'ncp';
import * as util from 'util';
import * as writeFileAtomic from 'write-file-atomic';

import {
getPkgManagerCommand,
readFilep as read,
readJsonp as readJson,
writeFileAtomicp as write,
Bag,
DefaultPackage,
} from './util';
Expand Down Expand Up @@ -168,7 +168,7 @@ async function writePackageJson(
): Promise<void> {
options.logger.log('Writing package.json...');
if (!options.dryRun) {
await write('./package.json', formatJson(packageJson));
await writeFileAtomic('./package.json', formatJson(packageJson));
}
const preview = {
scripts: packageJson.scripts,
Expand Down Expand Up @@ -216,7 +216,7 @@ async function generateConfigFile(
if (writeFile) {
options.logger.log(`Writing ${filename}...`);
if (!options.dryRun) {
await write(filename, contents);
await writeFileAtomic(filename, contents);
}
options.logger.log(contents);
}
Expand Down
2 changes: 0 additions & 2 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ import * as path from 'path';
import * as rimraf from 'rimraf';
import {promisify} from 'util';
import * as ncp from 'ncp';
import * as writeFileAtomic from 'write-file-atomic';
import * as JSON5 from 'json5';

export const readFilep = promisify(fs.readFile);
export const rimrafp = promisify(rimraf);
export const writeFileAtomicp = promisify(writeFileAtomic);
export const ncpp = promisify(ncp.ncp);

export interface Bag<T> {
Expand Down

0 comments on commit 5175921

Please sign in to comment.