Skip to content

Commit

Permalink
feat: support ${shared}
Browse files Browse the repository at this point in the history
Signed-off-by: zxypro1 <[email protected]>
  • Loading branch information
zxypro1 committed Aug 14, 2024
1 parent c3e09d3 commit 66520f1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
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.14-beta.11",
"version": "0.0.14-beta.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.16-beta.19",
"@serverless-devs/art-template": "^4.13.16-beta.20",
"@serverless-devs/credential": "workspace:^",
"@serverless-devs/downloads": "workspace:^",
"@serverless-devs/utils": "workspace:^",
Expand Down
6 changes: 6 additions & 0 deletions packages/load-application/src/v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,17 @@ class LoadApplication {
const variablePath = getYamlPath(path.join(this.filePath, DIPPER_VARIABLES_PATH));
if (variablePath && fs.pathExistsSync(variablePath)) {
const variableYaml = getYamlContent(variablePath);
// ${self}
const services = get(variableYaml, 'services', {});
for (const i of keys(services)) {
const params = keys(get(services, `${i}`, {}));
map(params, (j) => { set(this.publishData, j, `\${self.${j}}`) });
}
// ${shared}
const shared = get(variableYaml, 'shared', {});
console.log(shared);
map(keys(shared), (j) => { set(this.publishData, j, `\${shared.${j}}`) });
console.log(this.publishData);
}
}
private async parsePublishWithInquire() {
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.28-beta.14",
"version": "0.0.28-beta.15",
"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.16-beta.19",
"@serverless-devs/art-template": "^4.13.16-beta.20",
"@serverless-devs/credential": "workspace:^",
"@serverless-devs/utils": "workspace:^",
"chalk": "^4.1.2",
Expand Down
12 changes: 6 additions & 6 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 66520f1

Please sign in to comment.