Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: composite #1042

Merged
merged 4 commits into from
Dec 3, 2024
Merged

refactor: composite #1042

merged 4 commits into from
Dec 3, 2024

Conversation

cazala
Copy link
Member

@cazala cazala commented Nov 29, 2024

This PR refactor the addAsset operation to work with the new @dcl/asset-packs asset format, which uses composites instead of the custom format.

It also adds support for multiple entities per item, since the composite supports multiple entities. When multiple entities are present, a main entity will be created (this one will have the Transform in the position the user selected) and the item's entities will be added as children of that main entity. When a single entity is used and it's id is 0, then those components will be added to the main entities (to avoid having the main entity with a single child when only 1 entity is needed. which is the case of the current smart items).

Finally, it refactors the ProjectAssets and BuilderAssets into LocalAssets and CatalogAssets, which match better the current nomenclatures.

@cazala cazala marked this pull request as draft November 29, 2024 19:32
Copy link

codecov bot commented Nov 29, 2024

Codecov Report

Attention: Patch coverage is 13.37209% with 149 lines in your changes missing coverage. Please review.

Project coverage is 63.58%. Comparing base (680459b) to head (484dd1f).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...nspector/src/lib/sdk/operations/add-asset/index.ts 7.69% 144 Missing ⚠️
packages/@dcl/inspector/src/lib/logic/catalog.ts 66.66% 3 Missing ⚠️
...ector/src/components/ProjectAssetExplorer/types.ts 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1042      +/-   ##
==========================================
- Coverage   64.03%   63.58%   -0.46%     
==========================================
  Files         579      580       +1     
  Lines       18049    18314     +265     
  Branches     2288     2301      +13     
==========================================
+ Hits        11558    11645      +87     
- Misses       6082     6259     +177     
- Partials      409      410       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

cloudflare-workers-and-pages bot commented Dec 2, 2024

Deploying js-sdk-toolchain with  Cloudflare Pages  Cloudflare Pages

Latest commit: 924ca78
Status: ✅  Deploy successful!
Preview URL: https://ca8f6168.js-sdk-toolchain.pages.dev
Branch Preview URL: https://refactor-composite.js-sdk-toolchain.pages.dev

View logs

@cazala cazala marked this pull request as ready for review December 2, 2024 17:47
@cazala cazala requested a review from cyaiox December 2, 2024 17:47
Copy link
Contributor

github-actions bot commented Dec 2, 2024

Test this pull request

  • The @dcl/sdk package can be tested in scenes by running

    npm install "https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/refactor/composite/dcl-sdk-7.6.6-12140243906.commit-3ca7455.tgz"
  • To test with npx init

    export SDK_COMMANDS="https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/refactor/composite/dcl-sdk-commands-7.6.6-12140243906.commit-3ca7455.tgz"
    npx $SDK_COMMANDS init
  • The @dcl/inspector package can be tested by visiting this url

    • Or by installing it via NPM
    npm install "https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/refactor/composite/@dcl/inspector/dcl-inspector-7.6.6-12140243906.commit-3ca7455.tgz"
  • The /changerealm command to test test in-world

    /changerealm https://sdk-team-cdn.decentraland.org/ipfs/refactor/composite-e2e
    
  • You can preview this build entering:
    https://playground.decentraland.org/?sdk-branch=refactor/composite


export enum DropTypesEnum {
ProjectAsset = 'project-asset',
BuilderAsset = 'builder-asset'
ProjectAsset = 'local-asset',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be here?

Suggested change
ProjectAsset = 'local-asset',
LocalAsset = 'local-asset',

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Updated ✅

@cazala cazala enabled auto-merge (squash) December 3, 2024 13:05
@cazala cazala merged commit 10d594b into main Dec 3, 2024
8 checks passed
@cazala cazala deleted the refactor/composite branch December 3, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants