@atlaspack/core 2.12.1-canary.3545 → 2.12.1-canary.3547

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.
@@ -23,35 +23,23 @@ class Environment {
23
23
  this.loc = inner.loc;
24
24
  this.unstableSingleFileOutput = false;
25
25
  }
26
-
27
- // TODO
28
26
  isBrowser() {
29
- return true;
27
+ return this.context === 'browser' || this.isWorker() || this.isWorklet() || this.context === 'electron-renderer';
30
28
  }
31
-
32
- // TODO
33
29
  isNode() {
34
- return false;
30
+ return this.context === 'node' || this.isElectron();
35
31
  }
36
-
37
- // TODO
38
32
  isElectron() {
39
- return false;
33
+ return this.context === 'electron-main' || this.context === 'electron-renderer';
40
34
  }
41
-
42
- // TODO
43
35
  isWorker() {
44
- return false;
36
+ return this.context === 'web-worker' || this.context === 'service-worker';
45
37
  }
46
-
47
- // TODO
48
38
  isWorklet() {
49
- return false;
39
+ return this.context === 'worklet';
50
40
  }
51
-
52
- // TODO
53
41
  isIsolated() {
54
- return false;
42
+ return this.isWorker() || this.isWorklet();
55
43
  }
56
44
 
57
45
  // TODO
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/core",
3
- "version": "2.12.1-canary.3545+2f2945668",
3
+ "version": "2.12.1-canary.3547+b586f8787",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,21 +20,21 @@
20
20
  "check-ts": "tsc --noEmit index.d.ts"
21
21
  },
22
22
  "dependencies": {
23
- "@atlaspack/build-cache": "2.12.1-canary.3545+2f2945668",
24
- "@atlaspack/cache": "2.12.1-canary.3545+2f2945668",
25
- "@atlaspack/diagnostic": "2.12.1-canary.3545+2f2945668",
26
- "@atlaspack/events": "2.12.1-canary.3545+2f2945668",
27
- "@atlaspack/feature-flags": "2.12.1-canary.3545+2f2945668",
28
- "@atlaspack/fs": "2.12.1-canary.3545+2f2945668",
29
- "@atlaspack/graph": "3.2.1-canary.3545+2f2945668",
30
- "@atlaspack/logger": "2.12.1-canary.3545+2f2945668",
31
- "@atlaspack/package-manager": "2.12.1-canary.3545+2f2945668",
32
- "@atlaspack/plugin": "2.12.1-canary.3545+2f2945668",
33
- "@atlaspack/profiler": "2.12.1-canary.3545+2f2945668",
34
- "@atlaspack/rust": "2.12.1-canary.3545+2f2945668",
35
- "@atlaspack/types": "2.12.1-canary.3545+2f2945668",
36
- "@atlaspack/utils": "2.12.1-canary.3545+2f2945668",
37
- "@atlaspack/workers": "2.12.1-canary.3545+2f2945668",
23
+ "@atlaspack/build-cache": "2.12.1-canary.3547+b586f8787",
24
+ "@atlaspack/cache": "2.12.1-canary.3547+b586f8787",
25
+ "@atlaspack/diagnostic": "2.12.1-canary.3547+b586f8787",
26
+ "@atlaspack/events": "2.12.1-canary.3547+b586f8787",
27
+ "@atlaspack/feature-flags": "2.12.1-canary.3547+b586f8787",
28
+ "@atlaspack/fs": "2.12.1-canary.3547+b586f8787",
29
+ "@atlaspack/graph": "3.2.1-canary.3547+b586f8787",
30
+ "@atlaspack/logger": "2.12.1-canary.3547+b586f8787",
31
+ "@atlaspack/package-manager": "2.12.1-canary.3547+b586f8787",
32
+ "@atlaspack/plugin": "2.12.1-canary.3547+b586f8787",
33
+ "@atlaspack/profiler": "2.12.1-canary.3547+b586f8787",
34
+ "@atlaspack/rust": "2.12.1-canary.3547+b586f8787",
35
+ "@atlaspack/types": "2.12.1-canary.3547+b586f8787",
36
+ "@atlaspack/utils": "2.12.1-canary.3547+b586f8787",
37
+ "@atlaspack/workers": "2.12.1-canary.3547+b586f8787",
38
38
  "@mischnic/json-sourcemap": "^0.1.0",
39
39
  "@parcel/source-map": "^2.1.1",
40
40
  "base-x": "^3.0.8",
@@ -66,5 +66,5 @@
66
66
  "browser": {
67
67
  "./src/serializerCore.js": "./src/serializerCore.browser.js"
68
68
  },
69
- "gitHead": "2f2945668ee50567c7c8a59f9e0ed91dcb5d71cc"
69
+ "gitHead": "b586f878765bdfb490110db5fe4580116d835548"
70
70
  }
@@ -50,34 +50,35 @@ export class Environment implements IEnvironment {
50
50
  this.unstableSingleFileOutput = false;
51
51
  }
52
52
 
53
- // TODO
54
53
  isBrowser(): boolean {
55
- return true;
54
+ return (
55
+ this.context === 'browser' ||
56
+ this.isWorker() ||
57
+ this.isWorklet() ||
58
+ this.context === 'electron-renderer'
59
+ );
56
60
  }
57
61
 
58
- // TODO
59
62
  isNode(): boolean {
60
- return false;
63
+ return this.context === 'node' || this.isElectron();
61
64
  }
62
65
 
63
- // TODO
64
66
  isElectron(): boolean {
65
- return false;
67
+ return (
68
+ this.context === 'electron-main' || this.context === 'electron-renderer'
69
+ );
66
70
  }
67
71
 
68
- // TODO
69
72
  isWorker(): boolean {
70
- return false;
73
+ return this.context === 'web-worker' || this.context === 'service-worker';
71
74
  }
72
75
 
73
- // TODO
74
76
  isWorklet(): boolean {
75
- return false;
77
+ return this.context === 'worklet';
76
78
  }
77
79
 
78
- // TODO
79
80
  isIsolated(): boolean {
80
- return false;
81
+ return this.isWorker() || this.isWorklet();
81
82
  }
82
83
 
83
84
  // TODO