Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add option for app-with-router #13

Merged
merged 4 commits into from
Mar 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app-with-router/src/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>This is the page about the app.</h1>
8 changes: 8 additions & 0 deletions app-with-router/src/missing.ext
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export class Missing {
/* @if typescript */public /* @endif */static parameters = ['id'];
/* @if typescript */public /* @endif */missingComponent/* @if typescript */: string /* @endif */;

/* @if typescript */public /* @endif */enter(parameters) {
this.missingComponent = parameters.id;
}
}
1 change: 1 addition & 0 deletions app-with-router/src/missing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h3>Ouch! Couldn't find '${missingComponent}'!</h3>
17 changes: 17 additions & 0 deletions app-with-router/src/my-app.css__if_css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
nav {
background: #eee;
display: flex;
}

a {
padding: 10px;
text-decoration: none;
color: black;
}
a:hover {
background-color: darkgray;
}

.goto-active {
background-color: lightgray;
}
10 changes: 10 additions & 0 deletions app-with-router/src/my-app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<import from="./welcome"></import>
<import from="./about.html"></import>


<nav>
<a goto="welcome">Welcome</a>
<a goto="about">About</a>
</nav>

<au-viewport default="welcome" fallback="missing"></au-viewport>
18 changes: 18 additions & 0 deletions app-with-router/src/my-app.less__if_less
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
nav {
background: #eee;
display: flex;
}

a {
padding: 10px;
text-decoration: none;
color: black;

&:hover {
background-color: darkgray;
}
}

.goto-active {
background-color: lightgray;
}
19 changes: 19 additions & 0 deletions app-with-router/src/my-app.scss__if_sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
nav {
background: #eee;
display: flex;
}

a {
padding: 10px;
text-decoration: none;
color: black;

&:hover {
background-color: darkgray;
}

}

.goto-active {
background-color: lightgray;
}
3 changes: 3 additions & 0 deletions app-with-router/src/welcome.ext
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export class Welcome {
/* @if typescript */public /* @endif */message = 'Welcome to the Aurelia 2 app with routing!';
}
1 change: 1 addition & 0 deletions app-with-router/src/welcome.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>${message}</h1>
5 changes: 4 additions & 1 deletion app-min/src/main.ext → common/src/main.ext
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Promise polyfill for old browsers
import 'promise-polyfill/lib/polyfill';
// @endif
import Aurelia/* @if shadow-dom *//*, { StyleConfiguration }*//* @endif */ from 'aurelia';
import Aurelia/* @if shadow-dom || app-with-router */, { /* @endif *//* @if app-with-router */RouterConfiguration/* @endif *//* @if shadow-dom *//*, StyleConfiguration*//* @endif *//* @if shadow-dom || app-with-router */ }/* @endif */ from 'aurelia';
import { MyApp } from './my-app';
// @if shadow-dom
// @if webpack
Expand All @@ -22,5 +22,8 @@ Aurelia
}))
*/
// @endif
// @if app-with-router
.register(RouterConfiguration)
// @endif
.app(MyApp)
.start();
File renamed without changes.
5 changes: 2 additions & 3 deletions questions.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ module.exports = [
{value: 'cypress', title: 'Yes (Cypress)', hint: 'Cypress offers fast, easy and reliable testing for anything that runs in a browser.'}
]
},
// This question is not raised to end user, since there is only one choice, it will be selected automatically.
// We will add more sample code in future.
{
message: 'What kind of sample code do you want in this project?',
choices: [
{value: 'app-min', title: 'Bare minimum'}
{value: 'app-min', title: 'Bare minimum'},
{value: 'app-with-router', title: 'App With Router', hint: 'Application with navigation setup using conventional routing'}
]
},
// Currently this question is not visible to end user because there is only one option.
Expand Down