2 Commits

Author SHA1 Message Date
Дмитрий
cbc0bf9154 fix: fixed build dist folder
Some checks failed
Publish / Publish Job (push) Failing after 2m35s
2026-04-03 13:36:14 +03:00
Дмитрий
7bb94f817b fix: fixed build dist folder 2026-04-03 13:35:55 +03:00
2 changed files with 15 additions and 6 deletions

View File

@@ -41,19 +41,28 @@ jobs:
- name: Install deps - name: Install deps
run: npm ci run: npm ci
- name: Build # 1. СНАЧАЛА генерируем .ts и .go файлы (переместили шаг выше)
run: npm run build
# 3. Исправленный шаг генерации (команды разделены, добавлено создание папки)
- name: Generate Protobuf - name: Generate Protobuf
run: | run: |
npm install -g ts-proto npm install -g ts-proto
mkdir -p ./gen/go # Создаем вложенную папку для Go mkdir -p ./gen/go
protoc -I ./proto ./proto/*.proto \ protoc -I ./proto ./proto/*.proto \
--ts_proto_out=nestJs=true,addGrpcMetadata=true,package=omit:./gen \ --ts_proto_out=nestJs=true,addGrpcMetadata=true,package=omit:./gen \
--go_out=paths=source_relative:./gen/go \ --go_out=paths=source_relative:./gen/go \
--go-grpc_out=paths=source_relative:./gen/go --go-grpc_out=paths=source_relative:./gen/go
# 2. ЗАТЕМ собираем основной проект (если у вас есть другая логика в src/)
- name: Build
run: npm run build
# 3. НОВЫЙ ШАГ: Компилируем протобуфы в JS прямо внутри папки gen/
# Это гарантирует, что рядом с account.ts появится account.js и account.d.ts,
# и NestJS найдет их по точному пути без изменения импортов!
- name: Compile generated TS to JS in-place
run: |
cd gen
npx tsc *.ts --declaration --module commonjs --target es2021 --esModuleInterop --skipLibCheck
- name: Commit and push changes - name: Commit and push changes
run: | run: |
# Представляемся Git-ботом # Представляемся Git-ботом

View File

@@ -1,6 +1,6 @@
{ {
"name": "@lendry-erp/contracts", "name": "@lendry-erp/contracts",
"version": "1.0.35", "version": "1.0.36",
"description": "Protobuf definitions and generated TypeScript types", "description": "Protobuf definitions and generated TypeScript types",
"type": "commonjs", "type": "commonjs",
"main": "./dist/index.js", "main": "./dist/index.js",