From 5b017d07c41383907e4a56369a3b3394e523af8d Mon Sep 17 00:00:00 2001 From: "Lain." Date: Thu, 16 May 2024 10:40:33 +0800 Subject: [PATCH] fix: build --- .github/workflows/npm-publish.yml | 6 +++--- build.js | 4 ++-- package.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 01061fb..31511ad 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -18,12 +18,12 @@ jobs: uses: actions/setup-node@v2 with: node-version: 16 - registry-url: 'https://registry.npmjs.org/' + registry-url: "https://registry.npmjs.org/" env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - name: Install Dependencies - run: npm install + - name: Install protobufjs globally + run: npm install -g protobufjs - name: Build run: npm run build diff --git a/build.js b/build.js index 574d911..5b10717 100644 --- a/build.js +++ b/build.js @@ -32,8 +32,8 @@ fs.mkdirSync('./protos') const jsFile = './protos/compiled.js' const tsFile = './protos/compiled.d.ts' const proto = protoFiles.join(' ') -const jsCommand = `npx pbjs -t static-module -w es6 --keep-case -p ./kritor/protos -o ${jsFile} ${proto}` -const tsCommand = `npx pbts -o ${tsFile} ${jsFile}` +const jsCommand = `pbjs -t static-module -w es6 --keep-case -p ./kritor/protos -o ${jsFile} ${proto}` +const tsCommand = `pbts -o ${tsFile} ${jsFile}` exec(jsCommand, (error, stdout, stderr) => { if (error) { console.error(`编译 .proto 文件时出错:${error.message}`) diff --git a/package.json b/package.json index 396762b..fab7afa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kritor-proto", - "version": "0.0.2", + "version": "0.0.3", "type": "module", "main": "index.js", "author": "CalmLexi",