generated from EasyWebApp/WebCell-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[add] IdeaMall & EasyWebApp OSS based on GitHub API proxy (#50)
- Loading branch information
Showing
20 changed files
with
1,149 additions
and
892 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
#!/bin/sh | ||
|
||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm test |
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 |
---|---|---|
@@ -1,5 +1 @@ | ||
#!/bin/sh | ||
|
||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run build |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module.exports = { | ||
presets: [ | ||
// https://babeljs.io/docs/babel-preset-typescript | ||
[ | ||
'@babel/preset-typescript', | ||
{ | ||
allowDeclareFields: true, | ||
allowNamespaces: true, | ||
allExtensions: true, | ||
isTSX: true, | ||
}, | ||
], | ||
// https://babeljs.io/docs/babel-preset-react | ||
[ | ||
'@babel/preset-react', | ||
{ | ||
runtime: 'automatic', | ||
development: process.env.BABEL_ENV === 'development', | ||
}, | ||
], | ||
], | ||
// https://babeljs.io/docs/babel-plugin-proposal-decorators#note-compatibility-with-babelplugin-transform-class-properties | ||
plugins: [['@babel/plugin-proposal-decorators', { version: '2023-05' }]], | ||
}; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { proxyGithub } from './core'; | ||
|
||
export default proxyGithub(); |
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,21 @@ | ||
import { githubClient } from '../../../models/Base'; | ||
import { safeAPI } from '../core'; | ||
|
||
export const proxyGithub = <T>(dataFilter?: (path: string, data: T) => T) => | ||
safeAPI(async ({ method, url, headers, body }, response) => { | ||
delete headers.host; | ||
|
||
const path = url!.slice(`/api/GitHub/`.length); | ||
|
||
const { status, body: data } = await githubClient.request<T>({ | ||
// @ts-ignore | ||
method, | ||
path, | ||
// @ts-ignore | ||
headers, | ||
body: body || undefined, | ||
}); | ||
|
||
response.status(status); | ||
response.send(dataFilter?.(path, data as T) || data); | ||
}); |
Oops, something went wrong.
34a68d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for idea2app ready!
✅ Preview
https://idea2app-55s6jd9tp-techquery.vercel.app
Built with commit 34a68d5.
This pull request is being automatically deployed with vercel-action