Skip to content
Closed
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
114 changes: 57 additions & 57 deletions .github/workflows/namespace_declarations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,64 +83,64 @@ jobs:
make install-node-modules || make install-node-modules || make install-node-modules
timeout-minutes: 15

# Update namespace Typescript declarations:
- name: 'Update declarations'
# Update namespace Typescript declarations and create PRs:
- name: 'Update declarations and create PRs'
run: |
make list-pkgs-namespaces | node lib/node_modules/@stdlib/_tools/scripts/create_namespace_types.js

# Disable Git hooks:
- name: 'Disable Git hooks'
run: |
rm -rf .git/hooks

# Import GPG key to sign commits:
- name: 'Import GPG key to sign commits'
# Pin action to full length commit SHA
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6.2.0
with:
gpg_private_key: ${{ secrets.STDLIB_BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.STDLIB_BOT_GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true

# Create a pull request with the updated declarations:
- name: 'Create pull request'
id: cpr
# Pin action to full length commit SHA
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
with:
title: 'feat: update namespace TypeScript declarations'
body: |
This PR

- updates namespace TypeScript declarations

## Reviewer Checklist

- [ ] **Check the scope of the changes** (following [Conventional Commits](https://www.conventionalcommits.org)):
- Are these **new APIs**? Then this is a `feat`.
- Are these **changes to existing APIs** that could break compatibility? Then this is a `feat!` (i.e., a breaking change).
- Are these **only documentation** changes to existing APIs? Then this is `docs`.
- [ ] Update the PR title to align with the change type (`feat`, `feat!`, or `docs`).
- [ ] Approve the PR once you are confident about the classification and changes made.

commit-message: 'feat: update namespace TypeScript declarations'
committer: 'stdlib-bot <[email protected]>'
signoff: true
token: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
labels: |
documentation
automated-pr
team-reviewers: |
reviewers
branch: update-namespace-declarations
delete-branch: true

# Create Markdown summary of the pull request:
# Create a temporary file to store the list of namespaces
make list-pkgs-namespaces > namespaces.txt

# Process each namespace
while IFS= read -r namespace; do
if [ -n "$namespace" ] && [[ $namespace != *"_tools"* ]]; then
# Create branch name by replacing / with - and removing @stdlib/
branch_name="update-$(echo "$namespace" | sed 's/@stdlib\///' | sed 's/\//-/g')-declarations"

git checkout -b "$branch_name"

# Generate declarations for this namespace
echo "$namespace" | node lib/node_modules/@stdlib/_tools/scripts/create_namespace_types.js

# Check if there are changes in the stdlib directory
if ! git diff --quiet -- lib/node_modules/@stdlib; then
# Stage only changes in the stdlib directory
git add lib/node_modules/@stdlib
git commit -m "feat: update ${namespace} TypeScript declarations" --signoff

# Push branch and create PR
git push origin "$branch_name"

gh pr create \
--title "feat: update ${namespace} TypeScript declarations" \
--body "This PR updates TypeScript declarations for the ${namespace} namespace.

## Reviewer Checklist

- [ ] **Check the scope of the changes** (following [Conventional Commits](https://www.conventionalcommits.org)):
- Are these **new APIs**? Then this is a \`feat\`.
- Are these **changes to existing APIs** that could break compatibility? Then this is a \`feat!\` (i.e., a breaking change).
- Are these **only documentation** changes to existing APIs? Then this is \`docs\`.
- [ ] Update the PR title to align with the change type (\`feat\`, \`feat!\`, or \`docs\`).
- [ ] Approve the PR once you are confident about the classification and changes made." \
--label "documentation" \
--label "automated-pr" \
--reviewer "reviewers" \
--base develop \
--head "$branch_name"
fi

# Return to develop branch
git checkout develop
fi
done < namespaces.txt

# Clean up temporary file:
rm namespaces.txt
env:
GITHUB_TOKEN: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}

# Create Markdown summary of the pull requests:
- name: 'Create summary'
run: |
echo "# :tada: Pull Request created! :tada:" >> $GITHUB_STEP_SUMMARY
echo "# :tada: Pull Requests created! :tada:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Pull request ${{ steps.cpr.outputs.pull-request-number }} was successfully ${{ steps.cpr.outputs.pull-request-operation }}."
echo ":link: [${{ steps.cpr.outputs.pull-request-url }}](${{ steps.cpr.outputs.pull-request-url }})." >> $GITHUB_STEP_SUMMARY
echo "Head SHA: [${{ steps.cpr.outputs.pull-request-head-sha }}](${{ steps.cpr.outputs.pull-request-url }}/commits/${{ steps.cpr.outputs.pull-request-head-sha }})." >> $GITHUB_STEP_SUMMARY
echo "Separate pull requests were created for each namespace with TypeScript declaration changes." >> $GITHUB_STEP_SUMMARY
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/stats/base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3849,7 +3849,7 @@ interface Namespace {
*
* @param N - number of indexed elements
* @param x - input array
* @param stride - stride length
* @param strideX - stride length
* @returns arithmetic mean
*
* @example
Expand Down Expand Up @@ -4862,7 +4862,7 @@ interface Namespace {
* @param N - number of indexed elements
* @param correction - degrees of freedom adjustment
* @param x - input array
* @param stride - stride length
* @param strideX - stride length
* @returns standard deviation
*
* @example
Expand Down
Loading