Skip to content

Commit 6268935

Browse files
authored
fix: Add SDK version to the Scene metadata (#1235)
* fix: Add sdkVersion to the sceneJson during runtime to avoid signature issues * feat: Update inspector package * fix: Update test snapshots package-lock
1 parent 2558997 commit 6268935

5 files changed

Lines changed: 32 additions & 29 deletions

File tree

packages/@dcl/sdk-commands/package-lock.json

Lines changed: 22 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@dcl/sdk-commands/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"@dcl/crypto": "^3.4.4",
1111
"@dcl/ecs": "file:../ecs",
1212
"@dcl/hashing": "1.1.3",
13-
"@dcl/inspector": "7.12.8",
13+
"@dcl/inspector": "7.13.5",
1414
"@dcl/linker-dapp": "^0.14.2",
1515
"@dcl/mini-comms": "1.0.1-20230216163137.commit-a4c75be",
1616
"@dcl/protocol": "1.0.0-18911041883.commit-f4cd080",

packages/@dcl/sdk-commands/src/commands/deploy/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { buildScene } from '../build'
1717
import { getValidWorkspace } from '../../logic/workspace-validations'
1818
import { LinkerResponse } from '../../linker-dapp/routes'
1919
import { analyticsFeatures } from './analytics-features'
20+
import { getInstalledPackageVersion } from '../../logic/config'
2021

2122
interface Options {
2223
args: Result<typeof args>
@@ -96,7 +97,8 @@ export async function main(options: Options): Promise<ProgrammaticDeployResult |
9697
throw new CliError('DEPLOY_INVALID_ARGUMENTS', i18next.t('errors.deploy.invalid_arguments'))
9798
}
9899

99-
const sceneJson = await getValidSceneJson(options.components, projectRoot, { log: true })
100+
const sdkVersion = await getInstalledPackageVersion(options.components, '@dcl/sdk', projectRoot)
101+
const sceneJson = { sdkVersion, ...(await getValidSceneJson(options.components, projectRoot, { log: true })) }
100102
const coords = getBaseCoords(sceneJson)
101103
const isWorld = sceneHasWorldCfg(sceneJson)
102104
const trackProps: Events['Scene deploy started'] = {

packages/@dcl/sdk-commands/src/commands/start/server/endpoints.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
getProjectPublishableFilesWithHashes,
1414
projectFilesToContentMappings
1515
} from '../../../logic/project-files'
16-
import { getCatalystBaseUrl } from '../../../logic/config'
16+
import { getCatalystBaseUrl, getInstalledPackageVersion } from '../../../logic/config'
1717
import { Workspace } from '../../../logic/workspace-validations'
1818
import { ProjectUnion, WearableProject } from '../../../logic/project-validations'
1919

@@ -485,7 +485,8 @@ async function fakeEntityV3FromProject(
485485

486486
if (project.kind === 'scene') {
487487
const sceneJsonPath = path.resolve(project.workingDirectory, 'scene.json')
488-
const sceneJson = JSON.parse(await components.fs.readFile(sceneJsonPath, 'utf-8'))
488+
const sdkVersion = await getInstalledPackageVersion(components, '@dcl/sdk', project.workingDirectory)
489+
const sceneJson = { sdkVersion, ...JSON.parse(await components.fs.readFile(sceneJsonPath, 'utf-8')) }
489490
const { base, parcels }: { base: string; parcels: string[] } = sceneJson.scene
490491
const pointers = new Set<string>()
491492
pointers.add(base)

test/snapshots/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)