Appending pulsar.api service

This commit is contained in:
Maurício Szabo 2023-05-27 00:38:15 -03:00
parent 58cd60ce04
commit d63caa54ce
3 changed files with 7 additions and 9 deletions

View File

@ -32,7 +32,7 @@ module.exports = function({ blobStore }) {
const { ipcRenderer } = require('electron');
const { resourcePath, devMode } = getWindowLoadSettings();
require('./electron-shims');
addAtomExport();
addAtomExport(global.atom);
// Make React faster
if (!devMode && process.env.NODE_ENV == null) {

View File

@ -9,8 +9,6 @@ module.exports = async function({ blobStore, globalAtom }) {
const { remote } = require('electron');
const getWindowLoadSettings = require('./get-window-load-settings');
console.log("WATTT????")
const exitWithStatusCode = function(status) {
remote.app.emit('will-quit');
remote.process.exit(status);
@ -84,9 +82,6 @@ module.exports = async function({ blobStore, globalAtom }) {
window.addEventListener('keydown', handleKeydown, { capture: true });
addAtomExport();
updateProcessEnv(env);
// Set up optional transpilation for packages under test if any
const FindParentDir = require('find-parent-dir');
const packageRoot = FindParentDir.sync(testPaths[0], 'package.json');
@ -134,6 +129,11 @@ module.exports = async function({ blobStore, globalAtom }) {
applicationDelegate, window, document,
configDirPath: process.env.ATOM_HOME
})
addAtomExport(window.atom);
updateProcessEnv(env);
atom.packages.serviceHub.provide('pulsar.api', '0.1.0', {
moduleName: '@pulsar/test', exports: require('./mocha-test-runner/helpers')
})
// Set load paths for the package's test runner
let loadPaths = vm.runInThisContext('module.paths')

View File

@ -87,9 +87,7 @@ module.exports = async function({ blobStore }) {
window.addEventListener('keydown', handleKeydown, { capture: true });
// Add 'exports' to module search path.
addAtomExport();
addAtomExport(atom);
updateProcessEnv(env);
// Set up optional transpilation for packages under test if any