diff --git a/.github/workflows/publish-pkg.yml b/.github/workflows/publish-pkg.yml index 5bcb2207..c7352978 100644 --- a/.github/workflows/publish-pkg.yml +++ b/.github/workflows/publish-pkg.yml @@ -40,6 +40,7 @@ jobs: uses: actions/setup-node@v2 with: node-version: '18' + registry-url: https://registry.npmjs.org/ - name: Install pnpm run: npm install -g pnpm diff --git a/packages/component-interface/package.json b/packages/component-interface/package.json index f06eae29..b1df58d4 100644 --- a/packages/component-interface/package.json +++ b/packages/component-interface/package.json @@ -1,6 +1,6 @@ { "name": "@serverless-devs/component-interface", - "version": "0.0.3-beta.2", + "version": "0.0.4", "description": "request for serverless-devs", "main": "lib/index.js", "scripts": { diff --git a/packages/component-interface/src/index.ts b/packages/component-interface/src/index.ts index be212d1d..4489cf7f 100644 --- a/packages/component-interface/src/index.ts +++ b/packages/component-interface/src/index.ts @@ -18,7 +18,7 @@ export interface IInputs { access: string; // 访问秘钥名 }; getCredential: () => Promise; // 获取用户秘钥 - args: []; + args: string[]; cwd: string; outputs?: Record; } diff --git a/packages/credential/package.json b/packages/credential/package.json index 3c4370fb..ecab5e70 100644 --- a/packages/credential/package.json +++ b/packages/credential/package.json @@ -1,6 +1,6 @@ { "name": "@serverless-devs/credential", - "version": "0.0.5", + "version": "0.0.6-beta.1", "description": "credential for serverless-devs", "main": "lib/index.js", "scripts": { diff --git a/packages/credential/src/actions/set/index.ts b/packages/credential/src/actions/set/index.ts index 5d0b0c37..a179836b 100644 --- a/packages/credential/src/actions/set/index.ts +++ b/packages/credential/src/actions/set/index.ts @@ -69,7 +69,7 @@ export default class SetCredential { } set(credInformation, 'AccountID', accountId); } catch (ex: any) { - Logger.logger.warn(ex.data.Message); + Logger.logger.warn(get(ex, 'data.Message')); Logger.logger.warn('Please make sure provided access is legal, or serverless-devs service on Cloud Providers may fail.'); if (!uid) { throw ex; diff --git a/packages/engine/package.json b/packages/engine/package.json index 48134d4e..b03270b6 100644 --- a/packages/engine/package.json +++ b/packages/engine/package.json @@ -1,6 +1,6 @@ { "name": "@serverless-devs/engine", - "version": "0.1.1", + "version": "0.1.2-beta.4", "description": "a engine lib for serverless-devs", "main": "lib/index.js", "scripts": { diff --git a/packages/load-application/package.json b/packages/load-application/package.json index 7ca894bd..b28de1c9 100644 --- a/packages/load-application/package.json +++ b/packages/load-application/package.json @@ -1,6 +1,6 @@ { "name": "@serverless-devs/load-application", - "version": "0.0.12", + "version": "0.0.13-beta.1", "description": "load application for serverless-devs", "main": "lib/index.js", "scripts": { diff --git a/packages/load-component/package.json b/packages/load-component/package.json index ab00b5a7..35cbde73 100644 --- a/packages/load-component/package.json +++ b/packages/load-component/package.json @@ -1,6 +1,6 @@ { "name": "@serverless-devs/load-component", - "version": "0.0.7-beta.1", + "version": "0.0.7-beta.2", "description": "request for serverless-devs", "main": "lib/index.js", "scripts": { diff --git a/packages/load-component/src/utils/index.ts b/packages/load-component/src/utils/index.ts index 342cf188..3040cbe0 100644 --- a/packages/load-component/src/utils/index.ts +++ b/packages/load-component/src/utils/index.ts @@ -50,6 +50,8 @@ export const buildComponentInstance = async (componentPath: string, params?: any if (componentInstance) { componentInstance.__path = componentPath; const publishData = getYamlContent(path.join(componentPath, 'publish.yaml')); + const schema = get(publishData, 'Schema'); + componentInstance.schemaPath = schema ? path.join(componentPath, schema) : undefined; const version = get(publishData, 'Version'); if (version) { componentInstance.__version = version; diff --git a/packages/logger/package.json b/packages/logger/package.json index 3fbe253b..064ad03b 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -1,6 +1,6 @@ { "name": "@serverless-devs/logger", - "version": "0.0.4", + "version": "0.0.5-beta.1", "description": "", "main": "lib/index.js", "scripts": { diff --git a/packages/logger/src/engine-logger/index.ts b/packages/logger/src/engine-logger/index.ts index 872ef236..8a708f66 100644 --- a/packages/logger/src/engine-logger/index.ts +++ b/packages/logger/src/engine-logger/index.ts @@ -74,7 +74,7 @@ export default class EngineLogger extends Logger { } // TODO: 仅提示但不报错 tips(message: string, tips?: string) { - let msg = `\n${chalk.hex('#000').bgYellow('WARNING:')}\n\n${message}\n`; + let msg = `\n${chalk.hex('#000').bgYellow('TIPS:')}\n\n${message}\n`; if (tips) { msg += `\n${chalk.gray(tips)}\n`; } diff --git a/packages/parse-spec/package.json b/packages/parse-spec/package.json index 8197b05b..2df081ed 100644 --- a/packages/parse-spec/package.json +++ b/packages/parse-spec/package.json @@ -1,6 +1,6 @@ { "name": "@serverless-devs/parse-spec", - "version": "0.0.25", + "version": "0.0.26-beta.1", "description": "a parse yaml spec lib for serverless-devs", "main": "lib/index.js", "scripts": { diff --git a/packages/parse-spec/src/index.ts b/packages/parse-spec/src/index.ts index 67b59050..8d4da1eb 100644 --- a/packages/parse-spec/src/index.ts +++ b/packages/parse-spec/src/index.ts @@ -285,14 +285,12 @@ class ParseSpec { debug(`find flow: ${JSON.stringify(flowObj)}`); const projectOrder = {} as Record; const fn = (projects: string[] = [], index: number) => { - assert(isArray(projects), `flow ${this.record.command} data format is invalid`); + assert(isArray(projects), `flow ${this.record.command} data format is invalid.`); for (const project of projects) { - for (const step of steps) { - if (project === step.projectName) { - newSteps.push({ ...step, flowId: index }); - projectOrder[step.projectName] = index; - } - } + const step = find(steps, item => item.projectName === project); + assert(step, `Resource ${project} is not found. Please check the content of flow.`); + newSteps.push({ ...step, flowId: index }); + projectOrder[step.projectName] = index; } }; each(flowObj, fn);