removed files
attempting commit with fewer files; these are the ones removed
This commit is contained in:
parent
03fd1d0a18
commit
632f06ac5f
@ -1,166 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "my-prayer-journal",
|
|
||||||
"type": "project:application",
|
|
||||||
"platform": {
|
|
||||||
"id": "web",
|
|
||||||
"displayName": "Web",
|
|
||||||
"output": "scripts",
|
|
||||||
"index": "index.html",
|
|
||||||
"baseDir": "."
|
|
||||||
},
|
|
||||||
"transpiler": {
|
|
||||||
"id": "typescript",
|
|
||||||
"displayName": "TypeScript",
|
|
||||||
"fileExtension": ".ts",
|
|
||||||
"dtsSource": [
|
|
||||||
"./custom_typings/**/*.d.ts"
|
|
||||||
],
|
|
||||||
"source": "src/**/*.ts"
|
|
||||||
},
|
|
||||||
"markupProcessor": {
|
|
||||||
"id": "minimum",
|
|
||||||
"displayName": "Minimal Minification",
|
|
||||||
"fileExtension": ".html",
|
|
||||||
"source": "src/**/*.html"
|
|
||||||
},
|
|
||||||
"cssProcessor": {
|
|
||||||
"id": "none",
|
|
||||||
"displayName": "None",
|
|
||||||
"fileExtension": ".css",
|
|
||||||
"source": "src/**/*.css"
|
|
||||||
},
|
|
||||||
"editor": {
|
|
||||||
"id": "vscode",
|
|
||||||
"displayName": "Visual Studio Code"
|
|
||||||
},
|
|
||||||
"unitTestRunner": {
|
|
||||||
"id": "karma",
|
|
||||||
"displayName": "Karma",
|
|
||||||
"source": "test/unit/**/*.ts"
|
|
||||||
},
|
|
||||||
"paths": {
|
|
||||||
"root": "src",
|
|
||||||
"resources": "resources",
|
|
||||||
"elements": "resources/elements",
|
|
||||||
"attributes": "resources/attributes",
|
|
||||||
"valueConverters": "resources/value-converters",
|
|
||||||
"bindingBehaviors": "resources/binding-behaviors"
|
|
||||||
},
|
|
||||||
"testFramework": {
|
|
||||||
"id": "jasmine",
|
|
||||||
"displayName": "Jasmine"
|
|
||||||
},
|
|
||||||
"build": {
|
|
||||||
"targets": [
|
|
||||||
{
|
|
||||||
"id": "web",
|
|
||||||
"displayName": "Web",
|
|
||||||
"output": "scripts",
|
|
||||||
"index": "index.html",
|
|
||||||
"baseDir": "."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"loader": {
|
|
||||||
"type": "require",
|
|
||||||
"configTarget": "vendor-bundle.js",
|
|
||||||
"includeBundleMetadataInConfig": "auto",
|
|
||||||
"plugins": [
|
|
||||||
{
|
|
||||||
"name": "text",
|
|
||||||
"extensions": [
|
|
||||||
".html",
|
|
||||||
".css"
|
|
||||||
],
|
|
||||||
"stub": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"minify": "stage & prod",
|
|
||||||
"sourcemaps": "dev & stage"
|
|
||||||
},
|
|
||||||
"bundles": [
|
|
||||||
{
|
|
||||||
"name": "app-bundle.js",
|
|
||||||
"source": [
|
|
||||||
"[**/*.js]",
|
|
||||||
"**/*.{css,html}"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "vendor-bundle.js",
|
|
||||||
"prepend": [
|
|
||||||
"node_modules/bluebird/js/browser/bluebird.core.js",
|
|
||||||
"node_modules/aurelia-cli/lib/resources/scripts/configure-bluebird.js",
|
|
||||||
"node_modules/requirejs/require.js"
|
|
||||||
],
|
|
||||||
"dependencies": [
|
|
||||||
"aurelia-binding",
|
|
||||||
"aurelia-bootstrapper",
|
|
||||||
"aurelia-dependency-injection",
|
|
||||||
"aurelia-event-aggregator",
|
|
||||||
"aurelia-framework",
|
|
||||||
"aurelia-fetch-client",
|
|
||||||
"aurelia-history",
|
|
||||||
"aurelia-history-browser",
|
|
||||||
"aurelia-loader",
|
|
||||||
"aurelia-loader-default",
|
|
||||||
"aurelia-logging",
|
|
||||||
"aurelia-logging-console",
|
|
||||||
"aurelia-metadata",
|
|
||||||
"aurelia-pal",
|
|
||||||
"aurelia-pal-browser",
|
|
||||||
"aurelia-path",
|
|
||||||
"aurelia-polyfills",
|
|
||||||
"aurelia-route-recognizer",
|
|
||||||
"aurelia-router",
|
|
||||||
"aurelia-task-queue",
|
|
||||||
"aurelia-templating",
|
|
||||||
"aurelia-templating-binding",
|
|
||||||
"text",
|
|
||||||
{
|
|
||||||
"name": "aurelia-templating-resources",
|
|
||||||
"path": "../node_modules/aurelia-templating-resources/dist/amd",
|
|
||||||
"main": "aurelia-templating-resources"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "aurelia-templating-router",
|
|
||||||
"path": "../node_modules/aurelia-templating-router/dist/amd",
|
|
||||||
"main": "aurelia-templating-router"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "aurelia-testing",
|
|
||||||
"path": "../node_modules/aurelia-testing/dist/amd",
|
|
||||||
"main": "aurelia-testing",
|
|
||||||
"env": "dev"
|
|
||||||
},
|
|
||||||
"jquery",
|
|
||||||
{
|
|
||||||
"name": "bootstrap",
|
|
||||||
"path": "../node_modules/bootstrap/dist",
|
|
||||||
"main": "js/bootstrap.min",
|
|
||||||
"deps": ["jquery"],
|
|
||||||
"exports": "$",
|
|
||||||
"resources": [
|
|
||||||
"css/bootstrap.css"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "nprogress",
|
|
||||||
"path": "../node_modules/nprogress",
|
|
||||||
"main": "nprogress",
|
|
||||||
"resources": [
|
|
||||||
"nprogress.css"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "auth0-lock",
|
|
||||||
"path": "lib",
|
|
||||||
"main": "lock.min",
|
|
||||||
"exports": "Auth0Lock"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
export default {
|
|
||||||
debug: true,
|
|
||||||
testing: true
|
|
||||||
};
|
|
@ -1,4 +0,0 @@
|
|||||||
export default {
|
|
||||||
debug: false,
|
|
||||||
testing: false
|
|
||||||
};
|
|
@ -1,4 +0,0 @@
|
|||||||
export default {
|
|
||||||
debug: true,
|
|
||||||
testing: false
|
|
||||||
};
|
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "attribute",
|
|
||||||
"description": "Creates a custom attribute class and places it in the project resources."
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
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) { }
|
|
||||||
|
|
||||||
execute() {
|
|
||||||
return this.ui
|
|
||||||
.ensureAnswer(this.options.args[0], 'What would you like to call the custom attribute?')
|
|
||||||
.then(name => {
|
|
||||||
let fileName = this.project.makeFileName(name);
|
|
||||||
let className = this.project.makeClassName(name);
|
|
||||||
|
|
||||||
this.project.attributes.add(
|
|
||||||
ProjectItem.text(`${fileName}.ts`, this.generateSource(className))
|
|
||||||
);
|
|
||||||
|
|
||||||
return this.project.commitChanges()
|
|
||||||
.then(() => 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) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
`
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "binding-behavior",
|
|
||||||
"description": "Creates a binding behavior class and places it in the project resources."
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
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) { }
|
|
||||||
|
|
||||||
execute() {
|
|
||||||
return this.ui
|
|
||||||
.ensureAnswer(this.options.args[0], 'What would you like to call the binding behavior?')
|
|
||||||
.then(name => {
|
|
||||||
let fileName = this.project.makeFileName(name);
|
|
||||||
let className = this.project.makeClassName(name);
|
|
||||||
|
|
||||||
this.project.bindingBehaviors.add(
|
|
||||||
ProjectItem.text(`${fileName}.ts`, this.generateSource(className))
|
|
||||||
);
|
|
||||||
|
|
||||||
return this.project.commitChanges()
|
|
||||||
.then(() => this.ui.log(`Created ${fileName}.`));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
generateSource(className) {
|
|
||||||
return `export class ${className}BindingBehavior {
|
|
||||||
bind(binding, source) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
unbind(binding, source) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
`
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"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)."
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
import { inject } from 'aurelia-dependency-injection';
|
|
||||||
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
|
|
||||||
|
|
||||||
var path = require('path');
|
|
||||||
|
|
||||||
@inject(Project, CLIOptions, UI)
|
|
||||||
export default class ElementGenerator {
|
|
||||||
constructor(private project: Project, private options: CLIOptions, private ui: UI) { }
|
|
||||||
|
|
||||||
execute() {
|
|
||||||
let self = this;
|
|
||||||
|
|
||||||
return this.ui
|
|
||||||
.ensureAnswer(this.options.args[0], 'What would you like to call the component?')
|
|
||||||
.then(name => {
|
|
||||||
|
|
||||||
return self.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 the source folder (src).', ".")
|
|
||||||
.then(subFolders => {
|
|
||||||
|
|
||||||
let fileName = this.project.makeFileName(name);
|
|
||||||
let className = this.project.makeClassName(name);
|
|
||||||
|
|
||||||
self.project.root.add(
|
|
||||||
ProjectItem.text(path.join(subFolders, fileName + ".ts"), this.generateJSSource(className)),
|
|
||||||
ProjectItem.text(path.join(subFolders, fileName + ".html"), this.generateHTMLSource(className))
|
|
||||||
);
|
|
||||||
|
|
||||||
return this.project.commitChanges()
|
|
||||||
.then(() => this.ui.log(`Created ${name} in the '${path.join(self.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>`
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "element",
|
|
||||||
"description": "Creates a custom element class and template, placing them in the project resources."
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
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) { }
|
|
||||||
|
|
||||||
execute() {
|
|
||||||
return this.ui
|
|
||||||
.ensureAnswer(this.options.args[0], 'What would you like to call the custom element?')
|
|
||||||
.then(name => {
|
|
||||||
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))
|
|
||||||
);
|
|
||||||
|
|
||||||
return this.project.commitChanges()
|
|
||||||
.then(() => 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>`
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "generator",
|
|
||||||
"description": "Creates a generator class and places it in the project generators folder."
|
|
||||||
}
|
|
@ -1,65 +0,0 @@
|
|||||||
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) { }
|
|
||||||
|
|
||||||
execute() {
|
|
||||||
return this.ui
|
|
||||||
.ensureAnswer(this.options.args[0], 'What would you like to call the generator?')
|
|
||||||
.then(name => {
|
|
||||||
let fileName = this.project.makeFileName(name);
|
|
||||||
let className = this.project.makeClassName(name);
|
|
||||||
|
|
||||||
this.project.generators.add(
|
|
||||||
ProjectItem.text(`${fileName}.ts`, this.generateSource(className))
|
|
||||||
);
|
|
||||||
|
|
||||||
return this.project.commitChanges()
|
|
||||||
.then(() => this.ui.log(`Created ${fileName}.`));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
generateSource(className) {
|
|
||||||
return `import {autoinject} from 'aurelia-dependency-injection';
|
|
||||||
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';
|
|
||||||
|
|
||||||
@autoinject()
|
|
||||||
export default class ${className}Generator {
|
|
||||||
constructor(private project: Project, private options: CLIOptions, private 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}.js\`, 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) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
\`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
`
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "task",
|
|
||||||
"description": "Creates a task and places it in the project tasks folder."
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
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) { }
|
|
||||||
|
|
||||||
execute() {
|
|
||||||
return this.ui
|
|
||||||
.ensureAnswer(this.options.args[0], 'What would you like to call the task?')
|
|
||||||
.then(name => {
|
|
||||||
let fileName = this.project.makeFileName(name);
|
|
||||||
let functionName = this.project.makeFunctionName(name);
|
|
||||||
|
|
||||||
this.project.tasks.add(
|
|
||||||
ProjectItem.text(`${fileName}.ts`, this.generateSource(functionName))
|
|
||||||
);
|
|
||||||
|
|
||||||
return this.project.commitChanges()
|
|
||||||
.then(() => this.ui.log(`Created ${fileName}.`));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
generateSource(functionName) {
|
|
||||||
return `import * as gulp from 'gulp';
|
|
||||||
import * as changed from 'gulp-changed';
|
|
||||||
import * as project from '../aurelia.json';
|
|
||||||
|
|
||||||
export default function ${functionName}() {
|
|
||||||
return gulp.src(project.paths.???)
|
|
||||||
.pipe(changed(project.paths.output, {extension: '.???'}))
|
|
||||||
.pipe(gulp.dest(project.paths.output));
|
|
||||||
}
|
|
||||||
|
|
||||||
`
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "value-converter",
|
|
||||||
"description": "Creates a value converter class and places it in the project resources."
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
import {inject} from 'aurelia-dependency-injection';
|
|
||||||
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';
|
|
||||||
|
|
||||||
@inject(Project, CLIOptions, UI)
|
|
||||||
export default class ValueConverterGenerator {
|
|
||||||
constructor(private project: Project, private options: CLIOptions, private ui: UI) { }
|
|
||||||
|
|
||||||
execute() {
|
|
||||||
return this.ui
|
|
||||||
.ensureAnswer(this.options.args[0], 'What would you like to call the value converter?')
|
|
||||||
.then(name => {
|
|
||||||
let fileName = this.project.makeFileName(name);
|
|
||||||
let className = this.project.makeClassName(name);
|
|
||||||
|
|
||||||
this.project.valueConverters.add(
|
|
||||||
ProjectItem.text(`${fileName}.ts`, this.generateSource(className))
|
|
||||||
);
|
|
||||||
|
|
||||||
return this.project.commitChanges()
|
|
||||||
.then(() => this.ui.log(`Created ${fileName}.`));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
generateSource(className) {
|
|
||||||
return `export class ${className}ValueConverter {
|
|
||||||
toView(value) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
fromView(value) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
`
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "build",
|
|
||||||
"description": "Builds and processes all application assets.",
|
|
||||||
"flags": [
|
|
||||||
{
|
|
||||||
"name": "env",
|
|
||||||
"description": "Sets the build environment.",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
import * as gulp from 'gulp';
|
|
||||||
import transpile from './transpile';
|
|
||||||
import processMarkup from './process-markup';
|
|
||||||
import processCSS from './process-css';
|
|
||||||
import copyFiles from './copy-files';
|
|
||||||
import {build} from 'aurelia-cli';
|
|
||||||
import * as project from '../aurelia.json';
|
|
||||||
|
|
||||||
export default gulp.series(
|
|
||||||
readProjectConfiguration,
|
|
||||||
gulp.parallel(
|
|
||||||
transpile,
|
|
||||||
processMarkup,
|
|
||||||
processCSS,
|
|
||||||
copyFiles
|
|
||||||
),
|
|
||||||
writeBundles
|
|
||||||
);
|
|
||||||
|
|
||||||
function readProjectConfiguration() {
|
|
||||||
return build.src(project);
|
|
||||||
}
|
|
||||||
|
|
||||||
function writeBundles() {
|
|
||||||
return build.dest();
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
import * as gulp from 'gulp';
|
|
||||||
import * as path from 'path';
|
|
||||||
import * as minimatch from 'minimatch';
|
|
||||||
import * as changedInPlace from 'gulp-changed-in-place';
|
|
||||||
import * as project from '../aurelia.json';
|
|
||||||
|
|
||||||
export default function copyFiles(done) {
|
|
||||||
if (typeof project.build.copyFiles !== 'object') {
|
|
||||||
done();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const instruction = getNormalizedInstruction();
|
|
||||||
const files = Object.keys(instruction);
|
|
||||||
|
|
||||||
return gulp.src(files)
|
|
||||||
.pipe(changedInPlace({ firstPass: true }))
|
|
||||||
.pipe(gulp.dest(x => {
|
|
||||||
const filePath = prepareFilePath(x.path);
|
|
||||||
const key = files.find(f => minimatch(filePath, f));
|
|
||||||
return instruction[key];
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
function getNormalizedInstruction() {
|
|
||||||
const files = project.build.copyFiles;
|
|
||||||
let normalizedInstruction = {};
|
|
||||||
|
|
||||||
for (let key in files) {
|
|
||||||
normalizedInstruction[path.posix.normalize(key)] = files[key];
|
|
||||||
}
|
|
||||||
|
|
||||||
return normalizedInstruction;
|
|
||||||
}
|
|
||||||
|
|
||||||
function prepareFilePath(filePath) {
|
|
||||||
let preparedPath = filePath.replace(process.cwd(), '').substring(1);
|
|
||||||
|
|
||||||
//if we are running on windows we have to fix the path
|
|
||||||
if (/^win/.test(process.platform)) {
|
|
||||||
preparedPath = preparedPath.replace(/\\/g, '/');
|
|
||||||
}
|
|
||||||
|
|
||||||
return preparedPath;
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
import * as gulp from 'gulp';
|
|
||||||
import * as changedInPlace from 'gulp-changed-in-place';
|
|
||||||
import * as project from '../aurelia.json';
|
|
||||||
import {build} from 'aurelia-cli';
|
|
||||||
|
|
||||||
export default function processCSS() {
|
|
||||||
return gulp.src(project.cssProcessor.source)
|
|
||||||
.pipe(changedInPlace({firstPass:true}))
|
|
||||||
.pipe(build.bundle());
|
|
||||||
};
|
|
@ -1,17 +0,0 @@
|
|||||||
import * as gulp from 'gulp';
|
|
||||||
import * as htmlmin from 'gulp-htmlmin';
|
|
||||||
import * as changedInPlace from 'gulp-changed-in-place';
|
|
||||||
import * as project from '../aurelia.json';
|
|
||||||
import {build} from 'aurelia-cli';
|
|
||||||
|
|
||||||
export default function processMarkup() {
|
|
||||||
return gulp.src(project.markupProcessor.source)
|
|
||||||
.pipe(changedInPlace({firstPass:true}))
|
|
||||||
.pipe(htmlmin({
|
|
||||||
removeComments: true,
|
|
||||||
collapseWhitespace: true,
|
|
||||||
minifyCSS: true,
|
|
||||||
minifyJS: true
|
|
||||||
}))
|
|
||||||
.pipe(build.bundle());
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "run",
|
|
||||||
"description": "Builds the application and serves up the assets via a local web server, watching files for changes as you work.",
|
|
||||||
"flags": [
|
|
||||||
{
|
|
||||||
"name": "env",
|
|
||||||
"description": "Sets the build environment.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "watch",
|
|
||||||
"description": "Watches source files for changes and refreshes the app automatically.",
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,73 +0,0 @@
|
|||||||
import * as gulp from 'gulp';
|
|
||||||
import * as browserSync from 'browser-sync';
|
|
||||||
import * as historyApiFallback from 'connect-history-api-fallback/lib';
|
|
||||||
import * as project from '../aurelia.json';
|
|
||||||
import build from './build';
|
|
||||||
import {CLIOptions} from 'aurelia-cli';
|
|
||||||
|
|
||||||
function onChange(path) {
|
|
||||||
console.log(`File Changed: ${path}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
function reload(done) {
|
|
||||||
browserSync.reload();
|
|
||||||
done();
|
|
||||||
}
|
|
||||||
|
|
||||||
let serve = gulp.series(
|
|
||||||
build,
|
|
||||||
done => {
|
|
||||||
browserSync({
|
|
||||||
online: false,
|
|
||||||
open: false,
|
|
||||||
port: 9000,
|
|
||||||
logLevel: 'silent',
|
|
||||||
server: {
|
|
||||||
baseDir: [project.platform.baseDir],
|
|
||||||
middleware: [historyApiFallback(), function(req, res, next) {
|
|
||||||
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
||||||
next();
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}, function (err, bs) {
|
|
||||||
if (err) return done(err);
|
|
||||||
let urls = bs.options.get('urls').toJS();
|
|
||||||
console.log(`Application Available At: ${urls.local}`);
|
|
||||||
console.log(`BrowserSync Available At: ${urls.ui}`);
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
let refresh = gulp.series(
|
|
||||||
build,
|
|
||||||
reload
|
|
||||||
);
|
|
||||||
|
|
||||||
let watch = function(refreshCb, onChangeCb) {
|
|
||||||
return function(done) {
|
|
||||||
gulp.watch(project.transpiler.source, refreshCb).on('change', onChangeCb);
|
|
||||||
gulp.watch(project.markupProcessor.source, refreshCb).on('change', onChangeCb);
|
|
||||||
gulp.watch(project.cssProcessor.source, refreshCb).on('change', onChangeCb);
|
|
||||||
|
|
||||||
//see if there are static files to be watched
|
|
||||||
if (typeof project.build.copyFiles === 'object') {
|
|
||||||
const files = Object.keys(project.build.copyFiles);
|
|
||||||
gulp.watch(files, refreshCb).on('change', onChangeCb);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
let run;
|
|
||||||
|
|
||||||
if (CLIOptions.hasFlag('watch')) {
|
|
||||||
run = gulp.series(
|
|
||||||
serve,
|
|
||||||
watch(refresh, onChange)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
run = serve;
|
|
||||||
}
|
|
||||||
|
|
||||||
export { run as default, watch };
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "test",
|
|
||||||
"description": "Runs all unit tests and reports the results.",
|
|
||||||
"flags": [
|
|
||||||
{
|
|
||||||
"name": "env",
|
|
||||||
"description": "Sets the build environment.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "watch",
|
|
||||||
"description": "Watches test files for changes and re-runs the tests automatically.",
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
import * as gulp from 'gulp';
|
|
||||||
import {Server as Karma} from 'karma';
|
|
||||||
import {CLIOptions} from 'aurelia-cli';
|
|
||||||
import build from './build';
|
|
||||||
import {watch} from './run';
|
|
||||||
import * as path from 'path';
|
|
||||||
|
|
||||||
function log(message) {
|
|
||||||
console.log(message); //eslint-disable-line no-console
|
|
||||||
}
|
|
||||||
|
|
||||||
function onChange(path) {
|
|
||||||
log(`File Changed: ${path}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
let karma = done => {
|
|
||||||
new Karma({
|
|
||||||
configFile: path.join(__dirname, '/../../karma.conf.js'),
|
|
||||||
singleRun: !CLIOptions.hasFlag('watch')
|
|
||||||
}, done).start();
|
|
||||||
};
|
|
||||||
|
|
||||||
let unit;
|
|
||||||
|
|
||||||
if (CLIOptions.hasFlag('watch')) {
|
|
||||||
unit = gulp.series(
|
|
||||||
build,
|
|
||||||
gulp.parallel(
|
|
||||||
watch(build, onChange),
|
|
||||||
karma
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
unit = gulp.series(
|
|
||||||
build,
|
|
||||||
karma
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default unit;
|
|
@ -1,44 +0,0 @@
|
|||||||
import * as gulp from 'gulp';
|
|
||||||
import * as changedInPlace from 'gulp-changed-in-place';
|
|
||||||
import * as plumber from 'gulp-plumber';
|
|
||||||
import * as sourcemaps from 'gulp-sourcemaps';
|
|
||||||
import * as notify from 'gulp-notify';
|
|
||||||
import * as rename from 'gulp-rename';
|
|
||||||
import * as ts from 'gulp-typescript';
|
|
||||||
import * as project from '../aurelia.json';
|
|
||||||
import {CLIOptions, build} from 'aurelia-cli';
|
|
||||||
import * as eventStream from 'event-stream';
|
|
||||||
|
|
||||||
function configureEnvironment() {
|
|
||||||
let env = CLIOptions.getEnvironment();
|
|
||||||
|
|
||||||
return gulp.src(`aurelia_project/environments/${env}.ts`)
|
|
||||||
.pipe(changedInPlace({firstPass:true}))
|
|
||||||
.pipe(rename('environment.ts'))
|
|
||||||
.pipe(gulp.dest(project.paths.root));
|
|
||||||
}
|
|
||||||
|
|
||||||
var typescriptCompiler = typescriptCompiler || null;
|
|
||||||
|
|
||||||
function buildTypeScript() {
|
|
||||||
typescriptCompiler = ts.createProject('tsconfig.json', {
|
|
||||||
"typescript": require('typescript')
|
|
||||||
});
|
|
||||||
|
|
||||||
let dts = gulp.src(project.transpiler.dtsSource);
|
|
||||||
|
|
||||||
let src = gulp.src(project.transpiler.source)
|
|
||||||
.pipe(changedInPlace({firstPass: true}));
|
|
||||||
|
|
||||||
return eventStream.merge(dts, src)
|
|
||||||
.pipe(plumber({ errorHandler: notify.onError('Error: <%= error.message %>') }))
|
|
||||||
.pipe(sourcemaps.init())
|
|
||||||
.pipe(typescriptCompiler())
|
|
||||||
.pipe(sourcemaps.write({ sourceRoot: 'src' }))
|
|
||||||
.pipe(build.bundle());
|
|
||||||
}
|
|
||||||
|
|
||||||
export default gulp.series(
|
|
||||||
configureEnvironment,
|
|
||||||
buildTypeScript
|
|
||||||
);
|
|
Binary file not shown.
@ -1,44 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
const path = require('path');
|
|
||||||
const project = require('./aurelia_project/aurelia.json');
|
|
||||||
const tsconfig = require('./tsconfig.json');
|
|
||||||
|
|
||||||
let testSrc = [
|
|
||||||
{ pattern: project.unitTestRunner.source, included: false },
|
|
||||||
'test/aurelia-karma.js'
|
|
||||||
];
|
|
||||||
|
|
||||||
let output = project.platform.output;
|
|
||||||
let appSrc = project.build.bundles.map(x => path.join(output, x.name));
|
|
||||||
let entryIndex = appSrc.indexOf(path.join(output, project.build.loader.configTarget));
|
|
||||||
let entryBundle = appSrc.splice(entryIndex, 1)[0];
|
|
||||||
let files = [entryBundle].concat(testSrc).concat(appSrc);
|
|
||||||
|
|
||||||
module.exports = function(config) {
|
|
||||||
config.set({
|
|
||||||
basePath: '',
|
|
||||||
frameworks: [project.testFramework.id],
|
|
||||||
files: files,
|
|
||||||
exclude: [],
|
|
||||||
preprocessors: {
|
|
||||||
[project.unitTestRunner.source]: [project.transpiler.id]
|
|
||||||
},
|
|
||||||
typescriptPreprocessor: {
|
|
||||||
typescript: require('typescript'),
|
|
||||||
options: tsconfig.compilerOptions
|
|
||||||
},
|
|
||||||
reporters: ['progress'],
|
|
||||||
port: 9876,
|
|
||||||
colors: true,
|
|
||||||
logLevel: config.LOG_INFO,
|
|
||||||
autoWatch: true,
|
|
||||||
browsers: ['Chrome'],
|
|
||||||
singleRun: false,
|
|
||||||
// client.args must be a array of string.
|
|
||||||
// Leave 'aurelia-root', project.paths.root in this order so we can find
|
|
||||||
// the root of the aurelia project.
|
|
||||||
client: {
|
|
||||||
args: ['aurelia-root', project.paths.root]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
File diff suppressed because one or more lines are too long
@ -1,36 +0,0 @@
|
|||||||
<template>
|
|
||||||
<require from="bootstrap/css/bootstrap.css"></require>
|
|
||||||
<require from="./styles.css"></require>
|
|
||||||
|
|
||||||
<nav class="navbar navbar-inverse navbar-fixed-top">
|
|
||||||
<div class="container">
|
|
||||||
<div class="navbar-header">
|
|
||||||
<button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
|
||||||
<span class="sr-only">Toggle navigation</span>
|
|
||||||
<span class="icon-bar"></span>
|
|
||||||
<span class="icon-bar"></span>
|
|
||||||
<span class="icon-bar"></span>
|
|
||||||
</button>
|
|
||||||
<a route-href="route: home" class="navbar-brand">myPrayerJournal</a>
|
|
||||||
</div>
|
|
||||||
<div class="navbar-collapse collapse">
|
|
||||||
<ul class="nav navbar-nav navbar-right">
|
|
||||||
<li if.bind="!isAuthenticated()" click.delegate="logon()">Log On</li>
|
|
||||||
<li if.bind="isAuthenticated()" click.delegate="logoff()">Log Off</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
<loading-indicator loading.bind="router.isNavigating || api.isRequesting"></loading-indicator>
|
|
||||||
<div class="container body-content">
|
|
||||||
<div class="row">
|
|
||||||
<h2 class.bind="'mpj-page-title' + ('' === pageTitle ? ' hidden' : '')" textcontent.bind="pageTitle"></h2>
|
|
||||||
<router-view class="col-xs-12" swap-order="with"></router-view>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<footer class="mpj-footer">
|
|
||||||
<p class="text-right">myPrayerJournal v0.8.1</p>
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
@ -1,80 +0,0 @@
|
|||||||
import {Router, RouterConfiguration} from "aurelia-router"
|
|
||||||
import {EventAggregator} from "aurelia-event-aggregator"
|
|
||||||
import {inject} from "aurelia-framework"
|
|
||||||
import {HttpClient} from "aurelia-fetch-client"
|
|
||||||
import {PageTitle} from "./messages"
|
|
||||||
import {Auth0Lock} from "auth0-lock"
|
|
||||||
|
|
||||||
@inject(EventAggregator, HttpClient)
|
|
||||||
export class App {
|
|
||||||
router: Router;
|
|
||||||
pageTitle: string;
|
|
||||||
|
|
||||||
lock = new Auth0Lock('Of2s0RQCQ3mt3dwIkOBY5h85J9sXbF2n', 'djs-consulting.auth0.com', {
|
|
||||||
oidcConformant: true,
|
|
||||||
autoclose: true,
|
|
||||||
auth: {
|
|
||||||
redirectUrl: "http://localhost:8080/user/log-on",
|
|
||||||
responseType: 'token id_token',
|
|
||||||
audience: `https://djs-consulting.auth0.com/userinfo`,
|
|
||||||
params: {
|
|
||||||
scope: 'openid'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
private setSession(authResult): void {
|
|
||||||
// Set the time that the access token will expire at
|
|
||||||
const expiresAt = JSON.stringify((authResult.expiresIn * 1000) + new Date().getTime())
|
|
||||||
localStorage.setItem('access_token', authResult.accessToken)
|
|
||||||
localStorage.setItem('id_token', authResult.idToken)
|
|
||||||
localStorage.setItem('expires_at', expiresAt)
|
|
||||||
}
|
|
||||||
|
|
||||||
public logoff(): void {
|
|
||||||
// Remove tokens and expiry time from localStorage
|
|
||||||
localStorage.removeItem('access_token')
|
|
||||||
localStorage.removeItem('id_token')
|
|
||||||
localStorage.removeItem('expires_at')
|
|
||||||
// Go back to the home route
|
|
||||||
this.router.navigateToRoute("")
|
|
||||||
}
|
|
||||||
|
|
||||||
public isAuthenticated(): boolean {
|
|
||||||
// Check whether the current time is past the
|
|
||||||
// access token's expiry time
|
|
||||||
const expiresAt = JSON.parse(localStorage.getItem('expires_at'))
|
|
||||||
return new Date().getTime() < expiresAt
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(private ea: EventAggregator, private http: HttpClient) {
|
|
||||||
this.ea.subscribe(PageTitle, msg => this.pageTitle = msg.title)
|
|
||||||
var self = this
|
|
||||||
this.lock.on('authenticated', (authResult) => {
|
|
||||||
if (authResult && authResult.accessToken && authResult.idToken) {
|
|
||||||
this.setSession(authResult)
|
|
||||||
this.router.navigateToRoute("")
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.lock.on('authorization_error', (err) => {
|
|
||||||
this.router.navigateToRoute("")
|
|
||||||
console.log(err)
|
|
||||||
alert(`Error: ${err.error}. Check the console for further details.`)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
configureRouter(config: RouterConfiguration, router: Router){
|
|
||||||
config.title = "myPrayerJournal"
|
|
||||||
config.options.pushState = true
|
|
||||||
config.options.root = "/"
|
|
||||||
config.map([
|
|
||||||
{ route: "", moduleId: "home", name: "home", title: "Welcome" }
|
|
||||||
])
|
|
||||||
|
|
||||||
this.router = router
|
|
||||||
}
|
|
||||||
|
|
||||||
public logon() {
|
|
||||||
this.lock.show()
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
export default {
|
|
||||||
debug: true,
|
|
||||||
testing: true
|
|
||||||
};
|
|
@ -1,11 +0,0 @@
|
|||||||
<template>
|
|
||||||
<p>
|
|
||||||
myPrayerJournal is a place where individuals can record their prayer requests, record that they prayed for them,
|
|
||||||
update them as God moves in the situation, and record a final answer received on that request. It will also allow
|
|
||||||
individuals to review their answered prayers.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
This site is currently in very limited alpha, as it is being developed with a core group of test users. If this is
|
|
||||||
something you are interested in using, check back around mid-June 2017 to check on the development progress.
|
|
||||||
</p>
|
|
||||||
</template>
|
|
@ -1,10 +0,0 @@
|
|||||||
import {inject} from 'aurelia-framework';
|
|
||||||
import {EventAggregator} from "aurelia-event-aggregator"
|
|
||||||
import {PageTitle} from "./messages"
|
|
||||||
|
|
||||||
@inject(EventAggregator)
|
|
||||||
export class Home {
|
|
||||||
constructor(private ea: EventAggregator) {
|
|
||||||
this.ea.publish(new PageTitle("Welcome to myPrayerJournal"));
|
|
||||||
}
|
|
||||||
}
|
|
10
src/app/src/lib/lock.min.js
vendored
10
src/app/src/lib/lock.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,18 +0,0 @@
|
|||||||
import {Aurelia} from 'aurelia-framework'
|
|
||||||
import environment from './environment';
|
|
||||||
|
|
||||||
export function configure(aurelia: Aurelia) {
|
|
||||||
aurelia.use
|
|
||||||
.standardConfiguration()
|
|
||||||
.feature('resources');
|
|
||||||
|
|
||||||
if (environment.debug) {
|
|
||||||
aurelia.use.developmentLogging();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (environment.testing) {
|
|
||||||
aurelia.use.plugin('aurelia-testing');
|
|
||||||
}
|
|
||||||
|
|
||||||
aurelia.start().then(() => aurelia.setRoot());
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
export class PageTitle {
|
|
||||||
constructor(public title: string) { }
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
import * as nprogress from 'nprogress';
|
|
||||||
import {bindable, noView} from 'aurelia-framework';
|
|
||||||
|
|
||||||
@noView(['nprogress/nprogress.css'])
|
|
||||||
export class LoadingIndicator {
|
|
||||||
@bindable loading = false;
|
|
||||||
|
|
||||||
loadingChanged(newValue) {
|
|
||||||
if (newValue) {
|
|
||||||
nprogress.start();
|
|
||||||
} else {
|
|
||||||
nprogress.done();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
import {FrameworkConfiguration} from 'aurelia-framework';
|
|
||||||
|
|
||||||
export function configure(config: FrameworkConfiguration) {
|
|
||||||
config.globalResources(['./elements/loading-indicator']);
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
body {
|
|
||||||
padding-top: 70px;
|
|
||||||
padding-bottom: 20px;
|
|
||||||
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Wrapping element */
|
|
||||||
/* Set some basic padding to keep content from hitting the edges */
|
|
||||||
.body-content {
|
|
||||||
padding-left: 15px;
|
|
||||||
padding-right: 15px;
|
|
||||||
}
|
|
||||||
.material-icons.md-18 {
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
.material-icons.md-24 {
|
|
||||||
font-size: 24px;
|
|
||||||
}
|
|
||||||
.material-icons.md-36 {
|
|
||||||
font-size: 36px;
|
|
||||||
}
|
|
||||||
.material-icons.md-48 {
|
|
||||||
font-size: 48px;
|
|
||||||
}
|
|
||||||
.material-icons {
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
.mpj-page-title {
|
|
||||||
border-bottom: solid 1px lightgray;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
.mpj-footer {
|
|
||||||
border-top: solid 1px lightgray;
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
export function areEqual(obj1, obj2) {
|
|
||||||
return Object.keys(obj1).every((key) => obj2.hasOwnProperty(key) && (obj1[key] === obj2[key]));
|
|
||||||
};
|
|
@ -1,87 +0,0 @@
|
|||||||
(function(global) {
|
|
||||||
var karma = global.__karma__;
|
|
||||||
var requirejs = global.requirejs
|
|
||||||
var locationPathname = global.location.pathname;
|
|
||||||
var root = 'src';
|
|
||||||
karma.config.args.forEach(function(value, index) {
|
|
||||||
if (value === 'aurelia-root') {
|
|
||||||
root = karma.config.args[index + 1];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!karma || !requirejs) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
function normalizePath(path) {
|
|
||||||
var normalized = []
|
|
||||||
var parts = path
|
|
||||||
.split('?')[0] // cut off GET params, used by noext requirejs plugin
|
|
||||||
.split('/')
|
|
||||||
|
|
||||||
for (var i = 0; i < parts.length; i++) {
|
|
||||||
if (parts[i] === '.') {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parts[i] === '..' && normalized.length && normalized[normalized.length - 1] !== '..') {
|
|
||||||
normalized.pop()
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
normalized.push(parts[i])
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use case of testing source code. RequireJS doesn't add .js extension to files asked via sibling selector
|
|
||||||
// If normalized path doesn't include some type of extension, add the .js to it
|
|
||||||
if (normalized.length > 0 && normalized[normalized.length - 1].indexOf('.') < 0) {
|
|
||||||
normalized[normalized.length - 1] = normalized[normalized.length - 1] + '.js'
|
|
||||||
}
|
|
||||||
|
|
||||||
return normalized.join('/')
|
|
||||||
}
|
|
||||||
|
|
||||||
function patchRequireJS(files, originalLoadFn, locationPathname) {
|
|
||||||
var IS_DEBUG = /debug\.html$/.test(locationPathname)
|
|
||||||
|
|
||||||
requirejs.load = function (context, moduleName, url) {
|
|
||||||
url = normalizePath(url)
|
|
||||||
|
|
||||||
if (files.hasOwnProperty(url) && !IS_DEBUG) {
|
|
||||||
url = url + '?' + files[url]
|
|
||||||
}
|
|
||||||
|
|
||||||
if (url.indexOf('/base') !== 0) {
|
|
||||||
url = '/base/' + url;
|
|
||||||
}
|
|
||||||
|
|
||||||
return originalLoadFn.call(this, context, moduleName, url)
|
|
||||||
}
|
|
||||||
|
|
||||||
var originalDefine = global.define;
|
|
||||||
global.define = function(name, deps, m) {
|
|
||||||
if (typeof name === 'string') {
|
|
||||||
originalDefine('/base/' + root + '/' + name, [name], function (result) { return result; });
|
|
||||||
}
|
|
||||||
|
|
||||||
return originalDefine(name, deps, m);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function requireTests() {
|
|
||||||
var TEST_REGEXP = /(spec)\.js$/i;
|
|
||||||
var allTestFiles = ['/base/test/unit/setup.js'];
|
|
||||||
|
|
||||||
Object.keys(window.__karma__.files).forEach(function(file) {
|
|
||||||
if (TEST_REGEXP.test(file)) {
|
|
||||||
allTestFiles.push(file);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
require(allTestFiles, window.__karma__.start);
|
|
||||||
}
|
|
||||||
|
|
||||||
karma.loaded = function() {}; // make it async
|
|
||||||
patchRequireJS(karma.files, requirejs.load, locationPathname);
|
|
||||||
requireTests();
|
|
||||||
})(window);
|
|
@ -1,7 +0,0 @@
|
|||||||
import {App} from '../../src/app';
|
|
||||||
|
|
||||||
describe('the app', () => {
|
|
||||||
it('says hello', () => {
|
|
||||||
expect(new App().message).toBe('Hello World!');
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,3 +0,0 @@
|
|||||||
import 'aurelia-polyfills';
|
|
||||||
import {initialize} from 'aurelia-pal-browser';
|
|
||||||
initialize();
|
|
@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
"compileOnSave": false,
|
|
||||||
"compilerOptions": {
|
|
||||||
"sourceMap": true,
|
|
||||||
"target": "es5",
|
|
||||||
"module": "amd",
|
|
||||||
"declaration": false,
|
|
||||||
"noImplicitAny": false,
|
|
||||||
"removeComments": true,
|
|
||||||
"emitDecoratorMetadata": true,
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"lib": ["es2017", "dom"]
|
|
||||||
},
|
|
||||||
"exclude": [
|
|
||||||
"node_modules",
|
|
||||||
"aurelia_project"
|
|
||||||
],
|
|
||||||
"filesGlob": [
|
|
||||||
"./src/**/*.ts",
|
|
||||||
"./test/**/*.ts",
|
|
||||||
"./custom_typings/**/*.d.ts"
|
|
||||||
],
|
|
||||||
"atom": {
|
|
||||||
"rewriteTsconfig": false
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"rules": {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"globalDependencies": {
|
|
||||||
"nprogress": "registry:dt/nprogress#0.0.0+20161119044246"
|
|
||||||
}
|
|
||||||
}
|
|
113
src/app/typings/globals/nprogress/index.d.ts
vendored
113
src/app/typings/globals/nprogress/index.d.ts
vendored
@ -1,113 +0,0 @@
|
|||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/253e456e3c0bf4bd34afaceb7dcbae282da14066/nprogress/index.d.ts
|
|
||||||
interface NProgressStatic {
|
|
||||||
/**
|
|
||||||
* Shows the progress bar and begins trickling progress.
|
|
||||||
* @returns {NProgressConfigureOptions} The current NProgress object, useful for chaining.
|
|
||||||
*/
|
|
||||||
start(): NProgressStatic;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Finishes loading by transitioning it to 100%, then fading out.
|
|
||||||
* @param {boolean} forceShow Forces the progress bar to show, even if it's not being shown. (The default behavior is that .done() will not do anything if .start() isn't called.)
|
|
||||||
* @returns {NProgressConfigureOptions} The current NProgress object, useful for chaining.
|
|
||||||
*/
|
|
||||||
done(forceShow?: boolean): NProgressStatic;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Increments the progress bar with a random amount. This will never get to 100%: use it for every image load (or similar).
|
|
||||||
* @returns {NProgressConfigureOptions} The current NProgress object, useful for chaining.
|
|
||||||
*/
|
|
||||||
inc(): NProgressStatic;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Increments the progress bar with a set amount.
|
|
||||||
* @param {number} amount This will get the current status value and adds the value until status is max 0.994
|
|
||||||
* @returns {NProgressConfigureOptions} The current NProgress object, useful for chaining.
|
|
||||||
*/
|
|
||||||
inc(amount: number): NProgressStatic;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes the progress indicator.
|
|
||||||
*/
|
|
||||||
remove(): void;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the progress percentage.
|
|
||||||
* @param {number} progressPercent A number between 0.0 and 1.0 that represents the progress percentage.
|
|
||||||
* @returns {NProgressConfigureOptions} The current NProgress object, useful for chaining.
|
|
||||||
*/
|
|
||||||
set(progressPercent: number): NProgressStatic;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configures the progress indicator.
|
|
||||||
* @param {NProgressConfigureOptions} options An object containing the configuration options.
|
|
||||||
* @returns {NProgressConfigureOptions} The current NProgress object, useful for chaining.
|
|
||||||
*/
|
|
||||||
configure(options: NProgressConfigureOptions): NProgressStatic;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the NProgress version.
|
|
||||||
*/
|
|
||||||
version: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the status. If started, it will be the last progress number set.
|
|
||||||
*/
|
|
||||||
status: any;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets whether progress has been started.
|
|
||||||
* @returns {boolean} Whether the progress has started.
|
|
||||||
*/
|
|
||||||
isStarted(): boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface NProgressConfigureOptions {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* CSS selector to change the parent DOM element of the progress. Default is body.
|
|
||||||
*/
|
|
||||||
parent?: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The minimum progress percentage. Default is 0.08.
|
|
||||||
*/
|
|
||||||
minimum?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* How often to trickle, in milliseconds. Default is 800.
|
|
||||||
*/
|
|
||||||
trickleSpeed?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether to show the spinner. Defaults to true. Default is true.
|
|
||||||
*/
|
|
||||||
showSpinner?: boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether to enable trickling the progress. Default is true.
|
|
||||||
*/
|
|
||||||
trickle?: boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The CSS easing animation to use. Default is 'linear'.
|
|
||||||
*/
|
|
||||||
easing?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The animation speed in milliseconds. Default is 200.
|
|
||||||
*/
|
|
||||||
speed?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The HTML markup inserted for the progress indicator. To keep the progress bar working, keep an element with role='bar' in there.
|
|
||||||
*/
|
|
||||||
template?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var NProgress: NProgressStatic;
|
|
||||||
|
|
||||||
declare module "nprogress" {
|
|
||||||
export = NProgress;
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"resolution": "main",
|
|
||||||
"tree": {
|
|
||||||
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/253e456e3c0bf4bd34afaceb7dcbae282da14066/nprogress/index.d.ts",
|
|
||||||
"raw": "registry:dt/nprogress#0.0.0+20161119044246",
|
|
||||||
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/253e456e3c0bf4bd34afaceb7dcbae282da14066/nprogress/index.d.ts"
|
|
||||||
}
|
|
||||||
}
|
|
1
src/app/typings/index.d.ts
vendored
1
src/app/typings/index.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
/// <reference path="globals/nprogress/index.d.ts" />
|
|
Loading…
Reference in New Issue
Block a user