@atlaspack/core 2.14.1-dev.118 → 2.14.1-dev.128

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/_empty.js ADDED
File without changes
package/lib/Atlaspack.js CHANGED
@@ -119,7 +119,6 @@ var _atlaspackV = require("./atlaspack-v3");
119
119
  var _AssetGraphRequest = _interopRequireDefault(require("./requests/AssetGraphRequest"));
120
120
  var _AssetGraphRequestRust = require("./requests/AssetGraphRequestRust");
121
121
  var _rustWorkerThreadDylibHack = require("./rustWorkerThreadDylibHack");
122
- var _isSuperPackage = require("./isSuperPackage");
123
122
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
124
123
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
125
124
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -212,15 +211,13 @@ class Atlaspack {
212
211
  await lmdb.put('current_session_version', Buffer.from(version));
213
212
  rustAtlaspack = await _atlaspackV.AtlaspackV3.create({
214
213
  ...options,
215
- corePath: _path().default.join( /*#__ATLASPACK_IGNORE__*/__dirname, '..'),
216
214
  threads: process.env.NODE_ENV === 'test' ? 2 : undefined,
217
215
  entries: Array.isArray(entries) ? entries : entries == null ? undefined : [entries],
218
216
  env: resolvedOptions.env,
219
217
  fs: inputFS && new _atlaspackV.FileSystemV3(inputFS),
220
218
  // $FlowFixMe ProjectPath is a string
221
219
  defaultTargetOptions: resolvedOptions.defaultTargetOptions,
222
- lmdb,
223
- isSuperPackage: (0, _isSuperPackage.isSuperPackage)()
220
+ lmdb
224
221
  });
225
222
  }
226
223
  this.rustAtlaspack = rustAtlaspack;
@@ -19,7 +19,46 @@ function _diagnostic() {
19
19
  };
20
20
  return data;
21
21
  }
