Skip to content

Commit 2aba505

Browse files
committed
Auto-generated commit
1 parent f7d0f62 commit 2aba505

File tree

7 files changed

+147
-14
lines changed

7 files changed

+147
-14
lines changed

.github/.keepalive

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/bundle.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ jobs:
6565
# Replace links to other packages with links to the deno branch:
6666
find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/";
6767
68-
# Replace reference to `@stdlib/types` with deno.land link:
69-
find ./deno -type f -name '*.ts' -print0 | xargs -0 sed -Ei "s/\/\/\/ <reference types=\"@stdlib\/types\"\/>/\/\/\/ <reference types=\"https:\/\/deno.land\/x\/stdlib_types\/index.d.ts\"\/>/g"
68+
# Replace reference to `@stdlib/types` with CDN link:
69+
find ./deno -type f -name '*.ts' -print0 | xargs -0 sed -Ei "s/\/\/\/ <reference types=\"@stdlib\/types\"\/>/\/\/\/ <reference types=\"https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/types@main\/index.d.ts\"\/>/g"
7070
7171
# Change wording of project description to avoid reference to JavaScript and Node.js:
7272
find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g"
@@ -83,6 +83,9 @@ jobs:
8383
find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?<section class=\"cli\">[\s\S]+<\!\-\- \/.cli \-\->//g"
8484
find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?<section class=\"c\">[\s\S]+<\!\-\- \/.c \-\->//g"
8585
86+
# Create package.json file for deno branch:
87+
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
88+
8689
- name: Publish to deno branch
8790
uses: peaceiris/actions-gh-pages@v3
8891
with:
@@ -152,6 +155,9 @@ jobs:
152155
# Wrap contents of `<script type="text/javascript">` tag contents in an IIFE:
153156
find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/<script type=\"text\/javascript\">([\s\S]+?)<\/script>/<script type=\"text\/javascript\">\n\(function \(\) {\1}\)\(\)\n<\/script>/g"
154157
158+
# Create package.json file for umd branch:
159+
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
160+
155161
- name: Publish to umd branch
156162
uses: peaceiris/actions-gh-pages@v3
157163
with:
@@ -227,6 +233,9 @@ jobs:
227233
# Rewrite examples section to be a HTML file:
228234
find ./esm -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\#\# Examples([\s\S]*)\`\`\`javascript([\s\S]+?)\`\`\`/\#\# Examples\1\`\`\`html\n<\!DOCTYPE html>\n<html lang=\"en\">\n<body>\n<script type=\"module\">\n\2\n<\/script>\n<\/body>\n<\/html>\n\`\`\`/g"
229235
236+
# Create package.json file for esm branch:
237+
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
238+
230239
- name: Publish to esm branch
231240
uses: peaceiris/actions-gh-pages@v3
232241
with:

.github/workflows/publish.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,30 @@ jobs:
5959
steps: ${{ toJson(steps) }}
6060
channel: '#npm-ci'
6161
if: failure()
62+
increment:
63+
runs-on: ubuntu-latest
64+
steps:
65+
- name: Checkout main branch
66+
uses: actions/checkout@v2
67+
with:
68+
ref: main
69+
- name: Increment version in `package.json` to the version number of the tag
70+
run: |
71+
VERSION=$(echo ${{ github.ref }} | sed -E 's/refs\/tags\/v?([0-9]+.[0-9]+.[0-9]+).*/\1/')
72+
sed -Ei "s/\"version\": \"[^\"]+\"/\"version\": \"$VERSION\"/g" package.json
73+
- name: Configure git
74+
run: |
75+
git config --local user.email "noreply@stdlib.io"
76+
git config --local user.name "stdlib-bot"
77+
- name: Commit changes
78+
run: |
79+
git add package.json
80+
git commit -m "Auto-generated commit"
81+
- name: Push changes
82+
run: |
83+
SLUG=${{ github.repository }}
84+
echo "Pushing changes to $SLUG..."
85+
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" main
6286
cancel:
6387
runs-on: ubuntu-latest
6488
timeout-minutes: 3

