@atlaspack/workers 2.12.1-canary.3462 → 2.12.1-canary.3464

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/WorkerFarm.js CHANGED
@@ -112,7 +112,7 @@ class WorkerFarm extends _events().default {
112
112
 
113
113
  // $FlowFixMe
114
114
  if (process.browser) {
115
- if (this.options.workerPath === '@atlaspack/core/src/worker.js') {
115
+ if (this.options.workerPath === '@atlaspack/core/worker') {
116
116
  this.localWorker = coreWorker;
117
117
  } else {
118
118
  throw new Error('No dynamic require possible: ' + this.options.workerPath);
@@ -299,7 +299,7 @@ class WorkerFarm extends _events().default {
299
299
  } else if (location) {
300
300
  // $FlowFixMe
301
301
  if (process.browser) {
302
- if (location === '@atlaspack/workers/src/bus.js') {
302
+ if (location === '@atlaspack/workers/bus') {
303
303
  mod = bus;
304
304
  } else {
305
305
  throw new Error('No dynamic require possible: ' + location);
package/lib/bus.js CHANGED
@@ -18,7 +18,7 @@ class Bus extends _events().default {
18
18
  if (_childState.child) {
19
19
  _childState.child.workerApi.callMaster({
20
20
  // $FlowFixMe
21
- location: process.browser ? '@atlaspack/workers/src/bus.js' : __filename,
21
+ location: process.browser ? '@atlaspack/workers/bus' : __filename,
22
22
  method: 'emit',
23
23
  args: [event, ...args]
24
24
  }, false);
package/lib/child.js CHANGED
@@ -100,7 +100,7 @@ class Child {
100
100
  async childInit(module, childId) {
101
101
  // $FlowFixMe
102
102
  if (process.browser) {
103
- if (module === '@atlaspack/core/src/worker.js') {
103
+ if (module === '@atlaspack/core/worker') {
104
104
  this.module = coreWorker;
105
105
  } else {
106
106
  throw new Error('No dynamic require possible: ' + module);
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
 
3
- // eslint-disable-next-line monorepo/no-internal-import
4
- module.exports = require('@atlaspack/core/src/worker.js');
3
+ // $FlowFixMe
4
+ module.exports = require('@atlaspack/core/worker');
@@ -11,13 +11,6 @@ function _child_process() {
11
11
  };
12
12
  return data;
13
13
  }
14
- function _path() {
15
- const data = _interopRequireDefault(require("path"));
16
- _path = function () {
17
- return data;
18
- };
19
- return data;
20
- }
21
14
  function _core() {
22
15
  const data = require("@atlaspack/core");
23
16
  _core = function () {
@@ -26,7 +19,7 @@ function _core() {
26
19
  return data;
27
20
  }
28
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
- const WORKER_PATH = _path().default.join(__dirname, 'ProcessChild.js');
22
+ const WORKER_PATH = require.resolve('./ProcessChild');
30
23
  class ProcessWorker {
31
24
  processQueue = true;
32
25
  sendQueue = [];
@@ -11,13 +11,6 @@ function _worker_threads() {
11
11
  };
12
12
  return data;
13
13
  }
14
- function _path() {
15
- const data = _interopRequireDefault(require("path"));
16
- _path = function () {
17
- return data;
18
- };
19
- return data;
20
- }
21
14
  function _core() {
22
15
  const data = require("@atlaspack/core");
23
16
  _core = function () {
@@ -25,8 +18,7 @@ function _core() {
25
18
  };
26
19
  return data;
27
20
  }
28
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
- const WORKER_PATH = _path().default.join(__dirname, 'ThreadsChild.js');
21
+ const WORKER_PATH = require.resolve('./ThreadsChild');
30
22
  class ThreadsWorker {
31
23
  constructor(execArgv, onMessage, onError, onExit) {
32
24
  this.execArgv = execArgv;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/workers",
3
- "version": "2.12.1-canary.3462+3c4d00e02",
3
+ "version": "2.12.1-canary.3464+b66723585",
4
4
  "description": "Blazing fast, zero configuration web application bundler",
5
5
  "license": "(MIT OR Apache-2.0)",
6
6
  "publishConfig": {
@@ -17,20 +17,20 @@
17
17
  "node": ">= 16.0.0"
18
18
  },
19
19
  "dependencies": {
20
- "@atlaspack/diagnostic": "2.12.1-canary.3462+3c4d00e02",
21
- "@atlaspack/logger": "2.12.1-canary.3462+3c4d00e02",
22
- "@atlaspack/profiler": "2.12.1-canary.3462+3c4d00e02",
23
- "@atlaspack/types-internal": "2.12.1-canary.3462+3c4d00e02",
24
- "@atlaspack/utils": "2.12.1-canary.3462+3c4d00e02",
20
+ "@atlaspack/diagnostic": "2.12.1-canary.3464+b66723585",
21
+ "@atlaspack/logger": "2.12.1-canary.3464+b66723585",
22
+ "@atlaspack/profiler": "2.12.1-canary.3464+b66723585",
23
+ "@atlaspack/types-internal": "2.12.1-canary.3464+b66723585",
24
+ "@atlaspack/utils": "2.12.1-canary.3464+b66723585",
25
25
  "nullthrows": "^1.1.1"
26
26
  },
27
27
  "peerDependencies": {
28
- "@atlaspack/core": "2.12.1-canary.3462+3c4d00e02"
28
+ "@atlaspack/core": "2.12.1-canary.3464+b66723585"
29
29
  },
30
30
  "browser": {
31
31
  "./src/process/ProcessWorker.js": false,
32
32
  "./src/threads/ThreadsWorker.js": false,
33
33
  "./src/core-worker.js": "./src/core-worker.browser.js"
34
34
  },
35
- "gitHead": "3c4d00e027b4bd79399440961d13c2c37bac3005"
35
+ "gitHead": "b667235859922e485011908e0d4069ab95598be5"
36
36
  }
package/src/WorkerFarm.js CHANGED
@@ -105,7 +105,7 @@ export default class WorkerFarm extends EventEmitter {
105
105
 
106
106
  // $FlowFixMe
107
107
  if (process.browser) {
108
- if (this.options.workerPath === '@atlaspack/core/src/worker.js') {
108
+ if (this.options.workerPath === '@atlaspack/core/worker') {
109
109
  this.localWorker = coreWorker;
110
110
  } else {
111
111
  throw new Error(
@@ -357,7 +357,7 @@ export default class WorkerFarm extends EventEmitter {
357
357
  } else if (location) {
358
358
  // $FlowFixMe
359
359
  if (process.browser) {
360
- if (location === '@atlaspack/workers/src/bus.js') {
360
+ if (location === '@atlaspack/workers/bus') {
361
361
  mod = (bus: any);
362
362
  } else {
363
363
  throw new Error('No dynamic require possible: ' + location);
package/src/bus.js CHANGED
@@ -8,9 +8,7 @@ class Bus extends EventEmitter {
8
8
  child.workerApi.callMaster(
9
9
  {
10
10
  // $FlowFixMe
11
- location: process.browser
12
- ? '@atlaspack/workers/src/bus.js'
13
- : __filename,
11
+ location: process.browser ? '@atlaspack/workers/bus' : __filename,
14
12
  method: 'emit',
15
13
  args: [event, ...args],
16
14
  },
package/src/child.js CHANGED
@@ -103,7 +103,7 @@ export class Child {
103
103
  async childInit(module: string, childId: number): Promise<void> {
104
104
  // $FlowFixMe
105
105
  if (process.browser) {
106
- if (module === '@atlaspack/core/src/worker.js') {
106
+ if (module === '@atlaspack/core/worker') {
107
107
  this.module = coreWorker;
108
108
  } else {
109
109
  throw new Error('No dynamic require possible: ' + module);
@@ -1,3 +1,4 @@
1
1
  // @flow
2
- // eslint-disable-next-line monorepo/no-internal-import
3
- module.exports = require('@atlaspack/core/src/worker.js');
2
+
3
+ // $FlowFixMe
4
+ module.exports = require('@atlaspack/core/worker');
@@ -8,10 +8,9 @@ import type {
8
8
  WorkerMessage,
9
9
  } from '../types';
10
10
  import childProcess, {type ChildProcess} from 'child_process';
11
- import path from 'path';
12
11
  import {serialize, deserialize} from '@atlaspack/core';
13
12
 
14
- const WORKER_PATH = path.join(__dirname, 'ProcessChild.js');
13
+ const WORKER_PATH = require.resolve('./ProcessChild');
15
14
 
16
15
  export default class ProcessWorker implements WorkerImpl {
17
16
  execArgv: Object;
@@ -8,13 +8,12 @@ import type {
8
8
  WorkerMessage,
9
9
  } from '../types';
10
10
  import {Worker} from 'worker_threads';
11
- import path from 'path';
12
11
  import {
13
12
  prepareForSerialization,
14
13
  restoreDeserializedObject,
15
14
  } from '@atlaspack/core';
16
15
 
17
- const WORKER_PATH = path.join(__dirname, 'ThreadsChild.js');
16
+ const WORKER_PATH = require.resolve('./ThreadsChild');
18
17
 
19
18
  export default class ThreadsWorker implements WorkerImpl {
20
19
  execArgv: Object;