From d5d99e31475230d58ee7c0629b7eb219554cc021 Mon Sep 17 00:00:00 2001 From: ko_oler <kooler89@gmail.com> Date: Thu, 15 Dec 2022 17:53:05 +0800 Subject: [PATCH] fix .gitlab-ci.yml --- .gitlab-ci.yml | 5 ++--- config/generate.sh | 28 ++++++++++++++-------------- config/package.json | 4 ++-- config/tsconfig.json | 4 +++- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 15c7e4f..9b3ae46 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,10 +17,9 @@ publish_npm: script: - npm install -g typescript@4.7.4 - npm install -g ts-proto@1.115.5 - - mkdir config/clients + - mkdir config/dist - make proto - cd ./config - NPM_PACKAGE_VERSION=$(node -p "require('./package.json').version") - yarn pub - - echo "Successfully published version ${NPM_PACKAGE_VERSION} to GitLab's NPM registry" - - rm -rf ./clients \ No newline at end of file + - echo "Successfully published version ${NPM_PACKAGE_VERSION} to GitLab's NPM registry" \ No newline at end of file diff --git a/config/generate.sh b/config/generate.sh index 95ea8dc..c489dc6 100755 --- a/config/generate.sh +++ b/config/generate.sh @@ -54,30 +54,30 @@ generate_index() { } echo "---deleting existing *.d.ts, *.d.ts.map, *.js, *.js.map files" -find ./config/clients/*/**/ -path '*.d.ts' -delete -find ./config/clients/*/**/ -path '*.d.ts.map' -delete -find ./config/clients/*/**/ -path '*.js' -delete -find ./config/clients/*/**/ -path '*.js.map' -delete -find ./config/clients/*/**/ -path '*.ts.bak' -delete -find ./config/clients -path '*.d.ts' -delete -find ./config/clients -path '*.d.ts.map' -delete -find ./config/clients -path '*.js' -delete -find ./config/clients -path '*.js.map' -delete -find ./config/clients -path '*.ts.bak' -delete +find ./config/dist/*/**/ -path '*.d.ts' -delete +find ./config/dist/*/**/ -path '*.d.ts.map' -delete +find ./config/dist/*/**/ -path '*.js' -delete +find ./config/dist/*/**/ -path '*.js.map' -delete +find ./config/dist/*/**/ -path '*.ts.bak' -delete +find ./config/dist -path '*.d.ts' -delete +find ./config/dist -path '*.d.ts.map' -delete +find ./config/dist -path '*.js' -delete +find ./config/dist -path '*.js.map' -delete +find ./config/dist -path '*.ts.bak' -delete echo "---generating index.ts files" -ts_files=$(find ./config/clients/**/ -name '*.ts') +ts_files=$(find ./config/dist/**/ -name '*.ts') ts_files_array=($ts_files) generate_index "${ts_files_array[@]}" echo "---generating *.d.ts, *.d.ts.map, *.js, *.js.map files" npm i protobufjs@6.11.3 -tsc --project ./config --declaration --declarationMap --sourceMap --rootDir ./config/clients +tsc --project ./config --declaration --declarationMap --sourceMap --rootDir ./config/dist echo "---deleting created tmp files" npm uninstall protobufjs@6.11.3 -find ./config/clients -name 'index.ts' -delete -find ./config/clients/*/** -name 'index.ts' -delete +find ./config/dist -name 'index.ts' -delete +find ./config/dist/*/** -name 'index.ts' -delete find ./ -maxdepth 1 -name '*.json' -delete find ./ -maxdepth 1 -name '*.ts' -delete diff --git a/config/package.json b/config/package.json index 5d05f44..de0280e 100644 --- a/config/package.json +++ b/config/package.json @@ -2,9 +2,9 @@ "name": "@perxis-js/perxis-client", "version": "1.0.5", "description": "", - "main": "clients/index.js", + "main": "dist/index.js", "files": [ - "clients/" + "dist/" ], "repository": { "type": "git", diff --git a/config/tsconfig.json b/config/tsconfig.json index 1a2a568..e5b1de8 100644 --- a/config/tsconfig.json +++ b/config/tsconfig.json @@ -98,5 +98,7 @@ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ "skipLibCheck": true /* Skip type checking all .d.ts files. */ }, - "include": ["./clients/**/*"], + "include": [ + "./dist/**/*" + ], } -- GitLab