Skip to content

Commit

Permalink
fix(cloudv2): hide internal APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
Chriscbr committed Aug 6, 2024
1 parent 9acbe79 commit ef47a5c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cloudv2/counter-aws.w
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub interface IAwsCounter {
dynamoTableName(): str;
}

pub class Counter_tfaws impl counter_types.ICounter, IAwsCounter {
internal class Counter_tfaws impl counter_types.ICounter, IAwsCounter {
initial: num;
table: tfaws.dynamodbTable.DynamodbTable;
hashKey: str;
Expand Down
4 changes: 1 addition & 3 deletions cloudv2/counter-sim.w
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ inflight class CounterBackend impl sim.IResource {
}
}

// TODO: internal access modifiers - https://github.com/winglang/wing/issues/4156

pub class Counter_sim impl counter_types.ICounter {
internal class Counter_sim impl counter_types.ICounter {
initial: num;
backend: sim.Resource;
defaultKey: str; // TODO: module-level constants - https://github.com/winglang/wing/issues/3606
Expand Down
4 changes: 2 additions & 2 deletions cloudv2/package-lock.json

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

2 changes: 1 addition & 1 deletion cloudv2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"email": "[email protected]",
"name": "Chris Rybicki"
},
"version": "0.0.2",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "https://github.com/winglang/winglibs.git",
Expand Down
6 changes: 3 additions & 3 deletions cloudv2/util.w
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
bring "constructs" as constructs;

pub class Util {
internal class Util {
// TODO: private constructors - https://github.com/winglang/wing/issues/4377
// TODO: expose ResourceNames class from SDK
pub static friendlyName(c: constructs.IConstruct): str {
internal static friendlyName(c: constructs.IConstruct): str {
return nodeof(c).id + Util.shortHash(c);
}

pub static shortHash(c: constructs.IConstruct): str {
internal static shortHash(c: constructs.IConstruct): str {
let hash = nodeof(c).addr;
return hash.substring(hash.length - 8);
}
Expand Down

0 comments on commit ef47a5c

Please sign in to comment.