Skip to content

Commit 52dbfae

Browse files
authored
Merge pull request #88 from danielroe/feat/tokenize
feat: expose registry-free `tokenize` function
2 parents 553a722 + 2887f26 commit 52dbfae

505 files changed

Lines changed: 6227 additions & 4849 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/build.sh‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,25 @@ npm i
77
in_dir=./src
88
out_dir=./dist
99

10-
esbuild_options="--bundle --minify"
10+
esbuild_options="--bundle --minify --external:./languages/* --external:./themes/* --external:./index.js"
1111

1212
minify_js () {
1313
file=$1
14+
opts="$esbuild_options"
15+
case $file in
16+
# the barrel must stay a re-export file (its imports are written
17+
# ./asm.js so the global externals do not match them), inlining it
18+
# would destroy the module graph consumers tree-shake on
19+
*/languages/index.js) opts="$esbuild_options --external:./*" ;;
20+
esac
1421
out=${file/${in_dir}/${out_dir}}
1522
out=${out/.ts/.js}
1623
mkdir -p $(dirname $out)
17-
npx esbuild $file $esbuild_options --format=esm --target=es2020 --outfile=$out
24+
npx esbuild $file $opts --format=esm --target=es2020 --outfile=$out
1825

1926
node=${file/${in_dir}/"${out_dir}/node"}
2027
mkdir -p $(dirname $node)
21-
npx esbuild $file $esbuild_options --format=cjs --platform=node --target=node12 --outfile=$node
28+
npx esbuild $file $opts --format=cjs --platform=node --target=node12 --outfile=$node
2229
}
2330

2431
rm -rf $out_dir
@@ -52,4 +59,7 @@ npx -p typescript tsc --outDir dist/node
5259

5360
echo '{"type": "commonjs"}' > dist/node/package.json
5461

62+
node scripts/generate-tables.js
63+
node scripts/generate-toc.js
64+
5565
exit 0

‎.github/workflows/pages.yml‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: pages
14+
cancel-in-progress: true
15+
16+
jobs:
17+
# the playground is the org site, served at https://speed-highlight.github.io
18+
#
19+
# needs, one time: a repo named speed-highlight.github.io (pages source
20+
# "deploy from branch" main), a write deploy key on it, and its private
21+
# key as the SITE_DEPLOY_KEY secret of this repo
22+
deploy-site:
23+
name: deploy speed-highlight.github.io
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Setup Repo
27+
uses: actions/checkout@v6
28+
29+
- name: Setup Node
30+
uses: actions/setup-node@v6
31+
with:
32+
node-version: lts/*
33+
cache: npm
34+
cache-dependency-path: playground/package-lock.json
35+
36+
- run: npm clean-install
37+
working-directory: playground
38+
- run: npm run build
39+
working-directory: playground
40+
41+
- name: Push to site repository
42+
uses: peaceiris/actions-gh-pages@v4
43+
with:
44+
deploy_key: ${{ secrets.SITE_DEPLOY_KEY }}
45+
external_repository: speed-highlight/speed-highlight.github.io
46+
publish_branch: main
47+
publish_dir: playground/dist
48+
force_orphan: true

‎.github/workflows/release.yml‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ jobs:
3131
- run: npm clean-install
3232
- run: npm audit signatures
3333
- run: npm run build
34-
35-
- name: Build documention
36-
run: npx -y typedoc src/index.js src/detect.js src/terminal.js
34+
- run: npm test
3735

3836
- name: Auto commit
3937
run: |
@@ -46,4 +44,4 @@ jobs:
4644
- name: Release
4745
run: npx semantic-release
4846
env:
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.gitignore‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
.DS_Store
2-
node_modules
2+
node_modules
3+
deno.lock
4+
playground/dist
5+
tests/.tmp-snippets

‎CODE_OF_CONDUCT.md‎

Lines changed: 0 additions & 128 deletions
This file was deleted.

‎CONTRIBUTING.md‎

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)