This repository has been archived by the owner on Nov 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support route config type (#595)
* feat: support route config type * fix: type * fix: optimize code
- Loading branch information
Showing
16 changed files
with
80 additions
and
54 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
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,4 @@ | ||
// Define process.env in top make it possible to use ICE_CORE_* in @ice/runtime, esbuild define options doesn't have the ability | ||
// The runtime value such as __process.env.ICE_CORE_*__ will be replaced by esbuild define, so the value is real-time | ||
<% coreEnvKeys.forEach((key) => { %> | ||
process.env.<%= key %> = __process.env.<%= key %>__; | ||
<% }) %> | ||
process.env.<%= key %> = __process.env.<%= key %>__;<% }) %> |
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,13 +1,17 @@ | ||
<% if (globalStyle) {-%> | ||
import '<%= globalStyle %>' | ||
<% } -%> | ||
|
||
import type { RouteConfig } from './types'; | ||
<%- framework.imports %> | ||
|
||
<% if (framework.exports) { -%> | ||
type GetConfig = () => RouteConfig; | ||
function defineGetConfig(getConfig: GetConfig): GetConfig { | ||
return getConfig; | ||
} | ||
|
||
export { | ||
<%- framework.exports %> | ||
defineGetConfig, | ||
<% if (framework.exports) { -%><%- framework.exports %><% } -%> | ||
}; | ||
<% } -%> | ||
|
||
export * from './types'; |
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,20 +1,16 @@ | ||
import type { AppConfig as DefaultAppConfig, GetAppData, AppData } from '@ice/runtime'; | ||
import type { AppConfig, GetAppData, RouteConfig as DefaultRouteConfig } from '@ice/runtime'; | ||
<%- routeConfigTypes.imports -%> | ||
|
||
<%- configTypes.imports -%> | ||
|
||
<% if (configTypes.imports) {-%> | ||
interface ExtendsAppConfig extends DefaultAppConfig { | ||
<% if (configTypes.imports) { %> | ||
<%- configTypes.exports %> | ||
<% } %> | ||
}; | ||
export type AppConfig = ExtendsAppConfig; | ||
<% if (routeConfigTypes.imports) {-%> | ||
type ExtendsRouteConfig = <% if (routeConfigTypes.imports) { %><%- routeConfigTypes.exportNames.join(' & ') %><% } %>; | ||
<% } else { -%> | ||
export type AppConfig = DefaultAppConfig; | ||
type ExtendsRouteConfig = {}; | ||
<% } -%> | ||
type RouteConfig = DefaultRouteConfig<ExtendsRouteConfig>; | ||
|
||
export { | ||
export type { | ||
AppConfig, | ||
GetAppData, | ||
AppData | ||
} | ||
RouteConfig, | ||
}; |
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
503546a
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.
Successfully deployed to the following URLs:
ice-v3 – ./
ice-v3-ice-v3.vercel.app
ice-v3.vercel.app
ice-v3-git-release-next-ice-v3.vercel.app