22
+ var _isSuperPackage = require("../isSuperPackage");
23
+ function _path() {
24
+ const data = _interopRequireDefault(require("path"));
25
+ _path = function () {
26
+ return data;
27
+ };
28
+ return data;
29
+ }
22
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
+ function getJsPaths() {
32
+ const dirname = /*#__ATLASPACK_IGNORE__*/__dirname;
33
+ if ((0, _isSuperPackage.isSuperPackage)()) {
34
+ // dirname: atlaspack/lib/core/core/atlaspack-v3
35
+ // core: atlaspack/lib/core/core/index.js
36
+ const corePath = _path().default.join(dirname, '..');
37
+ // esmodule helpers: atlaspack/lib/transformers/js/esmodule-helpers.js
38
+ const esmoduleHelpersPath = _path().default.join(dirname, '../../../transformers/js/esmodule-helpers.js');
39
+
40
+ // empty file: atlaspack/lib/core/core/_empty.js
41
+ const emptyFile = _path().default.join(dirname, '_empty.js');
42
+ return {
43
+ corePath,
44
+ esmoduleHelpersSpecifier: _path().default.relative(corePath, esmoduleHelpersPath),
45
+ esmoduleHelpersIncludeNodeModules: 'atlaspack',
46
+ emptyFile
47
+ };
48
+ }
49
+
50
+ // dirname: @atlaspack/core/lib/atlaspack-v3
51
+ // core: @atlaspack/core
52
+ const corePath = _path().default.join(dirname, '../..');
53
+ // empty file: atlaspack/lib/core/core/_empty.js
54
+ const emptyFile = _path().default.join(dirname, '_empty.js');
55
+ return {
56
+ corePath,
57
+ esmoduleHelpersSpecifier: '@atlaspack/transformer-js/src/esmodule-helpers.js',
58
+ esmoduleHelpersIncludeNodeModules: '@atlaspack/transformer-js',
59
+ emptyFile
60
+ };
61
+ }
23
62
  class AtlaspackV3 {
24
63
  constructor(atlaspack_napi) {
25
64
  this._atlaspack_napi = atlaspack_napi;
@@ -40,7 +79,10 @@ class AtlaspackV3 {
40
79
  fs,
41
80
  packageManager,
42
81
  threads,
43
- options,
82
+ options: {
83
+ ...options,
84
+ jsPaths: getJsPaths()
85
+ },
44
86
  napiWorkerPool
45
87
  }, lmdb);
46
88
  if (error !== null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/core",
3
- "version": "2.14.1-dev.118+f615781c0",
3
+ "version": "2.14.1-dev.128+6bc708e4e",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,21 +20,21 @@
20
20
  "check-ts": "tsc --noEmit index.d.ts"
21
21
  },
22
22
  "dependencies": {
23
- "@atlaspack/build-cache": "2.13.3-dev.118+f615781c0",
24
- "@atlaspack/cache": "2.13.3-dev.118+f615781c0",
25
- "@atlaspack/diagnostic": "2.14.1-dev.118+f615781c0",
26
- "@atlaspack/events": "2.14.1-dev.118+f615781c0",
27
- "@atlaspack/feature-flags": "2.14.1-dev.118+f615781c0",
28
- "@atlaspack/fs": "2.14.1-dev.118+f615781c0",
29
- "@atlaspack/graph": "3.4.1-dev.118+f615781c0",
30
- "@atlaspack/logger": "2.14.1-dev.118+f615781c0",
31
- "@atlaspack/package-manager": "2.14.1-dev.118+f615781c0",
32
- "@atlaspack/plugin": "2.14.1-dev.118+f615781c0",
33
- "@atlaspack/profiler": "2.14.1-dev.118+f615781c0",
34
- "@atlaspack/rust": "3.0.1-dev.118+f615781c0",
35
- "@atlaspack/types": "2.14.1-dev.118+f615781c0",
36
- "@atlaspack/utils": "2.14.1-dev.118+f615781c0",
37
- "@atlaspack/workers": "2.14.1-dev.118+f615781c0",
23
+ "@atlaspack/build-cache": "2.13.3-dev.128+6bc708e4e",
24
+ "@atlaspack/cache": "2.13.3-dev.128+6bc708e4e",
25
+ "@atlaspack/diagnostic": "2.14.1-dev.128+6bc708e4e",
26
+ "@atlaspack/events": "2.14.1-dev.128+6bc708e4e",
27
+ "@atlaspack/feature-flags": "2.14.1-dev.128+6bc708e4e",
28
+ "@atlaspack/fs": "2.14.1-dev.128+6bc708e4e",
29
+ "@atlaspack/graph": "3.4.1-dev.128+6bc708e4e",
30
+ "@atlaspack/logger": "2.14.1-dev.128+6bc708e4e",
31
+ "@atlaspack/package-manager": "2.14.1-dev.128+6bc708e4e",
32
+ "@atlaspack/plugin": "2.14.1-dev.128+6bc708e4e",
33
+ "@atlaspack/profiler": "2.14.1-dev.128+6bc708e4e",
34
+ "@atlaspack/rust": "3.0.1-dev.128+6bc708e4e",
35
+ "@atlaspack/types": "2.14.1-dev.128+6bc708e4e",
36
+ "@atlaspack/utils": "2.14.1-dev.128+6bc708e4e",
37
+ "@atlaspack/workers": "2.14.1-dev.128+6bc708e4e",
38
38
  "@mischnic/json-sourcemap": "^0.1.0",
39
39
  "@parcel/source-map": "^2.1.1",
40
40
  "base-x": "^3.0.8",
@@ -63,9 +63,12 @@
63
63
  "default": "./lib/worker.js"
64
64
  }
65
65
  },
66
+ "atlaspackReferences": [
67
+ "_empty.js"
68
+ ],
66
69
  "browser": {
67
70
  "./src/serializerCore.js": "./src/serializerCore.browser.js"
68
71
  },
69
72
  "type": "commonjs",
70
- "gitHead": "f615781c07b16806135476593869793c64e9f4b6"
73
+ "gitHead": "6bc708e4ef019a9c7dd1ecb0966cd546f1b04f05"
71
74
  }
package/src/Atlaspack.js CHANGED
@@ -68,7 +68,6 @@ import createAssetGraphRequestJS from './requests/AssetGraphRequest';
68
68
  import {createAssetGraphRequestRust} from './requests/AssetGraphRequestRust';
69
69
  import type {AssetGraphRequestResult} from './requests/AssetGraphRequest';
70
70
  import {loadRustWorkerThreadDylibHack} from './rustWorkerThreadDylibHack';
71
- import {isSuperPackage} from './isSuperPackage';
72
71
 
