Skip to content

Commit a5eec50

Browse files
committed
Auto-generated commit
1 parent 42c2b82 commit a5eec50

File tree

13 files changed

+84
-40
lines changed

13 files changed

+84
-40
lines changed

.github/workflows/productionize.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -82,28 +82,14 @@ jobs:
8282
id: transform-error-messages
8383
uses: stdlib-js/transform-errors-action@main
8484

85-
# Format error messages:
86-
- name: 'Replace double quotes with single quotes in rewritten format string error messages'
87-
run: |
88-
find . -name "*.js" -exec sed -E -i "s/Error\( format\( \"([a-zA-Z0-9]+)\"/Error\( format\( '\1'/g" {} \;
89-
90-
# Format string literal error messages:
91-
- name: 'Replace double quotes with single quotes in rewritten string literal error messages'
92-
run: |
93-
find . -name "*.js" -exec sed -E -i "s/Error\( format\(\"([a-zA-Z0-9]+)\"\)/Error\( format\( '\1' \)/g" {} \;
94-
95-
# Format code:
96-
- name: 'Replace double quotes with single quotes in inserted `require` calls'
97-
run: |
98-
find . -name "*.js" -exec sed -E -i "s/require\( ?\"@stdlib\/error-tools-fmtprodmsg\" ?\);/require\( '@stdlib\/error-tools-fmtprodmsg' \);/g" {} \;
99-
10085
# Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency:
10186
- name: 'Update dependencies in package.json'
10287
run: |
88+
PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version)
10389
if grep -q '"@stdlib/string-format"' package.json; then
104-
sed -i "s/\"@stdlib\/string-format\"/\"@stdlib\/error-tools-fmtprodmsg\"/g" package.json
90+
sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json
10591
else
106-
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 ) );"
92+
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 ) );"
10793
fi
10894
10995
# Configure git:
@@ -348,7 +334,7 @@ jobs:
348334
349335
# Send status to Slack channel if job fails:
350336
- name: 'Send status to Slack channel in case of failure'
351-
uses: act10ns/slack@v1
337+
uses: act10ns/slack@v2
352338
with:
353339
status: ${{ job.status }}
354340
steps: ${{ toJson(steps) }}
@@ -519,7 +505,7 @@ jobs:
519505
520506
# Send status to Slack channel if job fails:
521507
- name: 'Send status to Slack channel in case of failure'
522-
uses: act10ns/slack@v1
508+
uses: act10ns/slack@v2
523509
with:
524510
status: ${{ job.status }}
525511
steps: ${{ toJson(steps) }}
@@ -696,7 +682,7 @@ jobs:
696682
697683
# Send status to Slack channel if job fails:
698684
- name: 'Send status to Slack channel in case of failure'
699-
uses: act10ns/slack@v1
685+
uses: act10ns/slack@v2
700686
with:
701687
status: ${{ job.status }}
702688
steps: ${{ toJson(steps) }}

