-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 [#724] Convert prepare-package.js to module and drop dependency on …
…config/paths.js
- Loading branch information
1 parent
7429dcd
commit 3847a88
Showing
2 changed files
with
7 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
#!/usr/bin/env node | ||
'use strict'; | ||
|
||
const fs = require('fs'); | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
|
||
const paths = require('../config/paths'); | ||
const APP_DIRECTORY = fs.realpathSync(process.cwd()); | ||
const PACKAGE_JSON_PATH = path.resolve(APP_DIRECTORY, 'package.json'); | ||
|
||
const packageJson = JSON.parse(fs.readFileSync(paths.appPackageJson, 'utf-8')); | ||
const packageJson = JSON.parse(fs.readFileSync(PACKAGE_JSON_PATH, 'utf-8')); | ||
|
||
// make package.json modifications to be able to publish the package. Workspaces require | ||
// private=true, but to publish it, it must be private=false. While publishing the | ||
// package, we do not use workspaces. | ||
packageJson.private = false; | ||
|
||
const stringified = JSON.stringify(packageJson, null, 2) + '\n'; | ||
fs.writeFileSync(paths.appPackageJson, stringified); | ||
fs.writeFileSync(PACKAGE_JSON_PATH, stringified); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters