Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
feat: Decouple Comms Services (#269)
Browse files Browse the repository at this point in the history
* comms v3

Co-authored-by: Juan Scolari <[email protected]>
Co-authored-by: Mateo Miccino <[email protected]>
Co-authored-by: menduz <[email protected]>
  • Loading branch information
4 people authored Jul 12, 2022
1 parent 696a74b commit 9209529
Show file tree
Hide file tree
Showing 15 changed files with 1,019 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ static/package-lock.json

packages/shared/apis/proto/*.ts
lsall
*.gen.ts
*.gen.ts
26 changes: 24 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ endif
NODE = node
COMPILER = $(NODE) --max-old-space-size=4096 node_modules/.bin/decentraland-compiler
CONCURRENTLY = node_modules/.bin/concurrently
BFF_PROTO_FILES := $(wildcard packages/shared/comms/v4/proto/bff/*.proto)
COMMS_PROTO_FILES := $(wildcard packages/shared/comms/v4/proto/*.proto)

SCENE_PROTO_FILES := $(wildcard node_modules/@dcl/protocol/kernel/apis/*.proto)
RENDERER_PROTO_FILES := $(wildcard node_modules/@dcl/protocol/renderer-protocol/*.proto)
PBS_TS = $(SCENE_PROTO_FILES:node_modules/@dcl/protocol/kernel/apis/%.proto=packages/shared/apis/proto/%.gen.ts)
PBRENDERER_TS = $(RENDERER_PROTO_FILES:node_modules/@dcl/protocol/renderer-protocol/%.proto=packages/renderer-protocol/proto/%.gen.ts)
BFF_TS = $(BFF_PROTO_FILES:packages/shared/comms/v4/proto/bff/%.proto=packages/shared/comms/v4/proto/bff/%.gen.ts)
COMMS_TS = $(COMMS_PROTO_FILES:packages/shared/comms/v4/proto/%.proto=packages/shared/comms/v4/proto/%.gen.ts)

CWD = $(shell pwd)
PROTOC = node_modules/.bin/protobuf/bin/protoc

Expand Down Expand Up @@ -62,7 +68,7 @@ empty-parcels:
cp $(EMPTY_SCENES)/mappings.json static/loader/empty-scenes/mappings.json
cp -R $(EMPTY_SCENES)/contents static/loader/empty-scenes/contents

build-essentials: ${PBRENDERER_TS} ${PBS_TS} $(COMPILED_SUPPORT_JS_FILES) $(SCENE_SYSTEM) $(INTERNAL_SCENES) $(DECENTRALAND_LOADER) $(GIF_PROCESSOR) $(VOICE_CHAT_CODEC_WORKER) empty-parcels
build-essentials: ${BFF_TS} ${COMMS_TS} ${PBRENDERER_TS} ${PBS_TS} $(COMPILED_SUPPORT_JS_FILES) $(SCENE_SYSTEM) $(INTERNAL_SCENES) $(DECENTRALAND_LOADER) $(GIF_PROCESSOR) $(VOICE_CHAT_CODEC_WORKER) empty-parcels

# Entry points
static/%.js: build-essentials packages/entryPoints/%.ts
Expand Down Expand Up @@ -202,6 +208,22 @@ packages/renderer-protocol/proto/%.gen.ts: node_modules/@dcl/protocol/renderer-p
-I="$(PWD)/node_modules/@dcl/protocol/renderer-protocol/" \
"$(PWD)/node_modules/@dcl/protocol/renderer-protocol/$*.proto";

compile_apis: ${PBS_TS}
packages/shared/comms/v4/proto/bff/%.gen.ts: packages/shared/comms/v4/proto/bff/%.proto node_modules/.bin/protobuf/bin/protoc
${PROTOC} \
--plugin=./node_modules/.bin/protoc-gen-ts_proto \
--ts_proto_opt=esModuleInterop=true,returnObservable=false,outputServices=generic-definitions \
--ts_proto_opt=fileSuffix=.gen \
--ts_proto_out="$(PWD)/packages/shared/comms/v4/proto/bff" -I="$(PWD)/packages/shared/comms/v4/proto/bff" \
"$(PWD)/packages/shared/comms/v4/proto/bff/$*.proto"

packages/shared/comms/v4/proto/%.gen.ts: packages/shared/comms/v4/proto/%.proto node_modules/.bin/protobuf/bin/protoc
${PROTOC} \
--plugin=./node_modules/.bin/protoc-gen-ts_proto \
--ts_proto_opt=esModuleInterop=true,oneof=unions\
--ts_proto_opt=fileSuffix=.gen \
--ts_proto_out="$(PWD)/packages/shared/comms/v4/proto" -I="$(PWD)/packages/shared/comms/v4/proto" \
"$(PWD)/packages/shared/comms/v4/proto/$*.proto"

compile_apis: ${BFF_TS} ${COMMS_TS} ${PBS_TS}

compile_renderer_protocol: ${PBRENDERER_TS}
164 changes: 142 additions & 22 deletions package-lock.json

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

Loading

0 comments on commit 9209529

Please sign in to comment.