.github/workflows/publish.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,19 @@ jobs:
105105
- name: 'Remove CLI'
106106
if: ${{ github.ref == 'refs/heads/main' }}
107107
run: |
108+
# Exit if the package does not have a CLI:
109+
if ! grep -q '"bin":' package.json; then
110+
exit 0
111+
fi
108112
rm -rf ./bin/cli
109-
rm test/test.cli.js
110-
rm etc/cli_opts.json
111-
rm docs/usage.txt
113+
rm -f test/test.cli.js
114+
rm -f etc/cli_opts.json
115+
rm -f docs/usage.txt
112116
113117
# For all dependencies, check in all *.js files if they are still used; if not, remove them:
114118
jq -r '.dependencies | keys[]' ./package.json | while read -r dep; do
115119
dep=$(echo "$dep" | xargs)
116-
if ! grep -q "$dep" lib/**; then
120+
if ! grep -q "$dep" lib/** && ! grep -q -s "$dep" manifest.json && ! grep -q -s "$dep" include.gypi; then
117121
jq --indent 2 "del(.dependencies[\"$dep\"])" ./package.json > ./package.json.tmp
118122
mv ./package.json.tmp ./package.json
119123
fi
@@ -123,7 +127,7 @@ jobs:
123127
continue
124128
fi
125129
dep=$(echo "$dep" | xargs)
126-
if ! grep -q "$dep" ./lib/**; then
130+
if ! grep -q "$dep" lib/** && ! grep -q -s "$dep" manifest.json && ! grep -q -s "$dep" include.gypi; then
127131
jq --indent 2 "del(.devDependencies[\"$dep\"])" ./package.json > ./package.json.tmp
128132
mv ./package.json.tmp ./package.json
129133
fi
@@ -136,6 +140,21 @@ jobs:
136140
jq -r 'del(.bin)' package.json > package.json.tmp
137141
mv package.json.tmp package.json
138142
143+
# Add entry for CLI package to See Also section of README.md:
144+
cliPkgName=$(jq -r '.name' package.json)-cli
145+
escapedPkg=$(echo "$cliPkgName" | sed -e 's/\//\\\//g')
146+
escapedPkg=$(echo "$escapedPkg" | sed -e 's/\@/\\\@/g')
147+
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/<section class=\"related\">(?:\n\n\* \* \*\n\n## See Also\n\n)?/<section class=\"related\">\n\n## See Also\n\n- <span class=\"package-name\">[\`$escapedPkg\`][$escapedPkg]<\/span><span class=\"delimiter\">: <\/span><span class=\"description\">CLI package for use as a command-line utility.<\/span>\n/"
148+
149+
# Add link definition for CLI package to README.md:
150+
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/<section class=\"links\">/<section class=\"links\">\n\n[$escapedPkg]: https:\/\/www.npmjs.com\/package\/$escapedPkg/"
151+
152+
# Replace GitHub MathJax equations with SVGs:
153+
- name: 'Replace GitHub MathJax equations with SVGs'
154+
run: |
155+
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe 's/```math\n([\s\S]+?)\n```\n\n//g'
156+
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe 's/<!-- <div class="equation"(.*)(<\/div>\s*-->)/<div class="equation"$1<\/div>/sg'
157+
139158
# Replace GitHub links to individual packages with npm links:
140159
- name: 'Replace all GitHub links to individual packages with npm links'
141160
run: |
@@ -146,6 +165,12 @@ jobs:
146165
run: |
147166
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`\n\nAlternatively,[^<]+<\/section>/\`\`\`\n\n<\/section>/"
148167
168+
# Remove unnecessary files:
169+
- name: 'Remove unnecessary files'
170+
run: |
171+
rm -f docs/repl.txt
172+
rm -f docs/types/test.ts
173+
149174
# Replace all stdlib GitHub dependencies with the respective npm packages:
150175
- name: 'Replace all stdlib GitHub dependencies with the respective npm packages'
151176
run: |
@@ -172,7 +197,7 @@ jobs:
172197
173198
# Publish package to npm:
174199
- name: 'Publish package to npm'
175-
uses: JS-DevTools/npm-publish@v1
200+
uses: JS-DevTools/npm-publish@v2
176201
with:
177202
token: ${{ secrets.NPM_TOKEN }}
178203
access: public
@@ -184,7 +209,7 @@ jobs:
184209
185210
# Send status to Slack channel if job fails:
186211
- name: 'Send status to Slack channel in case of failure'
187-
uses: act10ns/slack@v1
212+
uses: act10ns/slack@v2
188213
with:
189214
status: ${{ job.status }}
190215
steps: ${{ toJson(steps) }}

.github/workflows/test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ on:
3232
# Run workflow on each push to the main branch:
3333
push:
3434

35+
# Run workflow upon completion of `publish` workflow run:
36+
workflow_run:
37+
workflows: ["publish"]
38+
types: [completed]
39+
3540
# Workflow jobs:
3641
jobs:
3742

@@ -84,7 +89,7 @@ jobs:
8489
8590
# Send status to Slack channel if job fails:
8691
- name: 'Send status to Slack channel in case of failure'
87-
uses: act10ns/slack@v1
92+
uses: act10ns/slack@v2
8893
with:
8994
status: ${{ job.status }}
9095
steps: ${{ toJson(steps) }}

.github/workflows/test_bundles.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
8989
# Send notification to Slack channel if job fails:
9090
- name: 'Send status to Slack channel in case of failure'
91-
uses: act10ns/slack@v1
91+
uses: act10ns/slack@v2
9292
with:
9393
status: ${{ job.status }}
9494
steps: ${{ toJson(steps) }}
@@ -130,7 +130,7 @@ jobs:
130130
131131
# Send notification to Slack channel if job fails:
132132
- name: 'Send status to Slack channel in case of failure'
133-
uses: act10ns/slack@v1
133+
uses: act10ns/slack@v2
134134
with:
135135
status: ${{ job.status }}
136136
steps: ${{ toJson(steps) }}
@@ -172,7 +172,7 @@ jobs:
172172
173173
# Send notification to Slack channel if job fails:
174174
- name: 'Send status to Slack channel in case of failure'
175-
uses: act10ns/slack@v1
175+
uses: act10ns/slack@v2
176176
with:
177177
status: ${{ job.status }}
178178
steps: ${{ toJson(steps) }}

.github/workflows/test_coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
107107
# Send Slack notification if job fails:
108108
- name: 'Send status to Slack channel in case of failure'
109-
uses: act10ns/slack@v1
109+
uses: act10ns/slack@v2
110110
with:
111111
status: ${{ job.status }}
112112
steps: ${{ toJson(steps) }}

.github/workflows/test_install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575

7676
# Send Slack notification if job fails:
7777
- name: 'Send notification to Slack in case of failure'
78-
uses: act10ns/slack@v1
78+
uses: act10ns/slack@v2
7979
with:
8080
status: ${{ job.status }}
8181
steps: ${{ toJson(steps) }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,7 @@ jsconfig.json
182182
################
183183
*.sublime-workspace
184184
*.sublime-project
185+
186+
# Other editor files #
187+
######################
188+
.idea/

CONTRIBUTORS

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,37 @@
33
# Contributors listed in alphabetical order.
44

55
Ali Salesi <ali_sal1381@yahoo.com>
6+
Amit Jimiwal <amitjimiwal45@gmail.com>
67
Athan Reines <kgryte@gmail.com>
78
Brendan Graetz <bguiz@users.noreply.github.com>
89
Bruno Fenzl <brunofenzl@gmail.com>
910
Christopher Dambamuromo <chridam@gmail.com>
11+
Dan Rose <danoftheroses@gmail.com>
1012
Dominik Moritz <domoritz@gmail.com>
13+
Dorrin Sotoudeh <dorrinsotoudeh123@gmail.com>
1114
Frank Kovacs <fran70kk@gmail.com>
12-
James <jdgelok@gmail.com>
15+
Harshita Kalani <harshitakalani02@gmail.com>
16+
James Gelok <jdgelok@gmail.com>
1317
Jithin KS <jithinks112@gmail.com>
1418
Joey Reed <joeyrreed@gmail.com>
19+
Jordan Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com>
1520
Joris Labie <joris.labie1@gmail.com>
1621
Justin Dennison <justin1dennison@gmail.com>
17-
Marcus <mfantham@users.noreply.github.com>
22+
Marcus Fantham <mfantham@users.noreply.github.com>
1823
Matt Cochrane <matthew.cochrane.eng@gmail.com>
1924
Milan Raj <rajsite@users.noreply.github.com>
2025
Momtchil Momtchev <momtchil@momtchev.com>
26+
Naresh Jagadeesan <naresh.naresh000@gmail.com>
27+
Nithin Katta <88046362+nithinkatta@users.noreply.github.com>
2128
Ognjen Jevremović <ognjenjevremovic@users.noreply.github.com>
2229
Philipp Burckhardt <pburckhardt@outlook.com>
23-
Pranav <85227306+Pranavchiku@users.noreply.github.com>
30+
Pranav Goswami <goswami.4@iitj.ac.in>
2431
Ricky Reusser <rsreusser@gmail.com>
32+
Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com>
2533
Ryan Seal <splrk@users.noreply.github.com>
2634
Seyyed Parsa Neshaei <spneshaei@users.noreply.github.com>
2735
Shraddheya Shendre <shendreshraddheya@gmail.com>
2836
Stephannie Jiménez Gacha <steff456@hotmail.com>
29-
dorrin-sot <59933477+dorrin-sot@users.noreply.github.com>
30-
rei2hu <rei2hu@users.noreply.github.com>
37+
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
38+
orimiles5 <97595296+orimiles5@users.noreply.github.com>
39+
rei2hu <reimu@reimu.ws>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
212212
-->
213213

214214
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
215-
[chat-url]: https://gitter.im/stdlib-js/stdlib/
215+
[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
216216

217217
[stdlib]: https://github.com/stdlib-js/stdlib
218218

dist/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/// <reference path="../docs/types/index.d.ts" />
2+
import onesLike from '../docs/types/index';
3+
export = onesLike;

0 commit comments

Comments
 (0)