Skip to content

Commit

Permalink
chore(*): set up the project structure and build
Browse files Browse the repository at this point in the history
This commit adds the initial source code, sets up the project
structure, creates the gulp build file and configures karma.
  • Loading branch information
EisenbergEffect committed Dec 10, 2014
1 parent 333f90d commit 59fd2ca
Show file tree
Hide file tree
Showing 19 changed files with 882 additions and 6 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
jspm_packages
bower_components
.idea
.DS_STORE
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
jspm_packages
bower_components
.idea
5 changes: 2 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 aurelia
Copyright (c) 2014 The Durandal Project

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,5 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

SOFTWARE.
76 changes: 73 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,74 @@
framework
=========
# aurelia-framework

The aurelia framework brings together all the required core libraries into an application framework.
This library is part of the [Aurelia](http://www.aurelia.io/) platform and contains the aurelia framework which brings together all the required core aurelia libraries into a ready-to-go application-building platform.

> To keep up to date on [Aurelia](http://www.aurelia.io/), please visit and subscribe to [the official blog](http://blog.durandal.io/). If you have questions, we invite you to join us on [our Gitter Channel](https://gitter.im/Aurelia/Discuss).
## Dependencies

* [aurelia-dependency-injection](https://github.com/aurelia/dependency-injection)
* [aurelia-binding](https://github.com/aurelia/binding)
* [aurelia-metadata](https://github.com/aurelia/metadata)
* [aurelia-templating](https://github.com/aurelia/templating)
* [aurelia-loader](https://github.com/aurelia/loader)
* [aurelia-task-queue](https://github.com/aurelia/task-queue)
* [aurelia-event-aggregator](https://github.com/aurelia/event-aggregator)
* [aurelia-logging](https://github.com/aurelia/logging)

## Platform Support

This library can be used in the **browser** only.

## Building The Code

To build the code, follow these steps.

1. Ensure that [NodeJS](http://nodejs.org/) is installed. This provides the platform on which the build tooling runs.
2. From the project folder, execute the following command:

```shell
npm install
```
3. Ensure that [Gulp](http://gulpjs.com/) is installed. If you need to install it, use the following command:

```shell
npm install -g gulp
```
4. To build the code, you can now run:

```shell
gulp build
```
5. You will find the compiled code in the `dist` folder, available in three module formats: AMD, CommonJS and ES6.

6. See `gulpfile.js` for other tasks related to generating the docs and linting.

## Running The Tests

To run the unit tests, first ensure that you have followed the steps above in order to install all dependencies and successfully build the library. Once you have done that, proceed with these additional steps:

1. Ensure that the [Karma](http://karma-runner.github.io/) CLI is installed. If you need to install it, use the following command:

```shell
npm install -g karma-cli
```
2. Ensure that [jspm](http://jspm.io/) is installed. If you need to install it, use the following commnand:

```shell
npm install -g jspm
```
3. Install the client-side dependencies with jspm:

```shell
jspm install
```

4. You can now run the tests with this command:

```shell
karma start
```

## Contributing

We'd love for you to contribute to our source code and to make this project even better than it is today! If this interests you, please begin by reading [our contributing guidelines](https://github.com/DurandalProject/about/blob/master/CONTRIBUTING.md). The contributing document will provide you with all the information you need to get started. Once you have read that, you will need to also [sign our CLA](http://goo.gl/forms/dI8QDDSyKR) before we can accepts a Pull Request from you. More information on the process is including in the [contributor's guide](https://github.com/DurandalProject/about/blob/master/CONTRIBUTING.md).
39 changes: 39 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
System.config({
"paths": {
"*": "*.js",
"github:*": "jspm_packages/github/*.js"
}
});

System.config({
"map": {
"aurelia-binding": "github:aurelia/binding@0.0.1",
"aurelia-dependency-injection": "github:aurelia/dependency-injection@0.0.3",
"aurelia-event-aggregator": "github:aurelia/event-aggregator@0.0.1",
"aurelia-loader": "github:aurelia/loader@0.0.2",
"aurelia-logging": "github:aurelia/logging@0.0.1",
"aurelia-metadata": "github:aurelia/metadata@0.0.5",
"aurelia-task-queue": "github:aurelia/task-queue@0.0.2",
"aurelia-templating": "github:aurelia/templating@0.0.1",
"github:aurelia/binding@0.0.1": {
"aurelia-metadata": "github:aurelia/metadata@0.0.5",
"aurelia-task-queue": "github:aurelia/task-queue@0.0.2"
},
"github:aurelia/dependency-injection@0.0.3": {
"aurelia-metadata": "github:aurelia/metadata@0.0.5"
},
"github:aurelia/loader@0.0.2": {
"aurelia-path": "github:aurelia/path@0.0.1"
},
"github:aurelia/templating@0.0.1": {
"aurelia-binding": "github:aurelia/binding@0.0.1",
"aurelia-dependency-injection": "github:aurelia/dependency-injection@0.0.3",
"aurelia-loader": "github:aurelia/loader@0.0.2",
"aurelia-logging": "github:aurelia/logging@0.0.1",
"aurelia-metadata": "github:aurelia/metadata@0.0.5",
"aurelia-path": "github:aurelia/path@0.0.1",
"aurelia-task-queue": "github:aurelia/task-queue@0.0.2"
}
}
});

105 changes: 105 additions & 0 deletions dist/amd/aurelia.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-loader", "aurelia-templating", "aurelia-event-aggregator"], function (exports, _aureliaLogging, _aureliaDependencyInjection, _aureliaLoader, _aureliaTemplating, _aureliaEventAggregator) {
"use strict";

var LogManager = _aureliaLogging;
var Container = _aureliaDependencyInjection.Container;
var Loader = _aureliaLoader.Loader;
var BindingLanguage = _aureliaTemplating.BindingLanguage;
var ResourceCoordinator = _aureliaTemplating.ResourceCoordinator;
var ViewSlot = _aureliaTemplating.ViewSlot;
var ResourceRegistry = _aureliaTemplating.ResourceRegistry;
var EventAggregator = _aureliaEventAggregator.EventAggregator;
var includeEventsIn = _aureliaEventAggregator.includeEventsIn;


var logger = LogManager.getLogger("aurelia");

var Aurelia = (function () {
var Aurelia = function Aurelia(loader, container, resources) {
this.loader = loader || Loader.createDefaultLoader();
this.container = container || new Container();
this.resources = resources || new ResourceRegistry();
this.resourcesToLoad = [];

this.withInstance(Aurelia, this);
this.withInstance(Loader, this.loader);
this.withInstance(ResourceRegistry, this.resources);
this.withInstance(EventAggregator, includeEventsIn(this));
};

Aurelia.prototype.withInstance = function (type, instance) {
this.container.registerInstance(type, instance);
return this;
};

Aurelia.prototype.withSingleton = function (type, implementation) {
this.container.registerSingleton(type, implementation);
return this;
};

Aurelia.prototype.withBindingLanguage = function (languageType) {
this.container.registerSingleton(BindingLanguage, languageType);
return this;
};

Aurelia.prototype.withPlugins = function (config, baseUrl) {
logger.error("withPlugins is not yet implemented");
return this;
};

Aurelia.prototype.withResources = function (resources) {
if (Array.isArray(resources)) {
this.resourcesToLoad = this.resourcesToLoad.concat(resources);
} else {
this.resourcesToLoad = this.resourcesToLoad.concat(Array.prototype.slice.call(arguments));
}

return this;
};

Aurelia.prototype.start = function () {
var _this = this;
if (this.started) {
return;
}

this.started = true;
logger.info("Aurelia Starting");

if (!this.container.hasHandler(BindingLanguage)) {
logger.error("You must configure Aurelia with a BindingLanguage implementation.");
}

return this.container.get(ResourceCoordinator).importResources(this.resourcesToLoad).then(function (resources) {
resources.forEach(function (x) {
return x.register(_this.resources);
});
logger.info("Aurelia Started");
return _this;
});
};

Aurelia.prototype.setRoot = function (root, transition, applicationHost) {
var _this2 = this;
if (!applicationHost || typeof applicationHost == "string") {
this.host = document.getElementById(applicationHost || "applicationHost") || document.body;
} else {
this.host = applicationHost;
}

this.host.aurelia = this;

return this.container.get(ResourceCoordinator).loadElement(root).then(function (type) {
_this2.root = type.create(_this2.container);
var slot = new ViewSlot(_this2.host, true);
slot.swap(_this2.root.view);
slot.attached();
return _this2;
});
};

return Aurelia;
})();

exports.Aurelia = Aurelia;
});
49 changes: 49 additions & 0 deletions dist/amd/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
define(["exports", "./aurelia", "aurelia-dependency-injection", "aurelia-binding", "aurelia-metadata", "aurelia-templating", "aurelia-loader", "aurelia-task-queue", "aurelia-event-aggregator", "aurelia-logging"], function (exports, _aurelia, _aureliaDependencyInjection, _aureliaBinding, _aureliaMetadata, _aureliaTemplating, _aureliaLoader, _aureliaTaskQueue, _aureliaEventAggregator, _aureliaLogging) {
"use strict";

exports.Aurelia = _aurelia.Aurelia;
(function (obj) {
for (var i in obj) {
exports[i] = obj[i];
}
})(_aureliaDependencyInjection);

(function (obj) {
for (var i in obj) {
exports[i] = obj[i];
}
})(_aureliaBinding);

(function (obj) {
for (var i in obj) {
exports[i] = obj[i];
}
})(_aureliaMetadata);

(function (obj) {
for (var i in obj) {
exports[i] = obj[i];
}
})(_aureliaTemplating);

(function (obj) {
for (var i in obj) {
exports[i] = obj[i];
}
})(_aureliaLoader);

(function (obj) {
for (var i in obj) {
exports[i] = obj[i];
}
})(_aureliaTaskQueue);

(function (obj) {
for (var i in obj) {
exports[i] = obj[i];
}
})(_aureliaEventAggregator);

var TheLogManager = _aureliaLogging;
var LogManager = exports.LogManager = TheLogManager;
});
Loading

0 comments on commit 59fd2ca

Please sign in to comment.