Skip to content

Commit

Permalink
fix multipalyer clone issue at runtime (#1039)
Browse files Browse the repository at this point in the history
* fix multipalyer clone issue at runtime

* update asset-packs
  • Loading branch information
gonpombo8 authored Dec 3, 2024
1 parent 10d594b commit 085da37
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 22 deletions.
8 changes: 4 additions & 4 deletions packages/@dcl/inspector/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/@dcl/inspector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@dcl/inspector",
"version": "0.1.0",
"dependencies": {
"@dcl/asset-packs": "^2.0.0",
"@dcl/asset-packs": "^2.1.1",
"ts-deepmerge": "^7.0.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/@dcl/sdk-commands/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 4 additions & 15 deletions packages/@dcl/sdk-commands/src/logic/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,14 @@ import { compositeFromLoader } from '~sdk/all-composites'
${
isEditorScene &&
`
import { initAssetPacks } from '@dcl/asset-packs/dist/scene-entrypoint'
initAssetPacks(engine)
import { syncEntity } from '@dcl/sdk/network'
import { initAssetPacks, setSyncEntity } from '@dcl/asset-packs/dist/scene-entrypoint'
initAssetPacks(engine, { syncEntity })
// TODO: do we need to do this on runtime ?
// I think we have that information at build-time and we avoid to do evaluate this on the worker.
// Read composite.json or main.crdt => If that file has a NetowrkEntity import '@dcl/@sdk/network'
// conditionally load networking code if the NetworkEntity component is being used...
for (const path in compositeFromLoader) {
const composite = compositeProvider.getCompositeOrNull(path)
if (composite) {
const { components } = composite.composite
const hasNetworkEntity = components.find(($) => $.name === NetworkEntity.componentName)
if (hasNetworkEntity) {
import('@dcl/sdk/network')
}
}
}`
`
}
if ((entrypoint as any).main !== undefined) {
Expand All @@ -106,7 +96,6 @@ export * from '${unixEntrypointPath}'

export async function bundleProject(components: BundleComponents, options: CompileOptions, sceneJson: Scene) {
const tsconfig = path.join(options.workingDirectory, 'tsconfig.json')

/* istanbul ignore if */
if (!options.single && !sceneJson.main) {
throw new CliError('scene.json .main must be present')
Expand Down

0 comments on commit 085da37

Please sign in to comment.