Skip to content

Commit 2d07483

Browse files
kuruk-mmnicoechezagonpombo8cyaioxalejandralevy
authored
Update from main protocol squad (#1094)
* update left/right click button behaviour on renderer (#1078) * update left/right click button behaviour on renderer * remove gizmo right click button * fixed review comments * remove desktop client (OLD) option (#1083) * select "Scene" in tree on startup (#1082) * update left/right click button behaviour on renderer * select 'Scene' in tree on startup * add refresh button for Assets (#1085) * support border in uitransforms (#1084) * support border in uitransforms * fix build * change protocol to experimental * use main protocol * fix snapshots test * fix tests * fix coverage * update protocol * export useEffect & useState (#1089) * export useEffect & useState * fix tests * fix: Animation weight value (#1090) * fix: Animation weight value * fix: Animation weight and speed default value * revert .vscode/settings.json * lint * update .crdt * fix models removal when using filters (#1088) * add video player to syncEntities (#1097) * add skip-auth-screen & landscape-terrain-enabled options for preview (#1096) * chore: Add check local packages action (#1092) * chore: Update asset-packs package * fix: Allow dev package * chore: Move check no local packages to a GHAction * chore: Update asset-packs package * fix: Convert TS file to CJS * fix: GHAction comment id * chore: Move local dependencies check to ci pipeline * fix: debug downloaded files * chore: Enhance message * chore: simplify comment dependencies logic * chore: Generate comment.md to properly show in the PR * fix: string comment * fix: error detection * fix: check exit code * fix: catch exit code * chore: Update @dcl/asset-packs * remove AudioSource component from not sync list (#1099) * add entity highlight when selected (#1103) * fix: Handle components schemas errors (#1098) * fix: Basic view TweenComponent to better handle empty entities * fix: Sync external changes * feat: Add Default Basic View Field * fix: Add SyncComponents to Smart Items when using the AdminTools (#1100) * chore: Update @dcl/asset-packs package * fix: Update createEnumEntityId * feat: Add new util addSyncComponentsToEntities to add the Synccomponent and Network component to multiple entities * fix: Tests * chore: Update @dcl/asset-packs package * fix: Remove components for actions that doesn't create components on the fly * fix: Add a validation to avoid include Tween and Transform in the SyncComponent at the same time * chore: Update @dcl/asset-packs * update @dcl/[email protected] (#1106) * feat: add type safe entity names file (#1107) * feat: add type safe entity names file * fix build: * simplify enum types * update tests * fix bad merge issue with onChange * feat: change shortcut for rotating camera (#1110) Co-authored-by: Alejandra Levy <[email protected]> * fix Texture being flipped vertically (#1111) * add video screen (#1105) * add video screen * update asset-packs package * update ui * update asset-packs * update asset-packs * fix ui styles * fix volume and losing focus * update assert-packs * bump asset-packs * feat: add search param to actions dropdown (#1113) * feat: add search param to actions dropdown * feat: add searchable in Trigger Action and Trigger Basic View * feat: show selected entity first on dropdown (#1112) * feat: show selected entity first on dropdown * feat: remove unused import and reorder import * Update packages/@dcl/inspector/src/components/ui/EntityField/EntityField.tsx Co-authored-by: Gabriel Díaz <[email protected]> Signed-off-by: Alejandra Levy <[email protected]> * feat: update method --------- Signed-off-by: Alejandra Levy <[email protected]> Co-authored-by: Gabriel Díaz <[email protected]> * Support jpg textures (#1114) * feat: support jpg & jpge textures * feat: support jpg and jpeg for all images inputs * feat: update validation for textures * feat: Update regez to support .jpg and .jpge extensions * feat: fix lint issues * feat: add validation on input change * feat: change regex to pass tests * feat: update validation on component * feat: add error message for invalid URL and stop validating empty field * feat: update message * Update global value on Audio Source component (#1119) * feat: update global value & validate source input only where there's a value * feat: remove debugger * Support global prop on play sound action (#1120) * feat: support global prop on play sound action * feat: update pacjkage json * feat: update package json and fix issues * feat: install asset packs version * feat: update asset pack version * feat: install asset packs version on inspector * feat: remove asset packs from root package.json * feat: update package-lock * fix enter scene callback not being fired if there is no onLeaveCb (#1124) * fix enter scene callback not being fired if there is no onLeaveCb * fix tests and update asset-packs * feat: cursor position info (#1123) * Updated protocol and added test for the new PrimaryPointerInfo component * Lint-fix pass * fix play video not updaing src property (#1129) * add default emotes (#1132) * feat: 4088 add z-index support for ui elements (#1127) * Updated protocol pointers to dev branch * Added zIndex to the react-ecs component and test (cherry picked from commit 7ea5cfd) * Added opacity property to ui elements * Fixed tests * Updated protocol * Updated snapshots * Removed redundant definitions. Added test coverage * Adjusted the default value in test * ui transform test wip * Added more tests. Refactored parseUiTransform utility function to properly handle the new properties * Deep clean and snapshot * Removed redundant tests, removed redundant defaults definitions. * Updated snapshots * Updated default value for opacity and updated snapshots * feat: Update asset packs package (#1135) * update protocol from protocol-squad branch add "make update-protocol-squad" * fixes and update crdt snapshots * reduce coverage to 90% for protocol-squad branch * update protocol (add setUiFocus) --------- Signed-off-by: Alejandra Levy <[email protected]> Co-authored-by: Nicolas Echezarreta <[email protected]> Co-authored-by: Gon Pombo <[email protected]> Co-authored-by: Gabriel Díaz <[email protected]> Co-authored-by: Alejandra Levy <[email protected]> Co-authored-by: Alejandra Levy <[email protected]> Co-authored-by: Alejandro Alvarez Melucci <[email protected]>
1 parent 7bb4ee2 commit 2d07483

File tree

99 files changed

+2100
-719
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2100
-719
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
const fs = require('fs')
2+
const path = require('path')
3+
4+
// Function to recursively find all package.json files
5+
function findPackageJsonFiles(dir, fileList = []) {
6+
const files = fs.readdirSync(dir)
7+
8+
for (const file of files) {
9+
const filePath = path.join(dir, file)
10+
const stat = fs.statSync(filePath)
11+
12+
if (stat.isDirectory() && !filePath.includes('node_modules')) {
13+
findPackageJsonFiles(filePath, fileList)
14+
} else if (file === 'package.json') {
15+
fileList.push(filePath)
16+
}
17+
}
18+
19+
return fileList
20+
}
21+
22+
// Check for local package dependencies
23+
function checkNoLocalPackages(packageJsonPath) {
24+
try {
25+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'))
26+
const errors = []
27+
28+
// Check both dependencies and devDependencies
29+
for (const deps of [packageJson.dependencies, packageJson.devDependencies]) {
30+
if (!deps) continue
31+
32+
for (const [key, value] of Object.entries(deps)) {
33+
if (
34+
value.startsWith('file:') ||
35+
value.startsWith('http:') ||
36+
value.startsWith('https:') ||
37+
value.startsWith('git:')
38+
) {
39+
errors.push(`Dependency ${key} is not pointing to a published version: ${value}`)
40+
}
41+
}
42+
}
43+
44+
if (errors.length) {
45+
console.error(`\n\nErrors in ${packageJsonPath}:`)
46+
errors.forEach((error) => console.error(`- ${error}`))
47+
return false
48+
}
49+
50+
return true
51+
} catch (error) {
52+
console.error(`Error processing ${packageJsonPath}: ${error.message}`)
53+
return false
54+
}
55+
}
56+
57+
// Main function
58+
function main() {
59+
// Check if a directory was passed as an argument
60+
const targetDir = process.argv[2] || '.'
61+
62+
console.log(`Checking for local package dependencies in ${targetDir}...`)
63+
const packageJsonFiles = findPackageJsonFiles(targetDir)
64+
console.log(`Found ${packageJsonFiles.length} package.json files to check.`)
65+
66+
let hasErrors = false
67+
68+
for (const packageJsonPath of packageJsonFiles) {
69+
console.log(`Checking ${packageJsonPath}...`)
70+
if (!checkNoLocalPackages(packageJsonPath)) {
71+
hasErrors = true
72+
}
73+
}
74+
75+
if (hasErrors) {
76+
console.error(
77+
`\n\nFound packages with local dependencies in ${targetDir}. Please publish these dependencies instead of using local references.`
78+
)
79+
process.exit(1)
80+
} else {
81+
console.log(`\n\nNo local dependencies found in ${targetDir}. All good!`)
82+
}
83+
}
84+
85+
main()

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
"packages/@dcl/inspector/hot-reload.js": false
2020
},
2121
"[typescript]": {
22-
"editor.defaultFormatter": "vscode.typescript-language-features"
22+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
2323
}
2424
}

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ update-protocol:
3636
cd packages/@dcl/sdk-commands; npm i --save-exact @dcl/protocol@next
3737
$(MAKE) sync-deps compile_apis
3838

