@dcl/asset-packs 2.9.0 → 2.9.2
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 +61 -2
- package/bin/index.js +169 -78
- package/dist/bin/index.js +169 -78
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Asset Packs
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@dcl/asset-packs)
|
|
4
|
+
[](https://opensource.org/licenses/ISC)
|
|
5
|
+
[](https://github.com/decentraland/creator-hub/actions/workflows/asset-packs.yml)
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Overview](#overview)
|
|
10
|
+
- [Quick Start](#quick-start)
|
|
11
|
+
- [Using Asset Packs in Your Scene](#using-asset-packs-in-your-scene)
|
|
12
|
+
- [Prerequisites for Development](#prerequisites-for-development)
|
|
13
|
+
- [Distribution](#distribution)
|
|
14
|
+
- [Production](#production)
|
|
15
|
+
- [Development](#development)
|
|
16
|
+
- [Deployment](#deployment)
|
|
17
|
+
- [Local Development](#local-development)
|
|
18
|
+
- [Troubleshooting](#troubleshooting)
|
|
19
|
+
- [Related Architecture Decisions](#related-architecture-decisions)
|
|
20
|
+
|
|
3
21
|
## Overview
|
|
4
22
|
|
|
5
23
|
The asset-packs repository is a fundamental component of the Decentraland ecosystem that serves as the central storage and distribution system for default items and assets. It manages and distributes:
|
|
@@ -15,6 +33,39 @@ When deployed, all assets are hashed and uploaded to an S3 bucket under `content
|
|
|
15
33
|
|
|
16
34
|
The assets are accessible through `builder-items.decentraland.*` via Cloudflare.
|
|
17
35
|
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
### Using Asset Packs in Your Scene
|
|
39
|
+
|
|
40
|
+
Install the package in your Decentraland SDK7 scene:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install @dcl/asset-packs
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Import and use asset packs in your scene:
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import { readGltfLocator } from '@dcl/asset-packs'
|
|
50
|
+
|
|
51
|
+
// Use an asset from the catalog
|
|
52
|
+
const assetId = 'some-asset-id'
|
|
53
|
+
const gltfSrc = readGltfLocator(assetId)
|
|
54
|
+
|
|
55
|
+
// Use in your scene
|
|
56
|
+
engine.addEntity({
|
|
57
|
+
transform: Transform.create(),
|
|
58
|
+
gltfContainer: GltfContainer.create({ src: gltfSrc })
|
|
59
|
+
})
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Prerequisites for Development
|
|
63
|
+
|
|
64
|
+
- **Node.js** 22.x or higher
|
|
65
|
+
- **npm** (comes with Node.js)
|
|
66
|
+
- **Docker** (for running local content server)
|
|
67
|
+
- **@dcl/sdk-commands** installed globally or locally
|
|
68
|
+
|
|
18
69
|
## Distribution
|
|
19
70
|
|
|
20
71
|
### Production
|
|
@@ -29,9 +80,17 @@ The assets are accessible through `builder-items.decentraland.*` via Cloudflare.
|
|
|
29
80
|
|
|
30
81
|
### Deployment
|
|
31
82
|
|
|
32
|
-
|
|
83
|
+
**Production Deployment:**
|
|
84
|
+
- Triggered by: Every merge to the `main` branch
|
|
85
|
+
- npm: Publishes `@dcl/asset-packs@latest`
|
|
86
|
+
- CDN: Uploads assets to `https://builder-items.decentraland.org`
|
|
87
|
+
|
|
88
|
+
**Development Deployment:**
|
|
89
|
+
- Triggered by: Manual comment `/upload-assets` on pull requests (org members only)
|
|
90
|
+
- npm: Test packages available via S3 for PR testing
|
|
91
|
+
- CDN: Uploads assets to `https://builder-items.decentraland.zone`
|
|
33
92
|
|
|
34
|
-
|
|
93
|
+
**Note**: All assets are content-addressed (hashed), ensuring immutability and correct caching.
|
|
35
94
|
|
|
36
95
|
### Local Development
|
|
37
96
|
|