@atlaspack/core 2.25.1 → 2.25.2-dev-af891f2f6.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/LICENSE +201 -0
- package/dist/Atlaspack.js +1 -1
- package/dist/BundleGraph.js +9 -2
- package/dist/CommittedAsset.js +1 -1
- package/dist/Transformation.js +3 -2
- package/dist/UncommittedAsset.js +3 -3
- package/dist/assetUtils.js +2 -1
- package/dist/atlaspack-v3/worker/compat/mutable-asset.js +1 -1
- package/dist/worker.js +1 -1
- package/lib/Atlaspack.js +1 -1
- package/lib/BundleGraph.js +7 -2
- package/lib/CommittedAsset.js +1 -1
- package/lib/Transformation.js +9 -4
- package/lib/UncommittedAsset.js +3 -3
- package/lib/assetUtils.js +8 -1
- package/lib/atlaspack-v3/worker/compat/mutable-asset.js +1 -1
- package/lib/types/CommittedAsset.d.ts +1 -1
- package/lib/types/PackagerRunner.d.ts +1 -1
- package/lib/types/UncommittedAsset.d.ts +1 -1
- package/lib/types/atlaspack-v3/worker/compat/mutable-asset.d.ts +1 -1
- package/lib/types/public/Asset.d.ts +1 -1
- package/lib/worker.js +1 -1
- package/package.json +22 -21
- package/src/Atlaspack.ts +1 -1
- package/src/BundleGraph.ts +18 -7
- package/src/CommittedAsset.ts +1 -1
- package/src/PackagerRunner.ts +1 -1
- package/src/Transformation.ts +3 -2
- package/src/UncommittedAsset.ts +3 -3
- package/src/assetUtils.ts +2 -1
- package/src/atlaspack-v3/worker/compat/mutable-asset.ts +1 -1
- package/src/public/Asset.ts +1 -1
- package/src/worker.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/src/CommittedAsset.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {Readable} from 'stream';
|
|
|
3
3
|
import {deserializeRaw} from '@atlaspack/build-cache';
|
|
4
4
|
import type {AST, Blob} from '@atlaspack/types';
|
|
5
5
|
import {bufferStream, blobToStream, streamFromPromise} from '@atlaspack/utils';
|
|
6
|
-
import SourceMap from '@
|
|
6
|
+
import SourceMap from '@atlaspack/source-map';
|
|
7
7
|
|
|
8
8
|
import {generateFromAST} from './assetUtils';
|
|
9
9
|
import type {Asset, Dependency, AtlaspackOptions} from './types';
|
package/src/PackagerRunner.ts
CHANGED
package/src/Transformation.ts
CHANGED
|
@@ -69,6 +69,7 @@ import {
|
|
|
69
69
|
import {invalidateOnFileCreateToInternal, createInvalidations} from './utils';
|
|
70
70
|
import invariant from 'assert';
|
|
71
71
|
import {tracer, PluginTracer} from '@atlaspack/profiler';
|
|
72
|
+
import SourceMap from '@atlaspack/source-map';
|
|
72
73
|
import {getFeatureFlag} from '@atlaspack/feature-flags';
|
|
73
74
|
|
|
74
75
|
type GenerateFunc = (input: UncommittedAsset) => Promise<GenerateOutput>;
|
|
@@ -460,7 +461,7 @@ export default class Transformation {
|
|
|
460
461
|
if (asset.isASTDirty && asset.generate) {
|
|
461
462
|
let output = await asset.generate();
|
|
462
463
|
asset.content = output.content;
|
|
463
|
-
asset.mapBuffer = output.map
|
|
464
|
+
asset.mapBuffer = SourceMap.safeToBuffer(output.map);
|
|
464
465
|
}
|
|
465
466
|
|
|
466
467
|
asset.clearAST();
|
|
@@ -634,7 +635,7 @@ export default class Transformation {
|
|
|
634
635
|
) {
|
|
635
636
|
let output = await asset.generate();
|
|
636
637
|
asset.content = output.content;
|
|
637
|
-
asset.mapBuffer = output.map
|
|
638
|
+
asset.mapBuffer = SourceMap.safeToBuffer(output.map);
|
|
638
639
|
}
|
|
639
640
|
|
|
640
641
|
// Load config for the transformer.
|
package/src/UncommittedAsset.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type {Asset, Dependency, AtlaspackOptions, Invalidations} from './types';
|
|
|
11
11
|
|
|
12
12
|
import invariant from 'assert';
|
|
13
13
|
import {Readable} from 'stream';
|
|
14
|
-
import SourceMap from '@
|
|
14
|
+
import SourceMap from '@atlaspack/source-map';
|
|
15
15
|
import {serializeRaw} from '@atlaspack/build-cache';
|
|
16
16
|
import {
|
|
17
17
|
blobToStream,
|
|
@@ -249,7 +249,7 @@ export default class UncommittedAsset {
|
|
|
249
249
|
|
|
250
250
|
if (map) {
|
|
251
251
|
this.map = map;
|
|
252
|
-
this.mapBuffer =
|
|
252
|
+
this.mapBuffer = SourceMap.safeToBuffer(map);
|
|
253
253
|
this.setCode(code.replace(SOURCEMAP_RE, ''));
|
|
254
254
|
}
|
|
255
255
|
|
|
@@ -425,7 +425,7 @@ export default class UncommittedAsset {
|
|
|
425
425
|
content,
|
|
426
426
|
ast: result.ast,
|
|
427
427
|
isASTDirty: result.ast === this.ast ? this.isASTDirty : true,
|
|
428
|
-
mapBuffer:
|
|
428
|
+
mapBuffer: SourceMap.safeToBuffer(result.map),
|
|
429
429
|
code: this.code,
|
|
430
430
|
invalidations: this.invalidations,
|
|
431
431
|
});
|
package/src/assetUtils.ts
CHANGED
|
@@ -39,6 +39,7 @@ import {PluginTracer} from '@atlaspack/profiler';
|
|
|
39
39
|
import {identifierRegistry} from './IdentifierRegistry';
|
|
40
40
|
import type {EnvironmentRef} from './EnvironmentManager';
|
|
41
41
|
import {toEnvironmentId} from './EnvironmentManager';
|
|
42
|
+
import SourceMap from '@atlaspack/source-map';
|
|
42
43
|
|
|
43
44
|
export type AssetOptions = {
|
|
44
45
|
id?: string;
|
|
@@ -180,7 +181,7 @@ async function _generateFromAST(asset: CommittedAsset | UncommittedAsset) {
|
|
|
180
181
|
tracer: new PluginTracer({origin: pluginName, category: 'asset-generate'}),
|
|
181
182
|
});
|
|
182
183
|
|
|
183
|
-
let mapBuffer = map
|
|
184
|
+
let mapBuffer = SourceMap.safeToBuffer(map);
|
|
184
185
|
// Store the results in the cache so we can avoid generating again next time
|
|
185
186
|
await Promise.all([
|
|
186
187
|
asset.options.cache.setStream(
|
package/src/public/Asset.ts
CHANGED
package/src/worker.ts
CHANGED
|
@@ -21,7 +21,7 @@ import Validation, {ValidationOpts} from './Validation';
|
|
|
21
21
|
import {AtlaspackConfig} from './AtlaspackConfig';
|
|
22
22
|
import {registerCoreWithSerializer} from './registerCoreWithSerializer';
|
|
23
23
|
import {clearBuildCaches} from '@atlaspack/build-cache';
|
|
24
|
-
import {init as initSourcemaps} from '@
|
|
24
|
+
import {init as initSourcemaps} from '@atlaspack/source-map';
|
|
25
25
|
// @ts-expect-error TS2305
|
|
26
26
|
import {init as initRust} from '@atlaspack/rust';
|
|
27
27
|
import WorkerFarm from '@atlaspack/workers';
|