@atlaspack/core 2.14.1-dev.91 → 2.15.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,58 @@
1
1
  # @atlaspack/core
2
2
 
3
+ ## 2.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#512](https://github.com/atlassian-labs/atlaspack/pull/512) [`8f4e6c1`](https://github.com/atlassian-labs/atlaspack/commit/8f4e6c1b0e7c1fd48624afda48c1dcc599f1460f) Thanks [@yamadapc](https://github.com/yamadapc)! - Remove LMDB cache back-end
8
+
9
+ - Updated dependencies [[`9b85d3e`](https://github.com/atlassian-labs/atlaspack/commit/9b85d3e645b10bd027eed2304afc970a5ba40062), [`a891d65`](https://github.com/atlassian-labs/atlaspack/commit/a891d652bc4eb3d757d381adf65c5083f706effc), [`d02eab9`](https://github.com/atlassian-labs/atlaspack/commit/d02eab95eb60bf7457e0869af0b773608592c0e6), [`fb87a90`](https://github.com/atlassian-labs/atlaspack/commit/fb87a901973776b33ca4ce530e9d71669a9bd36d), [`7b9e8cf`](https://github.com/atlassian-labs/atlaspack/commit/7b9e8cf29e01a98e72e46b2b2fb74ccc514f4463), [`17b9579`](https://github.com/atlassian-labs/atlaspack/commit/17b9579484eced0ed8f23e2aba6d23b3c7238c39), [`8f4e6c1`](https://github.com/atlassian-labs/atlaspack/commit/8f4e6c1b0e7c1fd48624afda48c1dcc599f1460f)]:
10
+ - @atlaspack/feature-flags@2.14.2
11
+ - @atlaspack/rust@3.1.0
12
+ - @atlaspack/cache@3.0.0
13
+ - @atlaspack/fs@2.14.2
14
+ - @atlaspack/graph@3.4.2
15
+ - @atlaspack/utils@2.14.2
16
+ - @atlaspack/logger@2.14.2
17
+ - @atlaspack/package-manager@2.14.2
18
+ - @atlaspack/profiler@2.14.2
19
+ - @atlaspack/types@2.14.2
20
+ - @atlaspack/workers@2.14.2
21
+ - @atlaspack/plugin@2.14.2
22
+
23
+ ## 2.15.0
24
+
25
+ ### Minor Changes
26
+
27
+ - [#486](https://github.com/atlassian-labs/atlaspack/pull/486) [`87087f4`](https://github.com/atlassian-labs/atlaspack/commit/87087f44f348ac583a27ea0819122e191ba80f8d) Thanks [@yamadapc](https://github.com/yamadapc)! - Add environment variable to skip cache invalidation
28
+
29
+ ### Patch Changes
30
+
31
+ - [#450](https://github.com/atlassian-labs/atlaspack/pull/450) [`b9d41b1`](https://github.com/atlassian-labs/atlaspack/commit/b9d41b175ad5771651a5b0278a5a0147e669234a) Thanks [@benjervis](https://github.com/benjervis)! - Remove the Atlaspack engines compatibility check
32
+
33
+ - [#420](https://github.com/atlassian-labs/atlaspack/pull/420) [`e1422ad`](https://github.com/atlassian-labs/atlaspack/commit/e1422ad0a801faaa4bc4f1023bed042ffe236e9b) Thanks [@JakeLane](https://github.com/JakeLane)! - Support async script runtime in conditional bundling
34
+
35
+ - [#472](https://github.com/atlassian-labs/atlaspack/pull/472) [`7e357fb`](https://github.com/atlassian-labs/atlaspack/commit/7e357fb173e7958da330e3721667fa5749420952) Thanks [@yamadapc](https://github.com/yamadapc)! - Fix segmentation fault on exit on certain cases
36
+
37
+ - [#478](https://github.com/atlassian-labs/atlaspack/pull/478) [`570493b`](https://github.com/atlassian-labs/atlaspack/commit/570493beaf754e7985aebc7daaaf6dfcfa8fe56b) Thanks [@yamadapc](https://github.com/yamadapc)! - The first attempt at Version Packages didn't include the built artifacts.
38
+ This has hopefully been fixed, so this change will force those packages to re-release.
39
+ - Updated dependencies [[`80bd57b`](https://github.com/atlassian-labs/atlaspack/commit/80bd57b9f9e966563957dee0780d956a682eb2d4), [`ae70b81`](https://github.com/atlassian-labs/atlaspack/commit/ae70b810384cf58f9c57d341ab4c925c7bb2060c), [`ce13d5e`](https://github.com/atlassian-labs/atlaspack/commit/ce13d5e885d55518ee6318e7a72e3a6e4e5126f2), [`4aab060`](https://github.com/atlassian-labs/atlaspack/commit/4aab0605c0d4ee8e0dcc3ffa1162eae5b360b677), [`c0a61a9`](https://github.com/atlassian-labs/atlaspack/commit/c0a61a92405b6830fe39cc17622cc2e97bf02dd7), [`cb35e7d`](https://github.com/atlassian-labs/atlaspack/commit/cb35e7d2b90b372de8401792915f12f410508d24), [`e1422ad`](https://github.com/atlassian-labs/atlaspack/commit/e1422ad0a801faaa4bc4f1023bed042ffe236e9b), [`6ec11f1`](https://github.com/atlassian-labs/atlaspack/commit/6ec11f10a9366fb8a9fc0475c7678235056bd80e), [`570493b`](https://github.com/atlassian-labs/atlaspack/commit/570493beaf754e7985aebc7daaaf6dfcfa8fe56b)]:
40
+ - @atlaspack/fs@2.14.1
41
+ - @atlaspack/rust@3.0.1
42
+ - @atlaspack/utils@2.14.1
43
+ - @atlaspack/feature-flags@2.14.1
44
+ - @atlaspack/diagnostic@2.14.1
45
+ - @atlaspack/graph@3.4.1
46
+ - @atlaspack/logger@2.14.1
47
+ - @atlaspack/package-manager@2.14.1
48
+ - @atlaspack/plugin@2.14.1
49
+ - @atlaspack/profiler@2.14.1
50
+ - @atlaspack/types@2.14.1
51
+ - @atlaspack/workers@2.14.1
52
+ - @atlaspack/events@2.14.1
53
+ - @atlaspack/build-cache@2.13.3
54
+ - @atlaspack/cache@2.13.3
55
+
3
56
  ## 2.14.0
4
57
 
5
58
  ### Minor Changes
package/lib/Atlaspack.js CHANGED
@@ -126,7 +126,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
126
126
  (0, _registerCoreWithSerializer.registerCoreWithSerializer)();
127
127
  const INTERNAL_TRANSFORM = exports.INTERNAL_TRANSFORM = Symbol('internal_transform');
128
128
  const INTERNAL_RESOLVE = exports.INTERNAL_RESOLVE = Symbol('internal_resolve');
129
- const WORKER_PATH = exports.WORKER_PATH = _path().default.join( /*#__ATLASPACK_IGNORE__*/__dirname, 'worker.js');
129
+ const WORKER_PATH = exports.WORKER_PATH = _path().default.join(__dirname, 'worker.js');
130
130
  class Atlaspack {
131
131
  #requestTracker /*: RequestTracker*/;
132
132
  #config /*: AtlaspackConfig*/;
@@ -832,10 +832,7 @@ class BundleGraph {
832
832
  // If this asset is referenced by any async dependency, it's referenced.
833
833
  return true;
834
834
  }
835
- let dependencies = this._graph.getNodeIdsConnectedTo(assetNodeId,
836
- // TODO: This seems like bug with library builds when assets are present
837
- // in other files. Guarding the fix for now exclusively for super builds
838
- process.env.ATLASPACK_SUPER_BUILD === 'true' ? _graph().ALL_EDGE_TYPES : undefined).map(id => (0, _nullthrows().default)(this._graph.getNode(id))).filter(node => node.type === 'dependency').map(node => {
835
+ let dependencies = this._graph.getNodeIdsConnectedTo(assetNodeId).map(id => (0, _nullthrows().default)(this._graph.getNode(id))).filter(node => node.type === 'dependency').map(node => {
839
836
  (0, _assert().default)(node.type === 'dependency');
840
837
  return node.value;
841
838
  });
@@ -1100,7 +1100,7 @@ async function loadRequestGraph(options) {
1100
1100
  });
1101
1101
  }, 5000);
1102
1102
  let startTime = Date.now();
1103
- let events = await options.inputFS.getEventsSince(options.watchDir, snapshotPath, opts);
1103
+ let events = process.env.ATLASPACK_BYPASS_CACHE_INVALIDATION === 'true' ? [] : await options.inputFS.getEventsSince(options.watchDir, snapshotPath, opts);
1104
1104
  clearTimeout(timeout);
1105
1105
  _logger().default.verbose({
1106
1106
  origin: '@atlaspack/core',
package/lib/index.js CHANGED
@@ -9,8 +9,7 @@ var _exportNames = {
9
9
  BuildError: true,
10
10
  createWorkerFarm: true,
11
11
  INTERNAL_RESOLVE: true,
12
- INTERNAL_TRANSFORM: true,
13
- isSuperPackage: true
12
+ INTERNAL_TRANSFORM: true
14
13
  };
15
14
  Object.defineProperty(exports, "Atlaspack", {
16
15
  enumerable: true,
@@ -54,14 +53,7 @@ Object.defineProperty(exports, "default", {
54
53
  return _Atlaspack.default;
55
54
  }
56
55
  });
57
- Object.defineProperty(exports, "isSuperPackage", {
58
- enumerable: true,
59
- get: function () {
60
- return _isSuperPackage.isSuperPackage;
61
- }
62
- });
63
56
  var _Atlaspack = _interopRequireWildcard(require("./Atlaspack"));
64
- var _isSuperPackage = require("./isSuperPackage");
65
57
  var _atlaspackV = require("./atlaspack-v3");
66
58
  Object.keys(_atlaspackV).forEach(function (key) {
67
59
  if (key === "default" || key === "__esModule") return;
@@ -25,8 +25,6 @@ function _diagnostic() {
25
25
  };
26
26
  return data;
27
27
  }
28
- var _package = require("../package.json");
29
- var _internalPlugins = _interopRequireDefault(require("./internal-plugins"));
30
28
  function _utils() {
31
29
  const data = require("@atlaspack/utils");
32
30
  _utils = function () {
@@ -41,19 +39,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
41
39
  const NODE_MODULES = `${_path().default.sep}node_modules${_path().default.sep}`;
42
40
  const CONFIG = Symbol.for('parcel-plugin-config');
43
41
  async function loadPlugin(pluginName, configPath, keyPath, options) {
44
- if (_internalPlugins.default && _internalPlugins.default[pluginName]) {
45
- let plugin = _internalPlugins.default[pluginName]();
46
- plugin = plugin.default || plugin;
47
- plugin = plugin[CONFIG];
48
- if (!plugin) {
49
- throw new Error(`Plugin ${pluginName} is not a valid Atlaspack plugin, should export an instance of a Atlaspack plugin ex. "export default new Reporter({ ... })".`);
50
- }
51
- return {
52
- plugin,
53
- version: _package.version,
54
- resolveFrom: (0, _projectPath.toProjectPathUnsafe)(options.projectRoot)
55
- };
56
- }
57
42
  let resolveFrom = configPath;
58
43
 
59
44
  // Config packages can reference plugins, but cannot contain other plugins within them.
@@ -40,7 +40,7 @@ function _diagnostic() {
40
40
  return data;
41
41
  }
42
42
  function _json() {
43
- const data = _interopRequireDefault(require("json5"));
43
+ const data = require("json5");
44
44
  _json = function () {
45
45
  return data;
46
46
  };
@@ -60,13 +60,11 @@ function _assert() {
60
60
  };
61
61
  return data;
62
62
  }
63
- var _internalPlugins = _interopRequireDefault(require("../internal-plugins"));
64
63
  var _AtlaspackConfig = require("../AtlaspackConfig");
65
64
  var _AtlaspackConfig2 = _interopRequireDefault(require("../AtlaspackConfig.schema"));
66
65
  var _projectPath = require("../projectPath");
67
66
  var _RequestTracker = require("../RequestTracker");
68
67
  var _utils2 = require("../utils");
69
- var _isSuperPackage = require("../isSuperPackage");
70
68
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
71
69
  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); }
72
70
  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; }
@@ -136,36 +134,28 @@ async function resolveAtlaspackConfig(options) {
136
134
  let resolveFrom = getResolveFrom(options.inputFS, options.projectRoot);
137
135
  let configPath = options.config != null ? (await options.packageManager.resolve(options.config, resolveFrom)).resolved : await (0, _utils().resolveConfig)(options.inputFS, resolveFrom, ['.parcelrc'], options.projectRoot);
138
136
  let usedDefault = false;
139
- let config, extendedFiles;
140
- if (configPath == null && options.defaultConfig != null && (0, _isSuperPackage.isSuperPackage)() && options.defaultConfig.endsWith('.js')) {
137
+ if (configPath == null && options.defaultConfig != null) {
141
138
  usedDefault = true;
142
- // Load the super package default config
143
- let result = await processConfigChain(_internalPlugins.default['@atlaspack/config-default'](), options.defaultConfig, options);
144
- config = result.config;
145
- extendedFiles = result.extendedFiles;
146
- } else {
147
- if (configPath == null && options.defaultConfig != null) {
148
- usedDefault = true;
149
- configPath = (await options.packageManager.resolve(options.defaultConfig, resolveFrom)).resolved;
150
- }
151
- if (configPath == null) {
152
- return null;
153
- }
154
- let contents;
155
- try {
156
- contents = await options.inputFS.readFile(configPath, 'utf8');
157
- } catch (e) {
158
- throw new (_diagnostic().default)({
159
- diagnostic: {
160
- message: (0, _diagnostic().md)`Could not find parcel config at ${_path().default.relative(options.projectRoot, configPath)}`,
161
- origin: '@atlaspack/core'
162
- }
163
- });
164
- }
165
- let result = await parseAndProcessConfig(configPath, contents, options);
166
- config = result.config;
167
- extendedFiles = result.extendedFiles;
139
+ configPath = (await options.packageManager.resolve(options.defaultConfig, resolveFrom)).resolved;
140
+ }
141
+ if (configPath == null) {
142
+ return null;
143
+ }
144
+ let contents;
145
+ try {
146
+ contents = await options.inputFS.readFile(configPath, 'utf8');
147
+ } catch (e) {
148
+ throw new (_diagnostic().default)({
149
+ diagnostic: {
150
+ message: (0, _diagnostic().md)`Could not find parcel config at ${_path().default.relative(options.projectRoot, configPath)}`,
151
+ origin: '@atlaspack/core'
152
+ }
153
+ });
168
154
  }
155
+ let {
156
+ config,
157
+ extendedFiles
158
+ } = await parseAndProcessConfig(configPath, contents, options);
169
159
  if (options.additionalReporters.length > 0) {
170
160
  config.reporters = [...options.additionalReporters.map(({
171
161
  packageName,
@@ -189,7 +179,7 @@ function create(config, options) {
189
179
  async function parseAndProcessConfig(configPath, contents, options) {
190
180
  let config;
191
181
  try {
192
- config = _json().default.parse(contents);
182
+ config = (0, _json().parse)(contents);
193
183
  } catch (e) {
194
184
  let pos = {
195
185
  line: e.lineNumber,
@@ -314,16 +304,13 @@ async function processConfigChain(configFile, filePath, options) {
314
304
  for (let ext of exts) {
315
305
  try {
316
306
  let key = Array.isArray(configFile.extends) ? `/extends/${i}` : '/extends';
317
- let nextConfig;
318
- if (_internalPlugins.default[ext]) {
319
- nextConfig = (await processConfigChain(_internalPlugins.default[ext](), /*#__ATLASPACK_IGNORE__*/__dirname, options)).config;
320
- } else {
321
- let resolved = await resolveExtends(ext, filePath, key, options);
322
- extendedFiles.push(resolved);
323
- let result = await processExtendedConfig(filePath, key, ext, resolved, options);
324
- extendedFiles = extendedFiles.concat(result.extendedFiles);
325
- nextConfig = result.config;
326
- }
307
+ let resolved = await resolveExtends(ext, filePath, key, options);
308
+ extendedFiles.push(resolved);
309
+ let {
310
+ extendedFiles: moreExtendedFiles,
311
+ config: nextConfig
312
+ } = await processExtendedConfig(filePath, key, ext, resolved, options);
313
+ extendedFiles = extendedFiles.concat(moreExtendedFiles);
327
314
  extStartConfig = extStartConfig ? mergeConfigs(extStartConfig, nextConfig) : nextConfig;
328
315
  } catch (err) {
329
316
  errors.push(err);
@@ -139,8 +139,16 @@ async function resolveOptions(initialOptions) {
139
139
  // where symlinked dependencies outside the project root need to trigger HMR
140
140
  // updates. Default to the project root if not provided.
141
141
  let watchDir = initialOptions.watchDir != null ? _path().default.resolve(initialOptions.watchDir) : projectRoot;
142
- const needsRustLmdbCache = (0, _featureFlags().getFeatureFlag)('useLmdbJsLite') || (0, _featureFlags().getFeatureFlag)('atlaspackV3');
143
- let cache = needsRustLmdbCache ? new (_cache().LMDBLiteCache)(cacheDir) : outputFS instanceof _fs().NodeFS ? new (_cache().LMDBCache)(cacheDir) : new (_cache().FSCache)(outputFS, cacheDir);
142
+ let cache = function createCache() {
143
+ if (initialOptions.cache) {
144
+ return initialOptions.cache;
145
+ }
146
+ const needsRustLmdbCache = (0, _featureFlags().getFeatureFlag)('atlaspackV3');
147
+ if (!needsRustLmdbCache && !(outputFS instanceof _fs().NodeFS)) {
148
+ return new (_cache().FSCache)(outputFS, cacheDir);
149
+ }
150
+ return new (_cache().LMDBLiteCache)(cacheDir);
151
+ }();
144
152
  let mode = initialOptions.mode ?? 'development';
145
153
  let shouldOptimize = (initialOptions === null || initialOptions === void 0 || (_initialOptions$defau = initialOptions.defaultTargetOptions) === null || _initialOptions$defau === void 0 ? void 0 : _initialOptions$defau.shouldOptimize) ?? mode === 'production';
146
154
  let publicUrl = (initialOptions === null || initialOptions === void 0 || (_initialOptions$defau2 = initialOptions.defaultTargetOptions) === null || _initialOptions$defau2 === void 0 ? void 0 : _initialOptions$defau2.publicUrl) ?? '/';
package/lib/worker.js CHANGED
@@ -78,15 +78,15 @@ require("@atlaspack/package-manager");
78
78
  require("@atlaspack/fs");
79
79
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
80
80
  // register with serializer
81
- // Repl builds are currently not enabled
82
81
  // $FlowFixMe
83
- // if (process.env.ATLASPACK_BUILD_REPL && process.browser) {
84
- // /* eslint-disable import/no-extraneous-dependencies, monorepo/no-internal-import */
85
- // require('@atlaspack/repl/src/atlaspack/BrowserPackageManager.js');
86
- // // $FlowFixMe
87
- // require('@atlaspack/repl/src/atlaspack/ExtendedMemoryFS.js');
88
- // /* eslint-enable import/no-extraneous-dependencies, monorepo/no-internal-import */
89
- // }
82
+ if (process.env.ATLASPACK_BUILD_REPL && process.browser) {
83
+ /* eslint-disable import/no-extraneous-dependencies, monorepo/no-internal-import */
84
+ require('@atlaspack/repl/src/atlaspack/BrowserPackageManager.js');
85
+ // $FlowFixMe
86
+ require('@atlaspack/repl/src/atlaspack/ExtendedMemoryFS.js');
87
+ /* eslint-enable import/no-extraneous-dependencies, monorepo/no-internal-import */
88
+ }
89
+
90
90
  (0, _registerCoreWithSerializer.registerCoreWithSerializer)();
91
91
 
92
92
  // Remove the workerApi type from the TransformationOpts and ValidationOpts types:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/core",
3
- "version": "2.14.1-dev.91+08020e0e1",
3
+ "version": "2.15.1",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,22 +20,22 @@
20
20
  "check-ts": "tsc --noEmit index.d.ts"
21
21
  },
22
22
  "dependencies": {
23
- "@atlaspack/build-cache": "2.13.3-dev.91+08020e0e1",
24
- "@atlaspack/cache": "2.13.3-dev.91+08020e0e1",
25
- "@atlaspack/diagnostic": "2.14.1-dev.91+08020e0e1",
26
- "@atlaspack/events": "2.14.1-dev.91+08020e0e1",
27
- "@atlaspack/feature-flags": "2.14.1-dev.91+08020e0e1",
28
- "@atlaspack/fs": "2.14.1-dev.91+08020e0e1",
29
- "@atlaspack/graph": "3.4.1-dev.91+08020e0e1",
30
- "@atlaspack/logger": "2.14.1-dev.91+08020e0e1",
31
- "@atlaspack/package-manager": "2.14.1-dev.91+08020e0e1",
32
- "@atlaspack/plugin": "2.14.1-dev.91+08020e0e1",
33
- "@atlaspack/profiler": "2.14.1-dev.91+08020e0e1",
34
- "@atlaspack/rust": "3.0.1-dev.91+08020e0e1",
35
- "@atlaspack/types": "2.14.1-dev.91+08020e0e1",
36
- "@atlaspack/utils": "2.14.1-dev.91+08020e0e1",
37
- "@atlaspack/workers": "2.14.1-dev.91+08020e0e1",
38
23
  "@mischnic/json-sourcemap": "^0.1.0",
24
+ "@atlaspack/build-cache": "2.13.3",
25
+ "@atlaspack/cache": "3.0.0",
26
+ "@atlaspack/diagnostic": "2.14.1",
27
+ "@atlaspack/events": "2.14.1",
28
+ "@atlaspack/feature-flags": "2.14.2",
29
+ "@atlaspack/fs": "2.14.2",
30
+ "@atlaspack/graph": "3.4.2",
31
+ "@atlaspack/logger": "2.14.2",
32
+ "@atlaspack/package-manager": "2.14.2",
33
+ "@atlaspack/plugin": "2.14.2",
34
+ "@atlaspack/profiler": "2.14.2",
35
+ "@atlaspack/rust": "3.1.0",
36
+ "@atlaspack/types": "2.14.2",
37
+ "@atlaspack/utils": "2.14.2",
38
+ "@atlaspack/workers": "2.14.2",
39
39
  "@parcel/source-map": "^2.1.1",
40
40
  "base-x": "^3.0.8",
41
41
  "browserslist": "^4.6.6",
@@ -48,11 +48,11 @@
48
48
  "semver": "^7.5.2"
49
49
  },
50
50
  "devDependencies": {
51
- "@atlaspack/babel-register": "2.14.0",
51
+ "@atlaspack/babel-register": "2.14.1",
52
52
  "@types/node": ">= 18",
53
- "graphviz": "^0.0.9",
54
- "jest-diff": "*",
55
53
  "rfdc": "1",
54
+ "jest-diff": "*",
55
+ "graphviz": "^0.0.9",
56
56
  "tempy": "^0.2.1"
57
57
  },
58
58
  "exports": {
@@ -66,6 +66,5 @@
66
66
  "browser": {
67
67
  "./src/serializerCore.js": "./src/serializerCore.browser.js"
68
68
  },
69
- "type": "commonjs",
70
- "gitHead": "08020e0e18819f3e15e74726f9ffa697892f7bfa"
69
+ "type": "commonjs"
71
70
  }
package/src/Atlaspack.js CHANGED
@@ -73,10 +73,7 @@ registerCoreWithSerializer();
73
73
 
74
74
  export const INTERNAL_TRANSFORM: symbol = Symbol('internal_transform');
75
75
  export const INTERNAL_RESOLVE: symbol = Symbol('internal_resolve');
76
- export const WORKER_PATH: string = path.join(
77
- /*#__ATLASPACK_IGNORE__*/ __dirname,
78
- 'worker.js',
79
- );
76
+ export const WORKER_PATH: string = path.join(__dirname, 'worker.js');
80
77
 
81
78
  export default class Atlaspack {
82
79
  #requestTracker /*: RequestTracker*/;
@@ -1315,14 +1315,7 @@ export default class BundleGraph {
1315
1315
  }
1316
1316
 
1317
1317
  let dependencies = this._graph
1318
- .getNodeIdsConnectedTo(
1319
- assetNodeId,
1320
- // TODO: This seems like bug with library builds when assets are present
1321
- // in other files. Guarding the fix for now exclusively for super builds
1322
- process.env.ATLASPACK_SUPER_BUILD === 'true'
1323
- ? ALL_EDGE_TYPES
1324
- : undefined,
1325
- )
1318
+ .getNodeIdsConnectedTo(assetNodeId)
1326
1319
  .map((id) => nullthrows(this._graph.getNode(id)))
1327
1320
  .filter((node) => node.type === 'dependency')
1328
1321
  .map((node) => {
@@ -1697,11 +1697,14 @@ async function loadRequestGraph(options): Async<RequestGraph> {
1697
1697
  });
1698
1698
  }, 5000);
1699
1699
  let startTime = Date.now();
1700
- let events = await options.inputFS.getEventsSince(
1701
- options.watchDir,
1702
- snapshotPath,
1703
- opts,
1704
- );
1700
+ let events =
1701
+ process.env.ATLASPACK_BYPASS_CACHE_INVALIDATION === 'true'
1702
+ ? []
1703
+ : await options.inputFS.getEventsSince(
1704
+ options.watchDir,
1705
+ snapshotPath,
1706
+ opts,
1707
+ );
1705
1708
  clearTimeout(timeout);
1706
1709
 
1707
1710
  logger.verbose({
package/src/index.js CHANGED
@@ -10,6 +10,4 @@ export {
10
10
  INTERNAL_TRANSFORM,
11
11
  } from './Atlaspack';
12
12
 
13
- export {isSuperPackage} from './isSuperPackage';
14
-
15
13
  export * from './atlaspack-v3';
@@ -8,14 +8,8 @@ import ThrowableDiagnostic, {
8
8
  generateJSONCodeHighlights,
9
9
  md,
10
10
  } from '@atlaspack/diagnostic';
11
- import {version as ATLASPACK_VERSION} from '../package.json';
12
- import atlaspackInternalPlugins from './internal-plugins';
13
11
  import {findAlternativeNodeModules} from '@atlaspack/utils';
14
- import {
15
- type ProjectPath,
16
- toProjectPath,
17
- toProjectPathUnsafe,
18
- } from './projectPath';
12
+ import {type ProjectPath, toProjectPath} from './projectPath';
19
13
 
20
14
  const NODE_MODULES = `${path.sep}node_modules${path.sep}`;
21
15
  const CONFIG = Symbol.for('parcel-plugin-config');
@@ -30,22 +24,6 @@ export default async function loadPlugin<T>(
30
24
  version: Semver,
31
25
  resolveFrom: ProjectPath,
32
26
  |}> {
33
- if (atlaspackInternalPlugins && atlaspackInternalPlugins[pluginName]) {
34
- let plugin = atlaspackInternalPlugins[pluginName]();
35
- plugin = plugin.default || plugin;
36
- plugin = plugin[CONFIG];
37
- if (!plugin) {
38
- throw new Error(
39
- `Plugin ${pluginName} is not a valid Atlaspack plugin, should export an instance of a Atlaspack plugin ex. "export default new Reporter({ ... })".`,
40
- );
41
- }
42
- return {
43
- plugin,
44
- version: ATLASPACK_VERSION,
45
- resolveFrom: toProjectPathUnsafe(options.projectRoot),
46
- };
47
- }
48
-
49
27
  let resolveFrom = configPath;
50
28
 
51
29
  // Config packages can reference plugins, but cannot contain other plugins within them.
@@ -30,17 +30,15 @@ import ThrowableDiagnostic, {
30
30
  md,
31
31
  errorToDiagnostic,
32
32
  } from '@atlaspack/diagnostic';
33
- import json5 from 'json5';
33
+ import {parse} from 'json5';
34
34
  import path from 'path';
35
35
  import invariant from 'assert';
36
36
 
37
- import atlaspackInternalPlugins from '../internal-plugins';
38
37
  import {AtlaspackConfig} from '../AtlaspackConfig';
39
38
  import AtlaspackConfigSchema from '../AtlaspackConfig.schema';
40
39
  import {toProjectPath} from '../projectPath';
41
40
  import {requestTypes} from '../RequestTracker';
42
41
  import {optionsProxy} from '../utils';
43
- import {isSuperPackage} from '../isSuperPackage';
44
42
 
45
43
  type ConfigMap<K, V> = {[K]: V, ...};
46
44
 
@@ -161,60 +159,35 @@ export async function resolveAtlaspackConfig(
161
159
  );
162
160
 
163
161
  let usedDefault = false;
164
- let config, extendedFiles;
165
-
166
- if (
167
- configPath == null &&
168
- options.defaultConfig != null &&
169
- isSuperPackage() &&
170
- options.defaultConfig.endsWith('.js')
171
- ) {
162
+ if (configPath == null && options.defaultConfig != null) {
172
163
  usedDefault = true;
173
- // Load the super package default config
174
- let result: AtlaspackConfigChain = await processConfigChain(
175
- atlaspackInternalPlugins['@atlaspack/config-default'](),
176
- options.defaultConfig,
177
- options,
178
- );
179
- config = result.config;
180
- extendedFiles = result.extendedFiles;
181
- } else {
182
- if (configPath == null && options.defaultConfig != null) {
183
- usedDefault = true;
184
-
185
- configPath = (
186
- await options.packageManager.resolve(options.defaultConfig, resolveFrom)
187
- ).resolved;
188
- }
189
-
190
- if (configPath == null) {
191
- return null;
192
- }
164
+ configPath = (
165
+ await options.packageManager.resolve(options.defaultConfig, resolveFrom)
166
+ ).resolved;
167
+ }
193
168
 
194
- let contents;
195
- try {
196
- contents = await options.inputFS.readFile(configPath, 'utf8');
197
- } catch (e) {
198
- throw new ThrowableDiagnostic({
199
- diagnostic: {
200
- message: md`Could not find parcel config at ${path.relative(
201
- options.projectRoot,
202
- configPath,
203
- )}`,
204
- origin: '@atlaspack/core',
205
- },
206
- });
207
- }
169
+ if (configPath == null) {
170
+ return null;
171
+ }
208
172
 
209
- let result: AtlaspackConfigChain = await parseAndProcessConfig(
210
- configPath,
211
- contents,
212
- options,
213
- );
214
- config = result.config;
215
- extendedFiles = result.extendedFiles;
173
+ let contents;
174
+ try {
175
+ contents = await options.inputFS.readFile(configPath, 'utf8');
176
+ } catch (e) {
177
+ throw new ThrowableDiagnostic({
178
+ diagnostic: {
179
+ message: md`Could not find parcel config at ${path.relative(
180
+ options.projectRoot,
181
+ configPath,
182
+ )}`,
183
+ origin: '@atlaspack/core',
184
+ },
185
+ });
216
186
  }
217
187
 
188
+ let {config, extendedFiles}: AtlaspackConfigChain =
189
+ await parseAndProcessConfig(configPath, contents, options);
190
+
218
191
  if (options.additionalReporters.length > 0) {
219
192
  config.reporters = [
220
193
  ...options.additionalReporters.map(({packageName, resolveFrom}) => ({
@@ -243,7 +216,7 @@ export async function parseAndProcessConfig(
243
216
  ): Promise<AtlaspackConfigChain> {
244
217
  let config: RawAtlaspackConfig;
245
218
  try {
246
- config = json5.parse(contents);
219
+ config = parse(contents);
247
220
  } catch (e) {
248
221
  let pos = {
249
222
  line: e.lineNumber,
@@ -473,29 +446,11 @@ export async function processConfigChain(
473
446
  let key = Array.isArray(configFile.extends)
474
447
  ? `/extends/${i}`
475
448
  : '/extends';
476
-
477
- let nextConfig;
478
- if (atlaspackInternalPlugins[ext]) {
479
- nextConfig = (
480
- await processConfigChain(
481
- atlaspackInternalPlugins[ext](),
482
- /*#__ATLASPACK_IGNORE__*/ __dirname,
483
- options,
484
- )
485
- ).config;
486
- } else {
487
- let resolved = await resolveExtends(ext, filePath, key, options);
488
- extendedFiles.push(resolved);
489
- let result = await processExtendedConfig(
490
- filePath,
491
- key,
492
- ext,
493
- resolved,
494
- options,
495
- );
496
- extendedFiles = extendedFiles.concat(result.extendedFiles);
497
- nextConfig = result.config;
498
- }
449
+ let resolved = await resolveExtends(ext, filePath, key, options);
450
+ extendedFiles.push(resolved);
451
+ let {extendedFiles: moreExtendedFiles, config: nextConfig} =
452
+ await processExtendedConfig(filePath, key, ext, resolved, options);
453
+ extendedFiles = extendedFiles.concat(moreExtendedFiles);
499
454
  extStartConfig = extStartConfig
500
455
  ? mergeConfigs(extStartConfig, nextConfig)
501
456
  : nextConfig;
@@ -12,7 +12,7 @@ import type {AtlaspackOptions} from './types';
12
12
  import path from 'path';
13
13
  import {hashString} from '@atlaspack/rust';
14
14
  import {NodeFS, NodeVCSAwareFS} from '@atlaspack/fs';
15
- import {LMDBCache, LMDBLiteCache, FSCache} from '@atlaspack/cache';
15
+ import {LMDBLiteCache, FSCache} from '@atlaspack/cache';
16
16
  import {getFeatureFlag, getFeatureFlagValue} from '@atlaspack/feature-flags';
17
17
  import {NodePackageManager} from '@atlaspack/package-manager';
18
18
  import {
@@ -146,14 +146,21 @@ export default async function resolveOptions(
146
146
  ? path.resolve(initialOptions.watchDir)
147
147
  : projectRoot;
148
148
 
149
- const needsRustLmdbCache =
150
- getFeatureFlag('useLmdbJsLite') || getFeatureFlag('atlaspackV3');
149
+ function createCache() {
150
+ if (initialOptions.cache) {
151
+ return initialOptions.cache;
152
+ }
153
+
154
+ const needsRustLmdbCache = getFeatureFlag('atlaspackV3');
155
+
156
+ if (!needsRustLmdbCache && !(outputFS instanceof NodeFS)) {
157
+ return new FSCache(outputFS, cacheDir);
158
+ }
159
+
160
+ return new LMDBLiteCache(cacheDir);
161
+ }
151
162
 
152
- let cache = needsRustLmdbCache
153
- ? new LMDBLiteCache(cacheDir)
154
- : outputFS instanceof NodeFS
155
- ? new LMDBCache(cacheDir)
156
- : new FSCache(outputFS, cacheDir);
163
+ let cache = createCache();
157
164
 
158
165
  let mode = initialOptions.mode ?? 'development';
159
166
  let shouldOptimize =
package/src/worker.js CHANGED
@@ -32,15 +32,14 @@ import '@atlaspack/cache'; // register with serializer
32
32
  import '@atlaspack/package-manager';
33
33
  import '@atlaspack/fs';
34
34
 
35
- // Repl builds are currently not enabled
36
35
  // $FlowFixMe
37
- // if (process.env.ATLASPACK_BUILD_REPL && process.browser) {
38
- // /* eslint-disable import/no-extraneous-dependencies, monorepo/no-internal-import */
39
- // require('@atlaspack/repl/src/atlaspack/BrowserPackageManager.js');
40
- // // $FlowFixMe
41
- // require('@atlaspack/repl/src/atlaspack/ExtendedMemoryFS.js');
42
- // /* eslint-enable import/no-extraneous-dependencies, monorepo/no-internal-import */
43
- // }
36
+ if (process.env.ATLASPACK_BUILD_REPL && process.browser) {
37
+ /* eslint-disable import/no-extraneous-dependencies, monorepo/no-internal-import */
38
+ require('@atlaspack/repl/src/atlaspack/BrowserPackageManager.js');
39
+ // $FlowFixMe
40
+ require('@atlaspack/repl/src/atlaspack/ExtendedMemoryFS.js');
41
+ /* eslint-enable import/no-extraneous-dependencies, monorepo/no-internal-import */
42
+ }
44
43
 
45
44
  registerCoreWithSerializer();
46
45
 
@@ -108,7 +108,11 @@ describe('Environment', () => {
108
108
 
109
109
  describe('createEnvironment', function () {
110
110
  it('returns a stable hash', () => {
111
- initializeMonitoring();
111
+ try {
112
+ initializeMonitoring();
113
+ } catch (_err) {
114
+ /* ignore */
115
+ }
112
116
  const environment = createEnvironment({});
113
117
  expect(environment.id).toEqual('d821e85f6b50315e');
114
118
  });
package/LICENSE DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright (c) 2024 Atlassian US., Inc.
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
@@ -1,9 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- // This file is overridden in super package builds
8
- // $FlowFixMe
9
- var _default = exports.default = {};
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- let fs = require('fs');
4
- let {
5
- findAncestorFile
6
- } = require('@atlaspack/rust');
7
- let dirname = /*#__ATLASPACK_IGNORE__*/__dirname;
8
- function isSuperPackage() {
9
- if (!dirname) {
10
- return false;
11
- }
12
- let packageJson = JSON.parse(fs.readFileSync(findAncestorFile(['package.json'], dirname, '/')));
13
- return packageJson.name === '@atlaspack/super';
14
- }
15
- let result;
16
- module.exports.isSuperPackage = () => {
17
- if (result == null) {
18
- result = isSuperPackage();
19
- }
20
- return result;
21
- };
@@ -1,4 +0,0 @@
1
- // @flow
2
- // This file is overridden in super package builds
3
- // $FlowFixMe
4
- export default {};
@@ -1,26 +0,0 @@
1
- let fs = require('fs');
2
- let {findAncestorFile} = require('@atlaspack/rust');
3
-
4
- let dirname = /*#__ATLASPACK_IGNORE__*/ __dirname;
5
-
6
- function isSuperPackage() {
7
- if (!dirname) {
8
- return false;
9
- }
10
-
11
- let packageJson = JSON.parse(
12
- fs.readFileSync(findAncestorFile(['package.json'], dirname, '/')),
13
- );
14
-
15
- return packageJson.name === '@atlaspack/super';
16
- }
17
-
18
- let result;
19
-
20
- module.exports.isSuperPackage = () => {
21
- if (result == null) {
22
- result = isSuperPackage();
23
- }
24
-
25
- return result;
26
- };