Skip to content

Commit

Permalink
fix: read package manifest less
Browse files Browse the repository at this point in the history
  • Loading branch information
just-paja committed Jan 24, 2023
1 parent 3cba0fa commit 0c470af
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions packages/isolate/IsolatedPackage.mjs
Expand Up @@ -4,21 +4,13 @@ import tar from 'tar'
import tmp from 'tmp-promise'
import zlib from 'zlib'

import { createReadStream, createWriteStream } from 'fs'
import { copyFile, mkdir, readdir, readFile, stat } from 'fs/promises'
import { createReadStream, createWriteStream, writeFileSync } from 'fs'
import { ensureUnlink } from './fs.mjs'
import { execute } from './cli.mjs'
import { Package } from '@lerna/package'
import { packageProject } from './npm.mjs'
import { resolveFlags } from './flags.mjs'

import {
copyFile,
mkdir,
readdir,
readFile,
stat,
writeFile,
} from 'fs/promises'
import {
PackageDoesNotExistError,
PrivatePackageError,
Expand All @@ -37,6 +29,7 @@ export class IsolatedPackage extends Package {

constructor(pkg, location, rootPath, { project, reporter } = {}) {
super(pkg, location, rootPath)
this.manifest = pkg
this.backups = {}
this.integratedDependencies = []
this.isolatedPackagePrefix = 'isolated-'
Expand Down Expand Up @@ -235,10 +228,10 @@ export class IsolatedPackage extends Package {
return this.manifest
}

async writeManifest(data) {
writeManifest(data) {
const JSON_PADDING = 2
this.manifest = data
await writeFile(
writeFileSync(
this.manifestLocation,
JSON.stringify(data, null, JSON_PADDING)
)
Expand Down

0 comments on commit 0c470af

Please sign in to comment.