File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -193,6 +193,23 @@ test.each([
193193 )
194194} )
195195
196+ test . each ( [
197+ [
198+ 'https://docs.expo.dev/get-started/start-developing/' ,
199+ 'https://docs.expo.dev/get-started/start-developing.md' ,
200+ ] ,
201+ [
202+ 'https://expo.dev/blog/expo-go-vs-development-builds' ,
203+ 'https://expo.dev/blog/expo-go-vs-development-builds.md' ,
204+ ] ,
205+ [
206+ 'https://expo.dev/blog/expo-go-vs-development-builds/' ,
207+ 'https://expo.dev/blog/expo-go-vs-development-builds.md' ,
208+ ] ,
209+ ] as const ) ( 'expo rewrites %s to markdown URL' , ( url , expected ) => {
210+ expect ( rewrite ( rules . expo , url ) ?. href ) . toBe ( expected )
211+ } )
212+
196213test ( 'conductor matches canonical and redirecting docs urls' , ( ) => {
197214 expect ( patternsMatch ( rules . conductor ( ) , 'https://conductor.build/docs' ) ) . toBe ( true )
198215 expect ( patternsMatch ( rules . conductor ( ) , 'https://www.conductor.build/docs/installation' ) ) . toBe (
Original file line number Diff line number Diff line change @@ -75,6 +75,35 @@ export const drizzle = rawRepoWithIndex({
7575 ] ,
7676 checks : [ { url : 'https://orm.drizzle.team/docs/overview' , contains : [ 'Drizzle ORM' ] } ] ,
7777} )
78+ export const expo = defineRule ( {
79+ key : 'expo' ,
80+ patterns : [
81+ new URLPattern ( { hostname : 'docs.expo.dev' } ) ,
82+ new URLPattern ( { hostname : 'expo.dev' , pathname : '/blog/:slug' } ) ,
83+ new URLPattern ( { hostname : 'expo.dev' , pathname : '/blog/:slug/' } ) ,
84+ ] ,
85+ checks : [
86+ {
87+ url : 'https://docs.expo.dev/get-started/start-developing/' ,
88+ contains : [ 'Make your first change to an Expo project and see it live on your device.' ] ,
89+ } ,
90+ {
91+ url : 'https://expo.dev/blog/expo-go-vs-development-builds' ,
92+ contains : [
93+ 'Development builds and Expo Go are both tools for developing React Native apps' ,
94+ '## What exactly is Expo Go?' ,
95+ ] ,
96+ minLength : 500 ,
97+ title : 'Expo Go vs Development Builds' ,
98+ } ,
99+ ] ,
100+ rewrite ( url ) {
101+ if ( / \. m d x ? $ / i. test ( url . pathname ) ) return
102+ const mdUrl = new URL ( url . href )
103+ mdUrl . pathname = url . pathname === '/' ? '/index.md' : `${ url . pathname . replace ( / \/ $ / , '' ) } .md`
104+ return mdUrl
105+ } ,
106+ } )
78107export const openai = appendMd ( {
79108 key : 'openai' ,
80109 patterns : [ new URLPattern ( { hostname : 'developers.openai.com' } ) ] ,
You can’t perform that action at this time.
0 commit comments