Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(legacyEmberAppInstance: object, maybeOptions?: Options) {
let options = optionsWithDefaults(maybeOptions);
if (options && options.workspaceDir) {
ensureDirSync(options.workspaceDir);
this.destDir = realpathSync(options.workspaceDir);
} else {
this.destDir = realpathSync(mkdtempSync(join(tmpdir(), 'embroider-')));
}
let v1Cache = V1InstanceCache.forApp(legacyEmberAppInstance, options);
this.packageCache = v1Cache.packageCache.moveAddons(v1Cache.app.root, this.destDir);
let movedAddons = [...this.packageCache.moved.keys()].map(oldPkg => buildCompatAddon(oldPkg, v1Cache));
let { synthVendor, synthStyles } = this.getSyntheticPackages(v1Cache.app, movedAddons);
this.tree = new WaitForTrees({ movedAddons, synthVendor, synthStyles }, '@embroider/compat/addons', this.build.bind(this));
this.inputPath = v1Cache.app.root;
}