@graphql-mesh/cross-helpers 0.1.7 → 0.2.0-alpha-d232d9b5e.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/CHANGELOG.md +15 -0
- package/browser.js +12 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @graphql-mesh/cross-helpers
|
|
2
2
|
|
|
3
|
+
## 0.2.0-alpha-d232d9b5e.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 288c2ad8a: Improvements on string interpolation ({env.sth} or {context.headers.sth}) for different environments
|
|
8
|
+
|
|
9
|
+
As we mention in most of our docs, we usually expect a key-value `header` object in the context.
|
|
10
|
+
But Fetch-like environments don't have this kind of object but instead `Headers` object which is a kind `Map`.
|
|
11
|
+
Now Mesh can detect this and automatically convert it to the key-value object especially for Yoga users.
|
|
12
|
+
|
|
13
|
+
So for non-Node environments;
|
|
14
|
+
|
|
15
|
+
Mesh will consider `import.meta.env` as `env` if available.
|
|
16
|
+
Otherwise it will take `globalThis` as `env`.
|
|
17
|
+
|
|
3
18
|
## 0.1.7
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/browser.js
CHANGED
|
@@ -11,15 +11,23 @@ const processObj =
|
|
|
11
11
|
typeof process !== 'undefined'
|
|
12
12
|
? process
|
|
13
13
|
: {
|
|
14
|
+
platform: 'linux',
|
|
14
15
|
get env() {
|
|
15
16
|
try {
|
|
16
17
|
// eslint-disable-next-line no-new-func
|
|
17
18
|
return new Function('return import.meta.env')();
|
|
18
19
|
} catch {
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
return new Proxy(
|
|
21
|
+
{},
|
|
22
|
+
{
|
|
23
|
+
get(key) {
|
|
24
|
+
if (key === 'NODE_ENV') {
|
|
25
|
+
return 'development';
|
|
26
|
+
}
|
|
27
|
+
return globalThis[key];
|
|
28
|
+
},
|
|
29
|
+
}
|
|
30
|
+
);
|
|
23
31
|
}
|
|
24
32
|
},
|
|
25
33
|
};
|