@atlaspack/transformer-js 2.12.1-dev.3520 → 2.12.1-dev.3565

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.
@@ -130,6 +130,9 @@ const CONFIG_SCHEMA = {
130
130
  }
131
131
  }]
132
132
  },
133
+ magicComments: {
134
+ type: 'boolean'
135
+ },
133
136
  unstable_inlineConstants: {
134
137
  type: 'boolean'
135
138
  }
@@ -219,8 +222,9 @@ var _default = exports.default = new (_plugin().Transformer)({
219
222
  let inlineEnvironment = config.isSource;
220
223
  let inlineFS = !ignoreFS;
221
224
  let inlineConstants = false;
225
+ let magicComments = false;
222
226
  if (conf && conf.contents) {
223
- var _conf$contents, _conf$contents2, _conf$contents3;
227
+ var _conf$contents, _conf$contents2, _conf$contents3, _conf$contents4;
224
228
  _utils().validateSchema.diagnostic(CONFIG_SCHEMA, {
225
229
  data: conf.contents,
226
230
  // FIXME
@@ -230,9 +234,10 @@ var _default = exports.default = new (_plugin().Transformer)({
230
234
  },
231
235
  // FIXME
232
236
  '@atlaspack/transformer-js', 'Invalid config for @atlaspack/transformer-js');
233
- inlineEnvironment = ((_conf$contents = conf.contents) === null || _conf$contents === void 0 ? void 0 : _conf$contents.inlineEnvironment) ?? inlineEnvironment;
234
- inlineFS = ((_conf$contents2 = conf.contents) === null || _conf$contents2 === void 0 ? void 0 : _conf$contents2.inlineFS) ?? inlineFS;
235
- inlineConstants = ((_conf$contents3 = conf.contents) === null || _conf$contents3 === void 0 ? void 0 : _conf$contents3.unstable_inlineConstants) ?? inlineConstants;
237
+ magicComments = ((_conf$contents = conf.contents) === null || _conf$contents === void 0 ? void 0 : _conf$contents.magicComments) ?? magicComments;
238
+ inlineEnvironment = ((_conf$contents2 = conf.contents) === null || _conf$contents2 === void 0 ? void 0 : _conf$contents2.inlineEnvironment) ?? inlineEnvironment;
239
+ inlineFS = ((_conf$contents3 = conf.contents) === null || _conf$contents3 === void 0 ? void 0 : _conf$contents3.inlineFS) ?? inlineFS;
240
+ inlineConstants = ((_conf$contents4 = conf.contents) === null || _conf$contents4 === void 0 ? void 0 : _conf$contents4.unstable_inlineConstants) ?? inlineConstants;
236
241
  }
237
242
  return {
238
243
  isJSX,
@@ -245,7 +250,8 @@ var _default = exports.default = new (_plugin().Transformer)({
245
250
  inlineConstants,
246
251
  reactRefresh,
247
252
  decorators,
248
- useDefineForClassFields
253
+ useDefineForClassFields,
254
+ magicComments
249
255
  };
250
256
  },
251
257
  async transform({
@@ -367,6 +373,7 @@ var _default = exports.default = new (_plugin().Transformer)({
367
373
  standalone: asset.query.has('standalone'),
368
374
  inline_constants: config.inlineConstants,
369
375
  conditional_bundling: options.featureFlags.conditionalBundlingApi,
376
+ magic_comments: Boolean(config === null || config === void 0 ? void 0 : config.magicComments),
370
377
  callMacro: asset.isSource ? async (err, src, exportName, args, loc) => {
371
378
  let mod;
372
379
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/transformer-js",
3
- "version": "2.12.1-dev.3520+8a5346e28",
3
+ "version": "2.12.1-dev.3565+b31bc6b33",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -15,7 +15,7 @@
15
15
  "test": "mocha"
16
16
  },
17
17
  "engines": {
18
- "parcel": "^2.12.1-dev.3520+8a5346e28",
18
+ "atlaspack": "^2.12.1-dev.3565+b31bc6b33",
19
19
  "node": ">= 16.0.0"
20
20
  },
21
21
  "files": [
@@ -23,21 +23,21 @@
23
23
  "src"
24
24
  ],
25
25
  "dependencies": {
26
- "@atlaspack/diagnostic": "2.12.1-dev.3520+8a5346e28",
27
- "@atlaspack/feature-flags": "2.12.1-dev.3520+8a5346e28",
28
- "@atlaspack/plugin": "2.12.1-dev.3520+8a5346e28",
29
- "@atlaspack/rust": "2.12.1-dev.3520+8a5346e28",
30
- "@atlaspack/utils": "2.12.1-dev.3520+8a5346e28",
31
- "@atlaspack/workers": "2.12.1-dev.3520+8a5346e28",
26
+ "@atlaspack/diagnostic": "2.12.1-dev.3565+b31bc6b33",
27
+ "@atlaspack/feature-flags": "2.12.1-dev.3565+b31bc6b33",
28
+ "@atlaspack/plugin": "2.12.1-dev.3565+b31bc6b33",
29
+ "@atlaspack/rust": "2.12.1-dev.3565+b31bc6b33",
30
+ "@atlaspack/utils": "2.12.1-dev.3565+b31bc6b33",
31
+ "@atlaspack/workers": "2.12.1-dev.3565+b31bc6b33",
32
32
  "@parcel/source-map": "^2.1.1",
33
- "@swc/helpers": "^0.5.0",
33
+ "@swc/helpers": "^0.5.15",
34
34
  "browserslist": "^4.6.6",
35
35
  "nullthrows": "^1.1.1",
36
36
  "regenerator-runtime": "^0.13.7",
37
37
  "semver": "^7.5.2"
38
38
  },
39
39
  "peerDependencies": {
40
- "@atlaspack/core": "^2.12.1-dev.3520+8a5346e28"
40
+ "@atlaspack/core": "^2.12.1-dev.3565+b31bc6b33"
41
41
  },
42
- "gitHead": "8a5346e28c1bb3b9cd40f1c4e77c66dd6666f1e4"
42
+ "gitHead": "b31bc6b33de40c158b9f4d8ff177238be0de409d"
43
43
  }
@@ -108,6 +108,9 @@ const CONFIG_SCHEMA: SchemaEntity = {
108
108
  },
109
109
  ],
110
110
  },
111
+ magicComments: {
112
+ type: 'boolean',
113
+ },
111
114
  unstable_inlineConstants: {
112
115
  type: 'boolean',
113
116
  },
@@ -287,6 +290,8 @@ export default (new Transformer({
287
290
  let inlineEnvironment = config.isSource;
288
291
  let inlineFS = !ignoreFS;
289
292
  let inlineConstants = false;
293
+ let magicComments = false;
294
+
290
295
  if (conf && conf.contents) {
291
296
  validateSchema.diagnostic(
292
297
  CONFIG_SCHEMA,
@@ -302,6 +307,7 @@ export default (new Transformer({
302
307
  'Invalid config for @atlaspack/transformer-js',
303
308
  );
304
309
 
310
+ magicComments = conf.contents?.magicComments ?? magicComments;
305
311
  inlineEnvironment = conf.contents?.inlineEnvironment ?? inlineEnvironment;
306
312
  inlineFS = conf.contents?.inlineFS ?? inlineFS;
307
313
  inlineConstants =
@@ -320,6 +326,7 @@ export default (new Transformer({
320
326
  reactRefresh,
321
327
  decorators,
322
328
  useDefineForClassFields,
329
+ magicComments,
323
330
  };
324
331
  },
325
332
  async transform({asset, config, options, logger}) {
@@ -463,6 +470,7 @@ export default (new Transformer({
463
470
  standalone: asset.query.has('standalone'),
464
471
  inline_constants: config.inlineConstants,
465
472
  conditional_bundling: options.featureFlags.conditionalBundlingApi,
473
+ magic_comments: Boolean(config?.magicComments),
466
474
  callMacro: asset.isSource
467
475
  ? async (err, src, exportName, args, loc) => {
468
476
  let mod;