From c6a8fb6e622fbbd5069451a2870ae1803e3d2a96 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 27 Jul 2024 23:42:01 +0000 Subject: [PATCH] Release v0.2.0 --- .github/workflows/productionize.yml | 20 +-- .github/workflows/publish.yml | 10 +- .npmrc | 4 +- CHANGELOG.md | 156 +++++++++++++++++++++- CONTRIBUTORS | 6 +- README.md | 11 +- dist/index.js | 35 +---- dist/main.js | 195 ---------------------------- package.json | 20 +-- 9 files changed, 202 insertions(+), 255 deletions(-) delete mode 100644 dist/main.js diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml index f92a6c5..f4575e9 100644 --- a/.github/workflows/productionize.yml +++ b/.github/workflows/productionize.yml @@ -94,8 +94,8 @@ jobs: node -e "var pkg = require( './package.json' ); pkg.dependencies[ '@stdlib/error-tools-fmtprodmsg' ] = '^$PKG_VERSION'; require( 'fs' ).writeFileSync( 'package.json', JSON.stringify( pkg, null, 2 ) );" fi - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' run: | git config --local user.email "noreply@stdlib.io" git config --local user.name "stdlib-bot" @@ -191,8 +191,8 @@ jobs: # Pin action to full length commit SHA uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' run: | git config --local user.email "noreply@stdlib.io" git config --local user.name "stdlib-bot" @@ -366,8 +366,8 @@ jobs: # Pin action to full length commit SHA uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' run: | git config --local user.email "noreply@stdlib.io" git config --local user.name "stdlib-bot" @@ -539,8 +539,8 @@ jobs: # Pin action to full length commit SHA uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' run: | git config --local user.email "noreply@stdlib.io" git config --local user.name "stdlib-bot" @@ -735,8 +735,8 @@ jobs: echo "bump=true" >> $GITHUB_OUTPUT fi - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' if: steps.check-if-bump.outputs.bump run: | git config --local user.email "noreply@stdlib.io" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ad3a3e0..2888b88 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -72,8 +72,8 @@ jobs: node-version: 20 timeout-minutes: 5 - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' run: | git config --local user.email "noreply@stdlib.io" git config --local user.name "stdlib-bot" @@ -94,6 +94,10 @@ jobs: # Replace branch in README.md link definitions for badges with the new version: find . -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/branch([=:])[^ ]+/branch\1v${NEW_VERSION}/g" + # Rewrite CHANGELOG.md to replace "Unreleased" with the new version: + sed -Ei "s/Unreleased/${NEW_VERSION}/g" CHANGELOG.md + sed -Ei "s/unreleased/v${NEW_VERSION}/g" CHANGELOG.md + # Create a new commit and tag: git add package.json README.md git commit -m "Release v${NEW_VERSION}" @@ -202,7 +206,7 @@ jobs: # Publish package to npm: - name: 'Publish package to npm' # Pin action to full length commit SHA - uses: JS-DevTools/npm-publish@4b07b26a2f6e0a51846e1870223e545bae91c552 # v3.0.1 + uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1 with: token: ${{ secrets.NPM_TOKEN }} access: public diff --git a/.npmrc b/.npmrc index 5af9067..58dbd10 100644 --- a/.npmrc +++ b/.npmrc @@ -27,5 +27,5 @@ shrinkwrap = false # Disable automatically "saving" dependencies on install: save = false -# Generate provenance metadata: -provenance = true +# Do not generate provenance metadata: +provenance = false diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a8d568..9e4585a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,4 +2,158 @@ > Package changelog. -See [GitHub Releases](https://github.com/stdlib-js/string-to-grapheme-cluster-iterator/releases) for the changelog. \ No newline at end of file +
+ +## 0.2.0 (2024-07-27) + +
+ +### Commits + +
+ +- [`aaa391a`](https://github.com/stdlib-js/stdlib/commit/aaa391a46214c21dca294506d06ac0b3d59512ce) - **chore:** fix typos _(by Philipp Burckhardt)_ + +
+ +
+ + + +
+ +### Contributors + +A total of 1 person contributed to this release. Thank you to this contributor: + +- Philipp Burckhardt + +
+ + + +
+ + + +
+ +## 0.1.1 (2024-02-24) + +No changes reported for this release. + +
+ + + +
+ +## 0.2.0 (2024-02-14) + +
+ +### Commits + +
+ +- [`73f98e4`](https://github.com/stdlib-js/stdlib/commit/73f98e4e8dea53ece4a617b042f9d817643b4850) - **docs:** update related packages sections [(#1150)](https://github.com/stdlib-js/stdlib/pull/1150) _(by stdlib-bot)_ +- [`bf2cf8b`](https://github.com/stdlib-js/stdlib/commit/bf2cf8b0424e608a4e3abb6d18a8b44d790aa99c) - **build:** remove tslint directives _(by Philipp Burckhardt)_ + +
+ +
+ + + +
+ +### Contributors + +A total of 1 person contributed to this release. Thank you to this contributor: + +- Philipp Burckhardt + +
+ + + +
+ + + +
+ +## 0.1.0 (2023-09-23) + +
+ +### Features + +- [`3573d92`](https://github.com/stdlib-js/stdlib/commit/3573d92955f1150eae58fb534808b7a30532a1c1) - update minimum TypeScript version + +
+ + + +
+ +### Bug Fixes + +- [`9212514`](https://github.com/stdlib-js/stdlib/commit/9212514cd0ba9a681c2ca86ebe2fd3b61f866b64) - set correct package names and descriptions + +
+ + + +
+ +### BREAKING CHANGES + +- [`3573d92`](https://github.com/stdlib-js/stdlib/commit/3573d92955f1150eae58fb534808b7a30532a1c1): update minimum TypeScript version + +
+ + + +
+ +### Commits + +
+ +- [`3573d92`](https://github.com/stdlib-js/stdlib/commit/3573d92955f1150eae58fb534808b7a30532a1c1) - **feat:** update minimum TypeScript version _(by Philipp Burckhardt)_ +- [`9212514`](https://github.com/stdlib-js/stdlib/commit/9212514cd0ba9a681c2ca86ebe2fd3b61f866b64) - **fix:** set correct package names and descriptions _(by Philipp Burckhardt)_ +- [`6c7e770`](https://github.com/stdlib-js/stdlib/commit/6c7e770dab6e03561202af2861ae11c27af8a90c) - **refactor:** use strictEqual checks _(by Philipp Burckhardt)_ + +
+ +
+ + + +
+ +### Contributors + +A total of 1 person contributed to this release. Thank you to this contributor: + +- Philipp Burckhardt + +
+ + + +
+ + + +
+ +## 0.0.1 (2023-02-02) + +No changes reported for this release. + +
+ + + diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 6a1cbaa..26a1c46 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -27,6 +27,7 @@ Frank Kovacs Golden Kumar <103646877+AuenKr@users.noreply.github.com> Gunj Joshi Harshita Kalani +Hridyanshu <124202756+HRIDYANSHU054@users.noreply.github.com> Jaimin Godhani <112328542+Jai0401@users.noreply.github.com> James Gelok Jaysukh Makvana @@ -50,6 +51,7 @@ Muhammad Haris Naresh Jagadeesan NightKnight Nithin Katta <88046362+nithinkatta@users.noreply.github.com> +Nourhan Hasan <109472010+TheNourhan@users.noreply.github.com> Ognjen Jevremović Oneday12323 <107678750+Oneday12323@users.noreply.github.com> Philipp Burckhardt @@ -62,6 +64,7 @@ Pushpendra Chandravanshi Raunak Kumar Gupta Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com> Ricky Reusser +Ridam Garg <67867319+RidamGarg@users.noreply.github.com> Robert Gislason Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com> Rutam <138517416+performant23@users.noreply.github.com> @@ -74,7 +77,7 @@ Shraddheya Shendre Shubh Mehta <93862397+Shubh942@users.noreply.github.com> Shubham Mishra Sivam Das <100067002+Sivam2313@users.noreply.github.com> -Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com> +Snehil Shah Soumajit Chatterjee <121816890+soumajit23@users.noreply.github.com> Spandan Barve Stephannie Jiménez Gacha @@ -84,6 +87,7 @@ Tudor Pagu <104032457+tudor-pagu@users.noreply.github.com> Utkarsh Utkarsh Raj Varad Gupta +Xiaochuan Ye Yernar Yergaziyev naveen nishant-s7 <97207366+nishant-s7@users.noreply.github.com> diff --git a/README.md b/README.md index 7e89871..61f25b1 100644 --- a/README.md +++ b/README.md @@ -260,6 +260,11 @@ For more information on the project, filing bug reports and feature requests, an --- +## License + +See [LICENSE][stdlib-license]. + + ## Copyright Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. @@ -275,8 +280,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. [npm-image]: http://img.shields.io/npm/v/@stdlib/string-to-grapheme-cluster-iterator.svg [npm-url]: https://npmjs.org/package/@stdlib/string-to-grapheme-cluster-iterator -[test-image]: https://github.com/stdlib-js/string-to-grapheme-cluster-iterator/actions/workflows/test.yml/badge.svg?branch=main -[test-url]: https://github.com/stdlib-js/string-to-grapheme-cluster-iterator/actions/workflows/test.yml?query=branch:main +[test-image]: https://github.com/stdlib-js/string-to-grapheme-cluster-iterator/actions/workflows/test.yml/badge.svg?branch=v0.2.0 +[test-url]: https://github.com/stdlib-js/string-to-grapheme-cluster-iterator/actions/workflows/test.yml?query=branch:v0.2.0 [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/string-to-grapheme-cluster-iterator/main.svg [coverage-url]: https://codecov.io/github/stdlib-js/string-to-grapheme-cluster-iterator?branch=main @@ -306,6 +311,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. [esm-readme]: https://github.com/stdlib-js/string-to-grapheme-cluster-iterator/blob/esm/README.md [branches-url]: https://github.com/stdlib-js/string-to-grapheme-cluster-iterator/blob/main/branches.md +[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/string-to-grapheme-cluster-iterator/main/LICENSE + [unicode-text-segmentation]: http://www.unicode.org/reports/tr29/ diff --git a/dist/index.js b/dist/index.js index f9f6007..71c7d78 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,32 +1,5 @@ +"use strict";var p=function(e,t){return function(){return t||e((t={exports:{}}).exports,t),t.exports}};var d=p(function(j,m){ +var f=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),y=require('@stdlib/assert-is-function/dist'),w=require('@stdlib/assert-is-string/dist').isPrimitive,v=require('@stdlib/symbol-iterator/dist'),s=require('@stdlib/string-next-grapheme-cluster-break/dist'),g=require('@stdlib/error-tools-fmtprodmsg/dist');function l(e){var t,a,o,u,r;if(!w(e))throw new TypeError(g('1h13F',e));if(arguments.length>1){if(u=arguments[1],!y(u))throw new TypeError(g('1h12H',u));t=arguments[2]}return r=0,a={},u?f(a,"next",h):f(a,"next",b),f(a,"return",q),v&&f(a,v,x),a;function h(){var i,n;return o?{done:!0}:(n=s(e,r),n===-1?(o=!0,e.length?{value:u.call(t,e.substring(r),r,e),done:!1}:{done:!0}):(i=u.call(t,e.substring(r,n),r,e),r=n,{value:i,done:!1}))}function b(){var i,n;return o?{done:!0}:(n=s(e,r),n===-1?(o=!0,e.length?{value:e.substring(r),done:!1}:{done:!0}):(i=e.substring(r,n),r=n,{value:i,done:!1}))}function q(i){return o=!0,arguments.length?{value:i,done:!0}:{done:!0}}function x(){return u?l(e,u,t):l(e)}}m.exports=l +});var F=d();module.exports=F; /** @license Apache-2.0 */ - -'use strict'; - -/** -* Create an iterator which iterates over grapheme clusters. -* -* @module @stdlib/string-to-grapheme-cluster-iterator -* -* @example -* var graphemeClusters2iterator = require( '@stdlib/string-to-grapheme-cluster-iterator' ); -* -* var iter = graphemeClusters2iterator( '🌷🍕' ); -* -* var v = iter.next().value; -* // returns '🌷' -* -* v = iter.next().value; -* // returns '🍕' -* -* var bool = iter.next().done; -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; +//# sourceMappingURL=index.js.map diff --git a/dist/main.js b/dist/main.js deleted file mode 100644 index 7b42dd9..0000000 --- a/dist/main.js +++ /dev/null @@ -1,195 +0,0 @@ -/** -* @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. -*/ - -'use strict'; - -// MODULES // - -var setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' ); -var isFunction = require( '@stdlib/assert-is-function' ); -var isString = require( '@stdlib/assert-is-string' ).isPrimitive; -var iteratorSymbol = require( '@stdlib/symbol-iterator' ); -var nextGraphemeClusterBreak = require( '@stdlib/string-next-grapheme-cluster-break' ); -var format = require( '@stdlib/string-format' ); - - -// MAIN // - -/** -* Returns an iterator which iterates over each grapheme cluster in a string. -* -* @param {string} src - input value -* @param {Function} [mapFcn] - function to invoke for each iterated value -* @param {*} [thisArg] - execution context -* @throws {TypeError} first argument must be a string -* @throws {TypeError} second argument must be a function -* @returns {Iterator} iterator -* -* @example -* var iter = graphemeClusters2iterator( '🌷🍕' ); -* -* var v = iter.next().value; -* // returns '🌷' -* -* v = iter.next().value; -* // returns '🍕' -* -* var bool = iter.next().done; -* // returns true -*/ -function graphemeClusters2iterator( src ) { - var thisArg; - var iter; - var FLG; - var fcn; - var i; - if ( !isString( src ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', src ) ); - } - if ( arguments.length > 1 ) { - fcn = arguments[ 1 ]; - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) ); - } - thisArg = arguments[ 2 ]; - } - i = 0; - - // Create an iterator protocol-compliant object: - iter = {}; - if ( fcn ) { - setReadOnly( iter, 'next', next1 ); - } else { - setReadOnly( iter, 'next', next2 ); - } - setReadOnly( iter, 'return', end ); - - // If an environment supports `Symbol.iterator`, make the iterator iterable: - if ( iteratorSymbol ) { - setReadOnly( iter, iteratorSymbol, factory ); - } - return iter; - - /** - * Returns an iterator protocol-compliant object containing the next iterated value. - * - * @private - * @returns {Object} iterator protocol-compliant object - */ - function next1() { - var v; - var j; - if ( FLG ) { - return { - 'done': true - }; - } - j = nextGraphemeClusterBreak( src, i ); - if ( j === -1 ) { - FLG = true; - if ( src.length ) { - return { - 'value': fcn.call( thisArg, src.substring( i ), i, src ), - 'done': false - }; - } - return { - 'done': true - }; - } - v = fcn.call( thisArg, src.substring( i, j ), i, src ); - i = j; - return { - 'value': v, - 'done': false - }; - } - - /** - * Returns an iterator protocol-compliant object containing the next iterated value. - * - * @private - * @returns {Object} iterator protocol-compliant object - */ - function next2() { - var v; - var j; - if ( FLG ) { - return { - 'done': true - }; - } - j = nextGraphemeClusterBreak( src, i ); - if ( j === -1 ) { - FLG = true; - if ( src.length ) { - return { - 'value': src.substring( i ), - 'done': false - }; - } - return { - 'done': true - }; - } - v = src.substring( i, j ); - i = j; - return { - 'value': v, - 'done': false - }; - } - - /** - * Finishes an iterator. - * - * @private - * @param {*} [value] - value to return - * @returns {Object} iterator protocol-compliant object - */ - function end( value ) { - FLG = true; - if ( arguments.length ) { - return { - 'value': value, - 'done': true - }; - } - return { - 'done': true - }; - } - - /** - * Returns a new iterator. - * - * @private - * @returns {Iterator} iterator - */ - function factory() { - if ( fcn ) { - return graphemeClusters2iterator( src, fcn, thisArg ); - } - return graphemeClusters2iterator( src ); - } -} - - -// EXPORTS // - -module.exports = graphemeClusters2iterator; diff --git a/package.json b/package.json index 6214017..93efea8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stdlib/string-to-grapheme-cluster-iterator", - "version": "0.1.0", + "version": "0.2.0", "description": "Create an iterator which iterates over grapheme clusters.", "license": "Apache-2.0", "author": { @@ -37,19 +37,19 @@ "url": "https://github.com/stdlib-js/stdlib/issues" }, "dependencies": { - "@stdlib/assert-is-function": "^0.2.1", - "@stdlib/assert-is-string": "^0.2.1", - "@stdlib/string-format": "^0.2.1", - "@stdlib/string-next-grapheme-cluster-break": "^0.2.1", - "@stdlib/symbol-iterator": "^0.2.1", + "@stdlib/assert-is-function": "^0.2.2", + "@stdlib/assert-is-string": "^0.2.2", + "@stdlib/string-format": "^0.2.2", + "@stdlib/string-next-grapheme-cluster-break": "^0.2.2", + "@stdlib/symbol-iterator": "^0.2.2", "@stdlib/types": "^0.3.2", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.1", - "@stdlib/error-tools-fmtprodmsg": "^0.2.1" + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { - "@stdlib/assert-is-iterator-like": "^0.2.1", + "@stdlib/assert-is-iterator-like": "^0.2.2", "@stdlib/string-num-grapheme-clusters": "^0.2.1", - "@stdlib/utils-noop": "^0.2.1", + "@stdlib/utils-noop": "^0.2.2", "proxyquire": "^2.0.0", "tape": "git+https://github.com/kgryte/tape.git#fix/globby", "istanbul": "^0.4.1",