diff --git a/package.json b/package.json index 1cd92035..2f568d3f 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,82 @@ "url": "https://github.com/yandex-cloud/nodejs-sdk/issues" }, "files": [ - "dist" + "dist", + "ai-assistants-v1", + "ai-files-v1", + "ai-foundation_models-v1", + "ai-llm-v1alpha", + "ai-ocr-v1", + "ai-stt-v2", + "ai-stt-v3", + "ai-translate-v2", + "ai-tts-v3", + "ai-vision-v1", + "ai-vision-v2", + "airflow-v1", + "apploadbalancer-v1", + "audittrails-v1", + "backup-v1", + "billing-v1", + "cdn-v1", + "certificatemanager-v1", + "cic-v1", + "cloudapps-workload-v1", + "cloudrouter-v1", + "compute-v1", + "containerregistry-v1", + "dataproc-manager-v1", + "dataproc-v1", + "datasphere-v1", + "datasphere-v2", + "datatransfer-v1", + "dns-v1", + "endpoint", + "iam-v1", + "iot-broker-v1", + "iot-devices-v1", + "k8s-marketplace-v1", + "k8s-v1", + "kms-v1", + "loadbalancer-v1", + "loadtesting-agent-v1", + "loadtesting-api-v1", + "lockbox-v1", + "logging-v1", + "marketplace-licensemanager-saas-v1", + "marketplace-licensemanager-v1", + "marketplace-metering-v1", + "marketplace-v1", + "mdb-clickhouse-v1", + "mdb-elasticsearch-v1", + "mdb-greenplum-v1", + "mdb-kafka-v1", + "mdb-mongodb-v1", + "mdb-mysql-v1", + "mdb-mysql-v1alpha", + "mdb-opensearch-v1", + "mdb-postgresql-v1", + "mdb-redis-v1", + "mdb-sqlserver-v1", + "monitoring-v3", + "operation", + "organizationmanager-v1", + "resourcemanager-v1", + "serverless-apigateway-v1", + "serverless-apigateway-websocket-v1", + "serverless-containers-v1", + "serverless-eventrouter-v1", + "serverless-functions-v1", + "serverless-mdbproxy-v1", + "serverless-triggers-v1", + "serverless-workflows-v1", + "smartcaptcha-v1", + "smartwebsecurity-v1", + "speechsense-v1", + "storage-v1", + "video-v1", + "vpc-v1", + "ydb-v1" ], "homepage": "https://github.com/yandex-cloud/nodejs-sdk#readme", "dependencies": { diff --git a/scripts/generate_services/index.ts b/scripts/generate_services/index.ts index 3aa0992c..f4022d0d 100644 --- a/scripts/generate_services/index.ts +++ b/scripts/generate_services/index.ts @@ -117,7 +117,7 @@ const generateService = async (dir: string) => { const START_SIGN = '# generate_services start'; -const modidyGitignore = async (serviceList: string[]) => { +const modifyGitignore = async (serviceList: string[]) => { const path = PATH.resolve('.gitignore'); const content = fs.readFileSync(path, 'utf8'); @@ -126,7 +126,7 @@ const modidyGitignore = async (serviceList: string[]) => { let newContent = content.substring(0, startIdx + START_SIGN.length + 1); - serviceList.sort().forEach((service) => { + serviceList.forEach((service) => { newContent += `/${service}\n`; }); @@ -135,14 +135,25 @@ const modidyGitignore = async (serviceList: string[]) => { fs.writeFileSync(path, newContent, 'utf8'); }; +const modifyPackageJSON = async (serviceList: string[]) => { + const path = PATH.resolve('package.json'); + const data = fs.readFileSync(path, 'utf8'); + const jsonData = JSON.parse(data); + + jsonData.files = ['dist', ...serviceList]; + + fs.writeFileSync(path, JSON.stringify(jsonData, null, 2) + '\n', 'utf8'); +}; + const main = async () => { const serviceMap = await detectRootServices(YANDEX_CLOUD_DIR); writeToFile(serviceMap); const serviceList = await Promise.all(Object.keys(serviceMap).map(generateService)); + serviceList.sort(); - await modidyGitignore(serviceList); + await Promise.all([modifyGitignore(serviceList), modifyPackageJSON(serviceList)]); }; if (require.main === module) {