From 7b75efcae01ef1bca5cb1a1e7f9a5136de6430fd Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 1 May 2022 00:43:48 +0000 Subject: [PATCH] Auto-generated commit --- .github/.keepalive | 2 +- .github/workflows/benchmark.yml | 30 +- .github/workflows/bundle.yml | 358 ++++++++++++++++++---- .github/workflows/cancel.yml | 19 +- .github/workflows/close_pull_requests.yml | 2 +- .github/workflows/examples.yml | 28 +- .github/workflows/npm_downloads.yml | 101 ++++++ .github/workflows/productionize.yml | 160 ++++++++++ .github/workflows/publish.yml | 86 +++++- .github/workflows/test.yml | 44 ++- .github/workflows/test_bundles.yml | 85 ++++- .github/workflows/test_coverage.yml | 53 +++- .github/workflows/test_install.yml | 38 ++- .npmignore | 1 + LICENSE | 304 ------------------ README.md | 3 + branches.md | 53 ++++ package.json | 2 +- 18 files changed, 943 insertions(+), 426 deletions(-) create mode 100644 .github/workflows/npm_downloads.yml create mode 100644 .github/workflows/productionize.yml create mode 100644 branches.md diff --git a/.github/.keepalive b/.github/.keepalive index 1c6707d..b168bc5 100644 --- a/.github/.keepalive +++ b/.github/.keepalive @@ -1 +1 @@ -2022-04-01T00:42:05.054Z +2022-05-01T00:43:48.049Z diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 5fba1fd..29bf533 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -21,22 +21,42 @@ name: benchmark # Workflow triggers: on: + # Allow the workflow to be manually run: workflow_dispatch: # Workflow jobs: jobs: + + # Define a job to run benchmarks: benchmark: - runs-on: ubuntu-latest + + # Define a display name: + name: 'Run benchmarks' + + # Define the type of virtual host machine: + runs-on: 'ubuntu-latest' + + # Define the sequence of job steps... steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v2 + + # Checkout the repository: + - name: 'Checkout repository' + uses: actions/checkout@v3 + + # Install Node.js: + - name: 'Install Node.js' + uses: actions/setup-node@v2 with: node-version: 16 timeout-minutes: 5 - - name: Install production and development dependencies + + # Install dependencies: + - name: 'Install production and development dependencies' run: | npm install || npm install || npm install timeout-minutes: 15 - - name: Run benchmarks + + # Run benchmarks: + - name: 'Run benchmarks' run: | npm run benchmark diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index 5cdca52..a9b11b8 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -21,20 +21,40 @@ name: bundle # Workflow triggers: on: + # Allow workflow to be manually run: workflow_dispatch: - push: - branches: - - main - tags-ignore: - - 'v[0-9]+\.[0-9]+\.[0-9]+' + + # Run workflow upon completion of `productionize` workflow: + workflow_run: + workflows: ["productionize"] + types: [completed] # Workflow jobs: jobs: + + # Define job to create a bundle for use in Deno... deno: + + # Define display name: + name: 'Create Deno bundle' + + # Define the type of virtual host machine on which to run the job: runs-on: ubuntu-latest + + # Define the sequence of job steps... steps: - - uses: actions/checkout@v3 - - name: Copy files to deno directory + # Checkout the repository: + - name: 'Checkout repository' + uses: actions/checkout@v3 + + # Checkout production branch: + - name: 'Checkout production branch' + run: | + git fetch --all + git checkout -b production origin/production + + # Copy files to deno directory: + - name: 'Copy files to deno directory' run: | mkdir -p deno cp README.md LICENSE CONTRIBUTORS NOTICE ./deno @@ -46,21 +66,30 @@ jobs: if [ -e ./docs/types/index.d.ts ]; then cp ./docs/types/index.d.ts ./deno/mod.d.ts fi - - uses: actions/setup-node@v2 + + # Install Node.js: + - name: 'Install Node.js' + uses: actions/setup-node@v2 with: node-version: 16 timeout-minutes: 5 + + # Install dependencies: - name: Install production and development dependencies id: install run: | npm install || npm install || npm install timeout-minutes: 15 - - name: Bundle package for Deno + + # Bundle package for use in Deno: + - name: 'Bundle package for Deno' id: deno-bundle uses: stdlib-js/bundle-action@main with: target: 'deno' - - name: Rewrite file contents + + # Rewrite file contents: + - name: 'Rewrite file contents' run: | # Replace links to other packages with links to the deno branch: find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; @@ -86,53 +115,134 @@ jobs: # Create package.json file for deno branch: jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - name: Publish to deno branch - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./deno - publish_branch: deno - force_orphan: true - user_name: 'stdlib-bot' - user_email: 'noreply@stdlib.io' - commit_message: 'Auto-generated commit' - enable_jekyll: true - - name: Send status to Slack channel in case of failure + # Configure git: + - name: 'Configure git' + run: | + git config --local user.email "noreply@stdlib.io" + git config --local user.name "stdlib-bot" + + # Check if remote `deno` branch exists: + - name: 'Check if remote branch exists' + id: deno-branch-exists + continue-on-error: true + run: | + git ls-remote --exit-code --heads origin deno + if [ $? -eq 0 ]; then + echo "::set-output name=remote-exists::true" + else + echo "::set-output name=remote-exists::false" + fi + + # If `deno` exists, checkout branch and rebase on `main`: + - name: 'If `deno` exists, checkout branch and rebase on `main`' + if: steps.deno-branch-exists.outputs.remote-exists + continue-on-error: true + run: | + git checkout -b deno origin/deno + git rebase main -s recursive -X ours + while [ $? -ne 0 ]; do + git rebase --skip + done + + # If `deno` does not exist, checkout `main` and create `deno` branch: + - name: 'If `deno` does not exist, checkout `main` and create `deno` branch' + if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} + run: | + git checkout main + git checkout -b deno + + # Delete everything in current directory aside from deno folder: + - name: 'Delete everything in current directory aside from deno folder' + run: | + find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs rm + find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs rm -rf + + # Move deno directory to root: + - name: 'Move deno directory to root' + run: | + mv ./deno/* . + rmdir ./deno + + # Commit changes: + - name: 'Commit changes' + run: | + git add -A + git commit -m "Auto-generated commit" + + # Push changes: + - name: 'Push changes' + run: | + SLUG=${{ github.repository }} + echo "Pushing changes to $SLUG..." + git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno --force + + # Send status to Slack channel if job fails: + - name: 'Send status to Slack channel in case of failure' uses: act10ns/slack@v1 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() + + # Define job to create a UMD bundle... umd: + + # Define display name: + name: 'Create UMD bundle' + + # Define the type of virtual host machine on which to run the job: runs-on: ubuntu-latest + + # Define the sequence of job steps... steps: - - uses: actions/checkout@v3 - - name: Copy files to umd directory + # Checkout the repository: + - name: 'Checkout repository' + uses: actions/checkout@v3 + + # Checkout production branch: + - name: 'Checkout production branch' + run: | + git fetch --all + git checkout -b production origin/production + + # Copy files to umd directory: + - name: 'Copy files to umd directory' run: | mkdir -p umd cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - uses: actions/setup-node@v2 + + # Install Node.js + - name: 'Install Node.js' + uses: actions/setup-node@v2 with: node-version: 16 timeout-minutes: 5 - - name: Install production and development dependencies + + # Install dependencies: + - name: 'Install production and development dependencies' id: install run: | npm install || npm install || npm install timeout-minutes: 15 - - name: Extract Alias + + # Extract alias: + - name: 'Extract alias' id: extract-alias run: | alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') echo "::set-output name=alias::${alias}" - - name: Create Universal Module Definition (UMD) bundle + + # Create Universal Module Definition (UMD) bundle: + - name: 'Create Universal Module Definition (UMD) bundle' id: umd-bundle uses: stdlib-js/bundle-action@main with: target: 'umd' alias: ${{ steps.extract-alias.outputs.alias }} - - name: Rewrite file contents + + # Rewrite file contents: + - name: 'Rewrite file contents' run: | # Replace links to other packages with links to the umd branch: @@ -158,29 +268,99 @@ jobs: # Create package.json file for umd branch: jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "main": "./bundle.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./umd/package.json - - name: Publish to umd branch - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./umd - publish_branch: umd - force_orphan: true - user_name: 'stdlib-bot' - user_email: 'noreply@stdlib.io' - commit_message: 'Auto-generated commit' - enable_jekyll: true - - name: Send status to Slack channel in case of failure + # Configure git: + - name: 'Configure git' + run: | + git config --local user.email "noreply@stdlib.io" + git config --local user.name "stdlib-bot" + + # Check if remote `umd` branch exists: + - name: 'Check if remote `umd` branch exists' + id: umd-branch-exists + continue-on-error: true + run: | + git ls-remote --exit-code --heads origin umd + if [ $? -eq 0 ]; then + echo "::set-output name=remote-exists::true" + else + echo "::set-output name=remote-exists::false" + fi + + # If `umd` exists, checkout branch and rebase on `main`: + - name: 'If `umd` exists, checkout branch and rebase on `main`' + if: steps.umd-branch-exists.outputs.remote-exists + continue-on-error: true + run: | + git checkout -b umd origin/umd + git rebase main -s recursive -X ours + while [ $? -ne 0 ]; do + git rebase --skip + done + + # If `umd` does not exist, checkout `main` and create `umd` branch: + - name: 'If `umd` does not exist, checkout `main` and create `umd` branch' + if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} + run: | + git checkout main + git checkout -b umd + + # Delete everything in current directory aside from umd folder: + - name: 'Delete everything in current directory aside from umd folder' + run: | + find . -type 'f' | grep -v -e "umd" -e ".git/" | xargs rm + find . -mindepth 1 -type 'd' | grep -v -e "umd" -e ".git" | xargs rm -rf + + # Move umd directory to root: + - name: 'Move umd directory to root' + run: | + mv ./umd/* . + rmdir ./umd + + # Commit changes: + - name: 'Commit changes' + run: | + git add -A + git commit -m "Auto-generated commit" + + # Push changes: + - name: 'Push changes' + run: | + SLUG=${{ github.repository }} + echo "Pushing changes to $SLUG..." + git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" umd --force + + # Send status to Slack channel if job fails: + - name: 'Send status to Slack channel in case of failure' uses: act10ns/slack@v1 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() + + # Define job to create ES module build... esm: + + # Define display name: + name: 'Create ES module build' + + # Define the type of virtual host machine on which to run the job: runs-on: ubuntu-latest + + # Define the sequence of job steps... steps: - - uses: actions/checkout@v3 - - name: Copy files to umd directory + # Checkout the repository: + - name: 'Checkout repository' + uses: actions/checkout@v3 + + # Checkout production branch: + - name: 'Checkout production branch' + run: | + git fetch --all + git checkout -b production origin/production + + # Copy files to umd directory: + - name: 'Copy files to umd directory' run: | mkdir -p esm cp README.md LICENSE CONTRIBUTORS NOTICE ./esm @@ -192,21 +372,30 @@ jobs: if [ -d index.d.ts ]; then cp index.d.ts ./esm/index.d.ts fi - - uses: actions/setup-node@v2 + + # Install Node.js: + - name: 'Install Node.js' + uses: actions/setup-node@v2 with: node-version: 16 timeout-minutes: 5 - - name: Install production and development dependencies + + # Install dependencies: + - name: 'Install production and development dependencies' id: install run: | npm install || npm install || npm install timeout-minutes: 15 - - name: Create ES Module (ESM) bundle + + # Create ES Module (ESM) bundle: + - name: 'Create ES Module (ESM) bundle' id: esm-bundle uses: stdlib-js/bundle-action@main with: target: 'esm' - - name: Rewrite file contents + + # Rewrite file contents: + - name: 'Rewrite file contents' run: | # Replace links to other packages with links to the esm branch: @@ -236,18 +425,69 @@ jobs: # Create package.json file for esm branch: jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./index.mjs", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./esm/package.json - - name: Publish to esm branch - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./esm - publish_branch: esm - force_orphan: true - user_name: 'stdlib-bot' - user_email: 'noreply@stdlib.io' - commit_message: 'Auto-generated commit' - enable_jekyll: true - - name: Send status to Slack channel in case of failure + # Configure git: + - name: 'Configure git' + run: | + git config --local user.email "noreply@stdlib.io" + git config --local user.name "stdlib-bot" + + # Check if remote `esm` branch exists: + - name: 'Check if remote `esm` branch exists' + id: esm-branch-exists + continue-on-error: true + run: | + git ls-remote --exit-code --heads origin esm + if [ $? -eq 0 ]; then + echo "::set-output name=remote-exists::true" + else + echo "::set-output name=remote-exists::false" + fi + + # If `esm` exists, checkout branch and rebase on `main`: + - name: 'If `esm` exists, checkout branch and rebase on `main`' + if: steps.esm-branch-exists.outputs.remote-exists + continue-on-error: true + run: | + git checkout -b esm origin/esm + git rebase main -s recursive -X ours + while [ $? -ne 0 ]; do + git rebase --skip + done + + # If `esm` does not exist, checkout `main` and create `esm` branch: + - name: 'If `esm` does not exist, checkout `main` and create `esm` branch' + if: ${{ steps.esm-branch-exists.outputs.remote-exists == false }} + run: | + git checkout main + git checkout -b esm + + # Delete everything in current directory aside from esm folder: + - name: 'Delete everything in current directory aside from esm folder' + run: | + find . -type 'f' | grep -v -e "esm" -e ".git/" | xargs rm + find . -mindepth 1 -type 'd' | grep -v -e "esm" -e ".git" | xargs rm -rf + + # Move esm directory to root: + - name: 'Move esm directory to root' + run: | + mv ./esm/* . + rmdir ./esm + + # Commit changes: + - name: 'Commit changes' + run: | + git add -A + git commit -m "Auto-generated commit" + + # Push changes to `esm` branch: + - name: 'Push changes' + run: | + SLUG=${{ github.repository }} + echo "Pushing changes to $SLUG..." + git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" esm --force + + # Send status to Slack channel if job fails: + - name: 'Send status to Slack channel in case of failure' uses: act10ns/slack@v1 with: status: ${{ job.status }} diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml index 10697eb..a7a7f51 100644 --- a/.github/workflows/cancel.yml +++ b/.github/workflows/cancel.yml @@ -21,15 +21,30 @@ name: cancel # Workflow triggers: on: + # Allow the workflow to be manually run: workflow_dispatch: # Workflow jobs: jobs: + + # Define a job to cancel existing workflow runs: cancel: - runs-on: ubuntu-latest + + # Define a display name: + name: 'Cancel workflow runs' + + # Define the type of virtual host machine: + runs-on: 'ubuntu-latest' + + # Time limit: timeout-minutes: 3 + + # Define the sequence of job steps... steps: - - uses: styfle/cancel-workflow-action@0.9.0 + + # Cancel existing workflow runs: + - name: 'Cancel existing workflow runs' + uses: styfle/cancel-workflow-action@0.9.0 with: workflow_id: >- benchmark.yml, diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml index 9193004..28dc383 100644 --- a/.github/workflows/close_pull_requests.yml +++ b/.github/workflows/close_pull_requests.yml @@ -17,7 +17,7 @@ #/ # Workflow name: -name: Close Pull Requests +name: close_pull_requests # Workflow triggers: on: diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 01d5441..39b1613 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -21,22 +21,42 @@ name: examples # Workflow triggers: on: + # Allow the workflow to be manually run: workflow_dispatch: # Workflow jobs: jobs: + + # Define a job to run the package examples... examples: + + # Define display name: + name: 'Run examples' + + # Define the type of virtual host machine on which to run the job: runs-on: ubuntu-latest + + # Define the sequence of job steps... steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v2 + + # Checkout the repository: + - name: 'Checkout the repository' + uses: actions/checkout@v3 + + # Install Node.js: + - name: 'Install Node.js' + uses: actions/setup-node@v2 with: node-version: 16 timeout-minutes: 5 - - name: Install production and development dependencies + + # Install dependencies: + - name: 'Install production and development dependencies' run: | npm install || npm install || npm install timeout-minutes: 15 - - name: Run examples + + # Run examples: + - name: 'Run examples' run: | npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml new file mode 100644 index 0000000..c7b714e --- /dev/null +++ b/.github/workflows/npm_downloads.yml @@ -0,0 +1,101 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2022 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. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# Workflow name: +name: npm_downloads + +# Workflow triggers: +on: + # Run this workflow weekly: + schedule: + # cron: ' ' + - cron: '0 8 * * 6' + + # Allow the workflow to be manually run: + workflow_dispatch: + +# Workflow jobs: +jobs: + + # Define a job for retrieving npm download counts... + npm_downloads: + + # Define display name: + name: 'Retrieve npm download counts' + + # Define the type of virtual host machine on which to run the job: + runs-on: ubuntu-latest + + # Define the sequence of job steps... + steps: + # Checkout the repository: + - name: 'Checkout repository' + uses: actions/checkout@v3 + timeout-minutes: 10 + + # Install Node.js: + - name: 'Install Node.js' + uses: actions/setup-node@v2 + with: + node-version: 16 + timeout-minutes: 5 + + # Resolve package name: + - name: 'Resolve package name' + id: package_name + run: | + name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` + echo "::set-output name=package_name::$name" + timeout-minutes: 5 + + # Fetch download data: + - name: 'Fetch data' + id: download_data + run: | + url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" + echo "$url" + data=$(curl "$url") + mkdir ./tmp + echo "$data" > ./tmp/npm_downloads.json + echo "::set-output name=data::$data" + timeout-minutes: 5 + + # Upload the download data: + - name: 'Upload data' + uses: actions/upload-artifact@v2 + with: + # Define a name for the uploaded artifact (ensuring a unique name for each job): + name: npm_downloads + + # Specify the path to the file to upload: + path: ./tmp/npm_downloads.json + + # Specify the number of days to retain the artifact (default is 90 days): + retention-days: 90 + timeout-minutes: 10 + if: success() + + # Send data to events server: + - name: 'Post data' + uses: distributhor/workflow-webhook@v2 + env: + webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} + webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} + data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' + timeout-minutes: 5 + if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml new file mode 100644 index 0000000..4790424 --- /dev/null +++ b/.github/workflows/productionize.yml @@ -0,0 +1,160 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2022 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. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# Workflow name: +name: productionize + +# Workflow triggers: +on: + # Run workflow when a new commit is pushed to the repository: + push: + + # Allow the workflow to be manually run: + workflow_dispatch: + +# Workflow jobs: +jobs: + + # Define a job to create a production build... + productionize: + + # Define display name: + name: 'Productionize' + + # Define the type of virtual host machine: + runs-on: 'ubuntu-latest' + + # Define the sequence of job steps... + steps: + # Checkout main branch of repository: + - name: 'Checkout main branch' + uses: actions/checkout@v3 + with: + ref: main + + # Install Node.js: + - name: 'Install Node.js' + uses: actions/setup-node@v2 + with: + node-version: 16 + timeout-minutes: 5 + + # Create production branch: + - name: 'Create production branch' + run: | + git checkout -b production + + # Transform error messages: + - name: 'Transform error messages' + id: transform-error-messages + uses: stdlib-js/transform-errors-action@main + + # Format error messages: + - name: 'Replace double quotes with single quotes in rewritten format string error messages' + run: | + find . -name "*.js" -exec sed -E -i "s/Error\( format\( \"([a-zA-Z0-9]+)\"/Error\( format\( '\1'/g" {} \; + + # Format string literal error messages: + - name: 'Replace double quotes with single quotes in rewritten string literal error messages' + run: | + find . -name "*.js" -exec sed -E -i "s/Error\( format\(\"([a-zA-Z0-9]+)\"\)/Error\( format\( '\1' \)/g" {} \; + + # Format code: + - name: 'Replace double quotes with single quotes in inserted `require` calls' + run: | + find . -name "*.js" -exec sed -E -i "s/require\( ?\"@stdlib\/error-tools-fmtprodmsg\" ?\);/require\( '@stdlib\/error-tools-fmtprodmsg' \);/g" {} \; + + # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: + - name: 'Update dependencies in package.json' + run: | + if grep -q '"@stdlib/string-format"' package.json; then + sed -i "s/\"@stdlib\/string-format\"/\"@stdlib\/error-tools-fmtprodmsg\"/g" package.json + else + node -e "var pkg = require( './package.json' ); pkg.dependencies[ '@stdlib/error-tools-fmtprodmsg' ] = '^0.0.x'; require( 'fs' ).writeFileSync( 'package.json', JSON.stringify( pkg, null, 2 ) );" + fi + + # Configure git: + - name: 'Configure git' + run: | + git config --local user.email "noreply@stdlib.io" + git config --local user.name "stdlib-bot" + + # Commit changes: + - name: 'Commit changes' + run: | + git add -A + git commit -m "Transform error messages" + + # Push changes: + - name: 'Push changes' + run: | + SLUG=${{ github.repository }} + echo "Pushing changes to $SLUG..." + git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force + + # Define a job for running tests of the productionized code... + test: + + # Define a display name: + name: 'Run Tests' + + # Define the type of virtual host machine: + runs-on: 'ubuntu-latest' + + # Indicate that this job depends on the prior job finishing: + needs: test + + # Run this job regardless of the outcome of the prior job: + if: always() + + # Define the sequence of job steps... + steps: + + # Checkout the repository: + - name: 'Checkout repository' + uses: actions/checkout@v3 + with: + # Use the `production` branch: + ref: production + + # Install Node.js: + - name: 'Install Node.js' + uses: actions/setup-node@v2 + with: + node-version: 16 + timeout-minutes: 5 + + # Install dependencies: + - name: 'Install production and development dependencies' + id: install + run: | + npm install || npm install || npm install + timeout-minutes: 15 + + # Build native add-on if present: + - name: 'Build native add-on (if present)' + run: | + if [ -f "binding.gyp" ]; then + npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild + fi + + # Run tests: + - name: 'Run tests' + id: tests + run: | + npm test || npm test || npm test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0d4273d..8a9eec1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,73 +21,131 @@ name: publish # Workflow triggers: on: + # Run workflow when a new tag is pushed to the repository: push: tags: v[0-9]+.[0-9]+.[0-9]+ # Workflow jobs: jobs: + + # Define job to publish package to npm: publish: + + # Define display name: + name: 'Publish to npm' + + # Define the type of virtual host machine on which to run the job: runs-on: ubuntu-latest + + # Define environment variables: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + + # Define the sequence of job steps... steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v2 + + # Checkout the repository: + - name: 'Checkout repository' + uses: actions/checkout@v3 + + # Install Node.js: + - name: 'Install Node.js' + uses: actions/setup-node@v2 with: node-version: 16 timeout-minutes: 5 - - name: Replace all GitHub links to individual packages with npm links + + # Replace GitHub links to individual packages with npm links: + - name: 'Replace all GitHub links to individual packages with npm links' run: | find . -type f -name '*.md' -print0 | xargs -0 sed -Ei '/tree\/main/b; s/@stdlib\/([^:]*)\]: https:\/\/github.com\/stdlib-js/@stdlib\/\1\]: https:\/\/www.npmjs.com\/package\/@stdlib/g' - - name: Replace list with links to other branches from installation section + + # Replace list with links to other branches from installation section: + - name: 'Replace list with links to other branches from installation section' run: | find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`\n\nAlternatively,[^<]+<\/section>/\`\`\`\n\n<\/section>/" - - name: Replace all stdlib GitHub dependencies with the respective npm packages + + # Replace all stdlib GitHub dependencies with the respective npm packages: + - name: 'Replace all stdlib GitHub dependencies with the respective npm packages' run: | find package.json -type f -print0 | xargs -0 sed -Ei 's/"github:stdlib-js[^"]*"/"^0.0.x"/g' - - name: Publish package to npm + + # Publish package to npm: + - name: 'Publish package to npm' uses: JS-DevTools/npm-publish@v1 with: token: ${{ secrets.NPM_TOKEN }} access: public - - name: Discard any uncommitted changes + + # Discard any uncommitted changes: + - name: 'Discard any uncommitted changes' run: | git reset --hard - - uses: act10ns/slack@v1 + + # Send status to Slack channel if job fails: + - name: 'Send status to Slack channel in case of failure' + uses: act10ns/slack@v1 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() + + # Define job to increment semver version and commit the changes to main branch... increment: + + # Define the type of virtual host machine on which to run the job: runs-on: ubuntu-latest + + # Define the sequence of job steps... steps: - - name: Checkout main branch + + # Checkout main branch of repository: + - name: 'Checkout main branch' uses: actions/checkout@v3 with: ref: main - - name: Increment version in `package.json` to the version number of the tag + + # Increment version: + - name: 'Increment version in `package.json` to the version number of the tag' run: | VERSION=$(echo ${{ github.ref }} | sed -E 's/refs\/tags\/v?([0-9]+.[0-9]+.[0-9]+).*/\1/') sed -Ei "s/\"version\": \"[^\"]+\"/\"version\": \"$VERSION\"/g" package.json - - name: Configure git + + # Configure git: + - name: 'Configure git' run: | git config --local user.email "noreply@stdlib.io" git config --local user.name "stdlib-bot" - - name: Commit changes + + # Commit changes: + - name: 'Commit changes' run: | git add package.json git commit -m "Auto-generated commit" - - name: Push changes + + # Push changes: + - name: 'Push changes' run: | SLUG=${{ github.repository }} echo "Pushing changes to $SLUG..." git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" main + + # Define job to cancel any running or queued workflow runs... cancel: + + # Define the type of virtual host machine on which to run the job: runs-on: ubuntu-latest + + # Time out the job after 3 minutes: timeout-minutes: 3 + + # Define the sequence of job steps... steps: - - uses: styfle/cancel-workflow-action@0.9.0 + + # Cancel any running or queued workflow runs: + - name: 'Cancel running or queued workflow runs' + uses: styfle/cancel-workflow-action@0.9.0 with: workflow_id: >- benchmark.yml, diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4251f7c..17ace3f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,39 +21,69 @@ name: test # Workflow triggers: on: + # Run workflow on a weekly schedule: schedule: # * is a special character in YAML so you have to quote this string - cron: '30 1 * * 6' + + # Allow the workflow to be manually run: workflow_dispatch: + + # Run workflow on each push: push: # Workflow jobs: jobs: + + # Define job to run tests... test: - runs-on: ubuntu-latest + + # Define display name: + name: 'Run tests' + + # Define the type of virtual host machine: + runs-on: 'ubuntu-latest' + + # Define environment variables: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + + # Define the sequence of job steps... steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v2 + + # Checkout the repository: + - name: 'Checkout repository' + uses: actions/checkout@v3 + + # Install Node.js: + - name: 'Install Node.js' + uses: actions/setup-node@v2 with: node-version: 16 timeout-minutes: 5 - - name: Install production and development dependencies + + # Install dependencies: + - name: 'Install production and development dependencies' id: install run: | npm install || npm install || npm install timeout-minutes: 15 - - name: Build native add-on (if present) + + # Build native add-on if present: + - name: 'Build native add-on (if present)' run: | if [ -f "binding.gyp" ]; then npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild fi - - name: Run tests + + # Run tests: + - name: 'Run tests' id: tests run: | npm test || npm test || npm test - - name: Send status to Slack channel in case of failure + + # Send status to Slack channel if job fails: + - name: 'Send status to Slack channel in case of failure' uses: act10ns/slack@v1 with: status: ${{ job.status }} diff --git a/.github/workflows/test_bundles.yml b/.github/workflows/test_bundles.yml index 1d78253..d798b00 100644 --- a/.github/workflows/test_bundles.yml +++ b/.github/workflows/test_bundles.yml @@ -21,76 +21,135 @@ name: test_bundles # Workflow triggers: on: + # Run workflow upon completion of `bundle` workflow run: workflow_run: - workflows: ["test"] + workflows: ["bundle"] types: [completed] + + # Allow workflow to be manually run: workflow_dispatch: # Workflow jobs: jobs: + + # Define job to test UMD bundles... test-umd: + + # Define display name: + name: 'Test UMD Bundles' + + # Define the type of virtual host machine on which to run the job: runs-on: ubuntu-latest + + # Define environment variables: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + + # Define the sequence of job steps... steps: - - name: Checkout branch with UMD build + # Checkout UMD branch of the repository: + - name: 'Checkout branch with UMD build' uses: actions/checkout@v3 with: ref: umd - - name: Setup Node.js + + # Install Node.js: + - name: 'Install Node.js' uses: actions/setup-node@v2 with: node-version: 17 - - name: Try loading UMD module + + # Try loading the UMD bundle: + - name: 'Try loading UMD bundle' run: | node --eval "require( './bundle.js' )" || exit $? - - name: Send status to Slack channel in case of failure + + # Send notification to Slack channel if job fails: + - name: 'Send status to Slack channel in case of failure' uses: act10ns/slack@v1 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() + + # Define job to test ES modules... test-esm: + + # Define display name: + name: 'Test ES Modules' + + # Define the type of virtual host machine on which to run the job: runs-on: ubuntu-latest + + # Define environment variables: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + + # Define the sequence of job steps... steps: - - name: Checkout branch with ESM build + + # Checkout ES modules branch of the repository: + - name: 'Checkout branch with ESM build' uses: actions/checkout@v3 with: ref: esm - - name: Setup Node.js + + # Install Node.js: + - name: 'Install Node.js' uses: actions/setup-node@v2 with: node-version: 17 - - name: Try loading ESM + + # Try loading the ES module bundle: + - name: 'Try loading ESM' run: | node --experimental-network-imports --eval "import( './index.mjs' )" || exit $? - - name: Send status to Slack channel in case of failure + + # Send notification to Slack channel if job fails: + - name: 'Send status to Slack channel in case of failure' uses: act10ns/slack@v1 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() + + # Define job to test Deno bundles... test-deno: + + # Define display name: + name: 'Test Deno Bundles' + + # Define the type of virtual host machine on which to run the job: runs-on: ubuntu-latest + + # Define environment variables: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + + # Define the sequence of job steps... steps: - - name: Checkout branch with Deno build + + # Checkout Deno branch of the repository: + - name: 'Checkout branch with Deno build' uses: actions/checkout@v3 with: ref: deno - - name: Install Deno + + # Install Deno: + - name: 'Install Deno' uses: denoland/setup-deno@v1 with: deno-version: vx.x.x - - name: Try loading Deno build + + # Try loading the Deno bundle: + - name: 'Try loading Deno build' run: | deno eval "import main from './mod.js'" || exit $? - - name: Send status to Slack channel in case of failure + + # Send notification to Slack channel if job fails: + - name: 'Send status to Slack channel in case of failure' uses: act10ns/slack@v1 with: status: ${{ job.status }} diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml index ba78710..488ede5 100644 --- a/.github/workflows/test_coverage.yml +++ b/.github/workflows/test_coverage.yml @@ -21,53 +21,86 @@ name: test_coverage # Workflow triggers: on: + # Run workflow upon completion of `test` workflow run: workflow_run: workflows: ["test"] types: [completed] + + # Allow workflow to be manually run: workflow_dispatch: # Workflow jobs: jobs: - test: + + # Define job to run test coverage... + coverage: + + # Display name: + name: 'Calculate Test Coverage' + + # Define the type of virtual host machine on which to run the job: runs-on: ubuntu-latest + + # Define the sequence of job steps... steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v2 + + # Checkout the repository: + - name: 'Checkout repository' + uses: actions/checkout@v3 + + # Install Node.js: + - name: 'Install Node.js' + uses: actions/setup-node@v2 with: node-version: 16 timeout-minutes: 5 - - name: Install production and development dependencies + + # Install dependencies: + - name: 'Install production and development dependencies' run: | npm install || npm install || npm install timeout-minutes: 15 - - name: Build native add-on (if present) + + # Build native add-on if present: + - name: 'Build native add-on (if present)' run: | if [ -f "binding.gyp" ]; then npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild fi - - name: Calculate test coverage + + # Calculate coverage: + - name: 'Calculate test coverage' run: | npm run test-cov || npm run test-cov || npm run test-cov timeout-minutes: 15 - - name: Upload coverage to Codecov + + # Upload coverage report to Codecov: + - name: 'Upload coverage to Codecov' id: upload uses: codecov/codecov-action@v2 with: directory: reports/coverage flags: unittests fail_ci_if_error: true - - name: Extract coverage value and assign to output + + # Extract coverage value: + - name: 'Extract coverage value and assign to output' id: extract-coverage run: | coverage=`cat reports/coverage/lcov-report/index.html | grep "fraction" | grep -oP '\d+/\d+' | printf %s "$(cat)" | jq -R -s -c 'split("\n")'` echo "::set-output name=coverage::$coverage" - - uses: act10ns/slack@v1 + + # Send Slack notification if job fails: + - name: 'Send status to Slack channel in case of failure' + uses: act10ns/slack@v1 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() - - name: Send Webhook with status to stdlib backend + + # Send data to events server: + - name: 'Post data' uses: distributhor/workflow-webhook@v2 env: webhook_url: ${{ secrets.STDLIB_COVERAGE_URL }} diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 2549fef..9899908 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -21,32 +21,60 @@ name: test_install # Workflow triggers: on: + # Run workflow on a weekly schedule: schedule: # * is a special character in YAML so you have to quote this string - cron: '30 1 * * 6' + + # Run workflow upon completion of `publish` workflow run: workflow_run: workflows: ["publish"] types: [completed] + + # Allow workflow to be manually run: workflow_dispatch: # Workflow jobs: jobs: - on-success: + + # Define job to test installing dependencies... + test-install: + + # Define display name: + name: 'Test installing dependencies' + + # Define the type of virtual host machine on which to run the job: runs-on: ubuntu-latest + + # Define environment variables: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + + # Run workflow job if `publish` workflow run is successful or when the workflow is manually run: if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} + + # Define the sequence of job steps... steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v2 + + # Checkout the repository: + - name: 'Checkout repository' + uses: actions/checkout@v3 + + # Install Node.js: + - name: 'Install Node.js' + uses: actions/setup-node@v2 with: node-version: 16 timeout-minutes: 5 - - name: Install production dependencies via npm + + # Install dependencies: + - name: 'Install production dependencies via npm' run: | npm install --only=prod || npm install --only=prod || npm install --only=prod timeout-minutes: 15 - - name: Send notification to Slack in case of failure + + # Send Slack notification if job fails: + - name: 'Send notification to Slack in case of failure' uses: act10ns/slack@v1 with: status: ${{ job.status }} diff --git a/.npmignore b/.npmignore index 69c44df..d369eec 100644 --- a/.npmignore +++ b/.npmignore @@ -24,6 +24,7 @@ CONTRIBUTING.md CONTRIBUTORS TODO.md ROADMAP.md +branches.md .postinstall.json Makefile diff --git a/LICENSE b/LICENSE index fcc9934..f433b1a 100644 --- a/LICENSE +++ b/LICENSE @@ -175,307 +175,3 @@ of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - - - -Boost Software License - Version 1.0 - August 17th, 2003 - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by this -license (the "Software") to use, reproduce, display, distribute, execute, and -transmit the Software, and to prepare derivative works of the Software, and to -permit third-parties to whom the Software is furnished to do so, all subject to -the following: - -The copyright notices in the Software and this entire statement, including the -above license grant, this restriction and the following disclaimer, must be -included in all copies of the Software, in whole or in part, and all derivative -works of the Software, unless such copies or derivative works are solely in the -form of machine-executable object code generated by a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES -OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - -DEPENDENCIES - -The library links against the following external libraries, which have their own -licenses: - -* OpenBLAS - -Copyright (c) 2011-2014, The OpenBLAS Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - 3. Neither the name of the OpenBLAS project nor the names of - its contributors may be used to endorse or promote products - derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -* Electron - -Copyright (c) 2013-2017 GitHub Inc. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -* Boost - -Boost Software License - Version 1.0 - August 17th, 2003 - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - -* Cephes - -Copyright (c) 1984-2000 Stephen L. Moshier - -Some software in this archive may be from the book _Methods and Programs for -Mathematical Functions_ (Prentice-Hall or Simon & Schuster International, 1989) -or from the Cephes Mathematical Library, a commercial product. In either event, -it is copyrighted by the author. What you see here may be used freely but it -comes with no support or guarantee. - -Stephen L. Moshier -moshier@na-net.ornl.gov - - - -ATTRIBUTION - -The library contains implementations from the following external libraries, -which have their own licenses: - -* FreeBSD - -Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved. - -Developed at SunPro, a Sun Microsystems, Inc. business. -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. - - -* FDLIBM - -Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved. - -Developed at SunPro, a Sun Microsystems, Inc. business. -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. - - -* Go - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -* SLATEC Common Mathematical Library - -Public domain. - - -* ESLint - -Copyright JS Foundation and other contributors, https://js.foundation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -* StatsFuns.jl - -Copyright (c) 2015: Dahua Lin. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -* SpecialFunctions.jl - -The MIT License (MIT) - -Copyright (c) 2017 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and others: - -https://github.com/JuliaMath/SpecialFunctions.jl/graphs/contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -* MT19937 - -Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The names of its contributors may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 9ddc7d5..6876f51 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ Alternatively, - If you are using Deno, visit the [`deno` branch][deno-url]. - For use in Observable, or in browser/node environments, use the [Universal Module Definition (UMD)][umd] build available on the [`umd` branch][umd-url]. +The [branches.md][branches-url] file summarizes the available branches and displays a diagram illustrating their relationships. +
@@ -206,6 +208,7 @@ Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors]. [deno-url]: https://github.com/stdlib-js/assert-is-uint32array/tree/deno [umd-url]: https://github.com/stdlib-js/assert-is-uint32array/tree/umd [esm-url]: https://github.com/stdlib-js/assert-is-uint32array/tree/esm +[branches-url]: https://github.com/stdlib-js/assert-is-uint32array/blob/main/branches.md [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/assert-is-uint32array/main/LICENSE diff --git a/branches.md b/branches.md new file mode 100644 index 0000000..f7d8368 --- /dev/null +++ b/branches.md @@ -0,0 +1,53 @@ + + +# Branches + +This repository has the following branches: + +- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. +- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). +- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers. +- **deno**: [Deno][deno-url] branch for use in Deno. +- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments. + +The following diagram illustrates the relationships among the above branches: + +```mermaid +graph TD; +A[stdlib]-->|generate standalone package|B; +B[main] -->|productionize| C[production]; +C -->|bundle| D[esm]; +C -->|bundle| E[deno]; +C -->|bundle| F[umd]; + +click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-uint32array" +click B href "https://github.com/stdlib-js/assert-is-uint32array/tree/main" +click C href "https://github.com/stdlib-js/assert-is-uint32array/tree/production" +click D href "https://github.com/stdlib-js/assert-is-uint32array/tree/esm" +click E href "https://github.com/stdlib-js/assert-is-uint32array/tree/deno" +click F href "https://github.com/stdlib-js/assert-is-uint32array/tree/umd" +``` + +[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-uint32array +[production-url]: https://github.com/stdlib-js/assert-is-uint32array/tree/production +[deno-url]: https://github.com/stdlib-js/assert-is-uint32array/tree/deno +[umd-url]: https://github.com/stdlib-js/assert-is-uint32array/tree/umd +[esm-url]: https://github.com/stdlib-js/assert-is-uint32array/tree/esm \ No newline at end of file diff --git a/package.json b/package.json index 8b5fbb0..7b6a7fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stdlib/assert-is-uint32array", - "version": "0.0.0", + "version": "0.0.8", "description": "Test if a value is a Uint32Array.", "license": "Apache-2.0", "author": {