Skip to content

Commit

Permalink
publish credential, engine, load-application, parse-spec
Browse files Browse the repository at this point in the history
Signed-off-by: zxypro1 <[email protected]>
  • Loading branch information
zxypro1 committed Feb 28, 2024
1 parent 1aecc57 commit af6d4ef
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 32 deletions.
2 changes: 1 addition & 1 deletion packages/credential/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@serverless-devs/credential",
"version": "0.0.4",
"version": "0.0.5",
"description": "credential for serverless-devs",
"main": "lib/index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion packages/credential/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export async function writeData(content: Record<string, Record<string, string>>)
fs.writeFileSync(getYamlPath(), yaml.dump(content));
} catch (ex: any) {
Logger.logger.debug(`write data error: ${ex.message}`);
throw new Error('Configuration failed');
if (ex.message.includes('EACCES')) throw new Error(`Configuration failed. Please check the permission.`);;
throw new Error('Configuration failed.');
}
}
2 changes: 1 addition & 1 deletion packages/engine/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@serverless-devs/engine",
"version": "0.1.0-beta.3",
"version": "0.1.0",
"description": "a engine lib for serverless-devs",
"main": "lib/index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/load-application/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@serverless-devs/load-application",
"version": "0.0.12-beta.1",
"version": "0.0.12",
"description": "load application for serverless-devs",
"main": "lib/index.js",
"scripts": {
Expand All @@ -18,7 +18,7 @@
},
"dependencies": {
"@serverless-cd/debug": "^4.3.4",
"@serverless-devs/art-template": "^4.13.7",
"@serverless-devs/art-template": "^4.13.15",
"@serverless-devs/credential": "workspace:^",
"@serverless-devs/downloads": "workspace:^",
"@serverless-devs/utils": "workspace:^",
Expand Down
4 changes: 2 additions & 2 deletions packages/parse-spec/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@serverless-devs/parse-spec",
"version": "0.0.23",
"version": "0.0.24",
"description": "a parse yaml spec lib for serverless-devs",
"main": "lib/index.js",
"scripts": {
Expand All @@ -22,7 +22,7 @@
},
"dependencies": {
"@serverless-cd/debug": "^4.3.4",
"@serverless-devs/art-template": "^4.13.14",
"@serverless-devs/art-template": "^4.13.15",
"@serverless-devs/credential": "workspace:^",
"@serverless-devs/utils": "workspace:^",
"chalk": "^4.1.2",
Expand Down
7 changes: 7 additions & 0 deletions packages/parse-spec/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ class ParseSpec {
this.parseArgv();
if (!this.yaml.use3x) return this.v1();
const { steps, content, originSteps } = await new ParseContent(this.yaml.content, this.getParsedContentOptions(this.yaml.path)).start();
const services = get(this.yaml.content, 'services', {});
if (isEmpty(steps) && !isEmpty(services)) {
this.options.logger.tips('Check https://docs.serverless-devs.com/serverless-devs/yaml for more details. Use the \'s cli fc3 s2tos3\' command for automatic YAML transformation.');
throw new DevsError(`Keyword 'services' has been replaced by 'resources' in 3.0.0 YAML.`, {
trackerType: ETrackerType.parseException,
});
}
// steps 存放每个FC组件/函数的 yaml 配置 ([content.resource] => steps)
// content 为 yaml 已解析的整体完整信息
// originSteps 为 steps 的未解析版
Expand Down
32 changes: 7 additions & 25 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit af6d4ef

Please sign in to comment.