-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #207 from CloudCannon/feat/astro-5
Add support for Astro 5
- Loading branch information
Showing
14 changed files
with
306 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
javascript-modules/engines/astro-engine/lib/modules/actions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
export const actions = new Proxy({}, { | ||
get() { | ||
console.warn("[Bookshop] actions is not supported in Bookshop. Please use an editing fallback instead."); | ||
return () => {}; | ||
} | ||
}); | ||
|
||
export const defineAction = () => { | ||
console.warn("[Bookshop] defineAction is not supported in Bookshop. Please use an editing fallback instead."); | ||
return { | ||
handler: () => {}, | ||
input: null | ||
}; | ||
}; | ||
|
||
export const isInputError = (error) => { | ||
console.warn("[Bookshop] isInputError is not supported in Bookshop. Please use an editing fallback instead."); | ||
return false; | ||
}; | ||
|
||
export const isActionError = (error) => { | ||
console.warn("[Bookshop] isActionError is not supported in Bookshop. Please use an editing fallback instead."); | ||
return false; | ||
}; | ||
|
||
export class ActionError extends Error { | ||
constructor(code, message) { | ||
super(message); | ||
console.warn("[Bookshop] ActionError is not supported in Bookshop. Please use an editing fallback instead."); | ||
this.code = code; | ||
} | ||
} | ||
|
||
export const getActionContext = (context) => { | ||
console.warn("[Bookshop] getActionContext is not supported in Bookshop. Please use an editing fallback instead."); | ||
return { | ||
action: undefined, | ||
setActionResult: () => {}, | ||
serializeActionResult: () => ({}) | ||
}; | ||
}; | ||
|
||
export const deserializeActionResult = (result) => { | ||
console.warn("[Bookshop] deserializeActionResult is not supported in Bookshop. Please use an editing fallback instead."); | ||
return {}; | ||
}; | ||
|
||
export const getActionPath = (action) => { | ||
console.warn("[Bookshop] getActionPath is not supported in Bookshop. Please use an editing fallback instead."); | ||
return ''; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
javascript-modules/engines/astro-engine/lib/modules/client-router.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
console.warn("[Bookshop] view transitions are not supported in Bookshop. Please use an editing fallback instead."); | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
javascript-modules/engines/astro-engine/lib/modules/i18n.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
export const getRelativeLocaleUrl = (locale, path, options) => { | ||
console.warn("[Bookshop] i18n routing is not supported in Bookshop. Please use an editing fallback instead."); | ||
return ''; | ||
}; | ||
|
||
export const getAbsoluteLocaleUrl = (locale, path, options) => { | ||
console.warn("[Bookshop] i18n routing is not supported in Bookshop. Please use an editing fallback instead."); | ||
return ''; | ||
}; | ||
|
||
export const getRelativeLocaleUrlList = (path, options) => { | ||
console.warn("[Bookshop] i18n routing is not supported in Bookshop. Please use an editing fallback instead."); | ||
return []; | ||
}; | ||
|
||
export const getAbsoluteLocaleUrlList = (path, options) => { | ||
console.warn("[Bookshop] i18n routing is not supported in Bookshop. Please use an editing fallback instead."); | ||
return []; | ||
}; | ||
|
||
export const getPathByLocale = (locale) => { | ||
console.warn("[Bookshop] i18n routing is not supported in Bookshop. Please use an editing fallback instead."); | ||
return ''; | ||
}; | ||
|
||
export const getLocaleByPath = (path) => { | ||
console.warn("[Bookshop] i18n routing is not supported in Bookshop. Please use an editing fallback instead."); | ||
return ''; | ||
}; | ||
|
||
export const redirectToDefaultLocale = (context, statusCode) => { | ||
console.warn("[Bookshop] i18n routing is not supported in Bookshop. Please use an editing fallback instead."); | ||
return Promise.resolve(new Response()); | ||
}; | ||
|
||
export const redirectToFallback = (context, response) => { | ||
console.warn("[Bookshop] i18n routing is not supported in Bookshop. Please use an editing fallback instead."); | ||
return Promise.resolve(new Response()); | ||
}; | ||
|
||
export const notFound = (context, response) => { | ||
console.warn("[Bookshop] i18n routing is not supported in Bookshop. Please use an editing fallback instead."); | ||
return Promise.resolve(new Response()); | ||
}; | ||
|
||
export const middleware = (options) => { | ||
console.warn("[Bookshop] i18n routing is not supported in Bookshop. Please use an editing fallback instead."); | ||
return () => {}; | ||
}; | ||
|
||
export const requestHasLocale = (context) => { | ||
console.warn("[Bookshop] i18n routing is not supported in Bookshop. Please use an editing fallback instead."); | ||
return false; | ||
}; |
19 changes: 19 additions & 0 deletions
19
javascript-modules/engines/astro-engine/lib/modules/middleware.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export const sequence = (...handlers) => { | ||
console.warn("[Bookshop] middleware is not supported in Bookshop. Please use an editing fallback instead."); | ||
return () => {}; | ||
}; | ||
|
||
export const defineMiddleware = (fn) => { | ||
console.warn("[Bookshop] middleware is not supported in Bookshop. Please use an editing fallback instead."); | ||
return () => {}; | ||
}; | ||
|
||
export const createContext = (context) => { | ||
console.warn("[Bookshop] middleware is not supported in Bookshop. Please use an editing fallback instead."); | ||
return {}; | ||
}; | ||
|
||
export const trySerializeLocals = (value) => { | ||
console.warn("[Bookshop] middleware is not supported in Bookshop. Please use an editing fallback instead."); | ||
return ''; | ||
}; |
Oops, something went wrong.