File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff 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"
You can’t perform that action at this time.
0 commit comments