From 21f50d0211d9269c4a2f2fe7bff67d2fd330d5a3 Mon Sep 17 00:00:00 2001 From: baozhoutao Date: Thu, 12 Dec 2024 12:19:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=9C=8D=E5=8A=A1=E6=97=B6?= =?UTF-8?q?=E5=80=99,=20=E6=89=A7=E8=A1=8C=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E8=BD=AF=E4=BB=B6=E5=8C=85=E7=9A=84=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/steedos/steedos-platform/issues/5186 --- .../main/default/manager/registry.js | 4 ++-- .../service-package-registry/project.package.service.js | 3 ++- services/service-steedos-server/index.js | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/services/service-package-registry/main/default/manager/registry.js b/services/service-package-registry/main/default/manager/registry.js index 4821fc76fa..976b7a52c1 100644 --- a/services/service-package-registry/main/default/manager/registry.js +++ b/services/service-package-registry/main/default/manager/registry.js @@ -121,7 +121,7 @@ async function installModule(module, version, url, registry_url) { // if( check !== false){ // return check; // } - // console.log(`installModule`, module,version,url) + console.log(`install page`, module, version, url) module = module || ""; activePromise = activePromise.then(async function() { //TODO: ensure module is 'safe' @@ -193,7 +193,7 @@ async function installModule(module, version, url, registry_url) { var installDir = settings.userDir || "."; var args = ['install','--no-audit','--no-update-notifier','--no-fund','--save','--save-prefix=~','--production',installName]; - var yarnArgs = ['add', '-E', installName, '--json']; //yarnCommand , '--json' --registry + var yarnArgs = ['add', '-E', ...installName.split(' '), '--json']; //yarnCommand , '--json' --registry if (false && registry_url) { yarnArgs.push('--registry') yarnArgs.push(registry_url) diff --git a/services/service-package-registry/project.package.service.js b/services/service-package-registry/project.package.service.js index 632a17ac98..642bd636f0 100644 --- a/services/service-package-registry/project.package.service.js +++ b/services/service-package-registry/project.package.service.js @@ -394,6 +394,7 @@ module.exports = { async handler(){ const settings = this.settings; const packages = settings.STEEDOS_INITIAL_PACKAGES; + console.log('install initial packages: ', STEEDOS_INITIAL_PACKAGES); if(_.isString(packages) && packages){ for (const packageName of packages.split(',')) { try { @@ -430,7 +431,7 @@ module.exports = { await this.installPackageFromUrl(installProps.url, installProps.version, installProps.url, null, true, null, this.broker); }else{ //module, version, label, description, enable, broker - await this.installPackage(installProps.name, installProps.version, null, null, true, this.broker); + await this.installPackage(process.env.NPM_REGISTRY_URL ? `${installProps.name} --registry ${process.env.NPM_REGISTRY_URL}` : installProps.name, installProps.version, null, null, true, this.broker); } } catch (error) { this.broker.logger.error(`initialPackages: ${packageName}. ${error.message}`); diff --git a/services/service-steedos-server/index.js b/services/service-steedos-server/index.js index 5b365a2d55..8502f423c6 100644 --- a/services/service-steedos-server/index.js +++ b/services/service-steedos-server/index.js @@ -82,10 +82,10 @@ module.exports = { steedosConfig.setTenant({ enable_create_tenant: true, enable_register: true }); } // 工作区未初始化时,才初始化软件包 - const allowInit = await this.allowInit(records); - if (!allowInit) { - return - } + // const allowInit = await this.allowInit(records); + // if (!allowInit) { + // return + // } try { await ctx.broker.call('@steedos/service-project.initialPackages', {}, {}); } catch (error) {