Skip to content
Snippets Groups Projects
Commit fb2c98f9 authored by Pavel Antonov's avatar Pavel Antonov :asterisk:
Browse files

Merge branch 'chore/PRXS-2795-UpdDeps' into 'master'

Обновлены версии JS зависимостей

See merge request !32
parents eb78de3f 67557353
No related branches found
No related tags found
1 merge request!32Обновлены версии JS зависимостей
Pipeline #64066 passed
......@@ -2,17 +2,15 @@ stages:
- deploy
publish_npm:
image: "node:19.3-alpine3.17"
image: "node:20.18-alpine3.19"
stage: deploy
variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- apk --no-cache add git
- git submodule update --remote --merge
- apk add --update make bash protobuf-dev yarn
- npm install -g ts-proto@1.158.0
- npm install -g typescript@5.1.6
- npm i protobufjs@7.2.4
- apk add --update make bash protobuf-dev
- cd ./config && npm i && cd ../
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
......@@ -32,6 +30,6 @@ publish_npm:
fi
- NPM_PACKAGE_NAME=$(node -p "require('./package.json').name")
- NPM_PACKAGE_CURRENT_VERSION=$(npm show ${NPM_PACKAGE_NAME} version)
- yarn pub
- npm pub
- NPM_PACKAGE_VERSION=$(node -p "require('./package.json').version")
- echo "Successfully published version ${NPM_PACKAGE_VERSION} of ${NPM_PACKAGE_NAME} to GitLab's NPM registry"
\ No newline at end of file
......@@ -3,17 +3,15 @@ SHELL = /bin/bash -o pipefail
PROTODIR=perxis-proto/proto
DSTDIR=config/dist
TSPROTOPLUGIN=config/node_modules/.bin/protoc-gen-ts_proto
ALLPROTO?=$(shell find $(PROTODIR) -name '*.proto' )
PROTOFILES= $(filter-out proto/status/status.proto, $(ALLPROTO))
PROTOTSFILES=$(ALLPROTO:.proto=.ts)
PROTOC_MAJOR_VERSION=$(shell protoc --version | awk '{print $$2;}' | cut -d. -f1)
PROTOC_MINOR_VERSION=$(shell protoc --version | awk '{print $$2;}' | cut -d. -f2)
TSC_MAJOR_VERSION=$(shell tsc --version | awk '{print $$2;}' | cut -d. -f1)
TSC_MINOR_VERSION=$(shell tsc --version | awk '{print $$2;}' | cut -d. -f2)
TSC_MIC_VERSION=$(shell tsc --version | awk '{print $$2;}' | cut -d. -f3)
# PROTOC_MAJOR_VERSION=$(shell protoc --version | awk '{print $$2;}' | cut -d. -f1)
# PROTOC_MINOR_VERSION=$(shell protoc --version | awk '{print $$2;}' | cut -d. -f2)
$(shell mkdir $(DSTDIR))
# Генерация
......@@ -22,7 +20,7 @@ js-client: protoc-check js-check $(PROTOTSFILES) generate-js
%.ts: %.proto
@protoc -I=$(PROTODIR) \
--plugin=@protoc-gen-ts_proto \
--plugin=$(TSPROTOPLUGIN) \
--ts_proto_opt=env=browser,outputServices=generic-definitions,outputJsonMethods=false,esModuleInterop=true,useOptionals=messages,exportCommonSymbols=false,useDate=false,useExactTypes=false \
--ts_proto_out=$(DSTDIR) \
"$<"
......@@ -41,34 +39,17 @@ ifeq (,$(shell which protoc))
$(error "Protocol Buffers not found. Run for linux: \"sudo apt install -y protobuf-compiler\", for mac: \"brew install protobuf\" \
or visit \"https://grpc.io/docs/protoc-installation/\" for more.\n")
endif
ifneq ($(shell expr $(PROTOC_MAJOR_VERSION) \>= 3),1)
$(error "Current version is outdated. Please update protoc")
endif
ifneq ($(shell expr $(PROTOC_MINOR_VERSION) \>= 21), 1)
$(error "Current version is lower than 3.21. Please update protoc")
endif
# BUG проверка для минимальной версии 3.21 будет ошибочно не пройдена с версией 3.30 так как
# каждая цифра проверяется отдельно
# ifneq ($(shell expr $(PROTOC_MAJOR_VERSION) \>= 3),1)
# $(error "Current version is outdated. Please update protoc")
# endif
# ifneq ($(shell expr $(PROTOC_MINOR_VERSION) \>= 21), 1)
# $(error "Current version is lower than 3.21. Please update protoc")
# endif
js-check:
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
\ No newline at end of file
ifeq (,$(shell which protoc-gen-ts_proto))
$(error "Ts-proto plugin for protoc not found. \
Run \"npm install -g ts-proto@1.158.0\" \
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@5.1.6\" \
or visit \"https://github.com/microsoft/TypeScript\" for more.\n")
endif
ifneq ($(shell expr $(TSC_MAJOR_VERSION) \>= 5), 1)
$(error "Current version is outdated. Please update typescript \n")
endif
ifneq ($(shell expr $(TSC_MINOR_VERSION) \>= 1), 1)
$(error "Current version is lower than 5.1 Please update typescript \n")
endif
ifneq ($(shell expr $(TSC_MIC_VERSION) \>= 6), 1)
$(error "Current version is lower than 5.1.6 Please update typescript \n")
endif
......@@ -47,21 +47,17 @@ generate_index() {
done
}
cd ./config
echo "Generate index.ts files"
ts_files=$(find ./config/dist/**/ -name '*.ts')
ts_files=$(find ./dist -name '*.ts' -type f)
ts_files_array=($ts_files)
generate_index "${ts_files_array[@]}"
echo "Generate *.d.ts, *.d.ts.map, *.js, *.js.map files"
tsc --project ./config --declaration --declarationMap --sourceMap --rootDir ./config/dist
echo "Generate *.js files"
npx tsc --declaration --declarationMap --sourceMap --rootDir ./dist
echo "Delete created tmp files"
find ./config/dist -name 'index.ts' -delete
find ./config/dist/*/** -name 'index.ts' -delete
find ./config/ -maxdepth 1 -name 'index.ts' -delete
find ./ -maxdepth 1 -name '*.json' -delete
find ./ -maxdepth 1 -name '*.ts' -delete
find ./config/dist/*/** -name '*.ts' ! -name '*.d.ts' -delete
echo "Delete temporary files"
find ./dist -name '*.ts' ! -name '*.d.ts' -type f -delete
echo "---process finished"
\ No newline at end of file
echo "Process finished"
\ No newline at end of file
{
"name": "@perxis-js/perxis-client",
"version": "1.5.6",
"description": "",
"main": "dist/index.js",
"version": "1.5.8",
"description": "Perxis API клиент для JavaScript",
"files": [
"dist/"
"dist"
],
"main": "./dist/index.js",
"repository": {
"type": "git",
"url": "git+https://git.perx.ru/perxis/perxis-js.git"
......@@ -13,9 +13,11 @@
"scripts": {
"pub": "npm publish"
},
"dependencies": {
"protobufjs": "7.2.4"
},
"author": "",
"license": "ISC"
"license": "ISC",
"dependencies": {
"protobufjs": "7.4.0",
"ts-proto": "1.181.2",
"typescript": "5.6.3"
}
}
......@@ -11,7 +11,7 @@
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"target": "ES2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
......@@ -71,7 +71,7 @@
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */,
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
// "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
/* Type Checking */
"strict": true /* Enable all strict type-checking options. */,
......
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf"
integrity sha1-m4sMxmPWaafY9vXQiToU00jzD78=
"@protobufjs/base64@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735"
integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==
"@protobufjs/codegen@^2.0.4":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb"
integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==
"@protobufjs/eventemitter@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70"
integrity sha1-NVy8mLr61ZePntCV85diHx0Ga3A=
"@protobufjs/fetch@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45"
integrity sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=
dependencies:
"@protobufjs/aspromise" "^1.1.1"
"@protobufjs/inquire" "^1.1.0"
"@protobufjs/float@^1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1"
integrity sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=
"@protobufjs/inquire@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089"
integrity sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=
"@protobufjs/path@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d"
integrity sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=
"@protobufjs/pool@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54"
integrity sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=
"@protobufjs/utf8@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=
"@types/node@>=13.7.0":
version "16.11.12"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.12.tgz#ac7fb693ac587ee182c3780c26eb65546a1a3c10"
integrity sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw==
long@^5.0.0:
version "5.2.3"
resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1"
integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==
protobufjs@7.2.4:
version "7.2.4"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.4.tgz#3fc1ec0cdc89dd91aef9ba6037ba07408485c3ae"
integrity sha512-AT+RJgD2sH8phPmCf7OUZR8xGdcJRga4+1cOaXJ64hvcSkVhNcRHOwIxUatPH15+nj59WAGTDv3LSGZPEQbJaQ==
dependencies:
"@protobufjs/aspromise" "^1.1.2"
"@protobufjs/base64" "^1.1.2"
"@protobufjs/codegen" "^2.0.4"
"@protobufjs/eventemitter" "^1.1.0"
"@protobufjs/fetch" "^1.1.0"
"@protobufjs/float" "^1.0.2"
"@protobufjs/inquire" "^1.1.0"
"@protobufjs/path" "^1.1.2"
"@protobufjs/pool" "^1.1.0"
"@protobufjs/utf8" "^1.1.0"
"@types/node" ">=13.7.0"
long "^5.0.0"
Subproject commit c45f4b158bbb7e119a665cbd5f70f72df2803d87
Subproject commit a5054e6e91b176ca421ebf659b32c751e07c81cc
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment