@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.
Files changed (41) hide show
  1. package/dist/Atlaspack.js +1 -1
  2. package/dist/CommittedAsset.js +4 -1
  3. package/dist/Transformation.js +2 -3
  4. package/dist/UncommittedAsset.js +12 -3
  5. package/dist/assetUtils.js +1 -2
  6. package/dist/atlaspack-v3/worker/compat/mutable-asset.js +5 -1
  7. package/dist/public/Asset.js +6 -0
  8. package/dist/requests/TargetRequest.js +0 -1
  9. package/dist/worker.js +1 -1
  10. package/lib/Atlaspack.js +1 -1
  11. package/lib/CommittedAsset.js +4 -1
  12. package/lib/Transformation.js +4 -9
  13. package/lib/UncommittedAsset.js +12 -3
  14. package/lib/assetUtils.js +1 -8
  15. package/lib/atlaspack-v3/worker/compat/mutable-asset.js +5 -1
  16. package/lib/public/Asset.js +6 -0
  17. package/lib/requests/TargetRequest.js +1 -2
  18. package/lib/types/CommittedAsset.d.ts +2 -1
  19. package/lib/types/PackagerRunner.d.ts +1 -1
  20. package/lib/types/UncommittedAsset.d.ts +3 -1
  21. package/lib/types/atlaspack-v3/worker/compat/mutable-asset.d.ts +3 -1
  22. package/lib/types/public/Asset.d.ts +3 -1
  23. package/lib/types/types.d.ts +1 -0
  24. package/lib/worker.js +1 -1
  25. package/package.json +19 -19
  26. package/src/Atlaspack.ts +1 -1
  27. package/src/CommittedAsset.ts +5 -1
  28. package/src/PackagerRunner.ts +1 -1
  29. package/src/Transformation.ts +2 -3
  30. package/src/UncommittedAsset.ts +14 -3
  31. package/src/assetUtils.ts +1 -2
  32. package/src/atlaspack-v3/worker/compat/mutable-asset.ts +7 -1
  33. package/src/atlaspack-v3/worker/worker.ts +1 -1
  34. package/src/public/Asset.ts +9 -1
  35. package/src/requests/TargetRequest.ts +0 -1
  36. package/src/types.ts +1 -0
  37. package/src/worker.ts +1 -1
  38. package/test/TargetRequest.test.ts +0 -12
  39. package/test/fixtures/custom-targets/package.json +0 -6
  40. package/tsconfig.json +0 -3
  41. 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 = SourceMap.safeToBuffer(map);
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 '@atlaspack/source-map';
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
  }
@@ -278,7 +278,7 @@ export class AtlaspackWorker {
278
278
  );
279
279
 
280
280
  assert(
281
- result[0] === mutableAsset,
281
+ (result[0] as unknown as MutableAsset) === mutableAsset,
282
282
  '[V3] Unimplemented: New asset returned from Node transformer',
283
283
  );
284
284
 
@@ -1,4 +1,4 @@
1
- import type SourceMap from '@atlaspack/source-map';
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
@@ -226,6 +226,7 @@ export type Asset = {
226
226
  plugin: PackageName | null | undefined;
227
227
  configKeyPath?: string;
228
228
  isLargeBlob?: boolean;
229
+ compiledCssStyles?: string[];
229
230
  };
230
231
 
231
232
  export type InternalGlob = ProjectPath;
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 '@atlaspack/source-map';
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(
@@ -9,17 +9,11 @@
9
9
  "browserModern": {
10
10
  "engines": {
11
11
  "browsers": ["last 1 version"]
12
- },
13
- "env": {
14
- "useFlag": "false"
15
12
  }
16
13
  },
17
14
  "browserLegacy": {
18
15
  "engines": {
19
16
  "browsers": ["ie11"]
20
- },
21
- "env": {
22
- "useFlag": "true"
23
17
  }
24
18
  }
25
19
  }
package/tsconfig.json CHANGED
@@ -52,9 +52,6 @@
52
52
  },
53
53
  {
54
54
  "path": "../workers/tsconfig.json"
55
- },
56
- {
57
- "path": "../source-map/tsconfig.json"
58
55
  }
59
56
  ]
60
57
  }