Skip to content

Commit

Permalink
chore: add docs to libraries (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chriscbr authored Aug 30, 2024
1 parent 7452af7 commit 9e83673
Show file tree
Hide file tree
Showing 85 changed files with 4,001 additions and 100 deletions.
19 changes: 13 additions & 6 deletions .mkrepo/main.w
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ bring "./stale.w" as stale;
bring "./readme.w" as readme;

let workflowdir = ".github/workflows";
let skippedLibrariesPath = "SKIPPED_LIBRARIES.json";

// clean up
fs.remove(workflowdir);
Expand Down Expand Up @@ -37,10 +38,16 @@ new checkconfig.CheckConfigWorkflow(workflowdir);
new prlint.PullRequestLintWorkflow(workflowdir, libs.copy());
new gitattributes.GitAttributes();

let skipCanaryTests = [
"containers", // https://github.com/winglang/wing/issues/5716
"cognito", // https://github.com/winglang/wing/issues/6924
"python", // https://github.com/winglang/wing/issues/6923
];
struct SkippedLibrary {
name: str;
reason: str;
}

let skippedLibrariesData: Array<SkippedLibrary> = unsafeCast(fs.readJson(skippedLibrariesPath)["skipped-packages"]);
let skippedLibraries = MutArray<str>[];
for item in skippedLibrariesData {
skippedLibraries.push(item.name);
}
log("Libraries skipped for end-to-end tests: {Json.stringify(skippedLibraries)}");

new canary.CanaryWorkflow(workflowdir, libs.copy(), skipCanaryTests);
new canary.CanaryWorkflow(workflowdir, libs.copy(), skippedLibraries.copy());
16 changes: 16 additions & 0 deletions SKIPPED_LIBRARIES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"skipped-packages": [
{
"name": "containers",
"reason": "https://github.com/winglang/wing/issues/5716"
},
{
"name": "cognito",
"reason": "https://github.com/winglang/wing/issues/6924"
},
{
"name": "python",
"reason": "https://github.com/winglang/wing/issues/6923"
}
]
}
46 changes: 46 additions & 0 deletions bedrock/API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<h2>API Reference</h2>

<h3>Table of Contents</h3>

- **Classes**
- <a href="#@winglibs/bedrock.JokeMaker">JokeMaker</a>
- <a href="#@winglibs/bedrock.Model">Model</a>

<h3 id="@winglibs/bedrock.JokeMaker">JokeMaker (preflight class)</h3>

<h4>Constructor</h4>

<pre>
new(): JokeMaker
</pre>

<h4>Properties</h4>

*No properties*

<h4>Methods</h4>

| **Signature** | **Description** |
| --- | --- |
| <code>inflight makeJoke(topic: str): str</code> | *No description* |

<h3 id="@winglibs/bedrock.Model">Model (preflight class)</h3>

<h4>Constructor</h4>

<pre>
new(modelId: str): Model
</pre>

<h4>Properties</h4>

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code>modelId</code> | <code>str</code> | *No description* |

<h4>Methods</h4>

| **Signature** | **Description** |
| --- | --- |
| <code>inflight invoke(body: Json): Json</code> | *No description* |

