Skip to content

Commit 1621763

Browse files
authored
docs(core): fix deployment docs example code (#23289)
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> ## Current Behavior Using example code directly will result in an error because a `PackageJson` object cannot be parsed to the `writeFileSync` function. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> Replace the `writeFileSync` fn with the `writeJsonFile` fn from '@nx/devkit'
1 parent 1a85787 commit 1621763

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/shared/recipes/ci-deployment.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ const {
9797
createProjectGraphAsync,
9898
readCachedProjectGraph,
9999
detectPackageManager,
100+
writeJsonFile,
100101
} = require('@nx/devkit');
101102
const {
102103
createLockFile,
@@ -128,7 +129,7 @@ async function main() {
128129

129130
const lockFileName = getLockFileName(pm);
130131

131-
writeFileSync(`${outputDir}/package.json`, packageJson);
132+
writeJsonFile(`${outputDir}/package.json`, packageJson);
132133
writeFileSync(`${outputDir}/${lockFileName}`, lockFile, {
133134
encoding: 'utf8',
134135
});

0 commit comments

Comments
 (0)