Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b9c13d5

Browse filesBrowse files
committed
Auto-generated commit
1 parent 42b669d commit b9c13d5
Copy full SHA for b9c13d5

File tree

9 files changed

+166
-29
lines changed
Filter options

9 files changed

+166
-29
lines changed

‎.github/.keepalive

Copy file name to clipboard
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023-02-01T00:46:15.406Z
1+
2023-03-01T01:03:56.293Z

‎.github/workflows/productionize.yml

Copy file name to clipboardExpand all lines: .github/workflows/productionize.yml
+9-2Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ on:
3434
type: boolean
3535
default: true
3636

37+
# Run workflow upon completion of `publish` workflow run:
38+
workflow_run:
39+
workflows: ["publish"]
40+
types: [completed]
41+
42+
3743
# Concurrency group to prevent multiple concurrent executions:
3844
concurrency:
3945
group: productionize
@@ -94,10 +100,11 @@ jobs:
94100
# Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency:
95101
- name: 'Update dependencies in package.json'
96102
run: |
103+
PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version)
97104
if grep -q '"@stdlib/string-format"' package.json; then
98-
sed -i "s/\"@stdlib\/string-format\"/\"@stdlib\/error-tools-fmtprodmsg\"/g" package.json
105+
sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json
99106
else
100-
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 ) );"
107+
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 ) );"
101108
fi
102109
103110
# Configure git:

‎.github/workflows/publish.yml

Copy file name to clipboardExpand all lines: .github/workflows/publish.yml
+124-5Lines changed: 124 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,23 @@ name: publish
2121

2222
# Workflow triggers:
2323
on:
24-
# Run workflow when a new tag is pushed to the repository:
25-
push:
26-
tags: v[0-9]+.[0-9]+.[0-9]+
24+
# Allow the workflow to be manually run:
25+
workflow_dispatch:
26+
# Workflow inputs:
27+
inputs:
28+
version:
29+
description: 'Version Increment'
30+
type: choice
31+
default: 'none'
32+
options:
33+
- 'none'
34+
- 'major'
35+
- 'minor'
36+
- 'patch'
37+
- 'premajor'
38+
- 'preminor'
39+
- 'prepatch'
40+
- 'prerelease'
2741

2842
# Workflow jobs:
2943
jobs:
@@ -32,14 +46,15 @@ jobs:
3246
publish:
3347

3448
# Define display name:
35-
name: 'Publish to npm'
49+
name: 'Publish package to npm'
3650

3751
# Define the type of virtual host machine on which to run the job:
3852
runs-on: ubuntu-latest
3953

4054
# Define environment variables:
4155
env:
4256
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
57+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4358

4459
# Define the sequence of job steps...
4560
steps:
@@ -55,6 +70,85 @@ jobs:
5570
node-version: 16
5671
timeout-minutes: 5
5772

