@atlaspack/core 2.23.1 → 2.23.2

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,30 @@
1
1
  # @atlaspack/core
2
2
 
3
+ ## 2.23.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#742](https://github.com/atlassian-labs/atlaspack/pull/742) [`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd) Thanks [@yamadapc](https://github.com/yamadapc)! - Internal changes and bug fixes to environmentDeduplication flag
8
+
9
+ - [#755](https://github.com/atlassian-labs/atlaspack/pull/755) [`b6e72b6`](https://github.com/atlassian-labs/atlaspack/commit/b6e72b6dd2b517cbb0e700fa69e63332d3eacb1e) Thanks [@benjervis](https://github.com/benjervis)! - Allow runtime assets to be marked as requiring execution on load
10
+
11
+ - Updated dependencies [[`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd), [`889c65c`](https://github.com/atlassian-labs/atlaspack/commit/889c65cd25b811045e26a117e7404f694dde77a2)]:
12
+ - @atlaspack/package-manager@2.14.26
13
+ - @atlaspack/feature-flags@2.23.1
14
+ - @atlaspack/build-cache@2.13.5
15
+ - @atlaspack/diagnostic@2.14.3
16
+ - @atlaspack/profiler@2.14.23
17
+ - @atlaspack/workers@2.14.26
18
+ - @atlaspack/events@2.14.3
19
+ - @atlaspack/logger@2.14.18
20
+ - @atlaspack/plugin@2.14.26
21
+ - @atlaspack/cache@3.2.21
22
+ - @atlaspack/graph@3.5.15
23
+ - @atlaspack/types@2.15.16
24
+ - @atlaspack/utils@2.18.3
25
+ - @atlaspack/rust@3.6.1
26
+ - @atlaspack/fs@2.15.21
27
+
3
28
  ## 2.23.1
4
29
 
5
30
  ### Patch Changes
package/lib/Atlaspack.js CHANGED
@@ -128,7 +128,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
128
128
  const INTERNAL_TRANSFORM = exports.INTERNAL_TRANSFORM = Symbol('internal_transform');
129
129
  const INTERNAL_RESOLVE = exports.INTERNAL_RESOLVE = Symbol('internal_resolve');
130
130
  let WORKER_PATH = exports.WORKER_PATH = _path().default.join(__dirname, 'worker.js');
131
- if (process.env.ATLASPACK_REGISTER_USE_SRC === 'true') {
131
+ if (__filename.endsWith('.ts')) {
132
132
  exports.WORKER_PATH = WORKER_PATH = _path().default.join(__dirname, 'worker.ts');
133
133
  }
134
134
  class Atlaspack {
@@ -130,9 +130,7 @@ class AtlaspackConfig {
130
130
  if (allowEmpty) {
131
131
  return [];
132
132
  }
133
- throw await this.missingPluginError(this.transformers,
134
- // @ts-expect-error TS2345
135
- (0, _diagnostic().md)`No transformers found for __${(0, _projectPath.fromProjectPathRelative)(filePath)}__` + (pipeline != null ? ` with pipeline: '${pipeline}'` : '') + '.', '/transformers');
133
+ throw await this.missingPluginError(this.transformers, (0, _diagnostic().md)`No transformers found for __${(0, _projectPath.fromProjectPathRelative)(filePath)}__` + (pipeline != null ? ` with pipeline: '${pipeline}'` : '') + '.', '/transformers');
136
134
  }
137
135
  return this.loadPlugins(transformers);
138
136
  }
@@ -157,9 +155,7 @@ class AtlaspackConfig {
157
155
  async getPackager(filePath) {
158
156
  let packager = this.matchGlobMap((0, _projectPath.toProjectPathUnsafe)(filePath), this.packagers);
159
157
  if (!packager) {
160
- throw await this.missingPluginError(this.packagers,
161
- // @ts-expect-error TS2345
162
- (0, _diagnostic().md)`No packager found for __${filePath}__.`, '/packagers');
158
+ throw await this.missingPluginError(this.packagers, (0, _diagnostic().md)`No packager found for __${filePath}__.`, '/packagers');
163
159
  }
164
160
  return this.loadPlugin(packager);
165
161
  }
@@ -188,9 +184,7 @@ class AtlaspackConfig {
188
184
  async getCompressors(filePath) {
189
185
  let compressors = this.matchGlobMapPipelines((0, _projectPath.toProjectPathUnsafe)(filePath), this.compressors) ?? [];
190
186
  if (compressors.length === 0) {
191
- throw await this.missingPluginError(this.compressors,
192
- // @ts-expect-error TS2345
193
- (0, _diagnostic().md)`No compressors found for __${filePath}__.`, '/compressors');
187
+ throw await this.missingPluginError(this.compressors, (0, _diagnostic().md)`No compressors found for __${filePath}__.`, '/compressors');
194
188
  }
195
189
  return this.loadPlugins(compressors);
196
190
  }
@@ -402,12 +402,9 @@ function propagateSymbols({
402
402
  let resolution = (0, _nullthrows().default)(assetGraph.getNode(resolutionNodeId));
403
403
  (0, _assert().default)(resolution && (resolution.type === 'asset_group' || resolution.type === 'asset'));
404
404
  errors.push({
405
- // @ts-expect-error TS2345
406
405
  message: (0, _diagnostic().md)`${(0, _projectPath.fromProjectPathRelative)(
407
406
  // @ts-expect-error TS2345
408
- resolution.value.filePath
409
- // @ts-expect-error TS2731
410
- )} does not export '${s}'`,
407
+ resolution.value.filePath)} does not export '${s}'`,
411
408
  origin: '@atlaspack/core',
412
409
  codeFrames: loc ? [{
413
410
  filePath: (0, _projectPath.fromProjectPath)(options.projectRoot, loc === null || loc === void 0 ? void 0 : loc.filePath) ?? undefined,
@@ -113,7 +113,6 @@ class Transformation {
113
113
  } catch (err) {
114
114
  _logger().default.verbose([{
115
115
  origin: '@atlaspack/core',
116
- // @ts-expect-error TS2345
117
116
  message: (0, _diagnostic().md)`Could not load existing source map for ${(0, _projectPath.fromProjectPathRelative)(asset.value.filePath)}`
118
117
  }, {
119
118
  origin: '@atlaspack/core',
@@ -161,11 +161,13 @@ async function applyRuntimes({
161
161
  filePath,
162
162
  isEntry,
163
163
  env,
164
+ runtimeAssetRequiringExecutionOnLoad,
164
165
  priority
165
166
  } of runtimeAssets) {
166
167
  let sourceName = _path().default.join(_path().default.dirname(filePath), `runtime-${(0, _rust().hashString)(code)}.${bundle.type}`);
167
168
  let assetGroup = {
168
169
  code,
170
+ runtimeAssetRequiringExecutionOnLoad,
169
171
  filePath: (0, _projectPath.toProjectPath)(options.projectRoot, sourceName),
170
172
  env: (0, _Environment.mergeEnvironments)(options.projectRoot, (0, _EnvironmentManager.fromEnvironmentId)(bundle.env), env),
171
173
  // Runtime assets should be considered source, as they should be
@@ -47,7 +47,6 @@ async function loadPlugin(pluginName, configPath, keyPath, options) {
47
47
  let configContents = await options.inputFS.readFile(configPath, 'utf8');
48
48
  throw new (_diagnostic().default)({
49
49
  diagnostic: {
50
- // @ts-expect-error TS2345
51
50
  message: (0, _diagnostic().md)`Local plugins are not supported in Atlaspack config packages. Please publish "${pluginName}" as a separate npm package.`,
52
51
  origin: '@atlaspack/core',
53
52
  codeFrames: keyPath ? [{
@@ -77,7 +76,6 @@ async function loadPlugin(pluginName, configPath, keyPath, options) {
77
76
  let alternatives = await (0, _utils().findAlternativeNodeModules)(options.inputFS, pluginName, _path().default.dirname(resolveFrom));
78
77
  throw new (_diagnostic().default)({
79
78
  diagnostic: {
80
- // @ts-expect-error TS2345
81
79
  message: (0, _diagnostic().md)`Cannot find Atlaspack plugin "${pluginName}"`,
82
80
  origin: '@atlaspack/core',
83
81
  codeFrames: keyPath ? [{
@@ -87,7 +85,6 @@ async function loadPlugin(pluginName, configPath, keyPath, options) {
87
85
  codeHighlights: (0, _diagnostic().generateJSONCodeHighlights)(configContents, [{
88
86
  key: keyPath,
89
87
  type: 'value',
90
- // @ts-expect-error TS2345
91
88
  message: (0, _diagnostic().md)`Cannot find module "${pluginName}"${alternatives[0] ? `, did you mean "${alternatives[0]}"?` : ''}`
92
89
  }])
93
90
  }] : undefined
@@ -415,6 +415,14 @@ class AssetGraphBuilder {
415
415
  });
416
416
  if (assets != null) {
417
417
  for (let asset of assets) {
418
+ // Pass the runtimeAssetRequiringExecutionOnLoad flag from the asset
419
+ // group down to the asset itself, for reading in the packager.
420
+ if (input.runtimeAssetRequiringExecutionOnLoad) {
421
+ asset.meta = {
422
+ ...(asset.meta ?? {}),
423
+ runtimeAssetRequiringExecutionOnLoad: input.runtimeAssetRequiringExecutionOnLoad
424
+ };
425
+ }
418
426
  if (this.assetGraph.safeToIncrementallyBundle) {
419
427
  let otherAsset = this.assetGraph.getNodeByContentKey(asset.id);
420
428
  if (otherAsset != null) {
@@ -151,7 +151,6 @@ async function resolveAtlaspackConfig(options) {
151
151
  } catch (e) {
152
152
  throw new (_diagnostic().default)({
153
153
  diagnostic: {
154
- // @ts-expect-error TS2345
155
154
  message: (0, _diagnostic().md)`Could not find parcel config at ${_path().default.relative(options.projectRoot, configPath)}`,
156
155
  origin: '@atlaspack/core'
157
156
  }
@@ -359,7 +358,6 @@ async function resolveExtends(ext, configPath, extendsKey, options) {
359
358
  codeHighlights: (0, _diagnostic().generateJSONCodeHighlights)(parentContents, [{
360
359
  key: extendsKey,
361
360
  type: 'value',
362
- // @ts-expect-error TS2345
363
361
  message: (0, _diagnostic().md)`Cannot find module "${ext}"${alternatives[0] ? `, did you mean "${alternatives[0]}"?` : ''}`
364
362
  }])
365
363
  }]
@@ -386,7 +384,6 @@ async function processExtendedConfig(configPath, extendsKey, extendsSpecifier, r
386
384
  codeHighlights: (0, _diagnostic().generateJSONCodeHighlights)(parentContents, [{
387
385
  key: extendsKey,
388
386
  type: 'value',
389
- // @ts-expect-error TS2345
390
387
  message: (0, _diagnostic().md)`"${extendsSpecifier}" does not exist${alternatives[0] ? `, did you mean "${alternatives[0]}"?` : ''}`
391
388
  }])
392
389
  }]
@@ -92,7 +92,6 @@ async function assertFile(fs, entry, relativeSource, pkgFilePath, keyPath, optio
92
92
  throw new (_diagnostic().default)({
93
93
  diagnostic: {
94
94
  origin: '@atlaspack/core',
95
- // @ts-expect-error TS2345
96
95
  message: (0, _diagnostic().md)`${_path().default.relative(process.cwd(), source)} does not exist.`,
97
96
  codeFrames: [{
98
97
  filePath: pkgFilePath,
@@ -102,7 +101,6 @@ async function assertFile(fs, entry, relativeSource, pkgFilePath, keyPath, optio
102
101
  }])
103
102
  }],
104
103
  hints: alternatives.map(r => {
105
- // @ts-expect-error TS2345
106
104
  return (0, _diagnostic().md)`Did you mean '__${r}__'?`;
107
105
  })
108
106
  }
@@ -113,7 +111,6 @@ async function assertFile(fs, entry, relativeSource, pkgFilePath, keyPath, optio
113
111
  throw new (_diagnostic().default)({
114
112
  diagnostic: {
115
113
  origin: '@atlaspack/core',
116
- // @ts-expect-error TS2345
117
114
  message: (0, _diagnostic().md)`${_path().default.relative(process.cwd(), source)} is not a file.`,
118
115
  codeFrames: [{
119
116
  filePath: pkgFilePath,
@@ -138,7 +135,6 @@ class EntryResolver {
138
135
  if (!(0, _utils().isGlob)(entry)) {
139
136
  throw new (_diagnostic().default)({
140
137
  diagnostic: {
141
- // @ts-expect-error TS2345
142
138
  message: (0, _diagnostic().md)`Entry ${entry} does not exist`
143
139
  }
144
140
  });
@@ -250,7 +246,6 @@ class EntryResolver {
250
246
  }
251
247
  throw new (_diagnostic().default)({
252
248
  diagnostic: {
253
- // @ts-expect-error TS2345
254
249
  message: (0, _diagnostic().md)`Could not find entry: ${entry}`
255
250
  }
256
251
  });
@@ -268,7 +263,6 @@ class EntryResolver {
268
263
  }
269
264
  throw new (_diagnostic().default)({
270
265
  diagnostic: {
271
- // @ts-expect-error TS2345
272
266
  message: (0, _diagnostic().md)`Unknown entry: ${entry}`
273
267
  }
274
268
  });
@@ -287,7 +281,6 @@ class EntryResolver {
287
281
  // TODO: code frame?
288
282
  throw new (_diagnostic().default)({
289
283
  diagnostic: {
290
- // @ts-expect-error TS2345
291
284
  message: (0, _diagnostic().md)`Error parsing ${_path().default.relative(this.options.inputFS.cwd(), pkgFile)}: ${err.message}`
292
285
  }
293
286
  });
@@ -302,9 +302,7 @@ class ResolverRunner {
302
302
  var _result$query;
303
303
  let resultFilePath = result.filePath;
304
304
  if (!_path().default.isAbsolute(resultFilePath)) {
305
- throw new Error(
306
- // @ts-expect-error TS2345
307
- (0, _diagnostic().md)`Resolvers must return an absolute path, ${resolver.name} returned: ${resultFilePath}`);
305
+ throw new Error((0, _diagnostic().md)`Resolvers must return an absolute path, ${resolver.name} returned: ${resultFilePath}`);
308
306
  }
309
307
  return {
310
308
  assetGroup: {
@@ -366,9 +364,7 @@ class ResolverRunner {
366
364
  }
367
365
  let resolveFrom = dependency.resolveFrom ?? dependency.sourcePath;
368
366
  let dir = resolveFrom != null ? (0, _utils().normalizePath)((0, _projectPath.fromProjectPathRelative)(resolveFrom)) : '';
369
- let diagnostic = await this.getDiagnostic(dependency,
370
- // @ts-expect-error TS2345
371
- (0, _diagnostic().md)`Failed to resolve '${dependency.specifier}' ${dir ? `from '${dir}'` : ''}`);
367
+ let diagnostic = await this.getDiagnostic(dependency, (0, _diagnostic().md)`Failed to resolve '${dependency.specifier}' ${dir ? `from '${dir}'` : ''}`);
372
368
  diagnostics.unshift(diagnostic);
373
369
  return {
374
370
  assetGroup: null,
@@ -180,7 +180,6 @@ class TargetResolver {
180
180
  if (!packageTargets.has(target)) {
181
181
  throw new (_diagnostic().default)({
182
182
  diagnostic: {
183
- // @ts-expect-error TS2345
184
183
  message: (0, _diagnostic().md)`Could not find target with name "${target}"`,
185
184
  origin: '@atlaspack/core'
186
185
  }
@@ -202,7 +201,6 @@ class TargetResolver {
202
201
  let optionTargetsString = JSON.stringify(optionTargets, null, '\t');
203
202
  throw new (_diagnostic().default)({
204
203
  diagnostic: {
205
- // @ts-expect-error TS2345
206
204
  message: (0, _diagnostic().md)`Missing distDir for target "${name}"`,
207
205
  origin: '@atlaspack/core',
208
206
  codeFrames: [{
@@ -314,7 +312,6 @@ class TargetResolver {
314
312
  if (pkgFile == null) {
315
313
  throw new (_diagnostic().default)({
316
314
  diagnostic: {
317
- // @ts-expect-error TS2345
318
315
  message: (0, _diagnostic().md)`Expected package.json file in ${rootDir}`,
319
316
  origin: '@atlaspack/core'
320
317
  }
@@ -538,7 +535,6 @@ class TargetResolver {
538
535
  let ext = _path().default.extname(distEntry);
539
536
  throw new (_diagnostic().default)({
540
537
  diagnostic: {
541
- // @ts-expect-error TS2345
542
538
  message: (0, _diagnostic().md)`Unexpected output file type ${ext} in target "${targetName}"`,
543
539
  origin: '@atlaspack/core',
544
540
  codeFrames: [{
@@ -560,7 +556,6 @@ class TargetResolver {
560
556
  let contents = typeof pkgContents === 'string' ? pkgContents : JSON.stringify(pkgContents, null, '\t');
561
557
  throw new (_diagnostic().default)({
562
558
  diagnostic: {
563
- // @ts-expect-error TS2345
564
559
  message: (0, _diagnostic().md)`The "global" output format is not supported in the "${targetName}" target.`,
565
560
  origin: '@atlaspack/core',
566
561
  codeFrames: [{
@@ -587,7 +582,6 @@ class TargetResolver {
587
582
  throw new (_diagnostic().default)({
588
583
  diagnostic: {
589
584
  // prettier-ignore
590
- // @ts-expect-error TS2345
591
585
  message: (0, _diagnostic().md)`Output format "esmodule" cannot be used in the "main" target without a .mjs extension or "type": "module" field.`,
592
586
  origin: '@atlaspack/core',
593
587
  codeFrames: [{
@@ -719,7 +713,6 @@ class TargetResolver {
719
713
  let contents = typeof pkgContents === 'string' ? pkgContents : JSON.stringify(pkgContents, null, '\t');
720
714
  throw new (_diagnostic().default)({
721
715
  diagnostic: {
722
- // @ts-expect-error TS2345
723
716
  message: (0, _diagnostic().md)`Invalid distPath for target "${targetName}"`,
724
717
  origin: '@atlaspack/core',
725
718
  codeFrames: [{
@@ -911,7 +904,6 @@ class TargetResolver {
911
904
  });
912
905
  throw new (_diagnostic().default)({
913
906
  diagnostic: {
914
- // @ts-expect-error TS2345
915
907
  message: (0, _diagnostic().md)`Declared output format "${descriptor.outputFormat}" does not match expected output format "${inferredOutputFormat}".`,
916
908
  origin: '@atlaspack/core',
917
909
  codeFrames: [{
@@ -1009,7 +1001,6 @@ function assertNoDuplicateTargets(options, targets, pkgFilePath, pkgContents) {
1009
1001
  for (let [targetPath, targetNames] of targetsByPath) {
1010
1002
  if (targetNames.length > 1 && pkgContents != null && pkgFilePath != null) {
1011
1003
  diagnostics.push({
1012
- // @ts-expect-error TS2345
1013
1004
  message: (0, _diagnostic().md)`Multiple targets have the same destination path "${_path().default.relative(_path().default.dirname(pkgFilePath), targetPath)}"`,
1014
1005
  origin: '@atlaspack/core',
1015
1006
  codeFrames: [{
@@ -1150,7 +1141,6 @@ async function debugResolvedTargets(input, targets, targetInfo, options) {
1150
1141
  highlight.type = null;
1151
1142
  }
1152
1143
  if (keyInfo.path) {
1153
- // @ts-expect-error TS2345
1154
1144
  highlight.defined = (0, _diagnostic().md)`${key} defined here`;
1155
1145
  }
1156
1146
  if (keyInfo.inferred) {
@@ -1193,7 +1183,6 @@ async function debugResolvedTargets(input, targets, targetInfo, options) {
1193
1183
  v.message != null ? _diagnostic().md.italic(v.message) : '';
1194
1184
  _logger().default.verbose({
1195
1185
  origin: '@atlaspack/core',
1196
- // @ts-expect-error TS2345
1197
1186
  message: (0, _diagnostic().md)`**Target** "${target.name}"
1198
1187
 
1199
1188
  **Entry**: ${_path().default.relative(process.cwd(), (0, _projectPath.fromProjectPath)(options.projectRoot, input.filePath))}
@@ -322,6 +322,7 @@ export type AssetRequestInput = {
322
322
  isSource?: boolean;
323
323
  canDefer?: boolean;
324
324
  sideEffects?: boolean;
325
+ runtimeAssetRequiringExecutionOnLoad?: boolean;
325
326
  code?: string;
326
327
  pipeline?: string | null | undefined;
327
328
  optionsRef: SharedReference;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/core",
3
- "version": "2.23.1",
3
+ "version": "2.23.2",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -24,21 +24,21 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@mischnic/json-sourcemap": "^0.1.0",
27
- "@atlaspack/build-cache": "2.13.4",
28
- "@atlaspack/cache": "3.2.20",
29
- "@atlaspack/diagnostic": "2.14.2",
30
- "@atlaspack/events": "2.14.2",
31
- "@atlaspack/feature-flags": "2.23.0",
32
- "@atlaspack/fs": "2.15.20",
33
- "@atlaspack/graph": "3.5.14",
34
- "@atlaspack/logger": "2.14.17",
35
- "@atlaspack/package-manager": "2.14.25",
36
- "@atlaspack/plugin": "2.14.25",
37
- "@atlaspack/profiler": "2.14.22",
38
- "@atlaspack/rust": "3.6.0",
39
- "@atlaspack/types": "2.15.15",
40
- "@atlaspack/utils": "2.18.2",
41
- "@atlaspack/workers": "2.14.25",
27
+ "@atlaspack/build-cache": "2.13.5",
28
+ "@atlaspack/cache": "3.2.21",
29
+ "@atlaspack/diagnostic": "2.14.3",
30
+ "@atlaspack/events": "2.14.3",
31
+ "@atlaspack/feature-flags": "2.23.1",
32
+ "@atlaspack/fs": "2.15.21",
33
+ "@atlaspack/graph": "3.5.15",
34
+ "@atlaspack/logger": "2.14.18",
35
+ "@atlaspack/package-manager": "2.14.26",
36
+ "@atlaspack/plugin": "2.14.26",
37
+ "@atlaspack/profiler": "2.14.23",
38
+ "@atlaspack/rust": "3.6.1",
39
+ "@atlaspack/types": "2.15.16",
40
+ "@atlaspack/utils": "2.18.3",
41
+ "@atlaspack/workers": "2.14.26",
42
42
  "@parcel/source-map": "^2.1.1",
43
43
  "base-x": "^3.0.8",
44
44
  "browserslist": "^4.6.6",
@@ -51,7 +51,7 @@
51
51
  "semver": "^7.5.2"
52
52
  },
53
53
  "devDependencies": {
54
- "@atlaspack/babel-register": "2.14.2",
54
+ "@atlaspack/babel-register": "2.14.3",
55
55
  "@types/node": ">= 18",
56
56
  "rfdc": "1",
57
57
  "jest-diff": "*",
package/src/Atlaspack.ts CHANGED
@@ -70,7 +70,7 @@ registerCoreWithSerializer();
70
70
  export const INTERNAL_TRANSFORM: symbol = Symbol('internal_transform');
71
71
  export const INTERNAL_RESOLVE: symbol = Symbol('internal_resolve');
72
72
  export let WORKER_PATH: string = path.join(__dirname, 'worker.js');
73
- if (process.env.ATLASPACK_REGISTER_USE_SRC === 'true') {
73
+ if (__filename.endsWith('.ts')) {
74
74
  WORKER_PATH = path.join(__dirname, 'worker.ts');
75
75
  }
76
76
 
@@ -208,7 +208,6 @@ export class AtlaspackConfig {
208
208
 
209
209
  throw await this.missingPluginError(
210
210
  this.transformers,
211
- // @ts-expect-error TS2345
212
211
  md`No transformers found for __${fromProjectPathRelative(filePath)}__` +
213
212
  (pipeline != null ? ` with pipeline: '${pipeline}'` : '') +
214
213
  '.',
@@ -261,7 +260,6 @@ export class AtlaspackConfig {
261
260
  if (!packager) {
262
261
  throw await this.missingPluginError(
263
262
  this.packagers,
264
- // @ts-expect-error TS2345
265
263
  md`No packager found for __${filePath}__.`,
266
264
  '/packagers',
267
265
  );
@@ -325,7 +323,6 @@ export class AtlaspackConfig {
325
323
  if (compressors.length === 0) {
326
324
  throw await this.missingPluginError(
327
325
  this.compressors,
328
- // @ts-expect-error TS2345
329
326
  md`No compressors found for __${filePath}__.`,
330
327
  '/compressors',
331
328
  );
@@ -1,7 +1,6 @@
1
1
  import type {
2
2
  GraphVisitor,
3
3
  FilePath,
4
- Symbol,
5
4
  TraversalActions,
6
5
  BundleBehavior as IBundleBehavior,
7
6
  ConditionMeta,
@@ -525,11 +525,9 @@ export function propagateSymbols({
525
525
  );
526
526
 
527
527
  errors.push({
528
- // @ts-expect-error TS2345
529
528
  message: md`${fromProjectPathRelative(
530
529
  // @ts-expect-error TS2345
531
530
  resolution.value.filePath,
532
- // @ts-expect-error TS2731
533
531
  )} does not export '${s}'`,
534
532
  origin: '@atlaspack/core',
535
533
  codeFrames: loc
@@ -142,7 +142,6 @@ export default class Transformation {
142
142
  logger.verbose([
143
143
  {
144
144
  origin: '@atlaspack/core',
145
- // @ts-expect-error TS2345
146
145
  message: md`Could not load existing source map for ${fromProjectPathRelative(
147
146
  asset.value.filePath,
148
147
  )}`,
@@ -150,6 +150,7 @@ export default async function applyRuntimes<TResult extends RequestResult>({
150
150
  filePath,
151
151
  isEntry,
152
152
  env,
153
+ runtimeAssetRequiringExecutionOnLoad,
153
154
  priority,
154
155
  } of runtimeAssets) {
155
156
  let sourceName = path.join(
@@ -159,6 +160,7 @@ export default async function applyRuntimes<TResult extends RequestResult>({
159
160
 
160
161
  let assetGroup = {
161
162
  code,
163
+ runtimeAssetRequiringExecutionOnLoad,
162
164
  filePath: toProjectPath(options.projectRoot, sourceName),
163
165
  env: mergeEnvironments(
164
166
  options.projectRoot,
@@ -31,7 +31,6 @@ export default async function loadPlugin<T>(
31
31
  let configContents = await options.inputFS.readFile(configPath, 'utf8');
32
32
  throw new ThrowableDiagnostic({
33
33
  diagnostic: {
34
- // @ts-expect-error TS2345
35
34
  message: md`Local plugins are not supported in Atlaspack config packages. Please publish "${pluginName}" as a separate npm package.`,
36
35
  origin: '@atlaspack/core',
37
36
  codeFrames: keyPath
@@ -71,7 +70,6 @@ export default async function loadPlugin<T>(
71
70
  );
72
71
  throw new ThrowableDiagnostic({
73
72
  diagnostic: {
74
- // @ts-expect-error TS2345
75
73
  message: md`Cannot find Atlaspack plugin "${pluginName}"`,
76
74
  origin: '@atlaspack/core',
77
75
  codeFrames: keyPath
@@ -84,7 +82,6 @@ export default async function loadPlugin<T>(
84
82
  {
85
83
  key: keyPath,
86
84
  type: 'value',
87
- // @ts-expect-error TS2345
88
85
  message: md`Cannot find module "${pluginName}"${
89
86
  alternatives[0]
90
87
  ? `, did you mean "${alternatives[0]}"?`
@@ -8,7 +8,6 @@ import type {
8
8
  ExportSymbolResolution,
9
9
  FilePath,
10
10
  GraphVisitor,
11
- Symbol,
12
11
  NamedBundle,
13
12
  SymbolResolution,
14
13
  Target,
@@ -560,6 +560,16 @@ export class AssetGraphBuilder {
560
560
 
561
561
  if (assets != null) {
562
562
  for (let asset of assets) {
563
+ // Pass the runtimeAssetRequiringExecutionOnLoad flag from the asset
564
+ // group down to the asset itself, for reading in the packager.
565
+ if (input.runtimeAssetRequiringExecutionOnLoad) {
566
+ asset.meta = {
567
+ ...(asset.meta ?? {}),
568
+ runtimeAssetRequiringExecutionOnLoad:
569
+ input.runtimeAssetRequiringExecutionOnLoad,
570
+ };
571
+ }
572
+
563
573
  if (this.assetGraph.safeToIncrementallyBundle) {
564
574
  let otherAsset = this.assetGraph.getNodeByContentKey(asset.id);
565
575
  if (otherAsset != null) {
@@ -184,7 +184,6 @@ export async function resolveAtlaspackConfig(
184
184
  } catch (e: any) {
185
185
  throw new ThrowableDiagnostic({
186
186
  diagnostic: {
187
- // @ts-expect-error TS2345
188
187
  message: md`Could not find parcel config at ${path.relative(
189
188
  options.projectRoot,
190
189
  configPath,
@@ -520,7 +519,6 @@ export async function resolveExtends(
520
519
  {
521
520
  key: extendsKey,
522
521
  type: 'value',
523
- // @ts-expect-error TS2345
524
522
  message: md`Cannot find module "${ext}"${
525
523
  alternatives[0]
526
524
  ? `, did you mean "${alternatives[0]}"?`
@@ -570,7 +568,6 @@ async function processExtendedConfig(
570
568
  {
571
569
  key: extendsKey,
572
570
  type: 'value',
573
- // @ts-expect-error TS2345
574
571
  message: md`"${extendsSpecifier}" does not exist${
575
572
  alternatives[0] ? `, did you mean "${alternatives[0]}"?` : ''
576
573
  }`,
@@ -107,7 +107,6 @@ async function assertFile(
107
107
  throw new ThrowableDiagnostic({
108
108
  diagnostic: {
109
109
  origin: '@atlaspack/core',
110
- // @ts-expect-error TS2345
111
110
  message: md`${path.relative(process.cwd(), source)} does not exist.`,
112
111
  codeFrames: [
113
112
  {
@@ -121,7 +120,6 @@ async function assertFile(
121
120
  },
122
121
  ],
123
122
  hints: alternatives.map((r) => {
124
- // @ts-expect-error TS2345
125
123
  return md`Did you mean '__${r}__'?`;
126
124
  }),
127
125
  },
@@ -133,7 +131,6 @@ async function assertFile(
133
131
  throw new ThrowableDiagnostic({
134
132
  diagnostic: {
135
133
  origin: '@atlaspack/core',
136
- // @ts-expect-error TS2345
137
134
  message: md`${path.relative(process.cwd(), source)} is not a file.`,
138
135
  codeFrames: [
139
136
  {
@@ -166,7 +163,6 @@ export class EntryResolver {
166
163
  if (!isGlob(entry)) {
167
164
  throw new ThrowableDiagnostic({
168
165
  diagnostic: {
169
- // @ts-expect-error TS2345
170
166
  message: md`Entry ${entry} does not exist`,
171
167
  },
172
168
  });
@@ -319,7 +315,6 @@ export class EntryResolver {
319
315
 
320
316
  throw new ThrowableDiagnostic({
321
317
  diagnostic: {
322
- // @ts-expect-error TS2345
323
318
  message: md`Could not find entry: ${entry}`,
324
319
  },
325
320
  });
@@ -346,7 +341,6 @@ export class EntryResolver {
346
341
 
347
342
  throw new ThrowableDiagnostic({
348
343
  diagnostic: {
349
- // @ts-expect-error TS2345
350
344
  message: md`Unknown entry: ${entry}`,
351
345
  },
352
346
  });
@@ -379,7 +373,6 @@ export class EntryResolver {
379
373
  // TODO: code frame?
380
374
  throw new ThrowableDiagnostic({
381
375
  diagnostic: {
382
- // @ts-expect-error TS2345
383
376
  message: md`Error parsing ${path.relative(
384
377
  this.options.inputFS.cwd(),
385
378
  pkgFile,
@@ -357,7 +357,6 @@ export class ResolverRunner {
357
357
  let resultFilePath = result.filePath;
358
358
  if (!path.isAbsolute(resultFilePath)) {
359
359
  throw new Error(
360
- // @ts-expect-error TS2345
361
360
  md`Resolvers must return an absolute path, ${resolver.name} returned: ${resultFilePath}`,
362
361
  );
363
362
  }
@@ -449,7 +448,6 @@ export class ResolverRunner {
449
448
 
450
449
  let diagnostic = await this.getDiagnostic(
451
450
  dependency,
452
- // @ts-expect-error TS2345
453
451
  md`Failed to resolve '${dependency.specifier}' ${
454
452
  dir ? `from '${dir}'` : ''
455
453
  }`,