-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 95a8019
Showing
131 changed files
with
4,729 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.DS_Store | ||
node_modules | ||
|
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,33 @@ | ||
# `aurelia-app` | ||
|
||
This project is bootstrapped by [aurelia-cli](https://github.com/aurelia/cli). | ||
|
||
For more information, go to https://aurelia.io/docs/cli/webpack | ||
|
||
## Run dev app | ||
|
||
Run `npm start`, then open `http://localhost:8080` | ||
|
||
You can change the standard webpack configurations from CLI easily with something like this: `npm start -- --open --port 8888`. However, it is better to change the respective npm scripts or `webpack.config.js` with these options, as per your need. | ||
|
||
To enable Webpack Bundle Analyzer, do `npm run analyze` (production build). | ||
|
||
To enable hot module reload, do `npm start -- --hmr`. | ||
|
||
To change dev server port, do `npm start -- --port 8888`. | ||
|
||
To change dev server host, do `npm start -- --host 127.0.0.1` | ||
|
||
**PS:** You could mix all the flags as well, `npm start -- --host 127.0.0.1 --port 7070 --open --hmr` | ||
|
||
For long time aurelia-cli user, you can still use `au run` with those arguments like `au run --env prod --open --hmr`. But `au run` now simply executes `npm start` command. | ||
|
||
## Build for production | ||
|
||
Run `npm run build`, or the old way `au build --env prod`. | ||
|
||
## Unit tests | ||
|
||
Run `au test` (or `au jest`). | ||
|
||
To run in watch mode, `au test --watch` or `au jest --watch`. |
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 @@ | ||
|
||
# Errors | ||
|
||
### All | ||
- Don't allow duplicate messages. | ||
- Fix the background so it works on mobile. | ||
|
||
### Aurelia | ||
- clean up the hamburger menu | ||
- After getting new game, display message in New Game Controls for a few seconds so controls are not available. | ||
- click on signboard message to freeze it?, option to delete it? | ||
- add easy method to contest a word | ||
|
||
|
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,30 @@ | ||
{ | ||
"name": "aurelia-app", | ||
"type": "project:application", | ||
"paths": { | ||
"root": "src", | ||
"resources": "resources", | ||
"elements": "resources/elements", | ||
"attributes": "resources/attributes", | ||
"valueConverters": "resources/value-converters", | ||
"bindingBehaviors": "resources/binding-behaviors" | ||
}, | ||
"transpiler": { | ||
"id": "typescript", | ||
"fileExtension": ".ts" | ||
}, | ||
"build": { | ||
"options": { | ||
"server": "dev", | ||
"extractCss": "prod", | ||
"coverage": false | ||
} | ||
}, | ||
"platform": { | ||
"hmr": false, | ||
"open": false, | ||
"port": 8080, | ||
"host": "localhost", | ||
"output": "dist" | ||
} | ||
} |
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,4 @@ | ||
{ | ||
"name": "attribute", | ||
"description": "Creates a custom attribute class and places it in the project resources." | ||
} |
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,38 @@ | ||
import {inject} from 'aurelia-dependency-injection'; | ||
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; | ||
|
||
@inject(Project, CLIOptions, UI) | ||
export default class AttributeGenerator { | ||
constructor(private project: Project, private options: CLIOptions, private ui: UI) { } | ||
|
||
async execute() { | ||
const name = await this.ui.ensureAnswer( | ||
this.options.args[0], | ||
'What would you like to call the custom attribute?' | ||
); | ||
|
||
let fileName = this.project.makeFileName(name); | ||
let className = this.project.makeClassName(name); | ||
|
||
this.project.attributes.add( | ||
ProjectItem.text(`${fileName}.ts`, this.generateSource(className)) | ||
); | ||
|
||
await this.project.commitChanges(); | ||
await this.ui.log(`Created ${fileName}.`); | ||
} | ||
|
||
generateSource(className) { | ||
return `import {autoinject} from 'aurelia-framework'; | ||
@autoinject() | ||
export class ${className}CustomAttribute { | ||
constructor(private element: Element) { } | ||
valueChanged(newValue, oldValue) { | ||
// | ||
} | ||
} | ||
`; | ||
} | ||
} |
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,4 @@ | ||
{ | ||
"name": "binding-behavior", | ||
"description": "Creates a binding behavior class and places it in the project resources." | ||
} |
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,37 @@ | ||
import {inject} from 'aurelia-dependency-injection'; | ||
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; | ||
|
||
@inject(Project, CLIOptions, UI) | ||
export default class BindingBehaviorGenerator { | ||
constructor(private project: Project, private options: CLIOptions, private ui: UI) { } | ||
|
||
async execute() { | ||
const name = await this.ui.ensureAnswer( | ||
this.options.args[0], | ||
'What would you like to call the binding behavior?' | ||
); | ||
|
||
let fileName = this.project.makeFileName(name); | ||
let className = this.project.makeClassName(name); | ||
|
||
this.project.bindingBehaviors.add( | ||
ProjectItem.text(`${fileName}.ts`, this.generateSource(className)) | ||
); | ||
|
||
await this.project.commitChanges(); | ||
await this.ui.log(`Created ${fileName}.`); | ||
} | ||
|
||
generateSource(className) { | ||
return `export class ${className}BindingBehavior { | ||
bind(binding, source) { | ||
// | ||
} | ||
unbind(binding, source) { | ||
// | ||
} | ||
} | ||
` | ||
} | ||
} |
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,4 @@ | ||
{ | ||
"name": "component", | ||
"description": "Creates a custom component class and template (view model and view), placing them in the project source folder (or optionally in sub folders)." | ||
} |
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,49 @@ | ||
import { inject } from 'aurelia-dependency-injection'; | ||
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli'; | ||
import * as path from 'path'; | ||
|
||
@inject(Project, CLIOptions, UI) | ||
export default class ElementGenerator { | ||
constructor(private project: Project, private options: CLIOptions, private ui: UI) { } | ||
|
||
async execute() { | ||
const name = await this.ui.ensureAnswer( | ||
this.options.args[0], | ||
'What would you like to call the component?' | ||
); | ||
|
||
const subFolders = await this.ui.ensureAnswer( | ||
this.options.args[1], | ||
'What sub-folder would you like to add it to?\nIf it doesn\'t exist it will be created for you.\n\nDefault folder is "." relative to the source folder src/', "." | ||
); | ||
|
||
let fileName = this.project.makeFileName(name); | ||
let className = this.project.makeClassName(name); | ||
|
||
this.project.root.add( | ||
ProjectItem.text(path.join(subFolders, fileName + '.ts'), this.generateJSSource(className)), | ||
ProjectItem.text(path.join(subFolders, fileName + '.html'), this.generateHTMLSource(className)) | ||
); | ||
|
||
await this.project.commitChanges(); | ||
await this.ui.log(`Created ${name} in the '${path.join(this.project.root.name, subFolders)}' folder`); | ||
} | ||
|
||
generateJSSource(className) { | ||
return `export class ${className} { | ||
message: string; | ||
constructor() { | ||
this.message = 'Hello world'; | ||
} | ||
} | ||
` | ||
} | ||
|
||
generateHTMLSource(className) { | ||
return `<template> | ||
<h1>\${message}</h1> | ||
</template> | ||
` | ||
} | ||
} |
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,4 @@ | ||
{ | ||
"name": "element", | ||
"description": "Creates a custom element class and template, placing them in the project resources." | ||
} |
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,45 @@ | ||
import {inject} from 'aurelia-dependency-injection'; | ||
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; | ||
|
||
@inject(Project, CLIOptions, UI) | ||
export default class ElementGenerator { | ||
constructor(private project: Project, private options: CLIOptions, private ui: UI) { } | ||
|
||
async execute() { | ||
const name = await this.ui.ensureAnswer( | ||
this.options.args[0], | ||
'What would you like to call the custom element?' | ||
); | ||
|
||
let fileName = this.project.makeFileName(name); | ||
let className = this.project.makeClassName(name); | ||
|
||
this.project.elements.add( | ||
ProjectItem.text(`${fileName}.ts`, this.generateJSSource(className)), | ||
ProjectItem.text(`${fileName}.html`, this.generateHTMLSource(className)) | ||
); | ||
|
||
await this.project.commitChanges(); | ||
await this.ui.log(`Created ${fileName}.`); | ||
} | ||
|
||
generateJSSource(className) { | ||
return `import {bindable} from 'aurelia-framework'; | ||
export class ${className} { | ||
@bindable value; | ||
valueChanged(newValue, oldValue) { | ||
// | ||
} | ||
} | ||
`; | ||
} | ||
|
||
generateHTMLSource(className) { | ||
return `<template> | ||
<h1>\${value}</h1> | ||
</template> | ||
`; | ||
} | ||
} |
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,4 @@ | ||
{ | ||
"name": "generator", | ||
"description": "Creates a generator class and places it in the project generators folder." | ||
} |
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,68 @@ | ||
import {inject} from 'aurelia-dependency-injection'; | ||
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; | ||
|
||
@inject(Project, CLIOptions, UI) | ||
export default class GeneratorGenerator { | ||
constructor(private project: Project, private options: CLIOptions, private ui: UI) { } | ||
|
||
async execute() { | ||
const name = await this.ui.ensureAnswer( | ||
this.options.args[0], | ||
'What would you like to call the generator?' | ||
); | ||
|
||
let fileName = this.project.makeFileName(name); | ||
let className = this.project.makeClassName(name); | ||
|
||
this.project.generators.add( | ||
ProjectItem.text(`${fileName}.ts`, this.generateSource(className)) | ||
); | ||
|
||
await this.project.commitChanges() | ||
await this.ui.log(`Created ${fileName}.`); | ||
} | ||
|
||
generateSource(className) { | ||
return `import {inject} from 'aurelia-dependency-injection'; | ||
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; | ||
@inject(Project, CLIOptions, UI) | ||
export default class ${className}Generator { | ||
constructor(project, options, ui) { | ||
this.project = project; | ||
this.options = options; | ||
this.ui = ui; | ||
} | ||
execute() { | ||
return this.ui | ||
.ensureAnswer(this.options.args[0], 'What would you like to call the new item?') | ||
.then(name => { | ||
let fileName = this.project.makeFileName(name); | ||
let className = this.project.makeClassName(name); | ||
this.project.elements.add( | ||
ProjectItem.text(\`\${fileName}.ts\`, this.generateSource(className)) | ||
); | ||
return this.project.commitChanges() | ||
.then(() => this.ui.log(\`Created \${fileName}.\`)); | ||
}); | ||
} | ||
generateSource(className) { | ||
return \`import {bindable} from 'aurelia-framework'; | ||
export class \${className} { | ||
@bindable value; | ||
valueChanged(newValue, oldValue) { | ||
// | ||
} | ||
} | ||
\` | ||
} | ||
} | ||
`; | ||
} | ||
} |
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,4 @@ | ||
{ | ||
"name": "task", | ||
"description": "Creates a task and places it in the project tasks folder." | ||
} |
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,36 @@ | ||
import {inject} from 'aurelia-dependency-injection'; | ||
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; | ||
|
||
@inject(Project, CLIOptions, UI) | ||
export default class TaskGenerator { | ||
constructor(private project: Project, private options: CLIOptions, private ui: UI) { } | ||
|
||
async execute() { | ||
const name = await this.ui.ensureAnswer( | ||
this.options.args[0], | ||
'What would you like to call the task?' | ||
); | ||
|
||
let fileName = this.project.makeFileName(name); | ||
let functionName = this.project.makeFunctionName(name); | ||
|
||
this.project.tasks.add( | ||
ProjectItem.text(`${fileName}.ts`, this.generateSource(functionName)) | ||
); | ||
|
||
await this.project.commitChanges(); | ||
await this.ui.log(`Created ${fileName}.`); | ||
} | ||
|
||
generateSource(functionName) { | ||
return `import * as gulp from 'gulp'; | ||
import * as project from '../aurelia.json'; | ||
export default function ${functionName}() { | ||
return gulp.src(project.paths.???) | ||
.pipe(gulp.dest(project.paths.output)); | ||
} | ||
`; | ||
|
||
} | ||
} |
Oops, something went wrong.