diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index 5cdca52b..bf541a04 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -22,11 +22,9 @@ name: bundle # Workflow triggers: on: workflow_dispatch: - push: - branches: - - main - tags-ignore: - - 'v[0-9]+\.[0-9]+\.[0-9]+' + workflow_run: + workflows: ["productionize"] + types: [completed] # Workflow jobs: jobs: @@ -34,6 +32,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Checkout production branch + run: | + git fetch --all + git checkout -b production origin/production - name: Copy files to deno directory run: | mkdir -p deno @@ -85,18 +87,51 @@ 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: Configure git + run: | + git config --local user.email "noreply@stdlib.io" + git config --local user.name "stdlib-bot" + - name: Check if remote `deno` 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 + - 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 + - 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 + - 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 + - name: Move deno directory to root + run: | + mv ./deno/* . + rmdir ./deno + - name: Commit changes + run: | + git add -A + git commit -m "Auto-generated commit" + - 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 - name: Send status to Slack channel in case of failure uses: act10ns/slack@v1 with: @@ -108,6 +143,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Checkout production branch + run: | + git fetch --all + git checkout -b production origin/production - name: Copy files to umd directory run: | mkdir -p umd @@ -121,7 +160,7 @@ jobs: run: | npm install || npm install || npm install timeout-minutes: 15 - - name: 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/') @@ -157,18 +196,51 @@ 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: Configure git + run: | + git config --local user.email "noreply@stdlib.io" + git config --local user.name "stdlib-bot" + - 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 + - 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 + - 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 + - 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 + - name: Move umd directory to root + run: | + mv ./umd/* . + rmdir ./umd + - name: Commit changes + run: | + git add -A + git commit -m "Auto-generated commit" + - 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 - name: Send status to Slack channel in case of failure uses: act10ns/slack@v1 with: @@ -180,6 +252,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Checkout production branch + run: | + git fetch --all + git checkout -b production origin/production - name: Copy files to umd directory run: | mkdir -p esm @@ -235,18 +311,51 @@ 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: Configure git + run: | + git config --local user.email "noreply@stdlib.io" + git config --local user.name "stdlib-bot" + - 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 + - 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 + - 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 + - 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 + - name: Move esm directory to root + run: | + mv ./esm/* . + rmdir ./esm + - name: Commit changes + run: | + git add -A + git commit -m "Auto-generated commit" + - 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 - name: Send status to Slack channel in case of failure uses: act10ns/slack@v1 with: diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml new file mode 100644 index 00000000..0101493b --- /dev/null +++ b/.github/workflows/productionize.yml @@ -0,0 +1,94 @@ +#/ +# @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: + push: + workflow_dispatch: + +# Workflow jobs: +jobs: + productionize: + runs-on: ubuntu-latest + steps: + - name: Checkout main branch + uses: actions/checkout@v3 + with: + ref: main + - name: Create new `production` branch + run: | + git checkout -b production + - name: Transform Error Messages + id: transform-error-messages + uses: stdlib-js/transform-errors-action@main + - 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" {} \; + - 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" {} \; + - 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" {} \; + - name: Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency + run: | + if grep -q '"@stdlib/string-format"' package.json; then + sed -i "s/\"@stdlib\/string-format\"/\"@stdlib\/error-tools-fmtprodmsg\"/g" package.json + else + sed -i "s/\"dependencies\": {/\"dependencies\": {\\n \"@stdlib\/error-tools-fmtprodmsg\": \"^0.0.x\",/g" package.json + fi + - name: Configure git + run: | + git config --local user.email "noreply@stdlib.io" + git config --local user.name "stdlib-bot" + - name: Commit changes + run: | + git add -A + git commit -m "Transform error messages" + - 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 + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: production + - uses: actions/setup-node@v2 + with: + node-version: 16 + timeout-minutes: 5 + - 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) + run: | + if [ -f "binding.gyp" ]; then + npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild + fi + - name: Run tests + id: tests + run: | + npm test || npm test || npm test diff --git a/.github/workflows/test_bundles.yml b/.github/workflows/test_bundles.yml index 1d78253c..476600e3 100644 --- a/.github/workflows/test_bundles.yml +++ b/.github/workflows/test_bundles.yml @@ -22,7 +22,7 @@ name: test_bundles # Workflow triggers: on: workflow_run: - workflows: ["test"] + workflows: ["bundle"] types: [completed] workflow_dispatch: diff --git a/.npmignore b/.npmignore index 69c44df6..d369eecd 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 fcc99346..f433b1a5 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 1574e3a1..2fa17a8a 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. +
@@ -293,6 +295,7 @@ Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors]. [deno-url]: https://github.com/stdlib-js/array/tree/deno [umd-url]: https://github.com/stdlib-js/array/tree/umd [esm-url]: https://github.com/stdlib-js/array/tree/esm +[branches-url]: https://github.com/stdlib-js/array/blob/main/branches.md [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/array/main/LICENSE diff --git a/branches.md b/branches.md new file mode 100644 index 00000000..ccde494c --- /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/array" +click B href "https://github.com/stdlib-js/array/tree/main" +click C href "https://github.com/stdlib-js/array/tree/production" +click D href "https://github.com/stdlib-js/array/tree/esm" +click E href "https://github.com/stdlib-js/array/tree/deno" +click F href "https://github.com/stdlib-js/array/tree/umd" +``` + +[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array +[production-url]: https://github.com/stdlib-js/array/tree/production +[deno-url]: https://github.com/stdlib-js/array/tree/deno +[umd-url]: https://github.com/stdlib-js/array/tree/umd +[esm-url]: https://github.com/stdlib-js/array/tree/esm \ No newline at end of file diff --git a/to-iterator-right/lib/main.js b/to-iterator-right/lib/main.js index 7c4290fa..be7c4712 100644 --- a/to-iterator-right/lib/main.js +++ b/to-iterator-right/lib/main.js @@ -25,6 +25,7 @@ var isFunction = require( '@stdlib/assert/is-function' ); var isCollection = require( '@stdlib/assert/is-collection' ); var iteratorSymbol = require( '@stdlib/symbol/iterator' ); var arraylike2object = require( './../../base/arraylike2object' ); +var format = require( '@stdlib/string/format' ); // MAIN //