Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Nov 9, 2023
1 parent b256346 commit afa28c4
Show file tree
Hide file tree
Showing 35 changed files with 1,183 additions and 760 deletions.
52 changes: 2 additions & 50 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#/
# @license Apache-2.0
#
# Copyright (c) 2021 The Stdlib Authors.
# Copyright (c) 2023 The Stdlib Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
publish:

# Define display name:
name: 'Publish package to npm'
name: 'Publish top-level package to npm'

# Define the type of virtual host machine on which to run the job:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -103,54 +103,6 @@ jobs:
SLUG=${{ github.repository }}
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" --follow-tags
# Remove CLI:
- name: 'Remove CLI'
if: ${{ github.ref == 'refs/heads/main' }}
run: |
# Exit if the package does not have a CLI:
if ! grep -q '"bin":' package.json; then
exit 0
fi
rm -rf ./bin/cli
rm -f test/test.cli.js
rm -f etc/cli_opts.json
rm -f docs/usage.txt
# For all dependencies, check in all *.js files if they are still used; if not, remove them:
jq -r '.dependencies | keys[]' ./package.json | while read -r dep; do
dep=$(echo "$dep" | xargs)
if ! grep -q "$dep" lib/** && ! grep -q -s "$dep" manifest.json && ! grep -q -s "$dep" include.gypi; then
jq --indent 2 "del(.dependencies[\"$dep\"])" ./package.json > ./package.json.tmp
mv ./package.json.tmp ./package.json
fi
done
jq -r '.devDependencies | keys[]' ./package.json | while read -r dep; do
if [[ "$dep" != "@stdlib"* ]]; then
continue
fi
dep=$(echo "$dep" | xargs)
if ! grep -q "$dep" lib/** && ! grep -q -s "$dep" manifest.json && ! grep -q -s "$dep" include.gypi; then
jq --indent 2 "del(.devDependencies[\"$dep\"])" ./package.json > ./package.json.tmp
mv ./package.json.tmp ./package.json
fi
done
# Remove CLI section:
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?<section class=\"cli\">[\s\S]+?<\!\-\- \/.cli \-\->//"
# Remove CLI from package.json:
jq -r 'del(.bin)' package.json > package.json.tmp
mv package.json.tmp package.json
# Add entry for CLI package to See Also section of README.md:
cliPkgName=$(jq -r '.name' package.json)-cli
escapedPkg=$(echo "$cliPkgName" | sed -e 's/\//\\\//g')
escapedPkg=$(echo "$escapedPkg" | sed -e 's/\@/\\\@/g')
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/<section class=\"related\">(?:\n\n\* \* \*\n\n## See Also\n\n)?/<section class=\"related\">\n\n## See Also\n\n- <span class=\"package-name\">[\`$escapedPkg\`][$escapedPkg]<\/span><span class=\"delimiter\">: <\/span><span class=\"description\">CLI package for use as a command-line utility.<\/span>\n/"
# Add link definition for CLI package to README.md:
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/<section class=\"links\">/<section class=\"links\">\n\n[$escapedPkg]: https:\/\/www.npmjs.com\/package\/$escapedPkg/"
# Replace GitHub MathJax equations with SVGs:
- name: 'Replace GitHub MathJax equations with SVGs'
run: |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
[npm-image]: http://img.shields.io/npm/v/@stdlib/strided.svg
[npm-url]: https://npmjs.org/package/@stdlib/strided

[test-image]: https://github.com/stdlib-js/strided/actions/workflows/test.yml/badge.svg?branch=v0.1.1
[test-url]: https://github.com/stdlib-js/strided/actions/workflows/test.yml?query=branch:v0.1.1
[test-image]: https://github.com/stdlib-js/strided/actions/workflows/test.yml/badge.svg?branch=main
[test-url]: https://github.com/stdlib-js/strided/actions/workflows/test.yml?query=branch:main

[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/strided/main.svg
[coverage-url]: https://codecov.io/github/stdlib-js/strided?branch=main
Expand Down
14 changes: 13 additions & 1 deletion base/binary-dtype-signatures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ console.log( str );

<section class="related">

* * *

## See Also

- <span class="package-name">[`@stdlib/strided/base/binary-signature-callbacks`][@stdlib/strided/base/binary-signature-callbacks]</span><span class="delimiter">: </span><span class="description">assign callbacks to binary interfaces according to type promotion rules.</span>

</section>

<!-- /.related -->
Expand All @@ -152,7 +158,13 @@ console.log( str );

[@stdlib/strided/dtypes]: https://github.com/stdlib-js/strided/tree/main/dtypes

[@stdlib/ndarray/promotion-rules]: https://github.com/stdlib-js/stdlib
[@stdlib/ndarray/promotion-rules]: https://github.com/stdlib-js/ndarray-promotion-rules

<!-- <related-links> -->

[@stdlib/strided/base/binary-signature-callbacks]: https://github.com/stdlib-js/strided/tree/main/base/binary-signature-callbacks

<!-- </related-links> -->

</section>

Expand Down
14 changes: 13 additions & 1 deletion base/binary-signature-callbacks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ var clbks = callbacks( table, sigs );

<section class="related">

* * *

## See Also

- <span class="package-name">[`@stdlib/strided/base/binary-dtype-signatures`][@stdlib/strided/base/binary-dtype-signatures]</span><span class="delimiter">: </span><span class="description">generate a list of binary interface signatures from strided array data types.</span>

</section>

<!-- /.related -->
Expand All @@ -159,7 +165,13 @@ var clbks = callbacks( table, sigs );

<section class="links">

[@stdlib/ndarray/promotion-rules]: https://github.com/stdlib-js/stdlib
[@stdlib/ndarray/promotion-rules]: https://github.com/stdlib-js/ndarray-promotion-rules

<!-- <related-links> -->

[@stdlib/strided/base/binary-dtype-signatures]: https://github.com/stdlib-js/strided/tree/main/base/binary-dtype-signatures

<!-- </related-links> -->

</section>

Expand Down
Loading

0 comments on commit afa28c4

Please sign in to comment.