@atlaspack/core 2.13.2-dev.3682 → 2.14.0

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.
Files changed (87) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/package.json +20 -20
  3. package/src/Atlaspack.js +3 -2
  4. package/src/atlaspack-v3/AtlaspackV3.js +24 -8
  5. package/src/loadAtlaspackPlugin.js +26 -71
  6. package/src/projectPath.js +14 -1
  7. package/src/requests/WriteBundlesRequest.js +31 -22
  8. package/LICENSE +0 -201
  9. package/lib/AssetGraph.js +0 -521
  10. package/lib/Atlaspack.js +0 -676
  11. package/lib/AtlaspackConfig.js +0 -298
  12. package/lib/AtlaspackConfig.schema.js +0 -103
  13. package/lib/BundleGraph.js +0 -1527
  14. package/lib/CommittedAsset.js +0 -155
  15. package/lib/Dependency.js +0 -136
  16. package/lib/Environment.js +0 -144
  17. package/lib/IdentifierRegistry.js +0 -36
  18. package/lib/InternalConfig.js +0 -56
  19. package/lib/PackagerRunner.js +0 -525
  20. package/lib/ReporterRunner.js +0 -151
  21. package/lib/RequestTracker.js +0 -1178
  22. package/lib/SymbolPropagation.js +0 -618
  23. package/lib/TargetDescriptor.schema.js +0 -118
  24. package/lib/Transformation.js +0 -522
  25. package/lib/UncommittedAsset.js +0 -348
  26. package/lib/Validation.js +0 -203
  27. package/lib/applyRuntimes.js +0 -355
  28. package/lib/assetUtils.js +0 -205
  29. package/lib/atlaspack-v3/AtlaspackV3.js +0 -57
  30. package/lib/atlaspack-v3/NapiWorkerPool.js +0 -71
  31. package/lib/atlaspack-v3/fs.js +0 -39
  32. package/lib/atlaspack-v3/index.js +0 -26
  33. package/lib/atlaspack-v3/jsCallable.js +0 -20
  34. package/lib/atlaspack-v3/worker/compat/asset-symbols.js +0 -197
  35. package/lib/atlaspack-v3/worker/compat/bitflags.js +0 -84
  36. package/lib/atlaspack-v3/worker/compat/dependency.js +0 -44
  37. package/lib/atlaspack-v3/worker/compat/environment.js +0 -57
  38. package/lib/atlaspack-v3/worker/compat/index.js +0 -104
  39. package/lib/atlaspack-v3/worker/compat/mutable-asset.js +0 -164
  40. package/lib/atlaspack-v3/worker/compat/plugin-config.js +0 -78
  41. package/lib/atlaspack-v3/worker/compat/plugin-logger.js +0 -29
  42. package/lib/atlaspack-v3/worker/compat/plugin-options.js +0 -113
  43. package/lib/atlaspack-v3/worker/compat/plugin-tracer.js +0 -12
  44. package/lib/atlaspack-v3/worker/compat/target.js +0 -17
  45. package/lib/atlaspack-v3/worker/index.js +0 -3
  46. package/lib/atlaspack-v3/worker/worker.js +0 -280
  47. package/lib/constants.js +0 -21
  48. package/lib/dumpGraphToGraphViz.js +0 -206
  49. package/lib/index.js +0 -70
  50. package/lib/loadAtlaspackPlugin.js +0 -136
  51. package/lib/loadDotEnv.js +0 -54
  52. package/lib/projectPath.js +0 -94
  53. package/lib/public/Asset.js +0 -259
  54. package/lib/public/Bundle.js +0 -236
  55. package/lib/public/BundleGraph.js +0 -279
  56. package/lib/public/BundleGroup.js +0 -50
  57. package/lib/public/Config.js +0 -202
  58. package/lib/public/Dependency.js +0 -131
  59. package/lib/public/Environment.js +0 -247
  60. package/lib/public/MutableBundleGraph.js +0 -204
  61. package/lib/public/PluginOptions.js +0 -71
  62. package/lib/public/Symbols.js +0 -247
  63. package/lib/public/Target.js +0 -64
  64. package/lib/registerCoreWithSerializer.js +0 -51
  65. package/lib/requests/AssetGraphRequest.js +0 -432
  66. package/lib/requests/AssetGraphRequestRust.js +0 -220
  67. package/lib/requests/AssetRequest.js +0 -132
  68. package/lib/requests/AtlaspackBuildRequest.js +0 -79
  69. package/lib/requests/AtlaspackConfigRequest.js +0 -479
  70. package/lib/requests/BundleGraphRequest.js +0 -485
  71. package/lib/requests/ConfigRequest.js +0 -203
  72. package/lib/requests/DevDepRequest.js +0 -193
  73. package/lib/requests/EntryRequest.js +0 -295
  74. package/lib/requests/PackageRequest.js +0 -88
  75. package/lib/requests/PathRequest.js +0 -357
  76. package/lib/requests/TargetRequest.js +0 -1179
  77. package/lib/requests/ValidationRequest.js +0 -66
  78. package/lib/requests/WriteBundleRequest.js +0 -252
  79. package/lib/requests/WriteBundlesRequest.js +0 -153
  80. package/lib/requests/asset-graph-diff.js +0 -128
  81. package/lib/requests/asset-graph-dot.js +0 -131
  82. package/lib/resolveOptions.js +0 -265
  83. package/lib/serializerCore.browser.js +0 -29
  84. package/lib/summarizeRequest.js +0 -55
  85. package/lib/types.js +0 -35
  86. package/lib/utils.js +0 -160
  87. package/lib/worker.js +0 -184