.github/workflows/test_bundles.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2022 The Stdlib Authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#/
18+
19+
# Workflow name:
20+
name: Test Loading Bundles
21+
22+
# Workflow triggers:
23+
on:
24+
workflow_run:
25+
workflows: ["bundle"]
26+
types: [completed]
27+
workflow_dispatch:
28+
29+
# Workflow jobs:
30+
jobs:
31+
test-umd:
32+
runs-on: ubuntu-latest
33+
env:
34+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
35+
steps:
36+
- name: Checkout branch with UMD build
37+
uses: actions/checkout@v2
38+
with:
39+
ref: umd
40+
- name: Setup Node.js
41+
uses: actions/setup-node@v2
42+
with:
43+
node-version: 17
44+
- name: Try loading UMD module
45+
run: |
46+
node --eval "require( './bundle.js' )" || exit $?
47+
- name: Send status to Slack channel in case of failure
48+
uses: act10ns/slack@v1
49+
with:
50+
status: ${{ job.status }}
51+
steps: ${{ toJson(steps) }}
52+
channel: '#npm-ci'
53+
if: failure()
54+
test-esm:
55+
runs-on: ubuntu-latest
56+
env:
57+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
58+
steps:
59+
- name: Checkout branch with ESM build
60+
uses: actions/checkout@v2
61+
with:
62+
ref: esm
63+
- name: Setup Node.js
64+
uses: actions/setup-node@v2
65+
with:
66+
node-version: 17
67+
- name: Try loading ESM
68+
run: |
69+
node --experimental-network-imports --eval "import( './index.mjs' )" || exit $?
70+
- name: Send status to Slack channel in case of failure
71+
uses: act10ns/slack@v1
72+
with:
73+
status: ${{ job.status }}
74+
steps: ${{ toJson(steps) }}
75+
channel: '#npm-ci'
76+
if: failure()
77+
test-deno:
78+
runs-on: ubuntu-latest
79+
env:
80+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
81+
steps:
82+
- name: Checkout branch with Deno build
83+
uses: actions/checkout@v2
84+
with:
85+
ref: deno
86+
- name: Install Deno
87+
uses: denoland/setup-deno@v1
88+
with:
89+
deno-version: vx.x.x
90+
- name: Try loading Deno build
91+
run: |
92+
deno eval "import main from './mod.js'" || exit $?
93+
- name: Send status to Slack channel in case of failure
94+
uses: act10ns/slack@v1
95+
with:
96+
status: ${{ job.status }}
97+
steps: ${{ toJson(steps) }}
98+
channel: '#npm-ci'
99+
if: failure()

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -461,20 +461,20 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
461461

462462
-->
463463

464-
[umd]: https://github.com/umdjs/umd
465-
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
466-
467-
[deno-url]: https://github.com/stdlib-js/utils-async-count-by/tree/deno
468-
[umd-url]: https://github.com/stdlib-js/utils-async-count-by/tree/umd
469-
[esm-url]: https://github.com/stdlib-js/utils-async-count-by/tree/esm
470-
471464
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
472465
[chat-url]: https://gitter.im/stdlib-js/stdlib/
473466

474467
[stdlib]: https://github.com/stdlib-js/stdlib
475468

476469
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
477470

471+
[umd]: https://github.com/umdjs/umd
472+
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
473+
474+
[deno-url]: https://github.com/stdlib-js/utils-async-count-by/tree/deno
475+
[umd-url]: https://github.com/stdlib-js/utils-async-count-by/tree/umd
476+
[esm-url]: https://github.com/stdlib-js/utils-async-count-by/tree/esm
477+
478478
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/utils-async-count-by/main/LICENSE
479479

480480
[mdn-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array

lib/validate.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var isObject = require( '@stdlib/assert-is-plain-object' );
2424
var hasOwnProp = require( '@stdlib/assert-has-own-property' );
2525
var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;
2626
var isPositiveInteger = require( '@stdlib/assert-is-positive-integer' ).isPrimitive;
27+
var format = require( '@stdlib/string-format' );
2728

2829

2930
// MAIN //
@@ -53,21 +54,21 @@ var isPositiveInteger = require( '@stdlib/assert-is-positive-integer' ).isPrimit
5354
*/
5455
function validate( opts, options ) {
5556
if ( !isObject( options ) ) {
56-
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
57+
return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
5758
}
5859
if ( hasOwnProp( options, 'thisArg' ) ) {
5960
opts.thisArg = options.thisArg;
6061
}
6162
if ( hasOwnProp( options, 'series' ) ) {
6263
opts.series = options.series;
6364
if ( !isBoolean( opts.series ) ) {
64-
return new TypeError( 'invalid option. `series` option must be a boolean primitive. Option: `' + opts.series + '`.' );
65+
return new TypeError( format( 'invalid option. `%s` option must be a boolean primitive. Option: `%s`.', 'series', opts.series ) );
6566
}
6667
}
6768
if ( hasOwnProp( options, 'limit' ) ) {
6869
opts.limit = options.limit;
6970
if ( !isPositiveInteger( opts.limit ) ) {
70-
return new TypeError( 'invalid option. `limit` option must be a positive integer. Option: `' + opts.limit + '`.' );
71+
return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );
7172
}
7273
}
7374
return null;

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stdlib/utils-async-count-by",
3-
"version": "0.0.8",
3+
"version": "0.0.0",
44
"description": "Group values according to an indicator function and return group counts.",
55
"license": "Apache-2.0",
66
"author": {
@@ -44,6 +44,7 @@
4444
"@stdlib/assert-is-plain-object": "^0.0.x",
4545
"@stdlib/assert-is-positive-integer": "^0.0.x",
4646
"@stdlib/constants-float64-pinf": "^0.0.x",
47+
"@stdlib/string-format": "^0.0.x",
4748
"@stdlib/types": "^0.0.x",
4849
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x",
4950
"debug": "^2.6.9"

0 commit comments

Comments
 (0)