@atlaspack/core 2.25.2-dev-9dac9ed3a.0 → 2.25.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/dist/Atlaspack.js +1 -1
- package/dist/CommittedAsset.js +4 -1
- package/dist/Transformation.js +2 -3
- package/dist/UncommittedAsset.js +12 -3
- package/dist/assetUtils.js +1 -2
- package/dist/atlaspack-v3/worker/compat/mutable-asset.js +5 -1
- package/dist/public/Asset.js +6 -0
- package/dist/requests/TargetRequest.js +0 -1
- package/dist/worker.js +1 -1
- package/lib/Atlaspack.js +1 -1
- package/lib/CommittedAsset.js +4 -1
- package/lib/Transformation.js +4 -9
- package/lib/UncommittedAsset.js +12 -3
- package/lib/assetUtils.js +1 -8
- package/lib/atlaspack-v3/worker/compat/mutable-asset.js +5 -1
- package/lib/public/Asset.js +6 -0
- package/lib/requests/TargetRequest.js +1 -2
- package/lib/types/CommittedAsset.d.ts +2 -1
- package/lib/types/PackagerRunner.d.ts +1 -1
- package/lib/types/UncommittedAsset.d.ts +3 -1
- package/lib/types/atlaspack-v3/worker/compat/mutable-asset.d.ts +3 -1
- package/lib/types/public/Asset.d.ts +3 -1
- package/lib/types/types.d.ts +1 -0
- package/lib/worker.js +1 -1
- package/package.json +19 -19
- package/src/Atlaspack.ts +1 -1
- package/src/CommittedAsset.ts +5 -1
- package/src/PackagerRunner.ts +1 -1
- package/src/Transformation.ts +2 -3
- package/src/UncommittedAsset.ts +14 -3
- package/src/assetUtils.ts +1 -2
- package/src/atlaspack-v3/worker/compat/mutable-asset.ts +7 -1
- package/src/atlaspack-v3/worker/worker.ts +1 -1
- package/src/public/Asset.ts +9 -1
- package/src/requests/TargetRequest.ts +0 -1
- package/src/types.ts +1 -0
- package/src/worker.ts +1 -1
- package/test/TargetRequest.test.ts +0 -12
- package/test/fixtures/custom-targets/package.json +0 -6
- package/tsconfig.json +0 -3
- package/tsconfig.tsbuildinfo +1 -1
package/src/assetUtils.ts
CHANGED
|
@@ -39,7 +39,6 @@ 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';
|
|
43
42
|
|
|
44
43
|
export type AssetOptions = {
|
|
45
44
|
id?: string;
|
|
@@ -181,7 +180,7 @@ async function _generateFromAST(asset: CommittedAsset | UncommittedAsset) {
|
|
|
181
180
|
tracer: new PluginTracer({origin: pluginName, category: 'asset-generate'}),
|
|
182
181
|
});
|
|
183
182
|
|
|
184
|
-
let mapBuffer =
|
|
183
|
+
let mapBuffer = map?.toBuffer();
|
|
185
184
|
// Store the results in the cache so we can avoid generating again next time
|
|
186
185
|
await Promise.all([
|
|
187
186
|
asset.options.cache.setStream(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import SourceMap from '@
|
|
1
|
+
import SourceMap from '@parcel/source-map';
|
|
2
2
|
import * as napi from '@atlaspack/rust';
|
|
3
3
|
import {Readable} from 'stream';
|
|
4
4
|
import type {
|
|
@@ -41,6 +41,7 @@ export class MutableAsset implements IMutableAsset {
|
|
|
41
41
|
symbols: MutableAssetSymbols;
|
|
42
42
|
type: string;
|
|
43
43
|
uniqueKey: string | null | undefined;
|
|
44
|
+
compiledCssStyles?: string[];
|
|
44
45
|
|
|
45
46
|
#astDirty: boolean;
|
|
46
47
|
#ast: AST | null | undefined;
|
|
@@ -82,6 +83,7 @@ export class MutableAsset implements IMutableAsset {
|
|
|
82
83
|
this.symbols = new MutableAssetSymbols(asset.symbols);
|
|
83
84
|
this.type = asset.type;
|
|
84
85
|
this.uniqueKey = asset.uniqueKey;
|
|
86
|
+
this.compiledCssStyles = asset.compiledCssStyles;
|
|
85
87
|
|
|
86
88
|
this.#astDirty = false;
|
|
87
89
|
this.#contents = contents;
|
|
@@ -206,4 +208,8 @@ export class MutableAsset implements IMutableAsset {
|
|
|
206
208
|
invalidateOnBuild(): void {
|
|
207
209
|
// TODO: Forward invalidations to Rust
|
|
208
210
|
}
|
|
211
|
+
|
|
212
|
+
setCompiledCssStyles(styles: string[]): void {
|
|
213
|
+
this.compiledCssStyles = styles;
|
|
214
|
+
}
|
|
209
215
|
}
|
package/src/public/Asset.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type SourceMap from '@
|
|
1
|
+
import type SourceMap from '@parcel/source-map';
|
|
2
2
|
import type {Readable} from 'stream';
|
|
3
3
|
import type {FileSystem} from '@atlaspack/fs';
|
|
4
4
|
|
|
@@ -190,6 +190,10 @@ class BaseAsset {
|
|
|
190
190
|
getMapBuffer(): Promise<Buffer | null | undefined> {
|
|
191
191
|
return this.#asset.getMapBuffer();
|
|
192
192
|
}
|
|
193
|
+
|
|
194
|
+
getCompiledCssStyles(): ReadonlyArray<string> | undefined {
|
|
195
|
+
return this.#asset.getCompiledCssStyles();
|
|
196
|
+
}
|
|
193
197
|
}
|
|
194
198
|
|
|
195
199
|
export class Asset extends BaseAsset implements IAsset {
|
|
@@ -369,4 +373,8 @@ export class MutableAsset extends BaseAsset implements IMutableAsset {
|
|
|
369
373
|
});
|
|
370
374
|
this.#asset.updateId();
|
|
371
375
|
}
|
|
376
|
+
|
|
377
|
+
setCompiledCssStyles(styles: string[]): void {
|
|
378
|
+
this.#asset.setCompiledCssStyles(styles);
|
|
379
|
+
}
|
|
372
380
|
}
|
|
@@ -1151,7 +1151,6 @@ export class TargetResolver {
|
|
|
1151
1151
|
shouldScopeHoist:
|
|
1152
1152
|
shouldScopeHoist && descriptor.scopeHoist !== false,
|
|
1153
1153
|
sourceMap: normalizeSourceMap(this.options, descriptor.sourceMap),
|
|
1154
|
-
customEnv: descriptor.env,
|
|
1155
1154
|
}),
|
|
1156
1155
|
loc: toInternalSourceLocation(this.options.projectRoot, loc),
|
|
1157
1156
|
});
|
package/src/types.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 '@parcel/source-map';
|
|
25
25
|
// @ts-expect-error TS2305
|
|
26
26
|
import {init as initRust} from '@atlaspack/rust';
|
|
27
27
|
import WorkerFarm from '@atlaspack/workers';
|
|
@@ -382,9 +382,6 @@ describe('TargetResolver', () => {
|
|
|
382
382
|
loc: undefined,
|
|
383
383
|
sourceType: 'module',
|
|
384
384
|
unstableSingleFileOutput: false,
|
|
385
|
-
customEnv: {
|
|
386
|
-
useFlag: 'false',
|
|
387
|
-
},
|
|
388
385
|
}),
|
|
389
386
|
loc: {
|
|
390
387
|
filePath: relative(
|
|
@@ -419,9 +416,6 @@ describe('TargetResolver', () => {
|
|
|
419
416
|
loc: undefined,
|
|
420
417
|
sourceType: 'module',
|
|
421
418
|
unstableSingleFileOutput: false,
|
|
422
|
-
customEnv: {
|
|
423
|
-
useFlag: 'true',
|
|
424
|
-
},
|
|
425
419
|
}),
|
|
426
420
|
loc: {
|
|
427
421
|
filePath: relative(
|
|
@@ -507,9 +501,6 @@ describe('TargetResolver', () => {
|
|
|
507
501
|
loc: undefined,
|
|
508
502
|
sourceType: 'module',
|
|
509
503
|
unstableSingleFileOutput: false,
|
|
510
|
-
customEnv: {
|
|
511
|
-
useFlag: 'false',
|
|
512
|
-
},
|
|
513
504
|
}),
|
|
514
505
|
loc: {
|
|
515
506
|
filePath: relative(
|
|
@@ -544,9 +535,6 @@ describe('TargetResolver', () => {
|
|
|
544
535
|
loc: undefined,
|
|
545
536
|
sourceType: 'module',
|
|
546
537
|
unstableSingleFileOutput: false,
|
|
547
|
-
customEnv: {
|
|
548
|
-
useFlag: 'true',
|
|
549
|
-
},
|
|
550
538
|
}),
|
|
551
539
|
loc: {
|
|
552
540
|
filePath: relative(
|