Commit Graph

89 Commits

Author SHA1 Message Date
Vib Bhardwaj 0fac399b3f Add lockfile 2024-05-14 17:18:41 +02:00
Vib Bhardwaj 24a889cf50 Add support for examples in the OpenAPI block 2024-05-14 17:12:18 +02:00
Steven H 5db3cbc2ce Render Embed blocks that can be handled by an integration in the Space. (#2302) 2024-04-25 15:25:53 +01:00
Steven H bf450e5cc7 Support GitHub-flavoured Markdown when parsing OpenAPI descriptions. (#2288) 2024-04-17 14:21:07 +01:00
spastorelli bfb2342ab3 Add support for integration inject script for sites (#2277) 2024-04-11 10:28:24 +02:00
Taran Vohra 0c224861e3 Sites support (#2262) 2024-04-08 17:06:22 +05:30
Samy Pessé 4f728c0137 Fix parsing of Swagger 2.0 when it can be patched (#2254) 2024-03-31 20:13:34 +02:00
Steven H 3144b2fec1 Update SyncedBlocks to use new API (#2251) 2024-03-29 15:57:08 +00:00
Greg Bergé d3f9131af4 Support images & files in synced blocks (#2234) 2024-03-25 21:53:24 +01:00
Samy Pessé c5a28f884a Fix zoom on small images with custom zoom component (#2228) 2024-03-25 11:31:40 +01:00
Amrit Kahlon ef8eb72364 fix: clear scalar api client response on close (#318)
* fix: clear scalar api client response on close

* bun install

---------

Co-authored-by: Samy Pessé <samypesse@gmail.com>
2024-03-21 14:53:29 +01:00
Samy Pessé b029b1e23d Fix display of advanced blocks in OL/Tasks lists (#317)
* Fix OL list style

* Format

* Fix it for tasks lists as well

* Default to fullPage

* Run some test without fullPage

* Run fullPage only on list
2024-03-21 09:50:18 +01:00
Marc Laventure 4f039ecb2b feat: add scalar api client (#180)
* wip

* feat: add scalar api client

* fix: pr feedback

* feat: add scalar react client package, remove vueary

* feat: add scalar proxy

* Move dependencies to package

* Format once

* Rename prop

* Use react context and simplify lazy loading

* Add loading state

* Format

* Move styles

* bun install

* bun

* fix: remove extraneous api-reference package

* feat: make operation functional with spec in client

* fix: column bug and http request type wrapping

* fix: add scalar api reference package

* Format

* bun install

* fix: scrolling in scalar modal

* Lazy load operations data in component

* fix: change dependency from api-reference to oas-utils to reduce size

* bun install

* Log error in the worker proxy

* Cleanup

* Comment "mode"

* Without credentials and referrerPolicy

---------

Co-authored-by: Samy Pessé <samypesse@gmail.com>
Co-authored-by: Amrit <amrit@hockey-community.com>
2024-03-19 15:32:54 +01:00
Samy Pessé cf958bacd1 Fallback to MathJax when KaTeX fails to compile math (#303)
* Start

* Use MathJax v3

* Format

* Improve font-size

* Lint

* Better handle loading

* Copy MathJax assets to public folder

* Attempt at using local assets for MathJax

* Use bun 1.0.31

* Try with bun 1.0.33

* Try fixing headers

* Simplify

* Simplify and not use suspense module

* Cleanup more

* Add test for Math

* Make math block scroll if needed

* Update packages/react-math/src/KaTeX.tsx

Co-authored-by: Greg Bergé <berge.greg@gmail.com>

* Use React.use

* Format

* Use exports

* Lint

* Disable cache in CI for lint

* Format

---------

Co-authored-by: Greg Bergé <berge.greg@gmail.com>
2024-03-19 11:34:53 +01:00
Greg Bergé 3c96bf84b5 Upgrade Argos (#296)
* Upgrade Argos

* Wait for cookie dialog, avoid fullPage if not needed

* Fix E2E

* Cookies dialog
2024-03-18 15:30:45 +01:00
Greg Bergé c87197bb98 Replace shikiji by shiki (#297) 2024-03-18 15:11:22 +01:00
Samy Pessé a27fa68ae6 Fix scroll to hash and update next to 14.1.3 (#286)
* Update next to 14.1.3

* Scroll to hash when url changes

* Simplify tests

* Lint and format

* Fix TS

* Dummy comment

* Try async function
2024-03-18 08:55:30 +01:00
Samy Pessé cf4b1249a9 Optimize performances for reading revisions (#251)
* Optimize read of revisions with metadata=false when possible

* Format

* Fix

* Update src/components/AdminToolbar/AdminToolbar.tsx

Co-authored-by: Steven H <shne24@gmail.com>

---------

Co-authored-by: Steven H <shne24@gmail.com>
2024-03-13 12:54:32 +01:00
Taran Vohra 0da4e9a926 Fix visitor auth logic by testing multiple basePaths (#239)
* WIP

* add search params to target in multi-path

* Simplify

* Format

* Ensure trailing slash

* Add unit test

* fix lint

* use search from target in redirect

* remove unused import

---------

Co-authored-by: Samy Pessé <samypesse@gmail.com>
2024-03-13 13:54:47 +05:30
Greg Bergé 5a5b4bb93c Replace Puppeteer by Playwright (#224)
* Replace Puppeteer by Playwright

* Remove the limit of workers on ci

* Various fixes after review

* Document things
2024-03-08 10:41:30 +01:00
Samy Pessé 55d1e538d9 More resilient caching and use of KV (#222)
* Add unit tests for "race"

* Reduce to 80s

* Implement a Cloudflare KV cache

* Format

* Lint

* Fix tagging of entries in KV

* No longer use HTTP cache tags

* Simplify tags to only keep 2

* Implement a blockFallback logic

* Improve the block fallback logic

* More tests

* Start introducing a always optional signal on all cache ops

* Correctly pass signal end to end

* Fix one more case and add tests

* Fix it

* Add test for error

* Fix error handling

* Simplify even more

* Improve logs

* Improve logs / measurements

* Fix timing

* Fix read cache duration and add minor tests

* Log redis time

* Change replication logic

* Fix redis errors

* Log more

* More logs and test memory first

* Improve tracing for cache backends

* Ignore all dependencies

* Log the key in the cache low level traces
2024-03-08 09:43:30 +01:00
Greg Bergé 7d04336b5f Support synced blocks (#223) 2024-03-08 09:16:01 +01:00
Samy Pessé f26e856170 Accept customization settings as a query paremeter (#199)
* Accept a query parameter "customization" to extend space customization

* Test it

* Use rison instead of JSON

* Use object version
2024-02-28 19:24:48 +01:00
Samy Pessé 70c6c9df42 First pass at implementing ContentKit (#69)
* Start

* Try webframe

* Lint and format

* Move to package

* Continue

* Implement card and cleanup contexts

* Start code blocks

* Start rendering image

* Continue with card

* Start stack

* Start text

* Start modal

* Format

* Continue

* Fix TS errors

* Cleanup

* Make markdown work with server components

* Format

* Add visual test

* Lint and format

* Fix lifecycle

* Implement textinput

* Divider

* Remove console logs

* Remove listSpaceIntegrationsBlocks
2024-02-28 14:46:47 +01:00
Samy Pessé a2d967e98e Use Joypixels instead of native emojis (#176)
* fist test

* Use a font

* Cleanup

* Use right fallbacks for fonts

* Lint

* Cleanup and comment

* Add visual test
2024-02-20 13:54:57 +01:00
Samy Pessé 49a1561801 Update @cloudflare/next-on-pages to 1.9.0 (#156) 2024-02-14 12:35:39 +01:00
Samy Pessé ec1769fc32 Let users zoom images (inline and block) (#151) 2024-02-13 21:54:48 +01:00
Samy Pessé 46a3543a5e Use new version of cloudflare/next-on-pages and remove patch (#145)
* Use new version of cloudflare/next-on-pages and remove patch

* TS

* Fix ts again

* Remove patch-package

* Remove test

* Make it work locally
2024-02-12 16:38:33 +01:00
Samy Pessé 34e339b5e4 Correctly handle errors from getPublishedContentByUrl (#142)
* Correctly handle errors from getPublishedContentByUrl

* Format

* Improve error message
2024-02-09 19:24:36 +01:00
Samy Pessé 6cab31faf6 Stream AI answers to questions (#138)
* Stream AI answers to questions

* Use a different polyfill

* Revert "Use a different polyfill"

This reverts commit b8474c56301faf3180eebf81f697703c31447500.

* Update api

* Patch event-source-polyfill to support Cloudflare

* Patch the min version

* Update api client and remove eventsource polyfill

* Cleanup
2024-02-08 15:53:05 +01:00
Samy Pessé 1c0ea074b3 Update API client and fetch API blocks in new format only (#137) 2024-02-07 18:19:30 +01:00
Samy Pessé 75876474a2 Convert swagger 2.0 to OpenAPI v3 (#128)
* Convert swagger 2.0 to OpenAPI 3

* Format
2024-01-31 15:46:42 +01:00
Samy Pessé 85ec1884e6 OpenAPI blocks (#74)
* Start methods to resolve refs

* bun

* Start package

* Add code to resolve ref

* Continue

* Deref

* Start monorepo

* Continue

* Fix ref resolver

* Style a bit more

* Start toggling section

* Continue

* Start displaying query/path/headers params

* Hide respo se if empty

* Fix recursive refs

* Simplify interactive and styling

* Display enums

* Format

* Improve type name being displayed

* Improve naming

* Render oneOf/anyOf/allOf

* Handle circular references

* Start variable in server url

* Use client component for the spec part

* Improve CSS sizing

* Display open api blocks in aside

* Make aside an overlay

* Improve stickiness of openapi

* Align document on the left when api page

* Improve general layout

* Better align

* Fix padding in aside

* Use syntax highlighting

* Show sample of response

* Improve code generation

* Improve code generated

* Format

* Format

* Rename to OpenAPI

* Skip deprecated properties and handle additionalProperties

* Use discriminator for naming

* Better name enum

* Make entire header toggeable

* Format and lint

* Add curl example

* Improve curl

* style pass

* Start securities

* Bun

* Fix TS

* Improve label

* Start markdown

* Improve code samples

* Test

* Use custom skeleton for api block

* Format

* Add support for redocly code samples

* Fix api blocks in aside

* Use typography for markdown

* Format

* Fix spacing in markdown

* Render headers

* Format

* Format

---------

Co-authored-by: Sebastian Graz <graz@live.se>
2024-01-30 10:15:58 +01:00
Samy Pessé f1f91a6816 Fix opening search results (#118)
* Switch to nuqs

* Navigate post url update

* Fix

* Fix AI search
2024-01-24 17:25:01 +01:00
Samy Pessé eabc46b86e Start using next-themes (#115)
* Start using next-themes

* Fix with nonce

* Lint
2024-01-24 11:39:59 +01:00
Samy Pessé 756b5a766f Setup Sentry for errors (#110)
* First try

* Lint and format

* Use edge runtime

* Use envs for sentry

* Fix type

* Fix upload of sourcemaps

* Try fixing monitoring calls

* Fix gitbook/monitoring in middleware

* test error in middleware

* Define context on sentry data

* Set SENTRY_ENVIRONMENT to preview or production

* Format

* Pass url and userAgent

* Remove test cases

* Disable debug

* Remove ignoreBuildErrors
2024-01-23 14:36:56 +01:00
Samy Pessé 1f7530aaf8 Set a user-agent for the API (#103)
* Pass user-agent and allow configuring it with envs

* Format
2024-01-19 14:55:04 +01:00
Samy Pessé 64a9e27ca7 Resolve revision and change request URL correctly (#98)
* Add tests for getURLLookupAlternatives

* Match correctly revisions and changes URLs

* Use revision and changerequets ID passed from lookup

* Prevent indexing these urls

* Start

* Start rendering toolbar

* Update api client

* Format

* Format

* Mock resolve of snippet

* Add test for revision
2024-01-15 09:42:38 +01:00
Samy Pessé 0668d8a287 Track page view (#42)
* Track page view using a server action

* Track the page view

* Format

* Track it once

* Support no page an pass language

* Update API client
2023-12-29 15:28:49 +01:00
Samy Pessé 6cf73e4962 Support URL path to directly access a space by its ID (even private) (#76)
* Handle URLs /~space/:id

* Validate permissions in multi-id mode
2023-12-27 13:46:35 +01:00
Samy Pessé 7267398d5b Use caching for search/ask and rich content for answers (#68)
* Use caching for search/ask

* Refactor DocumentView to be ready to be used for other stuff

* Start logic to use document

* Fix comment

* Remove log

* Format and typecheck
2023-12-25 22:59:14 +01:00
Samy Pessé bfdf6640c8 Add "Edit on GitHub" in aside (#58)
* Start showing link in the aside

* Show link in aside

* Add icon next to link

* Fix padding
2023-12-24 16:04:25 +01:00
Samy Pessé 6f6dde1aa4 Update tailwind to 3.4 (#63)
* Update tailwind to 3.4.0

* Update tailwind-merge

* Fix responsive for cards in the footer

* Make card responsive

* Lint
2023-12-24 01:26:51 +01:00
Samy Pessé 215c724a9b Use Cloudflare Cache API as one of the cache backend (#59)
* Implement cache for cloudflare

* Start using it

* Fix cache use

* Generate proper URLs

* Comment

* Fix cache always resulting in cache miss

* Log

* Correctly cancel redis

* Write to fallback caches

* Disable memory cache

* Re-enable memory cache

* Try patching

* Use it

* Also patch package.json

* Fix TS errors

* Remove yarn.lock

* Fix local error

* Lint

* Try bunx to fix vercel build

* Update lockfile

* Add back revalidating
2023-12-22 11:05:14 +01:00
Samy Pessé be198045b1 Fallback to using hash of arguments for cache key (#51)
* Fallback to using hash of arguments for cache key

* Dummy commit to trigger build
2023-12-20 09:36:20 +01:00
Samy Pessé 720c2ca909 Setup visual testing (#50)
* Add cloudflare job to publish pages

* Try like this

* Fix build path

* Try end to end

* Fix installation

* Use var instead of secret for CLOUDFLARE_PROJECT_NAME

* Use new puppeteer mode

* Add more tests

* Run in parallel

* Go back to no-concurrency

* Test pagespeed

* Print output

* Fix thresholds
2023-12-19 23:51:06 +01:00
Samy Pessé 4f84011f6b Purge cache when option is passed and revalidate starting by entries with max hits (#49)
* Accept an option to purge without refreshing

* Store hits on the redis cache entry

* Revalidate first the entries with the most hits

* Format

* bun

* Ignore error from JSON.NUMINCRBY
2023-12-19 19:16:36 +01:00
Samy Pessé e903bb7752 Update upstash module to fix typing 2023-12-19 10:11:58 +01:00
Samy Pessé 13b9f6b07f Optimize images using Cloudflare Images (#40)
* Optimize images using Cloudflare Images

* Try skipping middleware

* Make it work with base path

* Fetch image size

* Use a target instead of the cf fetch options

* Fix resizing

* Start optimizing images

* Preload images

* Use it for page cover

* Format and adapt cover

* Fix image resizing serving jpeg

* Lazy load dark mode images

* Timeout at 2s

* Fix iframe CSP

* Implement logic to lazy load images that should be offscreen

* Also lazy load cover images

* Low priority in preloading

* Fix csp
2023-12-17 22:26:07 +01:00
Samy Pessé afcb0ecba6 Load integration scripts and secure the app with CSP (#39)
* Set colorSchema metadata

* Try CSP

* Move colorScheme to generateViewport

* Bun install

* Use wildcard for img-src and connect-src

* Allow all unsafe-inline for now for style

* Remove nonce for style

* Remove nonce for style

* Optimize data fetching with parallel requests

* Try to reuse memory cache between middleware and rendering in CF

* Comment

* Fetch document in parallel of collections

* Cleanup

* Log if redis is enabled for caching

* Fix memory cache before redis one

* Optimize alternatives being tested
2023-12-17 00:25:07 +01:00