Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support glyphs #54

Merged
merged 36 commits into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
053dd7e
initial build script to generate SDFs
gmaclennan Aug 1, 2022
ca5ed15
add license file to font
achou11 Aug 1, 2022
34125da
install @fastify/static@5
achou11 Aug 1, 2022
e717590
Merge branch 'master' into feat/glyphs
achou11 Aug 1, 2022
ae2f4e6
output pbf files for sdf script
achou11 Aug 1, 2022
c1b3917
set up @fastify/static plugin
achou11 Aug 1, 2022
5954745
update type annotation for createServer
achou11 Aug 1, 2022
fcf8570
add basic route and tests for fonts
achou11 Aug 1, 2022
15f0414
remove unused imports
achou11 Aug 1, 2022
e7f2045
update fonts route to handle fontstack param better
achou11 Aug 1, 2022
ae359ae
replace style's glyphs field with offline url
achou11 Aug 1, 2022
0b995b5
update create style test to check change in glyphs field
achou11 Aug 1, 2022
b425cfd
remove only call
achou11 Aug 1, 2022
20ee781
generate sdfs in ci
achou11 Aug 2, 2022
d43631f
remove console log in test
achou11 Aug 2, 2022
313b33a
basic api implementation of getGlyphs
achou11 Aug 2, 2022
f9cc35f
add more half-baked tests
achou11 Aug 2, 2022
2a8dffe
implement untested upstream glyphs functionality
achou11 Aug 2, 2022
959d904
remove comment
achou11 Aug 2, 2022
0cf0b1b
update naming convention for statically stored fonts
achou11 Aug 3, 2022
ea23bdd
add todo about validating upstream url
achou11 Aug 3, 2022
fd247c8
update variable name
achou11 Aug 3, 2022
8b465b2
fix glyph url generation
achou11 Aug 3, 2022
bc33d47
update access token error status code to match mapbox
achou11 Aug 3, 2022
f38d819
forward upstream responses
achou11 Aug 3, 2022
35abd03
fix mock in test
achou11 Aug 3, 2022
3c1ba7c
fix git naming of open sans dir
achou11 Aug 3, 2022
bf69fc6
update comments in fastify static register
achou11 Aug 3, 2022
9eb6962
set etag from upstream to reply headers
achou11 Aug 3, 2022
7c9ed4b
return error for invalid ranges
achou11 Aug 4, 2022
bd905e6
add test for error response forwarding
achou11 Aug 4, 2022
65272d9
reduce boilerplate in glyphs tests
achou11 Aug 4, 2022
13f0bf3
handle offline case
achou11 Aug 4, 2022
e286bd2
fix comment
achou11 Aug 4, 2022
0a3e82d
move offline error codes to errors file
achou11 Aug 4, 2022
2ced2e4
disable ci for node 16 due to node-fontnik
achou11 Aug 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix glyph url generation
  • Loading branch information
achou11 committed Aug 3, 2022
commit 8b465b20556d4edb7ebf4135f29e55577a0327fa
2 changes: 1 addition & 1 deletion src/api/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function createStylesApi({
? `?${new URLSearchParams({ styleId }).toString()}`
: ''

return `${baseApiUrl}/fonts/{fontStack}/{range}.pbf${searchParams}`
return `${baseApiUrl}/fonts/{fontstack}/{range}.pbf${searchParams}`
}

function styleExists(styleId: string) {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/styles.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ test('POST /styles when providing valid style returns resource with id and alter

t.ok(id, 'created style possesses an id')

const expectedGlyphsUrl = `http://localhost:80/fonts/{fontStack}/{range}.pbf?styleId=${id}`
const expectedGlyphsUrl = `http://localhost:80/fonts/{fontstack}/{range}.pbf?styleId=${id}`

t.equal(style.glyphs, expectedGlyphsUrl, 'glyphs points to offline url')

Expand Down