73+
# Configure git:
74+
- name: 'Configure git'
75+
run: |
76+
git config --local user.email "noreply@stdlib.io"
77+
git config --local user.name "stdlib-bot"
78+
79+
# Increment package version (if requested):
80+
- name: 'Increment package version (if requested)'
81+
if: ${{ github.event.inputs.version != 'none' }}
82+
run: |
83+
# Save NPM_TOKEN to user's .npmrc:
84+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
85+
86+
# Increment package version:
87+
npm version ${{ github.event.inputs.version }} --no-git-tag-version
88+
89+
# Define variable for new version:
90+
NEW_VERSION=$(node -p "require('./package.json').version")
91+
92+
# Replace branch in README.md link definitions for badges with the new version:
93+
find . -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/branch([=:])[^ ]+/branch\1v${NEW_VERSION}/g"
94+
95+
# Create a new commit and tag:
96+
git add package.json README.md
97+
git commit -m "Release v${NEW_VERSION}"
98+
git tag -a "v${NEW_VERSION}" -m "Release v${NEW_VERSION}"
99+
100+
# Push changes to GitHub:
101+
SLUG=${{ github.repository }}
102+
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" --follow-tags
103+
104+
# Remove CLI:
105+
- name: 'Remove CLI'
106+
if: ${{ github.ref == 'refs/heads/main' }}
107+
run: |
108+
# Exit if the package does not have a CLI:
109+
if ! grep -q '"bin":' package.json; then
110+
exit 0
111+
fi
112+
rm -rf ./bin/cli
113+
rm test/test.cli.js
114+
rm etc/cli_opts.json
115+
rm docs/usage.txt
116+
117+
# For all dependencies, check in all *.js files if they are still used; if not, remove them:
118+
jq -r '.dependencies | keys[]' ./package.json | while read -r dep; do
119+
dep=$(echo "$dep" | xargs)
120+
if ! grep -q "$dep" lib/** && ! grep -q -s "$dep" manifest.json && ! grep -q -s "$dep" include.gypi; then
121+
jq --indent 2 "del(.dependencies[\"$dep\"])" ./package.json > ./package.json.tmp
122+
mv ./package.json.tmp ./package.json
123+
fi
124+
done
125+
jq -r '.devDependencies | keys[]' ./package.json | while read -r dep; do
126+
if [[ "$dep" != "@stdlib"* ]]; then
127+
continue
128+
fi
129+
dep=$(echo "$dep" | xargs)
130+
if ! grep -q "$dep" lib/** && ! grep -q -s "$dep" manifest.json && ! grep -q -s "$dep" include.gypi; then
131+
jq --indent 2 "del(.devDependencies[\"$dep\"])" ./package.json > ./package.json.tmp
132+
mv ./package.json.tmp ./package.json
133+
fi
134+
done
135+
136+
# Remove CLI section:
137+
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?<section class=\"cli\">[\s\S]+?<\!\-\- \/.cli \-\->//"
138+
139+
# Remove CLI from package.json:
140+
jq -r 'del(.bin)' package.json > package.json.tmp
141+
mv package.json.tmp package.json
142+
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+
58152
# Replace GitHub links to individual packages with npm links:
59153
- name: 'Replace all GitHub links to individual packages with npm links'
60154
run: |
@@ -65,10 +159,35 @@ jobs:
65159
run: |
66160
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`\n\nAlternatively,[^<]+<\/section>/\`\`\`\n\n<\/section>/"
67161
162+
# Remove unnecessary files:
163+
- name: 'Remove unnecessary files'
164+
run: |
165+
rm docs/repl.txt
166+
rm docs/types/test.ts
167+
68168
# Replace all stdlib GitHub dependencies with the respective npm packages:
69169
- name: 'Replace all stdlib GitHub dependencies with the respective npm packages'
70170
run: |
71-
find package.json -type f -print0 | xargs -0 sed -Ei 's/"github:stdlib-js[^"]*"/"^0.0.x"/g'
171+
for dep in $(jq -r '.dependencies | keys | .[]' package.json); do
172+
if [[ "$dep" != "@stdlib"* ]]; then
173+
continue
174+
fi
175+
# Trim leading and trailing whitespace:
176+
dep=$(echo "$dep" | xargs)
177+
version="^$(npm view $dep version)"
178+
jq -r --arg dep "$dep" --arg version "$version" '.dependencies[$dep] = $version' package.json > package.json.tmp
179+
mv package.json.tmp package.json
180+
done
181+
for dep in $(jq -r '.devDependencies | keys | .[]' package.json); do
182+
if [[ "$dep" != "@stdlib"* ]]; then
183+
continue
184+
fi
185+
# Trim leading and trailing whitespace:
186+
dep=$(echo "$dep" | xargs)
187+
version="^$(npm view $dep version)"
188+
jq -r --arg dep "$dep" --arg version "$version" '.devDependencies[$dep] = $version' package.json > package.json.tmp
189+
mv package.json.tmp package.json
190+
done
72191
73192
# Publish package to npm:
74193
- name: 'Publish package to npm'

‎.github/workflows/test.yml

Copy file name to clipboardExpand all lines: .github/workflows/test.yml
+5Lines changed: 5 additions & 0 deletions
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

‎.gitignore

Copy file name to clipboardExpand all lines: .gitignore
+4Lines 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

Copy file name to clipboardExpand all lines: CONTRIBUTORS
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ Bruno Fenzl <brunofenzl@gmail.com>
99
Christopher Dambamuromo <chridam@gmail.com>
1010
Dominik Moritz <domoritz@gmail.com>
1111
Frank Kovacs <fran70kk@gmail.com>
12+
Harshita Kalani <95532771+HarshitaKalani@users.noreply.github.com>
1213
James <jdgelok@gmail.com>
1314
Jithin KS <jithinks112@gmail.com>
1415
Joey Reed <joeyrreed@gmail.com>
16+
Jordan-Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com>
1517
Joris Labie <joris.labie1@gmail.com>
1618
Justin Dennison <justin1dennison@gmail.com>
1719
Marcus <mfantham@users.noreply.github.com>

‎README.md

Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ bool = isFloat32Array( null );
135135

136136
## See Also
137137

138-
- <span class="package-name">[`@stdlib/assert/is-float64array`][@stdlib/assert/is-float64array]</span><span class="delimiter">: </span><span class="description">test if a value is a Float64Array.</span>
138+
- <span class="package-name">[`@stdlib/assert-is-float64array`][@stdlib/assert/is-float64array]</span><span class="delimiter">: </span><span class="description">test if a value is a Float64Array.</span>
139139

140140
</section>
141141

‎branches.md

Copy file name to clipboardExpand all lines: branches.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ C -->|bundle| D[esm];
3838
C -->|bundle| E[deno];
3939
C -->|bundle| F[umd];
4040
41-
click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-float32array"
42-
click B href "https://github.com/stdlib-js/assert-is-float32array/tree/main"
43-
click C href "https://github.com/stdlib-js/assert-is-float32array/tree/production"
44-
click D href "https://github.com/stdlib-js/assert-is-float32array/tree/esm"
45-
click E href "https://github.com/stdlib-js/assert-is-float32array/tree/deno"
46-
click F href "https://github.com/stdlib-js/assert-is-float32array/tree/umd"
41+
%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-float32array"
42+
%% click B href "https://github.com/stdlib-js/assert-is-float32array/tree/main"
43+
%% click C href "https://github.com/stdlib-js/assert-is-float32array/tree/production"
44+
%% click D href "https://github.com/stdlib-js/assert-is-float32array/tree/esm"
45+
%% click E href "https://github.com/stdlib-js/assert-is-float32array/tree/deno"
46+
%% click F href "https://github.com/stdlib-js/assert-is-float32array/tree/umd"
4747
```
4848

4949
[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-float32array

‎package.json

Copy file name to clipboardExpand all lines: package.json
+14-14Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@
3737
"url": "https://github.com/stdlib-js/stdlib/issues"
3838
},
3939
"dependencies": {
40-
"@stdlib/utils-native-class": "^0.0.x"
40+
"@stdlib/utils-native-class": "^0.0.8"
4141
},
4242
"devDependencies": {
43-
"@stdlib/array-float32": "^0.0.x",
44-
"@stdlib/array-float64": "^0.0.x",
45-
"@stdlib/array-int16": "^0.0.x",
46-
"@stdlib/array-int32": "^0.0.x",
47-
"@stdlib/array-int8": "^0.0.x",
48-
"@stdlib/array-uint16": "^0.0.x",
49-
"@stdlib/array-uint32": "^0.0.x",
50-
"@stdlib/array-uint8": "^0.0.x",
51-
"@stdlib/array-uint8c": "^0.0.x",
52-
"@stdlib/assert-is-boolean": "^0.0.x",
53-
"@stdlib/bench": "^0.0.x",
43+
"@stdlib/array-float32": "^0.0.6",
44+
"@stdlib/array-float64": "^0.0.6",
45+
"@stdlib/array-int16": "^0.0.6",
46+
"@stdlib/array-int32": "^0.0.6",
47+
"@stdlib/array-int8": "^0.0.6",
48+
"@stdlib/array-uint16": "^0.0.6",
49+
"@stdlib/array-uint32": "^0.0.6",
50+
"@stdlib/array-uint8": "^0.0.7",
51+
"@stdlib/array-uint8c": "^0.0.8",
52+
"@stdlib/assert-is-boolean": "^0.0.8",
53+
"@stdlib/bench": "^0.0.12",
5454
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
5555
"istanbul": "^0.4.1",
5656
"tap-min": "git+https://github.com/Planeshifter/tap-min.git"
@@ -97,7 +97,7 @@
9797
"test"
9898
],
9999
"funding": {
100-
"type": "patreon",
101-
"url": "https://www.patreon.com/athan"
100+
"type": "opencollective",
101+
"url": "https://opencollective.com/stdlib"
102102
}
103103
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.