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 7
Feat: define routes and ignore route files #69
Merged
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
6f3427e
feat: support define routes
luhc228 43399de
Merge branch 'release-next' into feat/define-routes
luhc228 6129d18
fix: test
luhc228 b1d185e
fix: test
luhc228 2ed8e69
chore: undefined type
luhc228 0847edb
Merge branch 'release-next' into feat/define-routes
luhc228 6b14c4f
fix: conflict
luhc228 fe2a872
chore: remove pages str from route id
luhc228 808b00a
fix: watch route change
luhc228 7eae648
fix: warn
luhc228 bb155b0
fix: test
luhc228 e5c4da1
fix: test
luhc228 13f5b49
chore: example
luhc228 fd71732
chore: add route-gen example
luhc228 a6fce24
feat: add integration test
luhc228 a303db2
chore: test
luhc228 eff1449
chore: update config file
luhc228 0debd8a
chore: remove pnpm cache
luhc228 61c2e8b
chore: test
luhc228 f451371
chore: remove test:ci from ci workflow
luhc228 5dedac7
chore: update build-scripts version
luhc228 6e11fd0
chore: build fixture
luhc228 2ea451c
chore: remove devServer test
luhc228 4972237
chore: buildFixture
luhc228 8ef7f27
feat: add vitest
luhc228 1979985
chore: add ts-ignore
luhc228 ae4047e
chore: node ci version
luhc228 bc1ea1e
chore: comment bundle analyzer
luhc228 a5bc6be
chore: add test timeout
luhc228 a89cd86
fix: conflict
luhc228 d50e248
fix: lint
luhc228 09d849d
chore: remove threads
luhc228 e3adc08
chore: set maxThreads and minThreads
luhc228 834d107
chore: add maxConcurrency
luhc228 f6efb61
chore: remove coverage
luhc228 3facfd3
chore: threads
luhc228 636536c
chore: set threads to false
luhc228 f7ddd64
fix: conflict
luhc228 1c5bd5f
fix: comment
luhc228 67618a2
fix: conflict
luhc228 cf9fd54
fix: conflict
luhc228 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { defineConfig } from '@ice/app'; | ||
|
||
export default defineConfig({ | ||
routes: { | ||
ignoreFiles: ['about.tsx', 'products.tsx'], | ||
defineRoutes: (route) => { | ||
route('/about-me', 'about.tsx'); | ||
|
||
route('/', 'layout.tsx', () => { | ||
route('/product', 'products.tsx'); | ||
}); | ||
}, | ||
}, | ||
}); |
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,23 @@ | ||
{ | ||
"name": "basic-project", | ||
"version": "1.0.0", | ||
"scripts": { | ||
"start": "ice start", | ||
"build": "ice build" | ||
}, | ||
"description": "", | ||
"author": "", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@ice/app": "file:../../packages/ice", | ||
"@ice/runtime": "^1.0.0", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^17.0.39", | ||
"@types/react-dom": "^17.0.11", | ||
"browserslist": "^4.19.3", | ||
"regenerator-runtime": "^0.13.9" | ||
} | ||
} |
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 { defineAppConfig } from 'ice'; | ||
|
||
export default defineAppConfig({}); |
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,26 @@ | ||
/* eslint-disable react/self-closing-comp */ | ||
import React from 'react'; | ||
import { Meta, Title, Links, Main, Scripts } from 'ice'; | ||
|
||
function Document(props) { | ||
return ( | ||
<html lang="en"> | ||
<head> | ||
<meta charSet="utf-8" /> | ||
<meta name="description" content="ICE 3.0 Demo" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<Meta /> | ||
<Title /> | ||
<Links /> | ||
</head> | ||
<body> | ||
<Main> | ||
{props.children} | ||
</Main> | ||
<Scripts /> | ||
</body> | ||
</html> | ||
); | ||
} | ||
|
||
export default Document; |
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,6 @@ | ||
import * as React from 'react'; | ||
import { Link } from 'ice'; | ||
|
||
export default function About() { | ||
return <><h2>About</h2><Link to="/">home</Link></>; | ||
} |
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,7 @@ | ||
import React from 'react'; | ||
|
||
export default () => { | ||
return ( | ||
<h3>A page</h3> | ||
); | ||
}; |
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,7 @@ | ||
import React from 'react'; | ||
|
||
export default () => { | ||
return ( | ||
<h3>B page</h3> | ||
); | ||
}; |
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,7 @@ | ||
import React from 'react'; | ||
|
||
export default () => { | ||
return ( | ||
<div>Index</div> | ||
); | ||
}; |
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,15 @@ | ||
import * as React from 'react'; | ||
import { Outlet, Link } from 'ice'; | ||
|
||
export default () => { | ||
return ( | ||
<div> | ||
<h2>Dashboard</h2> | ||
<ul> | ||
<li><Link to="/dashboard/a">a</Link></li> | ||
<li><Link to="/dashboard/b">b</Link></li> | ||
</ul> | ||
<Outlet /> | ||
</div> | ||
); | ||
}; |
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,13 @@ | ||
import React from 'react'; | ||
import { useParams, Link } from 'ice'; | ||
|
||
export default function DetailId() { | ||
const params = useParams(); | ||
|
||
return ( | ||
<div> | ||
<h2>Detail id: {params.id}</h2> | ||
<Link to="/detail">Back to Detail</Link> | ||
</div> | ||
); | ||
} |
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,14 @@ | ||
import React from 'react'; | ||
import { Link } from 'ice'; | ||
|
||
export default function Detail() { | ||
return ( | ||
<div> | ||
<h2>Detail</h2> | ||
<ul> | ||
<li><Link to="/detail/join">join</Link></li> | ||
<li><Link to="/detail/dashboard">dashboard</Link></li> | ||
</ul> | ||
</div> | ||
); | ||
} |
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,15 @@ | ||
import * as React from 'react'; | ||
import { Link } from 'ice'; | ||
|
||
export default function Home() { | ||
return ( | ||
<> | ||
<h2>Home</h2> | ||
<ul> | ||
<li><Link to="/about-me">about</Link></li> | ||
<li><Link to="/detail">detail</Link></li> | ||
<li><Link to="/dashboard">dashboard</Link></li> | ||
</ul> | ||
</> | ||
); | ||
} |
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,11 @@ | ||
import * as React from 'react'; | ||
import { Outlet } from 'ice'; | ||
|
||
export default () => { | ||
return ( | ||
<div> | ||
<h1>Layout</h1> | ||
<Outlet /> | ||
</div> | ||
); | ||
}; |
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,6 @@ | ||
import * as React from 'react'; | ||
import { Link } from 'ice'; | ||
|
||
export default function Products() { | ||
return <><h2>Products Page</h2><Link to="/">home</Link></>; | ||
} |
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,32 @@ | ||
{ | ||
"compileOnSave": false, | ||
"buildOnSave": false, | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"outDir": "build", | ||
"module": "esnext", | ||
"target": "es6", | ||
"jsx": "react", | ||
"moduleResolution": "node", | ||
"allowSyntheticDefaultImports": true, | ||
"lib": ["es6", "dom"], | ||
"sourceMap": true, | ||
"allowJs": true, | ||
"rootDir": "./", | ||
"forceConsistentCasingInFileNames": true, | ||
"noImplicitReturns": true, | ||
"noImplicitThis": true, | ||
"noImplicitAny": false, | ||
"importHelpers": true, | ||
"strictNullChecks": true, | ||
"suppressImplicitAnyIndexErrors": true, | ||
"noUnusedLocals": true, | ||
"skipLibCheck": true, | ||
"paths": { | ||
"@/*": ["./src/*"], | ||
"ice": [".ice"] | ||
} | ||
}, | ||
"include": ["src", ".ice", "ice.config.*"], | ||
"exclude": ["node_modules", "build", "public"] | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
routes 不存在的情况
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.
fixed