@applicaster/quick-brick-assets 16.0.0-alpha.9338540010 → 16.0.0-rc.123

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/README.md CHANGED
@@ -24,7 +24,7 @@ const source = getQuickBrickAsset("mute_unmute_action", "action/flavour_1/mute.p
24
24
 
25
25
  - It returns the same value as a static `require` would (a number on native, a URL on web).
26
26
  - Both arguments are type-checked against the files in `assets/`: an unknown plugin identifier or path is a compile error.
27
- - For `@2x` / `@3x` variants, use the base file name (`icon.png`). The bundler picks the scale.
27
+ - Density variants (`@2x` / `@3x`) aren't supported: webpack's `asset/resource` only follows literal paths, so `generate` fails on them. Use one file per asset.
28
28
  - Platform variants (`.ios.png` / `.android.png`) aren't supported.
29
29
 
30
30
  ## How it works
@@ -45,7 +45,7 @@ export type QuickBrickAssetKey = keyof typeof assets;
45
45
  - `scripts/` and `__tests__/` are TypeScript sources for maintaining the package and aren't published.
46
46
  - In Jest, `tests/quickBrickAssetsMock.js` replaces the map with one that keeps the real keys and uses each key as its value.
47
47
 
48
- The app entry also imports `@applicaster/quick-brick-assets`, so `react-native bundle --assets-dest res` exports every file even if nothing looks it up.
48
+ The native and web app entries also import `@applicaster/quick-brick-assets`, so `react-native bundle --assets-dest res` (native) and webpack (web) export every file even if nothing looks it up.
49
49
 
50
50
  ## Contributing: adding assets
51
51
 
@@ -53,7 +53,6 @@ The app entry also imports `@applicaster/quick-brick-assets`, so `react-native b
53
53
  - `{plugin_identifier}` is the identifier of the plugin or feature that owns the assets (e.g. `mute_unmute_action`). Never put customer-specific assets here.
54
54
  - Group files in subfolders as you like. The path relative to the plugin folder is the lookup key, so treat it as a public API: renaming or moving a file is a breaking change for its callers.
55
55
  - Use a file type from Metro's `assetExts` (e.g. `png`, `jpg`). If the asset is also used on web, stick to types that the web template's image rule handles (`png`, `svg`, `jpg`, `jpeg`, `gif`, `mp4`). Every file except dotfiles gets a `require`, so don't put anything else (READMEs, sources) under `assets/`. It would break the bundle.
56
- - For pixel densities, add `icon.png`, `icon@2x.png`, `icon@3x.png` side by side. They share one key, `icon.png`.
57
56
 
58
57
  2. **Regenerate the index:**
59
58
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-assets",
3
- "version": "16.0.0-alpha.9338540010",
3
+ "version": "16.0.0-rc.123",
4
4
  "description": "Static assets bundled by Quick Brick, grouped by plugin identifier",
5
5
  "main": "index.ts",
6
6
  "files": [