-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Big Fixes + ENV Rework + Asset/CDN prefix + there's still more
* Fixed icon & font rendering on native * Code now ensures NEXT_PUBLIC_ and EXPO_PUBLIC_ ENV vars are duplicated across both names * Createed util for getting public ENV vars * Added asset/CDN prefix * Fixed some type errors * Added Dripsy-ified variants of used `@expo/vector-icons` components (also see: expo/vector-icons#317) * Updated Solito fork to use a `'link'` variant by default for the `<TextLink>`'s child `<P>` component * Renamed `'a'` variant to `'link'` * Updated Solito fork to fix a mistake in Solito's typing
- Loading branch information
1 parent
553d456
commit dab66be
Showing
35 changed files
with
714 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
diff --git a/path-support.js b/path-support.js | ||
index f0a85af33ff98d3d6d8a9c279378eb2676af160a..87f5df3ccd7e2358ac83b8c6005f8ded60d28bf8 100755 | ||
--- a/path-support.js | ||
+++ b/path-support.js | ||
@@ -10,7 +10,7 @@ | ||
|
||
'use strict'; | ||
|
||
-import type {PackagerAsset} from './registry.js'; | ||
+//import type {PackagerAsset} from './registry.js'; | ||
|
||
const androidScaleSuffix = { | ||
'0.75': 'ldpi', | ||
@@ -27,7 +27,7 @@ const ANDROID_BASE_DENSITY = 160; | ||
* FIXME: using number to represent discrete scale numbers is fragile in essence because of | ||
* floating point numbers imprecision. | ||
*/ | ||
-function getAndroidAssetSuffix(scale: number): string { | ||
+function getAndroidAssetSuffix(scale) { | ||
if (scale.toString() in androidScaleSuffix) { | ||
return androidScaleSuffix[scale.toString()]; | ||
} | ||
@@ -52,9 +52,9 @@ const drawableFileTypes = new Set([ | ||
]); | ||
|
||
function getAndroidResourceFolderName( | ||
- asset: PackagerAsset, | ||
- scale: number, | ||
-): string | $TEMPORARY$string<'raw'> { | ||
+ asset,//: PackagerAsset, | ||
+ scale,//: number, | ||
+) { | ||
if (!drawableFileTypes.has(asset.type)) { | ||
return 'raw'; | ||
} | ||
@@ -72,7 +72,7 @@ function getAndroidResourceFolderName( | ||
return 'drawable-' + suffix; | ||
} | ||
|
||
-function getAndroidResourceIdentifier(asset: PackagerAsset): string { | ||
+function getAndroidResourceIdentifier(asset) { | ||
return (getBasePath(asset) + '/' + asset.name) | ||
.toLowerCase() | ||
.replace(/\//g, '_') // Encode folder structure in file name | ||
@@ -80,7 +80,7 @@ function getAndroidResourceIdentifier(asset: PackagerAsset): string { | ||
.replace(/^assets_/, ''); // Remove "assets_" prefix | ||
} | ||
|
||
-function getBasePath(asset: PackagerAsset): string { | ||
+function getBasePath(asset) { | ||
const basePath = asset.httpServerLocation; | ||
return basePath.startsWith('/') ? basePath.slice(1) : basePath; | ||
} | ||
diff --git a/registry.js b/registry.js | ||
index 02470da3c4962ad1bbdc62d9ed295c19ca4905fe..584c758f2d18f3dd611bcf2614528240346c8747 100755 | ||
--- a/registry.js | ||
+++ b/registry.js | ||
@@ -10,28 +10,28 @@ | ||
|
||
'use strict'; | ||
|
||
-export type PackagerAsset = { | ||
- +__packager_asset: boolean, | ||
- +fileSystemLocation: string, | ||
- +httpServerLocation: string, | ||
- +width: ?number, | ||
- +height: ?number, | ||
- +scales: Array<number>, | ||
- +hash: string, | ||
- +name: string, | ||
- +type: string, | ||
- ... | ||
-}; | ||
+//export type PackagerAsset = { | ||
+// +__packager_asset: boolean, | ||
+// +fileSystemLocation: string, | ||
+// +httpServerLocation: string, | ||
+// +width: ?number, | ||
+// +height: ?number, | ||
+// +scales: Array<number>, | ||
+// +hash: string, | ||
+// +name: string, | ||
+// +type: string, | ||
+// ... | ||
+//}; | ||
|
||
-const assets: Array<PackagerAsset> = []; | ||
+const assets = []; | ||
|
||
-function registerAsset(asset: PackagerAsset): number { | ||
+function registerAsset(asset) { | ||
// `push` returns new array length, so the first asset will | ||
// get id 1 (not 0) to make the value truthy | ||
return assets.push(asset); | ||
} | ||
|
||
-function getAssetByID(assetId: number): PackagerAsset { | ||
+function getAssetByID(assetId) { | ||
return assets[assetId - 1]; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/package.json b/package.json | ||
index 64d04d7664700d58e7914e8a01ee2a19227fd303..c22ec3aa572b2a36bea0b678679e72414842c60d 100644 | ||
--- a/package.json | ||
+++ b/package.json | ||
@@ -10,6 +10,11 @@ | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/cjs/index.js", | ||
"types": "./dist/@types/index.d.ts" | ||
+ }, | ||
+ "./*": { | ||
+ "import": "./dist/esm/*.js", | ||
+ "require": "./dist/cjs/*.js", | ||
+ "types": "./dist/@types/*.d.ts" | ||
} | ||
}, | ||
"files": [ |
Oops, something went wrong.