From f97cfb42dd961f2d1e74ad629382e56bcd42dbc3 Mon Sep 17 00:00:00 2001 From: eladcon Date: Tue, 21 May 2024 16:59:09 +0300 Subject: [PATCH] fix(sns): can't import package with multiple classes with same name (#244) --- sns/aws.w | 4 ++-- sns/lib.w | 8 ++++---- sns/package-lock.json | 4 ++-- sns/package.json | 2 +- sns/sim.w | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sns/aws.w b/sns/aws.w index 4709a2e5..b055d015 100644 --- a/sns/aws.w +++ b/sns/aws.w @@ -2,9 +2,9 @@ bring cloud; bring "./types.w" as types; bring aws; -pub class MobileClient impl types.IMobileClient { +pub class MobileClient_aws impl types.IMobileClient { pub inflight publish(options: types.PublishOptions): types.PublishResult { - return MobileClient._publish(options); + return MobileClient_aws._publish(options); } pub onLift(host: std.IInflightHost, ops: Array) { diff --git a/sns/lib.w b/sns/lib.w index 29e39db5..50ccb4fc 100644 --- a/sns/lib.w +++ b/sns/lib.w @@ -13,14 +13,14 @@ pub class MobileClient impl types.IMobileClient { let target = util.env("WING_TARGET"); if target == "sim" { if std.Node.of(this).app.isTestEnvironment { - this.inner = new sim.MobileClient(); + this.inner = new sim.MobileClient_sim(); } else { - this.inner = new aws.MobileClient(); + this.inner = new aws.MobileClient_aws(); } } elif target == "tf-aws" { - this.inner = new aws.MobileClient(); + this.inner = new aws.MobileClient_aws(); } elif target == "awscdk" { - this.inner = new aws.MobileClient(); + this.inner = new aws.MobileClient_aws(); } else { throw "Unsupported target {target}"; } diff --git a/sns/package-lock.json b/sns/package-lock.json index b772cb86..0c7e2f03 100644 --- a/sns/package-lock.json +++ b/sns/package-lock.json @@ -1,12 +1,12 @@ { "name": "@winglibs/sns", - "version": "0.0.1", + "version": "0.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@winglibs/sns", - "version": "0.0.1", + "version": "0.0.2", "license": "MIT", "peerDependencies": { "@aws-sdk/client-sns": "^3.577.0" diff --git a/sns/package.json b/sns/package.json index ffe8276c..5612303a 100644 --- a/sns/package.json +++ b/sns/package.json @@ -1,7 +1,7 @@ { "name": "@winglibs/sns", "description": "Wing library for interacting with AWS SNS", - "version": "0.0.1", + "version": "0.0.2", "repository": { "type": "git", "url": "https://github.com/winglang/winglibs.git", diff --git a/sns/sim.w b/sns/sim.w index 8f2e6b9f..ad549beb 100644 --- a/sns/sim.w +++ b/sns/sim.w @@ -2,7 +2,7 @@ bring cloud; bring util; bring "./types.w" as types; -pub class MobileClient impl types.IMobileClient { +pub class MobileClient_sim impl types.IMobileClient { store: cloud.Bucket; new() { this.store = new cloud.Bucket() as "Inbox";