package/lib/worker.js DELETED
@@ -1,184 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.childInit = childInit;
7
- exports.clearWorkerBuildCaches = clearWorkerBuildCaches;
8
- exports.invalidateRequireCache = invalidateRequireCache;
9
- exports.ping = ping;
10
- exports.runPackage = runPackage;
11
- exports.runTransform = runTransform;
12
- exports.runValidate = runValidate;
13
- function _utils() {
14
- const data = require("@atlaspack/utils");
15
- _utils = function () {
16
- return data;
17
- };
18
- return data;
19
- }
20
- function _assert() {
21
- const data = _interopRequireDefault(require("assert"));
22
- _assert = function () {
23
- return data;
24
- };
25
- return data;
26
- }
27
- function _nullthrows() {
28
- const data = _interopRequireDefault(require("nullthrows"));
29
- _nullthrows = function () {
30
- return data;
31
- };
32
- return data;
33
- }
34
- var _BundleGraph = _interopRequireDefault(require("./BundleGraph"));
35
- var _Transformation = _interopRequireDefault(require("./Transformation"));
36
- var _ReporterRunner = require("./ReporterRunner");
37
- var _PackagerRunner = _interopRequireDefault(require("./PackagerRunner"));
38
- var _Validation = _interopRequireDefault(require("./Validation"));
39
- var _AtlaspackConfig = require("./AtlaspackConfig");
40
- var _registerCoreWithSerializer = require("./registerCoreWithSerializer");
41
- function _buildCache() {
42
- const data = require("@atlaspack/build-cache");
43
- _buildCache = function () {
44
- return data;
45
- };
46
- return data;
47
- }
48
- function _sourceMap() {
49
- const data = require("@parcel/source-map");
50
- _sourceMap = function () {
51
- return data;
52
- };
53
- return data;
54
- }
55
- function _rust() {
56
- const data = require("@atlaspack/rust");
57
- _rust = function () {
58
- return data;
59
- };
60
- return data;
61
- }
62
- function _workers() {
63
- const data = _interopRequireDefault(require("@atlaspack/workers"));
64
- _workers = function () {
65
- return data;
66
- };
67
- return data;
68
- }
69
- function _featureFlags() {
70
- const data = require("@atlaspack/feature-flags");
71
- _featureFlags = function () {
72
- return data;
73
- };
74
- return data;
75
- }
76
- require("@atlaspack/cache");
77
- require("@atlaspack/package-manager");
78
- require("@atlaspack/fs");
79
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
80
- // register with serializer
81
- // $FlowFixMe
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
- (0, _registerCoreWithSerializer.registerCoreWithSerializer)();
91
-
92
- // Remove the workerApi type from the TransformationOpts and ValidationOpts types:
93
- // https://github.com/facebook/flow/issues/2835
94
- // TODO: this should eventually be replaced by an in memory cache layer
95
- let atlaspackConfigCache = new Map();
96
- function loadOptions(ref, workerApi) {
97
- return (0, _nullthrows().default)(workerApi.getSharedReference(ref
98
- // $FlowFixMe
99
- ));
100
- }
101
-
102
- async function loadConfig(cachePath, options) {
103
- let config = atlaspackConfigCache.get(cachePath);
104
- if (config && config.options === options) {
105
- return config;
106
- }
107
- let processedConfig = (0, _nullthrows().default)(await options.cache.get(cachePath));
108
- config = new _AtlaspackConfig.AtlaspackConfig(processedConfig, options);
109
- atlaspackConfigCache.set(cachePath, config);
110
- (0, _featureFlags().setFeatureFlags)(options.featureFlags);
111
- return config;
112
- }
113
- function clearWorkerBuildCaches() {
114
- _utils().loadConfig.clear();
115
- (0, _buildCache().clearBuildCaches)();
116
- }
117
- async function runTransform(workerApi, opts) {
118
- let {
119
- optionsRef,
120
- configCachePath,
121
- ...rest
122
- } = opts;
123
- let options = loadOptions(optionsRef, workerApi);
124
- let config = await loadConfig(configCachePath, options);
125
- return new _Transformation.default({
126
- workerApi,
127
- options,
128
- config,
129
- ...rest
130
- }).run();
131
- }
132
- async function runValidate(workerApi, opts) {
133
- let {
134
- optionsRef,
135
- configCachePath,
136
- ...rest
137
- } = opts;
138
- let options = loadOptions(optionsRef, workerApi);
139
- let config = await loadConfig(configCachePath, options);
140
- return new _Validation.default({
141
- workerApi,
142
- report: _ReporterRunner.reportWorker.bind(null, workerApi),
143
- options,
144
- config,
145
- ...rest
146
- }).run();
147
- }
148
- async function runPackage(workerApi, {
149
- bundle,
150
- bundleGraphReference,
151
- configCachePath,
152
- optionsRef,
153
- previousDevDeps,
154
- invalidDevDeps,
155
- previousInvalidations
156
- }) {
157
- let bundleGraph = workerApi.getSharedReference(bundleGraphReference);
158
- (0, _assert().default)(bundleGraph instanceof _BundleGraph.default);
159
- let options = loadOptions(optionsRef, workerApi);
160
- let atlaspackConfig = await loadConfig(configCachePath, options);
161
- let runner = new _PackagerRunner.default({
162
- config: atlaspackConfig,
163
- options,
164
- report: _workers().default.isWorker() ? _ReporterRunner.reportWorker.bind(null, workerApi) : _ReporterRunner.report,
165
- previousDevDeps,
166
- previousInvalidations
167
- });
168
- return runner.run(bundleGraph, bundle, invalidDevDeps);
169
- }
170
- async function childInit() {
171
- await _sourceMap().init;
172
- await (_rust().init === null || _rust().init === void 0 ? void 0 : (0, _rust().init)());
173
- }
174
- const PKG_RE = /node_modules[/\\]((?:@[^/\\]+[/\\][^/\\]+)|[^/\\]+)(?!.*[/\\]node_modules[/\\])/;
175
- function invalidateRequireCache() {
176
- throw new Error('invalidateRequireCache is only for tests');
177
- }
178
-
179
- /**
180
- * This is used to wait until workers are responding to messages.
181
- */
182
- function ping() {
183
- return true;
184
- }