@ankhorage/surface 0.1.1 → 0.1.3
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
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ankhorage/surface
|
|
2
2
|
|
|
3
|
+
## 0.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix Expo Web icon loading by resolving the runtime module loader from the local Metro `require` function before falling back to `globalThis.require`.
|
|
8
|
+
|
|
9
|
+
## 0.1.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Fix Expo Web icon loading by removing the `import.meta`-based runtime require path so Metro can bundle the package correctly.
|
|
14
|
+
|
|
3
15
|
## 0.1.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveExpoIconComponent.d.ts","sourceRoot":"","sources":["../../../src/primitives/icon/resolveExpoIconComponent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveExpoIconComponent.d.ts","sourceRoot":"","sources":["../../../src/primitives/icon/resolveExpoIconComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9D,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AA4CH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAQ5E"}
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';
|
|
2
1
|
import {} from 'react-native';
|
|
3
|
-
const require = createRequire(import.meta.url);
|
|
4
2
|
let cachedIcons = null;
|
|
3
|
+
function resolveRuntimeRequire() {
|
|
4
|
+
if (typeof require === 'function') {
|
|
5
|
+
return require;
|
|
6
|
+
}
|
|
7
|
+
const globalCandidate = globalThis.require;
|
|
8
|
+
if (typeof globalCandidate === 'function') {
|
|
9
|
+
return globalCandidate;
|
|
10
|
+
}
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
5
13
|
function loadExpoIcons() {
|
|
6
14
|
if (cachedIcons) {
|
|
7
15
|
return cachedIcons;
|
|
8
16
|
}
|
|
17
|
+
const runtimeRequire = resolveRuntimeRequire();
|
|
9
18
|
try {
|
|
10
|
-
|
|
11
|
-
|
|
19
|
+
if (!runtimeRequire) {
|
|
20
|
+
throw new Error('runtime require is unavailable');
|
|
21
|
+
}
|
|
22
|
+
// Keep icon loading lazy so non-Expo consumers do not need the package until Icon is used.
|
|
23
|
+
cachedIcons = runtimeRequire('@expo/vector-icons');
|
|
12
24
|
return cachedIcons;
|
|
13
25
|
}
|
|
14
26
|
catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveExpoIconComponent.js","sourceRoot":"","sources":["../../../src/primitives/icon/resolveExpoIconComponent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveExpoIconComponent.js","sourceRoot":"","sources":["../../../src/primitives/icon/resolveExpoIconComponent.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkC,MAAM,cAAc,CAAC;AAY9D,IAAI,WAAW,GAA2B,IAAI,CAAC;AAE/C,SAAS,qBAAqB;IAC5B,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;QAClC,OAAO,OAAkC,CAAC;IAC5C,CAAC;IAED,MAAM,eAAe,GACnB,UAGD,CAAC,OAAO,CAAC;IAEV,IAAI,OAAO,eAAe,KAAK,UAAU,EAAE,CAAC;QAC1C,OAAO,eAA0C,CAAC;IACpD,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,aAAa;IACpB,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,MAAM,cAAc,GAAG,qBAAqB,EAAE,CAAC;IAE/C,IAAI,CAAC;QACH,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACpD,CAAC;QAED,2FAA2F;QAC3F,WAAW,GAAG,cAAc,CAAC,oBAAoB,CAAoB,CAAC;QACtE,OAAO,WAAW,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,qHAAqH,CACtH,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,QAAgB;IACvD,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAI,KAAiC,CAAC,QAAQ,CAAC,CAAC;IAC/D,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE,CAAC;QACpC,OAAO,SAA8B,CAAC;IACxC,CAAC;IAED,OAAO,KAAK,CAAC,QAA6B,CAAC;AAC7C,CAAC"}
|
package/package.json
CHANGED