diff --git a/.travis.yml b/.travis.yml index cf23938..c5a0125 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,7 @@ before_install: - "npm install -g npm@^2" install: - - npm install -g bower - npm install - - bower install script: - npm test diff --git a/README.md b/README.md index ddac175..8a02999 100644 --- a/README.md +++ b/README.md @@ -1,102 +1,62 @@ -# ember-cli-github-pages +# angular-cli-github-pages -[![npm version](https://badge.fury.io/js/ember-cli-github-pages.svg)](http://badge.fury.io/js/ember-cli-github-pages) -[![Ember Observer Score](http://emberobserver.com/badges/ember-cli-github-pages.svg)](http://emberobserver.com/addons/ember-cli-github-pages) -[![Code Climate](https://codeclimate.com/github/poetic/ember-cli-github-pages/badges/gpa.svg)](https://codeclimate.com/github/poetic/ember-cli-github-pages) -[![Dependency Status](https://david-dm.org/poetic/ember-cli-github-pages.svg)](https://david-dm.org/poetic/ember-cli-github-pages) -[![devDependency Status](https://david-dm.org/poetic/ember-cli-github-pages/dev-status.svg)](https://david-dm.org/poetic/ember-cli-github-pages#info=devDependencies) +Angular CLI addon for deploying apps to GitHub pages. +If you need to quickly deploy and redeploy a small Angular 2 app via GitHub pages this angular-cli +addon is for you! -If you need to throw up a quick example of your addon in action, this is the -addon for you! +This addon does the following: -This addon provides new command(s) to help manage a gh-pages branch for your -addon. It's an addon for addons. +- creates GitHub repo for the current project if one doesn't exist +- rebuilds the app at the current `HEAD` +- creates a local `gh-pages` branch if one doesn't exist +- moves your app to the `gh-pages` branch and creates a commit +- pushes the `gh-pages` branch to github +- returns back to the original `HEAD` -## Installation & Setup - -First you need to install ember-cli-github-pages: - -ember-cli - 0.2.3 or newer - -```sh -ember install ember-cli-github-pages -``` -ember-cli - 0.1.5 to 0.2.3 -```sh -ember install:addon ember-cli-github-pages -``` - -ember-cli - 0.1.4 and below -```sh -npm install --save-dev ember-cli-github-pages -ember generate ember-cli-github-pages -``` +## Installation & Setup -In order to have any assets you have in your repo load correctly you need to add the following to your `tests/dummy/config/environment.js` file: -```javascript -if (environment === 'production') { - ENV.baseURL = '/name-of-your-repo' -} -``` +This addon has the following prerequisites: -Commit these changes `git add -A && git commit -m "Added ember-cli-github-pages addon"` +- Node.js 4.x +- SSH keys setup for authentication with GitHub (see "Authentication" section below) +- Angular project created via [angular-cli](https://github.com/angular/angular-cli) -Then you need to create the gh-pages branch and remove the unnecessary files: +To install this addon all you need to do is install angular-cli-github-pages via npm: ```sh -git checkout --orphan gh-pages && rm -rf `ls -a | grep -vE '\.gitignore|\.git|node_modules|bower_components|(^[.]{1,2}/?$)'` && git add -A && git commit -m "initial gh-pages commit" +npm install --save-dev angular-cli-github-pages ``` ## Usage Once that's done, you can checkout the branch you want to create the gh-page -from(likely master) and run the command to build and commit it. +from (likely master) and run the command to build and commit it. -Then run ember github-pages:commit --message "some commit message" in order to rebuild gh-pages branch. +Then run `ng github-pages:deploy` in order to rebuild gh-pages branch and deploy it. ```sh git checkout master -ember github-pages:commit --message "Initial gh-pages release" +ng github-pages:deploy --message "Optional commit message" ``` -### A note about Org and User Pages - -While in general, github repo pages will serve the content in the `gh-pages` branch, [org and user pages](https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages) serve content in the `master` branch. When using this addon to develop a Org or User page, edit your Ember Application on an alternate branch such as `ember`. Once you are ready to build the application and send to GitHub you can either: +## Authentication -* add the `--branch master` option to the `ember github-pages:commit` command -* make the `gh-pages` branch on your local machine track the master branch on `origin` via the command: +This addon relies on ssh authentication for all git operations that communicate with github.com. +To simplify the authentication, be sure to [setup your ssh keys](https://help.github.com/articles/generating-ssh-keys/). -```sh -git branch --set-upstream gh-pages origin/master -``` +For repository creation, the addon needs to make a single https call to the GitHub api, for this +user name and password are requested when the repo is being created. -### Advanced Usage +*Note: Two factor authentication is currently not supported by this addon.* -You may optionally specify an ember build environment and a branch name as parameters - -```sh -git checkout master -ember github-pages:commit --message "Initial demo app release" \ - --branch="my-demo-app" \ - --environment=development -``` -| Optional Argument | Default Value | Description | -|-------------------|---------------|-------------| -| environment | `production` | Ember build environment (i.e., `development`, `production`) | -| branch | `gh-pages` | Branch to commit your app to | - -You will still need to push the gh-pages branch up to github using git. Once you -do that you can access the repo at `http://username.github.io/repo-name`. It may -take a few minutes after pushing the code to show up. ## Authors -- [Jake Craige](http://twitter.com/jakecraige) - -[We are very thankful for our many contributors](https://github.com/poetic/ember-cli-github-pages/graphs/contributors) +- [Igor Minar](http://twitter.com/IgorMinar) +- Based on [ember-cli-github-pages](https://github.com/poetic/ember-cli-github-pages) by [Jake Craige](http://twitter.com/jakecraige) -## Legal +## License [Licensed under the MIT license](http://www.opensource.org/licenses/mit-license.php) diff --git a/blueprints/ember-cli-github-pages/index.js b/blueprints/ember-cli-github-pages/index.js deleted file mode 100644 index a5389b4..0000000 --- a/blueprints/ember-cli-github-pages/index.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -var RSVP = require('rsvp'); -var path = require('path'); -var fs = require('fs'); -var writeFile = RSVP.denodeify(fs.writeFile); - -module.exports = { - description: 'Updates baseURL in config to work on gh-pages', - normalizeEntityName: function() { }, - - afterInstall: function() { - return this.updateBaseURL().then(function() { - return this.updateLocationType(); - }.bind(this)).then(function() { - this.ui.writeLine('Updated config/environment.js baseURL and locationType.'); - }.bind(this)); - }, - - updateLocationType: function() { - var search = "locationType: 'auto'"; - var replace = "locationType: 'hash'"; - - return this.replaceEnvironment(search, replace); - }, - - updateBaseURL: function() { - var name = this.project.config('production').modulePrefix; - var search = "baseURL: '/'"; - var replace = "baseURL: '/" + name + "'"; - - return this.replaceEnvironment(search, replace); - }, - - replaceEnvironment: function(search, replace) { - return this.replaceInFile('config/environment.js', search, replace); - }, - - replaceInFile: function(pathRelativeToProjectRoot, searchTerm, contentsToInsert) { - var fullPath = path.join(this.project.root, pathRelativeToProjectRoot); - var originalContents = ''; - - if (fs.existsSync(fullPath)) { - originalContents = fs.readFileSync(fullPath, { encoding: 'utf8' }); - } - - var contentsToWrite = originalContents.replace(searchTerm, contentsToInsert); - - var returnValue = { - path: fullPath, - originalContents: originalContents, - contents: contentsToWrite, - inserted: false - }; - - if (contentsToWrite !== originalContents) { - returnValue.inserted = true; - - return writeFile(fullPath, contentsToWrite) - .then(function() { - return returnValue; - }); - } else { - return RSVP.resolve(returnValue); - } - } -} diff --git a/bower.json b/bower.json deleted file mode 100644 index 2159f6b..0000000 --- a/bower.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "ember-cli-github-pages", - "dependencies": { - "handlebars": "~1.3.0", - "jquery": "^1.11.1", - "ember": "1.8.1", - "ember-data": "1.0.0-beta.12", - "ember-resolver": "~0.1.10", - "loader.js": "stefanpenner/loader.js#1.0.1", - "ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.3", - "ember-cli-test-loader": "rwjblue/ember-cli-test-loader#0.0.4", - "ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2", - "ember-qunit": "0.1.8", - "ember-qunit-notifications": "0.0.4", - "qunit": "~1.15.0" - } -} \ No newline at end of file diff --git a/index.js b/index.js index a771b8f..05f72b4 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,7 @@ module.exports = { includedCommands: function() { return { - 'github-pages:commit': require('./lib/commands/commit') + 'github-pages:deploy': require('./lib/commands/deploy') }; } }; diff --git a/lib/commands/commit.js b/lib/commands/commit.js deleted file mode 100644 index 20c8f89..0000000 --- a/lib/commands/commit.js +++ /dev/null @@ -1,103 +0,0 @@ -'use strict'; - -var exec = require('child_process').exec; -var RSVP = require('rsvp'); - -module.exports = { - name: 'github-pages:commit', - aliases: ['gh-pages:commit'], - description: 'Build the test app for production and commit it into a git branch', - works: 'insideProject', - - availableOptions: [{ - name: 'message', - type: String, - default: 'new gh-pages version', - description: 'The commit message to include with the build, must be wrapped in quotes.' - }, { - name: 'environment', - type: String, - default: 'production', - description: 'The ember environment to create a build for' - }, { - name: 'branch', - type: String, - default: 'gh-pages', - description: 'The git branch to push your pages to' - }], - - run: function(options, rawArgs) { - var ui = this.ui; - var root = this.project.root; - var execOptions = { cwd: root }; - - function buildApp() { - var env = options.environment; - return runCommand('ember build --environment=' + env, execOptions); - } - - function checkoutGhPages() { - return runCommand('git checkout ' + options.branch, execOptions); - } - - function copy() { - return runCommand('cp -R dist/* .', execOptions); - } - - function addAndCommit() { - return runCommand('git add . && git commit -m "' + options.message + '"', execOptions) - } - - function returnToPreviousCheckout() { - // Each '\' needed to be escaped here - return runCommand("git checkout `git reflog HEAD | sed -n " + - "'/checkout/ !d; s/.* \\(\\S*\\)$/\\1/;p' | sed '2 !d'`", execOptions); - } - - return buildApp() - .then(checkoutGhPages) - .then(copy) - .then(addAndCommit) - .then(returnToPreviousCheckout) - .then(function() { - var branch = options.branch; - ui.write('Done. All that\'s left is to git push the ' + branch + - ' branch.\nEx: git push origin ' + branch + '\n'); - }); - } -}; - -function runCommand(/* child_process.exec args */) { - var args = Array.prototype.slice.call(arguments); - - var lastIndex = args.length - 1; - var lastArg = args[lastIndex]; - var logOutput = false; - if (typeof lastArg === 'boolean') { - logOutput = lastArg; - args.splice(lastIndex); - } - - return new RSVP.Promise(function(resolve, reject) { - var cb = function(err, stdout, stderr) { - if (logOutput) { - if (stderr) { - console.log(stderr); - } - - if (stdout) { - console.log(stdout); - } - } - - if (err) { - return reject(err); - } - - return resolve(); - }; - - args.push(cb); - exec.apply(exec, args); - }.bind(this)); -} diff --git a/lib/commands/deploy.js b/lib/commands/deploy.js new file mode 100644 index 0000000..eb79be9 --- /dev/null +++ b/lib/commands/deploy.js @@ -0,0 +1,208 @@ +'use strict'; + +var exec = require('child_process').exec; +var RSVP = require('rsvp'); +var https = require('https'); +var inquire = require('inquirer'); +var fs = require('fs'); +var fse = require('fs-extra'); +var path = require('path'); + + +module.exports = { + name: 'github-pages:deploy', + aliases: ['gh-pages:deploy'], + description: 'Build the test app for production, commit it into a git branch, setup GitHub repo and push to it', + works: 'insideProject', + + availableOptions: [{ + name: 'message', + type: String, + default: 'new gh-pages version', + description: 'The commit message to include with the build, must be wrapped in quotes.' + }, { + name: 'environment', + type: String, + default: 'production', + description: 'The Angular environment to create a build for' + }, { + name: 'branch', + type: String, + default: 'gh-pages', + description: 'The git branch to push your pages to' + }], + + run: function(options, rawArgs) { + var ui = this.ui; + var root = this.project.root; + var execOptions = { cwd: root }; + var projectName = this.project.pkg.name; + var projectUrl = ''; + var fsReadDir = RSVP.denodeify(fs.readdir); + var fsCopy = RSVP.denodeify(fse.copy); + + function buildApp() { + var env = options.environment; + return runCommand('ng build --environment=' + env, execOptions); + } + + function checkForPendingChanges() { + return runCommand('git status --porcelain', execOptions).then(stdout => { + if (/\w+/m.test(stdout)) { + return RSVP.reject('Uncommitted file changes found! Please commit all changes before deploying.'); + } + }); + } + + function checkoutGhPages() { + return runCommand('git checkout ' + options.branch, execOptions); + } + + function copy() { + return fsReadDir('dist').then( + (files) => RSVP.all(files.map((file) => fsCopy(path.join('dist', file), path.join('.', file))))); + } + + function addAndCommit() { + return runCommand('git add favicon.ico index.html app* vendor', execOptions). + then(runCommandLater('git commit -m "' + options.message + '"', execOptions)). + then(function() { return true; }, function() { return false; }); + } + + function createGitHubRepoIfNeeded() { + return runCommand('git remote -v'). + then(function(stdout) { + + if (!/origin\s+git@github\.com/m.test(stdout)) { + ui.write("In order to deploy this project via GitHub Pages, we must first create a repository for it...\n"); + + return new RSVP.Promise(function(resolve, reject) { + inquire.prompt([{ + name: 'ghUserName', + type: 'input', + message: 'Please enter your GitHub user name:', + validate: function(userName) { return /\w+/.test(userName); } + }, { + name: 'ghPassword', + type: 'password', + message: 'and your GitHub password (used only once to create the repo):', + validate: function(password) { return /.+/.test(password); } + }], function(answers) { + + projectUrl = `https://${answers.ghUserName.toLowerCase()}.github.io/${projectName}/`; + + var postData = JSON.stringify({ + 'name' : projectName + }); + + var req = https.request({ + hostname: 'api.github.com', + port: 443, + path: '/user/repos', + method: 'POST', + auth: answers.ghUserName + ':' + answers.ghPassword, + headers: { + 'Content-Type': 'application/json', + 'Content-Length': postData.length, + 'User-Agent': 'angular-cli-github-pages' + } + }); + + req.on('response', function(response) { + if (response.statusCode === 201) { + resolve( + runCommand(`git remote add origin git@github.com:${answers.ghUserName}/${projectName}.git`). + then(runCommandLater("git checkout --orphan gh-pages")). + then(runCommandLater("git rm --cached -r . ")). + then(runCommandLater("git add .gitignore")). + then(runCommandLater("git clean -f -d")). + then(runCommandLater("git commit -m \"initial gh-pages commit\"")). + then(runCommandLater("git checkout master")) + ) + } else { + reject(`Failed to create GitHub repo. Error: ${response.statusCode} ${response.statusMessage}`); + } + }); + + req.write(postData); + req.end(); + }); + }); + } else { + var userName = stdout.match(/origin\s+git@github\.com\:([^\/]+)/m)[1].toLowerCase(); + projectUrl = `https://${userName}.github.io/${projectName}/`; + } + }); + } + + function pushToGitRepo(committed) { + if (committed) { + return runCommand("git push origin gh-pages", execOptions).then(function() { return committed; }); + } + return committed; + } + + function returnToPreviousCheckout(committed) { + return runCommand("git checkout -", execOptions).then(function() { return committed; }); + } + + + + return buildApp(). + then(checkForPendingChanges). + then(createGitHubRepoIfNeeded). + then(checkoutGhPages). + then(copy). + then(addAndCommit). + then(returnToPreviousCheckout). + then(pushToGitRepo). + then(function(committed) { + //var branch = options.branch; + if (committed) { + ui.write(`Deployed! Visit ${projectUrl}\n`); + } else { + ui.write('No changes found. Deployment skipped.\n'); + } + }); + } +}; + +function runCommandLater() { + var args = arguments; + return function() { + return runCommand.apply(null, args); + } +} + +function runCommand(/* child_process.exec args */) { + var args = Array.prototype.slice.call(arguments); + + var lastIndex = args.length - 1; + var lastArg = args[lastIndex]; + var logOutput = false; + if (typeof lastArg === 'boolean') { + logOutput = lastArg; + args.splice(lastIndex); + } + + return new RSVP.Promise(function(resolve, reject) { + var cb = function(err, stdout, stderr) { + if (stderr) { + console.log(stderr); + } + + if (logOutput && stdout) { + console.log(stdout); + } + + if (err) { + return reject(err); + } + + return resolve(stdout); + }; + + args.push(cb); + exec.apply(exec, args); + }.bind(this)); +} diff --git a/package.json b/package.json index 943daa6..130a5f9 100644 --- a/package.json +++ b/package.json @@ -1,36 +1,14 @@ { - "name": "ember-cli-github-pages", - "description": "Easily manage gh-pages of your ember-cli addon", - "version": "0.0.6", - "directories": { - "doc": "doc", - "test": "tests" - }, - "scripts": { - "start": "ember server", - "build": "ember build", - "test": "ember test" - }, - "repository": "https://github.com/poetic/ember-cli-github-pages", + "name": "angular-cli-github-pages", + "description": "Easily publish your projects as gh-pages via angular-cli", + "version": "0.2.0", + "repository": "https://github.com/IgorMinar/angular-cli-github-pages", "engines": { - "node": ">= 0.10.0" + "node": ">= 4.1.0" }, - "author": "Jake Craige ", + "author": "Igor Minar ", "license": "MIT", "devDependencies": { - "broccoli-asset-rev": "^1.0.0", - "broccoli-ember-hbs-template-compiler": "^1.6.1", - "ember-cli": "0.1.3", - "ember-cli-content-security-policy": "0.3.0", - "ember-cli-dependency-checker": "0.0.6", - "ember-cli-esnext": "0.1.1", - "ember-cli-ic-ajax": "0.1.1", - "ember-cli-inject-live-reload": "^1.3.0", - "ember-cli-qunit": "0.1.2", - "ember-data": "1.0.0-beta.12", - "ember-export-application-global": "^1.0.0", - "express": "^4.8.5", - "glob": "^4.0.5" }, "keywords": [ "ember-addon" @@ -39,6 +17,8 @@ "configPath": "tests/dummy/config" }, "dependencies": { + "fs-extra": "^0.24.0", + "inquirer": "^0.10.1", "rsvp": "^3.0.14" } } diff --git a/tests/.jshintrc b/tests/.jshintrc deleted file mode 100644 index 6ebf71a..0000000 --- a/tests/.jshintrc +++ /dev/null @@ -1,74 +0,0 @@ -{ - "predef": [ - "document", - "window", - "location", - "setTimeout", - "$", - "-Promise", - "QUnit", - "define", - "console", - "equal", - "notEqual", - "notStrictEqual", - "test", - "asyncTest", - "testBoth", - "testWithDefault", - "raises", - "throws", - "deepEqual", - "start", - "stop", - "ok", - "strictEqual", - "module", - "moduleFor", - "moduleForComponent", - "moduleForModel", - "process", - "expect", - "visit", - "exists", - "fillIn", - "click", - "keyEvent", - "triggerEvent", - "find", - "findWithAssert", - "wait", - "DS", - "isolatedContainer", - "startApp", - "andThen", - "currentURL", - "currentPath", - "currentRouteName" - ], - "node": false, - "browser": false, - "boss": true, - "curly": false, - "debug": false, - "devel": false, - "eqeqeq": true, - "evil": true, - "forin": false, - "immed": false, - "laxbreak": false, - "newcap": true, - "noarg": true, - "noempty": false, - "nonew": false, - "nomen": false, - "onevar": false, - "plusplus": false, - "regexp": false, - "undef": true, - "sub": true, - "strict": false, - "white": false, - "eqnull": true, - "esnext": true -} diff --git a/tests/dummy/app/app.js b/tests/dummy/app/app.js deleted file mode 100644 index 757df38..0000000 --- a/tests/dummy/app/app.js +++ /dev/null @@ -1,16 +0,0 @@ -import Ember from 'ember'; -import Resolver from 'ember/resolver'; -import loadInitializers from 'ember/load-initializers'; -import config from './config/environment'; - -Ember.MODEL_FACTORY_INJECTIONS = true; - -var App = Ember.Application.extend({ - modulePrefix: config.modulePrefix, - podModulePrefix: config.podModulePrefix, - Resolver: Resolver -}); - -loadInitializers(App, config.modulePrefix); - -export default App; diff --git a/tests/dummy/app/components/.gitkeep b/tests/dummy/app/components/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/dummy/app/controllers/.gitkeep b/tests/dummy/app/controllers/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/dummy/app/helpers/.gitkeep b/tests/dummy/app/helpers/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/dummy/app/index.html b/tests/dummy/app/index.html deleted file mode 100644 index 6a7d324..0000000 --- a/tests/dummy/app/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - Dummy - - - - {{content-for 'head'}} - - - - - {{content-for 'head-footer'}} - - - {{content-for 'body'}} - - - - - {{content-for 'body-footer'}} - - diff --git a/tests/dummy/app/models/.gitkeep b/tests/dummy/app/models/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/dummy/app/router.js b/tests/dummy/app/router.js deleted file mode 100644 index cef554b..0000000 --- a/tests/dummy/app/router.js +++ /dev/null @@ -1,11 +0,0 @@ -import Ember from 'ember'; -import config from './config/environment'; - -var Router = Ember.Router.extend({ - location: config.locationType -}); - -Router.map(function() { -}); - -export default Router; diff --git a/tests/dummy/app/routes/.gitkeep b/tests/dummy/app/routes/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/dummy/app/styles/app.css b/tests/dummy/app/styles/app.css deleted file mode 100644 index 9adb5ad..0000000 --- a/tests/dummy/app/styles/app.css +++ /dev/null @@ -1,3 +0,0 @@ -html, body { - margin: 20px; -} diff --git a/tests/dummy/app/templates/application.hbs b/tests/dummy/app/templates/application.hbs deleted file mode 100644 index d08c11f..0000000 --- a/tests/dummy/app/templates/application.hbs +++ /dev/null @@ -1,3 +0,0 @@ -