39+
update-protocol-squad:
40+
npm i --save-exact @dcl/protocol@protocol-squad
41+
cd packages/@dcl/sdk-commands; npm i --save-exact @dcl/protocol@protocol-squad
42+
$(MAKE) sync-deps compile_apis
43+
3944
update-renderer:
4045
cd packages/@dcl/sdk; npm i --save-exact @dcl/explorer@latest
4146

jest.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ module.exports = {
1515
coverageDirectory: "coverage",
1616
coverageThreshold: {
1717
global: {
18-
branches: 100,
19-
functions: 100,
20-
lines: 100,
21-
statements: 100,
18+
branches: 90,
19+
functions: 90,
20+
lines: 90,
21+
statements: 90,
2222
},
2323
"packages/@dcl/ecs/src/systems/crdt/index.ts": {
2424
// This should be deleted on another PR. Need to release this asap.

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"bugs": "https://github.com/decentraland/js-sdk-toolchain/issues",
77
"dependencies": {
88
"@actions/core": "^1.10.0",
9-
"@dcl/protocol": "1.0.0-14231413869.commit-0c50705",
9+
"@dcl/protocol": "1.0.0-15736212864.commit-41e200e",
1010
"@dcl/quickjs-emscripten": "^0.21.0-3680274614.commit-1808aa1",
1111
"@dcl/ts-proto": "1.153.0",
1212
"@types/fs-extra": "^9.0.12",

packages/@dcl/ecs/src/components/extended/AvatarEquippedData.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ import { IEngine, LastWriteWinElementSetComponentDefinition } from '../../engine
22
import { AvatarEquippedDataSchema } from '../generated/AvatarEquippedData.gen'
33
import { PBAvatarEquippedData } from '../generated/pb/decentraland/sdk/components/avatar_equipped_data.gen'
44

5-
65
/**
76
* @public
87
*/
9-
export interface AvatarEquippedDataComponentDefinitionExtended
10-
extends LastWriteWinElementSetComponentDefinition<AvatarEquippedDataType> { }
8+
export type AvatarEquippedDataComponentDefinitionExtended =
9+
LastWriteWinElementSetComponentDefinition<AvatarEquippedDataType>
1110

1211
export type AvatarEquippedDataType = Omit<PBAvatarEquippedData, 'forceRender'> & {
1312
forceRender?: string[] | undefined
@@ -26,6 +25,6 @@ export function defineAvatarEquippedDataComponent(
2625
}
2726
}
2827

29-
const theComponent = engine.defineComponentFromSchema("core::AvatarEquippedData", patchedSchema);
28+
const theComponent = engine.defineComponentFromSchema('core::AvatarEquippedData', patchedSchema)
3029
return theComponent as unknown as AvatarEquippedDataComponentDefinitionExtended
3130
}

packages/@dcl/ecs/src/components/extended/AvatarShape.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ import { IEngine, LastWriteWinElementSetComponentDefinition } from '../../engine
22
import { AvatarShapeSchema } from '../generated/AvatarShape.gen'
33
import { PBAvatarShape } from '../generated/pb/decentraland/sdk/components/avatar_shape.gen'
44

5-
65
/**
76
* @public
87
*/
9-
export interface AvatarShapeComponentDefinitionExtended
10-
extends LastWriteWinElementSetComponentDefinition<AvatarShapeType> { }
8+
export type AvatarShapeComponentDefinitionExtended = LastWriteWinElementSetComponentDefinition<AvatarShapeType>
119

1210
export type AvatarShapeType = Omit<PBAvatarShape, 'forceRender'> & {
1311
forceRender?: string[] | undefined
@@ -26,6 +24,6 @@ export function defineAvatarShapeComponent(
2624
}
2725
}
2826

29-
const theComponent = engine.defineComponentFromSchema("core::AvatarShape", patchedSchema);
27+
const theComponent = engine.defineComponentFromSchema('core::AvatarShape', patchedSchema)
3028
return theComponent as unknown as AvatarShapeComponentDefinitionExtended
3129
}

packages/@dcl/ecs/src/components/index.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import { IEngine } from '../engine/types'
33
import { AnimatorComponentDefinitionExtended, defineAnimatorComponent } from './extended/Animator'
44
import { AudioSourceComponentDefinitionExtended, defineAudioSourceComponent } from './extended/AudioSource'
55
import { AudioStreamComponentDefinitionExtended, defineAudioStreamComponent } from './extended/AudioStream'
6-
import { AvatarEquippedDataComponentDefinitionExtended, defineAvatarEquippedDataComponent } from './extended/AvatarEquippedData'
6+
import {
7+
AvatarEquippedDataComponentDefinitionExtended,
8+
defineAvatarEquippedDataComponent
9+
} from './extended/AvatarEquippedData'
710
import { AvatarShapeComponentDefinitionExtended, defineAvatarShapeComponent } from './extended/AvatarShape'
811
import { defineInputModifierComponent, InputModifierComponentDefinitionExtended } from './extended/InputModifier'
912
import { defineMaterialComponent, MaterialComponentDefinitionExtended } from './extended/Material'
@@ -22,7 +25,9 @@ import { defineTransformComponent, TransformComponentExtended } from './manual/T
2225
export * from './generated/index.gen'
2326

2427
export type {
25-
GrowOnlyValueSetComponentDefinition, GSetComponentGetter, LastWriteWinElementSetComponentDefinition,
28+
GrowOnlyValueSetComponentDefinition,
29+
GSetComponentGetter,
30+
LastWriteWinElementSetComponentDefinition,
2631
LwwComponentGetter
2732
}
2833

@@ -58,10 +63,12 @@ export const MeshCollider: LwwComponentGetter<MeshColliderComponentDefinitionExt
5863
export const Tween: LwwComponentGetter<TweenComponentDefinitionExtended> = (engine) => defineTweenComponent(engine)
5964

6065
/* @__PURE__ */
61-
export const AvatarShape: LwwComponentGetter<AvatarShapeComponentDefinitionExtended> = (engine) => defineAvatarShapeComponent(engine)
66+
export const AvatarShape: LwwComponentGetter<AvatarShapeComponentDefinitionExtended> = (engine) =>
67+
defineAvatarShapeComponent(engine)
6268

6369
/* @__PURE__ */
64-
export const AvatarEquippedData: LwwComponentGetter<AvatarEquippedDataComponentDefinitionExtended> = (engine) => defineAvatarEquippedDataComponent(engine)
70+
export const AvatarEquippedData: LwwComponentGetter<AvatarEquippedDataComponentDefinitionExtended> = (engine) =>
71+
defineAvatarEquippedDataComponent(engine)
6572

6673
/* @__PURE__ */
6774
export const VirtualCamera: LwwComponentGetter<VirtualCameraComponentDefinitionExtended> = (engine) =>

packages/@dcl/ecs/src/components/types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ export type { AudioSourceComponentDefinitionExtended } from './extended/AudioSou
33
export type { AudioStreamComponentDefinitionExtended } from './extended/AudioStream'
44
export type { MeshRendererComponentDefinitionExtended } from './extended/MeshRenderer'
55
export type { MeshColliderComponentDefinitionExtended } from './extended/MeshCollider'
6-
export type { AvatarEquippedDataComponentDefinitionExtended, AvatarEquippedDataType } from './extended/AvatarEquippedData'
6+
export type {
7+
AvatarEquippedDataComponentDefinitionExtended,
8+
AvatarEquippedDataType
9+
} from './extended/AvatarEquippedData'
710
export type { AvatarShapeComponentDefinitionExtended, AvatarShapeType } from './extended/AvatarShape'
811
export type { TextureHelper, MaterialComponentDefinitionExtended } from './extended/Material'
912
export type { TweenHelper, TweenComponentDefinitionExtended } from './extended/Tween'

packages/@dcl/ecs/src/engine/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,19 @@ function preEngine(options?: IEngineOptions): PreEngine {
189189
}
190190
}
191191

192-
function getEntityOrNullByName(value: string) {
192+
function getEntityOrNullByName<T = string>(value: T) {
193193
const NameComponent = components.Name({ defineComponent })
194194
for (const [entity, name] of getEntitiesWith(NameComponent)) {
195195
if (name.value === value) return entity
196196
}
197197
return null
198198
}
199199

200+
function getEntityByName<T = never, K = T>(value: K & (T extends never ? never : string)): Entity {
201+
const entity = getEntityOrNullByName(value)
202+
return entity!
203+
}
204+
200205
function* getComponentDefGroup<T extends ComponentDefinition<any>[]>(...args: T): Iterable<[Entity, ...T]> {
201206
const [firstComponentDef, ...componentDefinitions] = args
202207
for (const [entity] of firstComponentDef.iterator()) {
@@ -252,6 +257,7 @@ function preEngine(options?: IEngineOptions): PreEngine {
252257
getComponent,
253258
getComponentOrNull: getComponentOrNull as IEngine['getComponentOrNull'],
254259
getEntityOrNullByName,
260+
getEntityByName,
255261
removeComponentDefinition,
256262
registerComponentDefinition,
257263
entityContainer,
@@ -313,6 +319,7 @@ export function Engine(options?: IEngineOptions): IEngine {
313319
componentsIter: partialEngine.componentsIter,
314320
seal: partialEngine.seal,
315321
getEntityOrNullByName: partialEngine.getEntityOrNullByName,
322+
getEntityByName: partialEngine.getEntityByName,
316323

317324
update,
318325

0 commit comments

Comments
 (0)