Skip to content

Commit

Permalink
init - version 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Machigatta committed Mar 20, 2019
0 parents commit 8099aef
Show file tree
Hide file tree
Showing 53 changed files with 14,323 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = api => {
api.cache.using(() => {
// cache based on the two env vars
return 'babel:' + process.env.BABEL_TARGET +
' protractor:' + process.env.IN_PROTRACTOR;
});

return {
"plugins": [
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: true }]
],
"presets": [
[
"@babel/preset-env", {
"targets": process.env.BABEL_TARGET === 'node' ? {
"node": process.env.IN_PROTRACTOR ? '6' : 'current'
} : {
"browsers": [ "last 2 versions" ]
},
"loose": true,
"modules": process.env.BABEL_TARGET === 'node' ? 'commonjs' : false
}
]
]
}
}
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# 2 space indentation
indent_style = space
indent_size = 2
8 changes: 8 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./node_modules/aurelia-tools/.eslintrc.json",
"parserOptions": {
"ecmaFeatures": {
"legacyDecorators": true
}
}
}
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.idea
.DS_STORE
.rpt2_cache
TESTS-*.xml

**/node_modules
**/coverage
**/dist
**/*.tgz
/test/**/coverage
/build

**/debug.log
**/npm-debug.log
**/lerna-debug.log

test/cypress/integration/example
10 changes: 10 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"recommendations": [
"AureliaEffect.aurelia",
"msjsdiag.debugger-for-chrome",
"steoates.autoimport",
"EditorConfig.EditorConfig",
"christian-kohler.path-intellisense",
"behzad88.Aurelia"
]
}
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:8080",
"webRoot": "${workspaceRoot}/src",
"userDataDir": "${workspaceRoot}/.chrome",
"sourceMapPathOverrides": {
"webpack:///./src/*": "${webRoot}/*"
}
}
]
}
32 changes: 32 additions & 0 deletions .vscode/launch.json_if_cli-bundler
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
// Use IntelliSense to find out which attributes exist for node debugging
// Use hover for the description of the existing attributes
// For further information visit https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Chrome Debugger",
"type": "chrome",
"request": "launch",
"url": "http://localhost:9000",
"webRoot": "${workspaceRoot}/src",
"userDataDir": "${workspaceRoot}/.chrome",
"sourceMapPathOverrides": {
"../src/*": "${webRoot}/*"
}
},
{
"type": "chrome",
"request": "attach",
"name": "Attach Karma Chrome",
"address": "localhost",
"port": 9333,
"sourceMaps": true,
"pathMapping": {
"/": "${workspaceRoot}",
"/base/": "${workspaceRoot}/"
},
"sourceMapPathOverrides": { "../src/*": "${webRoot}/*" }
}
]
}
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# `discord-embed-sender`

This project is build with [aurelia.js](https://aurelia.io/) and [Skeleton](http://getskeleton.com/)
It's also hosted on [embed.machigatta.com](https://embed.machigatta.com)

Feels free to work on this small project

## Requirements
- npm
- aurelia.cli

## Work-Enviroment

Run `au run`, then open `http://localhost:8080`


## Build

Run `au build --env prod`.

> Version 0.8
29 changes: 29 additions & 0 deletions aurelia_project/aurelia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "discord-embed-sender",
"type": "project:application",
"paths": {
"root": "src",
"resources": "resources",
"elements": "resources/elements",
"attributes": "resources/attributes",
"valueConverters": "resources/value-converters",
"bindingBehaviors": "resources/binding-behaviors"
},
"transpiler": {
"id": "babel",
"fileExtension": ".js"
},
"build": {
"options": {
"server": "dev",
"extractCss": "prod",
"coverage": false
}
},
"platform": {
"hmr": false,
"open": false,
"port": 8080,
"output": "dist"
}
}
4 changes: 4 additions & 0 deletions aurelia_project/environments/dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
debug: true,
testing: true
};
4 changes: 4 additions & 0 deletions aurelia_project/environments/prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
debug: false,
testing: false
};
4 changes: 4 additions & 0 deletions aurelia_project/environments/stage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
debug: true,
testing: false
};
44 changes: 44 additions & 0 deletions aurelia_project/generators/attribute.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import {inject} from 'aurelia-dependency-injection';
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';

@inject(Project, CLIOptions, UI)
export default class AttributeGenerator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.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}.js`, this.generateSource(className))
);

await this.project.commitChanges();
await this.ui.log(`Created ${fileName}.`);
}

generateSource(className) {
return `import {inject} from 'aurelia-framework';
@inject(Element)
export class ${className}CustomAttribute {
constructor(element) {
this.element = element;
}
valueChanged(newValue, oldValue) {
//
}
}
`;
}
}
4 changes: 4 additions & 0 deletions aurelia_project/generators/attribute.json
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."
}
41 changes: 41 additions & 0 deletions aurelia_project/generators/binding-behavior.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import {inject} from 'aurelia-dependency-injection';
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';

@inject(Project, CLIOptions, UI)
export default class BindingBehaviorGenerator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.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}.js`, 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) {
//
}
}
`
}
}
4 changes: 4 additions & 0 deletions aurelia_project/generators/binding-behavior.json
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."
}
52 changes: 52 additions & 0 deletions aurelia_project/generators/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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(project, options, ui) {
this.project = project;
this.options = options;
this.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 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 + '.js'), 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} {
constructor() {
this.message = 'Hello world';
}
}
`
}

generateHTMLSource(className) {
return `<template>
<h1>\${message}</h1>
</template>
`
}
}
4 changes: 4 additions & 0 deletions aurelia_project/generators/component.json
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)."
}
Loading

0 comments on commit 8099aef

Please sign in to comment.