Skip to content

Commit d781f19

Browse files
authored
Update bundle.yml
1 parent a3b83fc commit d781f19

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/bundle.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,22 @@ jobs:
164164
- name: Rewrite file contents
165165
run: |
166166
167+
# Replace links to other packages with links to the esm branch:
168+
find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/esm/";
169+
170+
# Replace reference to `@stdlib/types` with esm link:
171+
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@esm\/index.d.ts\"\/>/g"
172+
173+
# Change wording of project description to avoid reference to JavaScript and Node.js:
174+
find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g"
175+
176+
# Rewrite all `require()`s to use jsDelivr links:
177+
find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// {
178+
s/(var|let|const)\s+([a-z0-9]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i
179+
s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/
180+
s/';/@esm\/index.mjs';/
181+
}"
182+
167183
# Remove `installation`, `cli`, and `c` sections:
168184
find ./esm -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/<section class=\"installation\">[^<]+<\/section>//g;"
169185
find ./esm -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/<section class=\"cli\">[\s\S]+<\!\-\- \/.cli \-\->//g"

0 commit comments

Comments
 (0)