4 changes: 2 additions & 2 deletions bedrock/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 bedrock/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@winglibs/bedrock",
"description": "A Wing library for Amazon Bedrock",
"version": "0.1.0",
"version": "0.1.1",
"author": {
"name": "Eyal Keren",
"email": "[email protected]"
Expand Down
113 changes: 113 additions & 0 deletions budget/API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<h2>API Reference</h2>

<h3>Table of Contents</h3>

- **Classes**
- <a href="#@winglibs/budget.Alert">Alert</a>
- <a href="#@winglibs/budget.AlertTfAws">AlertTfAws</a>
- <a href="#@winglibs/budget.AlertSim">AlertSim</a>
- <a href="#@winglibs/budget.Util">Util</a>
- **Interfaces**
- <a href="#@winglibs/budget.IAlert">IAlert</a>
- **Structs**
- <a href="#@winglibs/budget.AlertProps">AlertProps</a>
- **Enums**
- <a href="#@winglibs/budget.TimeUnit">TimeUnit</a>

<h3 id="@winglibs/budget.Alert">Alert (preflight class)</h3>

<h4>Constructor</h4>

<pre>
new(props: AlertProps): Alert
</pre>

<h4>Properties</h4>

*No properties*

<h4>Methods</h4>

*No methods*

<h3 id="@winglibs/budget.AlertTfAws">AlertTfAws (preflight class)</h3>

<h4>Constructor</h4>

<pre>
new(props: AlertProps): AlertTfAws
</pre>

<h4>Properties</h4>

*No properties*

<h4>Methods</h4>

*No methods*

<h3 id="@winglibs/budget.AlertSim">AlertSim (preflight class)</h3>

<h4>Constructor</h4>

<pre>
new(props: AlertProps): AlertSim
</pre>

<h4>Properties</h4>

*No properties*

<h4>Methods</h4>

*No methods*

<h3 id="@winglibs/budget.Util">Util (preflight class)</h3>

<h4>Constructor</h4>

<pre>
new(): Util
</pre>

<h4>Properties</h4>

*No properties*

<h4>Methods</h4>

| **Signature** | **Description** |
| --- | --- |
| <code>static timeUnitToStr(timeUnit: TimeUnit): str</code> | *No description* |

<h3 id="@winglibs/budget.IAlert">IAlert (interface)</h3>

<h4>Properties</h4>

*No properties*

<h4>Methods</h4>

*No methods*

<h3 id="@winglibs/budget.AlertProps">AlertProps (struct)</h3>

<h4>Properties</h4>

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code>amount</code> | <code>num</code> | *No description* |
| <code>emailAddresses</code> | <code>Array<str></code> | *No description* |
| <code>name</code> | <code>str</code> | *No description* |
| <code>timeUnit</code> | <code>TimeUnit?</code> | *No description* |

<h3 id="@winglibs/budget.TimeUnit">TimeUnit (enum)</h3>

<h4>Values</h4>

| **Name** | **Description** |
| --- | --- |
| <code>DAILY</code> | *No description* |
| <code>MONTHLY</code> | *No description* |
| <code>ANNUALLY</code> | *No description* |

4 changes: 2 additions & 2 deletions budget/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 budget/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@winglibs/budget",
"version": "0.1.5",
"version": "0.1.6",
"description": "AWS Budget",
"keywords": [
"AWS",
Expand Down
47 changes: 34 additions & 13 deletions bump-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,42 @@ increment_patch_version() {
echo "${version_parts[0]}.${version_parts[1]}.${version_parts[2]}"
}

# Read the skipped packages from the JSON file
skipped_packages=$(jq -r '.["skipped-packages"][].name' SKIPPED_LIBRARIES.json)

# Find all package.json files in subdirectories
for package_file in */package.json; do
# Check if the package.json file exists
if [[ -f "$package_file" ]]; then
# Extract the current version
current_version=$(jq -r '.version' "$package_file")

# Increment the patch version
new_version=$(increment_patch_version "$current_version")

# Update the version in package.json
jq --arg new_version "$new_version" '.version = $new_version' "$package_file" > temp.json && mv temp.json "$package_file"

echo "Updated $package_file from $current_version to $new_version"
else
echo "No package.json found in $package_file"
if [[ ! -f "$package_file" ]]; then
continue
fi

package_name="${package_file%/package.json}"

echo "-----------------------------------------------------------------------------"
echo $package_name
echo "-----------------------------------------------------------------------------"

# Check if the package should be skipped
if echo "$skipped_packages" | grep -q "^$package_name$"; then
echo "Skipping $package_name"
continue
fi

# Extract the current version
current_version=$(jq -r '.version' "$package_file")

# Increment the patch version
new_version=$(increment_patch_version "$current_version")

# Update the version in package.json
jq --arg new_version "$new_version" '.version = $new_version' "$package_file" > temp.json && mv temp.json "$package_file"

# Run npm install to update package-lock.json
(
cd "$package_name"
npm install
)

echo "Updated $package_name from $current_version to $new_version"
done
Loading

0 comments on commit 9e83673

Please sign in to comment.