@atlaspack/core 2.12.1-canary.3439 → 2.12.1-canary.3441

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/Dependency.js CHANGED
@@ -40,7 +40,7 @@ function createDependencyId({
40
40
  const params = {
41
41
  sourceAssetId,
42
42
  specifier,
43
- env,
43
+ environmentId: env.id,
44
44
  target,
45
45
  pipeline,
46
46
  specifierType: _types.SpecifierType[specifierType],
package/lib/assetUtils.js CHANGED
@@ -62,7 +62,7 @@ function _profiler() {
62
62
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
63
63
  function createAssetIdFromOptions(options) {
64
64
  return (0, _rust().createAssetId)({
65
- env: options.env,
65
+ environmentId: options.env.id,
66
66
  filePath: options.filePath,
67
67
  code: options.code,
68
68
  pipeline: options.pipeline,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/core",
3
- "version": "2.12.1-canary.3439+4253c71f2",
3
+ "version": "2.12.1-canary.3441+d191cc659",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,20 +20,20 @@
20
20
  "check-ts": "tsc --noEmit index.d.ts"
21
21
  },
22
22
  "dependencies": {
23
- "@atlaspack/cache": "2.12.1-canary.3439+4253c71f2",
24
- "@atlaspack/diagnostic": "2.12.1-canary.3439+4253c71f2",
25
- "@atlaspack/events": "2.12.1-canary.3439+4253c71f2",
26
- "@atlaspack/feature-flags": "2.12.1-canary.3439+4253c71f2",
27
- "@atlaspack/fs": "2.12.1-canary.3439+4253c71f2",
28
- "@atlaspack/graph": "3.2.1-canary.3439+4253c71f2",
29
- "@atlaspack/logger": "2.12.1-canary.3439+4253c71f2",
30
- "@atlaspack/package-manager": "2.12.1-canary.3439+4253c71f2",
31
- "@atlaspack/plugin": "2.12.1-canary.3439+4253c71f2",
32
- "@atlaspack/profiler": "2.12.1-canary.3439+4253c71f2",
33
- "@atlaspack/rust": "2.12.1-canary.3439+4253c71f2",
34
- "@atlaspack/types": "2.12.1-canary.3439+4253c71f2",
35
- "@atlaspack/utils": "2.12.1-canary.3439+4253c71f2",
36
- "@atlaspack/workers": "2.12.1-canary.3439+4253c71f2",
23
+ "@atlaspack/cache": "2.12.1-canary.3441+d191cc659",
24
+ "@atlaspack/diagnostic": "2.12.1-canary.3441+d191cc659",
25
+ "@atlaspack/events": "2.12.1-canary.3441+d191cc659",
26
+ "@atlaspack/feature-flags": "2.12.1-canary.3441+d191cc659",
27
+ "@atlaspack/fs": "2.12.1-canary.3441+d191cc659",
28
+ "@atlaspack/graph": "3.2.1-canary.3441+d191cc659",
29
+ "@atlaspack/logger": "2.12.1-canary.3441+d191cc659",
30
+ "@atlaspack/package-manager": "2.12.1-canary.3441+d191cc659",
31
+ "@atlaspack/plugin": "2.12.1-canary.3441+d191cc659",
32
+ "@atlaspack/profiler": "2.12.1-canary.3441+d191cc659",
33
+ "@atlaspack/rust": "2.12.1-canary.3441+d191cc659",
34
+ "@atlaspack/types": "2.12.1-canary.3441+d191cc659",
35
+ "@atlaspack/utils": "2.12.1-canary.3441+d191cc659",
36
+ "@atlaspack/workers": "2.12.1-canary.3441+d191cc659",
37
37
  "@mischnic/json-sourcemap": "^0.1.0",
38
38
  "@parcel/source-map": "^2.1.1",
39
39
  "base-x": "^3.0.8",
@@ -57,5 +57,5 @@
57
57
  "browser": {
58
58
  "./src/serializerCore.js": "./src/serializerCore.browser.js"
59
59
  },
60
- "gitHead": "4253c71f2ca52d020671d98474ee505471e3e477"
60
+ "gitHead": "d191cc659802642a7b62cbde92aa8bd08d028600"
61
61
  }
package/src/Dependency.js CHANGED
@@ -72,7 +72,7 @@ export function createDependencyId({
72
72
  const params = {
73
73
  sourceAssetId,
74
74
  specifier,
75
- env,
75
+ environmentId: env.id,
76
76
  target,
77
77
  pipeline,
78
78
  specifierType: SpecifierType[specifierType],
package/src/assetUtils.js CHANGED
@@ -70,7 +70,7 @@ export type AssetOptions = {|
70
70
 
71
71
  export function createAssetIdFromOptions(options: AssetOptions): string {
72
72
  return createAssetIdRust({
73
- env: options.env,
73
+ environmentId: options.env.id,
74
74
  filePath: options.filePath,
75
75
  code: options.code,
76
76
  pipeline: options.pipeline,
@@ -17,5 +17,33 @@ describe('Dependency', () => {
17
17
  });
18
18
  expect(id1).toEqual(id2);
19
19
  });
20
+
21
+ it('dependencies with different targets should have different IDs', () => {
22
+ let id1 = createDependencyId({
23
+ specifier: 'foo',
24
+ env: createEnvironment(),
25
+ specifierType: 'esm',
26
+ target: {
27
+ name: 'test-1234',
28
+ distDir: 'dist-dir',
29
+ env: createEnvironment(),
30
+ publicUrl: 'public-url',
31
+ source: '1234',
32
+ },
33
+ });
34
+ let id2 = createDependencyId({
35
+ specifier: 'foo',
36
+ env: createEnvironment(),
37
+ specifierType: 'esm',
38
+ target: {
39
+ name: 'test-1234',
40
+ distDir: 'dist-dir',
41
+ env: createEnvironment(),
42
+ publicUrl: 'public-url',
43
+ source: '5678', // <- this is different
44
+ },
45
+ });
46
+ expect(id1).not.toEqual(id2);
47
+ });
20
48
  });
21
49
  });