@atlaspack/transformer-js 6.0.2-dev-9dac9ed3a.0 → 6.0.2-dev-native-compiled-test-712d92d32.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.
- package/lib/JSTransformer.js +7 -2
- package/package.json +9 -9
- package/src/JSTransformer.ts +7 -1
package/lib/JSTransformer.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
function _sourceMap() {
|
|
8
|
-
const data = _interopRequireDefault(require("@
|
|
8
|
+
const data = _interopRequireDefault(require("@parcel/source-map"));
|
|
9
9
|
_sourceMap = function () {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
@@ -391,7 +391,9 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
391
391
|
// @ts-expect-error TS2339
|
|
392
392
|
conditions,
|
|
393
393
|
// @ts-expect-error TS2339
|
|
394
|
-
magic_comments
|
|
394
|
+
magic_comments,
|
|
395
|
+
// @ts-expect-error TS2339
|
|
396
|
+
compiled_css_rules
|
|
395
397
|
} = await (_rust().transformAsync || _rust().transform)({
|
|
396
398
|
filename: asset.filePath,
|
|
397
399
|
code,
|
|
@@ -481,6 +483,7 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
481
483
|
}
|
|
482
484
|
map.addIndexedMappings(mappings);
|
|
483
485
|
if (originalMap) {
|
|
486
|
+
// @ts-expect-error TS2345
|
|
484
487
|
map.extends(originalMap);
|
|
485
488
|
} else {
|
|
486
489
|
if (!(0, _featureFlags().getFeatureFlag)('omitSourcesContentInMemory')) {
|
|
@@ -966,12 +969,14 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
966
969
|
});
|
|
967
970
|
}
|
|
968
971
|
}
|
|
972
|
+
asset.setCompiledCssStyles(compiled_css_rules);
|
|
969
973
|
asset.type = 'js';
|
|
970
974
|
asset.setBuffer(compiledCode);
|
|
971
975
|
if (map) {
|
|
972
976
|
let sourceMap = new (_sourceMap().default)(options.projectRoot);
|
|
973
977
|
sourceMap.addVLQMap(JSON.parse(map));
|
|
974
978
|
if (originalMap) {
|
|
979
|
+
// @ts-expect-error TS2345
|
|
975
980
|
sourceMap.extends(originalMap);
|
|
976
981
|
}
|
|
977
982
|
asset.setMap(sourceMap);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/transformer-js",
|
|
3
|
-
"version": "6.0.2-dev-
|
|
3
|
+
"version": "6.0.2-dev-native-compiled-test-712d92d32.0",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"src"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@atlaspack/diagnostic": "2.14.5-dev-
|
|
28
|
-
"@atlaspack/feature-flags": "2.25.5-dev-
|
|
29
|
-
"@atlaspack/plugin": "2.14.35-dev-
|
|
30
|
-
"@atlaspack/rust": "3.8.3-dev-
|
|
31
|
-
"@atlaspack/
|
|
32
|
-
"@atlaspack/
|
|
33
|
-
"@
|
|
27
|
+
"@atlaspack/diagnostic": "2.14.5-dev-native-compiled-test-712d92d32.0",
|
|
28
|
+
"@atlaspack/feature-flags": "2.25.5-dev-native-compiled-test-712d92d32.0",
|
|
29
|
+
"@atlaspack/plugin": "2.14.35-dev-native-compiled-test-712d92d32.0",
|
|
30
|
+
"@atlaspack/rust": "3.8.3-dev-native-compiled-test-712d92d32.0",
|
|
31
|
+
"@atlaspack/utils": "3.0.3-dev-native-compiled-test-712d92d32.0",
|
|
32
|
+
"@atlaspack/workers": "2.14.35-dev-native-compiled-test-712d92d32.0",
|
|
33
|
+
"@parcel/source-map": "^2.1.1",
|
|
34
34
|
"@swc/helpers": "^0.5.15",
|
|
35
35
|
"browserslist": "^4.6.6",
|
|
36
36
|
"nullthrows": "^1.1.1",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"@atlaspack/core": "2.25.1"
|
|
42
42
|
},
|
|
43
43
|
"type": "commonjs",
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "712d92d323f25ef36c76ecd254b8f227fe518b89"
|
|
45
45
|
}
|
package/src/JSTransformer.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type {
|
|
|
8
8
|
} from '@atlaspack/types';
|
|
9
9
|
import type {SchemaEntity} from '@atlaspack/utils';
|
|
10
10
|
import type {Diagnostic} from '@atlaspack/diagnostic';
|
|
11
|
-
import SourceMap from '@
|
|
11
|
+
import SourceMap from '@parcel/source-map';
|
|
12
12
|
import {Transformer} from '@atlaspack/plugin';
|
|
13
13
|
import {transform, transformAsync} from '@atlaspack/rust';
|
|
14
14
|
import invariant from 'assert';
|
|
@@ -475,6 +475,8 @@ export default new Transformer({
|
|
|
475
475
|
conditions,
|
|
476
476
|
// @ts-expect-error TS2339
|
|
477
477
|
magic_comments,
|
|
478
|
+
// @ts-expect-error TS2339
|
|
479
|
+
compiled_css_rules,
|
|
478
480
|
} = await (transformAsync || transform)({
|
|
479
481
|
filename: asset.filePath,
|
|
480
482
|
code,
|
|
@@ -581,6 +583,7 @@ export default new Transformer({
|
|
|
581
583
|
|
|
582
584
|
map.addIndexedMappings(mappings);
|
|
583
585
|
if (originalMap) {
|
|
586
|
+
// @ts-expect-error TS2345
|
|
584
587
|
map.extends(originalMap);
|
|
585
588
|
} else {
|
|
586
589
|
if (!getFeatureFlag('omitSourcesContentInMemory')) {
|
|
@@ -1170,6 +1173,8 @@ export default new Transformer({
|
|
|
1170
1173
|
}
|
|
1171
1174
|
}
|
|
1172
1175
|
|
|
1176
|
+
asset.setCompiledCssStyles(compiled_css_rules);
|
|
1177
|
+
|
|
1173
1178
|
asset.type = 'js';
|
|
1174
1179
|
asset.setBuffer(compiledCode);
|
|
1175
1180
|
|
|
@@ -1177,6 +1182,7 @@ export default new Transformer({
|
|
|
1177
1182
|
let sourceMap = new SourceMap(options.projectRoot);
|
|
1178
1183
|
sourceMap.addVLQMap(JSON.parse(map));
|
|
1179
1184
|
if (originalMap) {
|
|
1185
|
+
// @ts-expect-error TS2345
|
|
1180
1186
|
sourceMap.extends(originalMap);
|
|
1181
1187
|
}
|
|
1182
1188
|
asset.setMap(sourceMap);
|