diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 15c7e4f38d41f74433a2ccf13900a39ee463944f..9b3ae4654f9cccf778b1f8f3d52b381a32258ba5 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 95ea8dc8719a1e88ab8d91403f6ce282db776115..c489dc61d9976ce72cd203428fdb97b9f1960ed8 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 5d05f44ec7a7284e77564bab53d11e8a7cf4d969..de0280ea65fb75a48ba08f2ca67624f87e0e50af 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 1a2a568ef4cf67d07a4fb9b6cceaaafc12f4dd49..e5b1de8fc933afc364abfc7ea5ab772b222bc1dd 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/**/*" + ], }