Welcome to Ember.js

- -{{outlet}} diff --git a/tests/dummy/app/templates/components/.gitkeep b/tests/dummy/app/templates/components/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/dummy/app/views/.gitkeep b/tests/dummy/app/views/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/dummy/config/environment.js b/tests/dummy/config/environment.js deleted file mode 100644 index d3f169f..0000000 --- a/tests/dummy/config/environment.js +++ /dev/null @@ -1,47 +0,0 @@ -/* jshint node: true */ - -module.exports = function(environment) { - var ENV = { - modulePrefix: 'dummy', - environment: environment, - baseURL: '/', - locationType: 'auto', - EmberENV: { - FEATURES: { - // Here you can enable experimental features on an ember canary build - // e.g. 'with-controller': true - } - }, - - APP: { - // Here you can pass flags/options to your application instance - // when it is created - } - }; - - if (environment === 'development') { - // ENV.APP.LOG_RESOLVER = true; - ENV.APP.LOG_ACTIVE_GENERATION = true; - // ENV.APP.LOG_TRANSITIONS = true; - // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; - ENV.APP.LOG_VIEW_LOOKUPS = true; - } - - if (environment === 'test') { - // Testem prefers this... - ENV.baseURL = '/'; - ENV.locationType = 'none'; - - // keep test console output quieter - ENV.APP.LOG_ACTIVE_GENERATION = false; - ENV.APP.LOG_VIEW_LOOKUPS = false; - - ENV.APP.rootElement = '#ember-testing'; - } - - if (environment === 'production') { - - } - - return ENV; -}; diff --git a/tests/dummy/public/.gitkeep b/tests/dummy/public/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/dummy/public/crossdomain.xml b/tests/dummy/public/crossdomain.xml deleted file mode 100644 index 29a035d..0000000 --- a/tests/dummy/public/crossdomain.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - diff --git a/tests/dummy/public/robots.txt b/tests/dummy/public/robots.txt deleted file mode 100644 index 5debfa4..0000000 --- a/tests/dummy/public/robots.txt +++ /dev/null @@ -1,2 +0,0 @@ -# http://www.robotstxt.org -User-agent: * diff --git a/tests/helpers/resolver.js b/tests/helpers/resolver.js deleted file mode 100644 index 28f4ece..0000000 --- a/tests/helpers/resolver.js +++ /dev/null @@ -1,11 +0,0 @@ -import Resolver from 'ember/resolver'; -import config from '../../config/environment'; - -var resolver = Resolver.create(); - -resolver.namespace = { - modulePrefix: config.modulePrefix, - podModulePrefix: config.podModulePrefix -}; - -export default resolver; diff --git a/tests/helpers/start-app.js b/tests/helpers/start-app.js deleted file mode 100644 index e087e48..0000000 --- a/tests/helpers/start-app.js +++ /dev/null @@ -1,19 +0,0 @@ -import Ember from 'ember'; -import Application from '../../app'; -import Router from '../../router'; -import config from '../../config/environment'; - -export default function startApp(attrs) { - var App; - - var attributes = Ember.merge({}, config.APP); - attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; - - Ember.run(function() { - App = Application.create(attributes); - App.setupForTesting(); - App.injectTestHelpers(); - }); - - return App; -} diff --git a/tests/index.html b/tests/index.html deleted file mode 100644 index 4112b61..0000000 --- a/tests/index.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - Dummy Tests - - - - {{content-for 'head'}} - {{content-for 'test-head'}} - - - - - - - {{content-for 'head-footer'}} - {{content-for 'test-head-footer'}} - - - - {{content-for 'body'}} - {{content-for 'test-body'}} - - - - - - - {{content-for 'body-footer'}} - {{content-for 'test-body-footer'}} - - diff --git a/tests/test-helper.js b/tests/test-helper.js deleted file mode 100644 index b5f6449..0000000 --- a/tests/test-helper.js +++ /dev/null @@ -1,12 +0,0 @@ -import resolver from './helpers/resolver'; -import { - setResolver -} from 'ember-qunit'; - -setResolver(resolver); - -document.write('
'); - -QUnit.config.urlConfig.push({ id: 'nocontainer', label: 'Hide container'}); -var containerVisibility = QUnit.urlParams.nocontainer ? 'hidden' : 'visible'; -document.getElementById('ember-testing-container').style.visibility = containerVisibility; diff --git a/tests/unit/.gitkeep b/tests/unit/.gitkeep deleted file mode 100644 index e69de29..0000000