diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 03f8de125d14a336ce9535d2d50feef703aefe28..09b1efa0dbbb43052f0f58663a26e19a87d1833d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,16 +7,16 @@ publish_npm: before_script: - apk add --update bash - apk add --update make - - apk add --update yarn - - apk add --update jq - apk add --update protobuf-dev + - apk add --update yarn + rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' changes: - config/package.json script: + - npm install ts-proto@1.115.5 - npm install -g typescript@4.7.4 - - npm install -g ts-proto@1.115.5 - make proto - cd ./config - NPM_PACKAGE_VERSION=$(node -p "require('./package.json').version") diff --git a/Makefile b/Makefile index d4c3860b0a4d23ff6df70078e1ccc9947b9366c7..0295bbcf3b68b052d5511f00210a1694e1162731 100644 --- a/Makefile +++ b/Makefile @@ -22,13 +22,13 @@ proto-js: protoc-check js-check $(PROTOTSFILES) generate-ts generate-js %.ts: %.proto @protoc -I=$(PROTODIR) \ - --plugin=@protoc-gen-ts_proto \ + --plugin=./node_modules/.bin/protoc-gen-ts_proto \ --ts_proto_opt=env=browser,outputServices=generic-definitions,outputJsonMethods=false,esModuleInterop=true,useOptionals=messages,exportCommonSymbols=false,useDate=false,useExactTypes=false \ --ts_proto_out=$(DSTDIR) \ "$<" generate-ts: - @echo "Generated all protobuf TypeScript files" + @echo "Generated all TypeScript files" generate-js: @./config/generate.sh @@ -55,11 +55,11 @@ ifeq (,$(shell which npm)) $(error "NPM not found. Run for linux: \"sudo apt install npm\", for mac: \"brew install npm\" \ or visit \"https://docs.npmjs.com/getting-started\" for more.\n") endif -ifeq (,$(shell which protoc-gen-ts_proto)) - $(error "Ts-proto plugin for protoc not found. \ - Run \"npm install -g ts-proto@1.115.5\" \ - or visit \"https://github.com/stephenh/ts-proto\" for more.\n") -endif +#ifeq (,$(shell which protoc-gen-ts_proto)) +# $(error "Ts-proto plugin for protoc not found. \ +# Run \"npm install -g ts-proto@1.115.5\" \ +# or visit \"https://github.com/stephenh/ts-proto\" for more.\n") +#endif ifeq (,$(shell which tsc)) $(error "Typescript not found. \ Run \"npm install -g typescript@4.7.4\" \ diff --git a/config/generate.sh b/config/generate.sh index 7e9c7a77dc567714a34fed46788fb41dee7044b9..59ef7a6798717358499ba0197173fec7fdf5b46d 100755 --- a/config/generate.sh +++ b/config/generate.sh @@ -54,7 +54,6 @@ generate_index() { } echo "---deleting existing *.d.ts, *.d.ts.map, *.js, *.js.map files" -pwd find ./config/dist/*/**/ -path '*.d.ts' -delete find ./config/dist/*/**/ -path '*.d.ts.map' -delete find ./config/dist/*/**/ -path '*.js' -delete @@ -67,7 +66,6 @@ find ./config/dist -path '*.js.map' -delete find ./config/dist -path '*.ts.bak' -delete echo "---generating index.ts files" -pwd ts_files=$(find ./config/dist/**/ -name '*.ts') ts_files_array=($ts_files) generate_index "${ts_files_array[@]}"