Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cloudv2)!: hide internal APIs #311

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool with internal but I was actually wondering if it might be useful to expose these classes in case the user wants to explicitly instantiate an AWS counter (maybe under the aws namespace):

bring cloud;

new cloud.aws.Counter();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that's probably a good call

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
Loading