73
72
  registerCoreWithSerializer();
74
73
 
@@ -177,7 +176,6 @@ export default class Atlaspack {
177
176
 
178
177
  rustAtlaspack = await AtlaspackV3.create({
179
178
  ...options,
180
- corePath: path.join(/*#__ATLASPACK_IGNORE__*/ __dirname, '..'),
181
179
  threads: process.env.NODE_ENV === 'test' ? 2 : undefined,
182
180
  entries: Array.isArray(entries)
183
181
  ? entries
@@ -189,7 +187,6 @@ export default class Atlaspack {
189
187
  // $FlowFixMe ProjectPath is a string
190
188
  defaultTargetOptions: resolvedOptions.defaultTargetOptions,
191
189
  lmdb,
192
- isSuperPackage: isSuperPackage(),
193
190
  });
194
191
  }
195
192
  this.rustAtlaspack = rustAtlaspack;
@@ -12,6 +12,8 @@ import {NapiWorkerPool} from './NapiWorkerPool';
12
12
  import ThrowableDiagnostic from '@atlaspack/diagnostic';
13
13
  import type {Event} from '@parcel/watcher';
14
14
  import type {NapiWorkerPool as INapiWorkerPool} from '@atlaspack/types';
15
+ import {isSuperPackage} from '../isSuperPackage';
16
+ import path from 'path';
15
17
 
16
18
  export type AtlaspackV3Options = {|
17
19
  fs?: AtlaspackNapiOptions['fs'],
@@ -23,9 +25,53 @@ export type AtlaspackV3Options = {|
23
25
  lmdb: Lmdb,
24
26
  featureFlags?: {[string]: string | boolean},
25
27
  napiWorkerPool?: INapiWorkerPool,
26
- ...AtlaspackNapiOptions['options'],
28
+ ...$Diff<
29
+ AtlaspackNapiOptions['options'],
30
+ {|
31
+ jsPaths: AtlaspackNapiOptions['options']['jsPaths'],
32
+ |},
33
+ >,
27
34
  |};
28
35
 
36
+ function getJsPaths(): AtlaspackNapiOptions['options']['jsPaths'] {
37
+ const dirname = /*#__ATLASPACK_IGNORE__*/ __dirname;
38
+
39
+ if (isSuperPackage()) {
40
+ // dirname: atlaspack/lib/core/core/atlaspack-v3
41
+ // core: atlaspack/lib/core/core/index.js
42
+ const corePath = path.join(dirname, '..');
43
+ // esmodule helpers: atlaspack/lib/transformers/js/esmodule-helpers.js
44
+ const esmoduleHelpersPath = path.join(
45
+ dirname,
46
+ '../../../transformers/js/esmodule-helpers.js',
47
+ );
48
+
49
+ // empty file: atlaspack/lib/core/core/_empty.js
50
+ const emptyFile = path.join(dirname, '_empty.js');
51
+
52
+ return {
53
+ corePath,
54
+ esmoduleHelpersSpecifier: path.relative(corePath, esmoduleHelpersPath),
55
+ esmoduleHelpersIncludeNodeModules: 'atlaspack',
56
+ emptyFile,
57
+ };
58
+ }
59
+
60
+ // dirname: @atlaspack/core/lib/atlaspack-v3
61
+ // core: @atlaspack/core
62
+ const corePath = path.join(dirname, '../..');
63
+ // empty file: atlaspack/lib/core/core/_empty.js
64
+ const emptyFile = path.join(dirname, '_empty.js');
65
+
66
+ return {
67
+ corePath,
68
+ esmoduleHelpersSpecifier:
69
+ '@atlaspack/transformer-js/src/esmodule-helpers.js',
70
+ esmoduleHelpersIncludeNodeModules: '@atlaspack/transformer-js',
71
+ emptyFile,
72
+ };
73
+ }
74
+
29
75
  export class AtlaspackV3 {
30
76
  _atlaspack_napi: AtlaspackNapi;
31
77
 
@@ -52,7 +98,10 @@ export class AtlaspackV3 {
52
98
  fs,
53
99
  packageManager,
54
100
  threads,
55
- options,
101
+ options: {
102
+ ...options,
103
+ jsPaths: getJsPaths(),
104
+ },
56
105
  napiWorkerPool,
57
106
  },
58
107
  lmdb,