From f46f66f054d51aa630129ab9d9ac0d5002303ecf Mon Sep 17 00:00:00 2001 From: Vimal-Ramakrishnan Date: Fri, 14 Jul 2017 00:20:29 +0530 Subject: [PATCH] app-setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Done with container process. Let’s start work on this. --- .editorconfig | 20 +++++++ .ember-cli | 9 ++++ .eslintrc.js | 13 +++++ .gitignore | 17 ++++++ .travis.yml | 21 ++++++++ .watchmanconfig | 3 ++ README.md | 52 ++++++++++++++++++- app/app.js | 18 +++++++ app/components/.gitkeep | 0 app/components/app/app-container/component.js | 4 ++ app/components/app/app-container/template.hbs | 3 ++ app/controllers/.gitkeep | 0 app/helpers/.gitkeep | 0 app/index.html | 25 +++++++++ app/models/.gitkeep | 0 app/resolver.js | 3 ++ app/router.js | 12 +++++ app/routes/.gitkeep | 0 app/styles/app.css | 0 app/templates/application.hbs | 5 ++ app/templates/components/.gitkeep | 0 config/environment.js | 50 ++++++++++++++++++ config/targets.js | 10 ++++ ember-cli-build.js | 23 ++++++++ package.json | 44 ++++++++++++++++ public/crossdomain.xml | 15 ++++++ public/robots.txt | 3 ++ testem.js | 12 +++++ tests/.eslintrc.js | 5 ++ tests/helpers/destroy-app.js | 5 ++ tests/helpers/module-for-acceptance.js | 23 ++++++++ tests/helpers/resolver.js | 11 ++++ tests/helpers/start-app.js | 15 ++++++ tests/index.html | 33 ++++++++++++ tests/integration/.gitkeep | 0 .../app/app-container/component-test.js | 25 +++++++++ tests/test-helper.js | 8 +++ tests/unit/.gitkeep | 0 vendor/.gitkeep | 0 39 files changed, 485 insertions(+), 2 deletions(-) create mode 100644 .editorconfig create mode 100644 .ember-cli create mode 100644 .eslintrc.js create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 .watchmanconfig create mode 100644 app/app.js create mode 100644 app/components/.gitkeep create mode 100644 app/components/app/app-container/component.js create mode 100644 app/components/app/app-container/template.hbs create mode 100644 app/controllers/.gitkeep create mode 100644 app/helpers/.gitkeep create mode 100644 app/index.html create mode 100644 app/models/.gitkeep create mode 100644 app/resolver.js create mode 100644 app/router.js create mode 100644 app/routes/.gitkeep create mode 100644 app/styles/app.css create mode 100644 app/templates/application.hbs create mode 100644 app/templates/components/.gitkeep create mode 100644 config/environment.js create mode 100644 config/targets.js create mode 100644 ember-cli-build.js create mode 100644 package.json create mode 100644 public/crossdomain.xml create mode 100644 public/robots.txt create mode 100644 testem.js create mode 100644 tests/.eslintrc.js create mode 100644 tests/helpers/destroy-app.js create mode 100644 tests/helpers/module-for-acceptance.js create mode 100644 tests/helpers/resolver.js create mode 100644 tests/helpers/start-app.js create mode 100644 tests/index.html create mode 100644 tests/integration/.gitkeep create mode 100644 tests/integration/components/app/app-container/component-test.js create mode 100644 tests/test-helper.js create mode 100644 tests/unit/.gitkeep create mode 100644 vendor/.gitkeep diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..219985c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 + +[*.hbs] +insert_final_newline = false + +[*.{diff,md}] +trim_trailing_whitespace = false diff --git a/.ember-cli b/.ember-cli new file mode 100644 index 0000000..ee64cfe --- /dev/null +++ b/.ember-cli @@ -0,0 +1,9 @@ +{ + /** + Ember CLI sends analytics information by default. The data is completely + anonymous, but there are times when you might want to disable this behavior. + + Setting `disableAnalytics` to true will prevent any data from being sent. + */ + "disableAnalytics": false +} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..2873e2f --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,13 @@ +module.exports = { + root: true, + parserOptions: { + ecmaVersion: 2017, + sourceType: 'module' + }, + extends: 'eslint:recommended', + env: { + browser: true + }, + rules: { + } +}; diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ad14dd --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# See https://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/tmp + +# dependencies +/node_modules +/bower_components + +# misc +/.sass-cache +/connect.lock +/coverage/* +/libpeerconnection.log +npm-debug.log* +testem.log diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..385f003 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +--- +language: node_js +node_js: + - "6" + +sudo: false + +cache: + directories: + - $HOME/.npm + +before_install: + - npm config set spin false + - npm install -g phantomjs-prebuilt + - phantomjs --version + +install: + - npm install + +script: + - npm test diff --git a/.watchmanconfig b/.watchmanconfig new file mode 100644 index 0000000..e7834e3 --- /dev/null +++ b/.watchmanconfig @@ -0,0 +1,3 @@ +{ + "ignore_dirs": ["tmp", "dist"] +} diff --git a/README.md b/README.md index 0d698dd..0c2eaea 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,50 @@ -# Forli-client -Ember app for Forli +# forli + +This README outlines the details of collaborating on this Ember application. +A short introduction of this app could easily go here. + +## Prerequisites + +You will need the following things properly installed on your computer. + +* [Git](https://git-scm.com/) +* [Node.js](https://nodejs.org/) (with NPM) +* [Ember CLI](https://ember-cli.com/) +* [PhantomJS](http://phantomjs.org/) + +## Installation + +* `git clone ` this repository +* `cd forli` +* `npm install` + +## Running / Development + +* `ember serve` +* Visit your app at [http://localhost:4200](http://localhost:4200). + +### Code Generators + +Make use of the many generators for code, try `ember help generate` for more details + +### Running Tests + +* `ember test` +* `ember test --server` + +### Building + +* `ember build` (development) +* `ember build --environment production` (production) + +### Deploying + +Specify what it takes to deploy your app. + +## Further Reading / Useful Links + +* [ember.js](http://emberjs.com/) +* [ember-cli](https://ember-cli.com/) +* Development Browser Extensions + * [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi) + * [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/) diff --git a/app/app.js b/app/app.js new file mode 100644 index 0000000..831ad61 --- /dev/null +++ b/app/app.js @@ -0,0 +1,18 @@ +import Ember from 'ember'; +import Resolver from './resolver'; +import loadInitializers from 'ember-load-initializers'; +import config from './config/environment'; + +let App; + +Ember.MODEL_FACTORY_INJECTIONS = true; + +App = Ember.Application.extend({ + modulePrefix: config.modulePrefix, + podModulePrefix: config.podModulePrefix, + Resolver +}); + +loadInitializers(App, config.modulePrefix); + +export default App; diff --git a/app/components/.gitkeep b/app/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/components/app/app-container/component.js b/app/components/app/app-container/component.js new file mode 100644 index 0000000..926b613 --- /dev/null +++ b/app/components/app/app-container/component.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ +}); diff --git a/app/components/app/app-container/template.hbs b/app/components/app/app-container/template.hbs new file mode 100644 index 0000000..42b42a1 --- /dev/null +++ b/app/components/app/app-container/template.hbs @@ -0,0 +1,3 @@ +Welcome to Forli +Let's start this :) awesome stuff !!! +{{yield}} diff --git a/app/controllers/.gitkeep b/app/controllers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/helpers/.gitkeep b/app/helpers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/index.html b/app/index.html new file mode 100644 index 0000000..5a3d524 --- /dev/null +++ b/app/index.html @@ -0,0 +1,25 @@ + + + + + + Forli + + + + {{content-for "head"}} + + + + + {{content-for "head-footer"}} + + + {{content-for "body"}} + + + + + {{content-for "body-footer"}} + + diff --git a/app/models/.gitkeep b/app/models/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/resolver.js b/app/resolver.js new file mode 100644 index 0000000..2fb563d --- /dev/null +++ b/app/resolver.js @@ -0,0 +1,3 @@ +import Resolver from 'ember-resolver'; + +export default Resolver; diff --git a/app/router.js b/app/router.js new file mode 100644 index 0000000..cdc2578 --- /dev/null +++ b/app/router.js @@ -0,0 +1,12 @@ +import Ember from 'ember'; +import config from './config/environment'; + +const Router = Ember.Router.extend({ + location: config.locationType, + rootURL: config.rootURL +}); + +Router.map(function() { +}); + +export default Router; diff --git a/app/routes/.gitkeep b/app/routes/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/styles/app.css b/app/styles/app.css new file mode 100644 index 0000000..e69de29 diff --git a/app/templates/application.hbs b/app/templates/application.hbs new file mode 100644 index 0000000..10dfbae --- /dev/null +++ b/app/templates/application.hbs @@ -0,0 +1,5 @@ +{{#app/app-container}} +
+ {{outlet}} +
+{{/app/app-container}} diff --git a/app/templates/components/.gitkeep b/app/templates/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/config/environment.js b/config/environment.js new file mode 100644 index 0000000..4fe153c --- /dev/null +++ b/config/environment.js @@ -0,0 +1,50 @@ +/* eslint-env node */ + +module.exports = function(environment) { + var ENV = { + modulePrefix: 'forli', + environment: environment, + rootURL: '/', + locationType: 'auto', + EmberENV: { + FEATURES: { + // Here you can enable experimental features on an ember canary build + // e.g. 'with-controller': true + }, + EXTEND_PROTOTYPES: { + // Prevent Ember Data from overriding Date.parse. + Date: false + } + }, + + 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.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/config/targets.js b/config/targets.js new file mode 100644 index 0000000..2bebfac --- /dev/null +++ b/config/targets.js @@ -0,0 +1,10 @@ +/* eslint-env node */ + +module.exports = { + browsers: [ + 'ie 9', + 'last 1 Chrome versions', + 'last 1 Firefox versions', + 'last 1 Safari versions' + ] +}; diff --git a/ember-cli-build.js b/ember-cli-build.js new file mode 100644 index 0000000..c9be049 --- /dev/null +++ b/ember-cli-build.js @@ -0,0 +1,23 @@ +/* eslint-env node */ +const EmberApp = require('ember-cli/lib/broccoli/ember-app'); + +module.exports = function(defaults) { + var app = new EmberApp(defaults, { + // Add options here + }); + + // Use `app.import` to add additional libraries to the generated + // output files. + // + // If you need to use different assets in different + // environments, specify an object as the first parameter. That + // object's keys should be the environment name and the values + // should be the asset to use in that environment. + // + // If the library that you are including contains AMD or ES6 + // modules that you would like to import into your application + // please specify an object with the list of modules as keys + // along with the exports of each module as its value. + + return app.toTree(); +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..898136a --- /dev/null +++ b/package.json @@ -0,0 +1,44 @@ +{ + "name": "forli", + "version": "0.0.0", + "description": "Small description for forli goes here", + "license": "MIT", + "author": "", + "directories": { + "doc": "doc", + "test": "tests" + }, + "repository": "", + "scripts": { + "build": "ember build", + "start": "ember server", + "test": "ember test" + }, + "devDependencies": { + "broccoli-asset-rev": "^2.4.5", + "ember-ajax": "^3.0.0", + "ember-cli": "2.13.1", + "ember-cli-app-version": "^3.0.0", + "ember-cli-babel": "^6.0.0", + "ember-cli-dependency-checker": "^1.3.0", + "ember-cli-eslint": "^3.0.0", + "ember-cli-htmlbars": "^1.1.1", + "ember-cli-htmlbars-inline-precompile": "^0.4.0", + "ember-cli-inject-live-reload": "^1.4.1", + "ember-cli-qunit": "^4.0.0", + "ember-cli-shims": "^1.1.0", + "ember-cli-sri": "^2.1.0", + "ember-cli-uglify": "^1.2.0", + "ember-data": "^2.13.0", + "ember-export-application-global": "^2.0.0", + "ember-load-initializers": "^1.0.0", + "ember-resolver": "^4.0.0", + "ember-source": "~2.13.0", + "ember-welcome-page": "^3.0.0", + "loader.js": "^4.2.3" + }, + "engines": { + "node": ">= 4" + }, + "private": true +} diff --git a/public/crossdomain.xml b/public/crossdomain.xml new file mode 100644 index 0000000..0c16a7a --- /dev/null +++ b/public/crossdomain.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..f591645 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,3 @@ +# http://www.robotstxt.org +User-agent: * +Disallow: diff --git a/testem.js b/testem.js new file mode 100644 index 0000000..b234048 --- /dev/null +++ b/testem.js @@ -0,0 +1,12 @@ +/* eslint-env node */ +module.exports = { + "test_page": "tests/index.html?hidepassed", + "disable_watching": true, + "launch_in_ci": [ + "PhantomJS" + ], + "launch_in_dev": [ + "PhantomJS", + "Chrome" + ] +}; diff --git a/tests/.eslintrc.js b/tests/.eslintrc.js new file mode 100644 index 0000000..fbf2555 --- /dev/null +++ b/tests/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + env: { + embertest: true + } +}; diff --git a/tests/helpers/destroy-app.js b/tests/helpers/destroy-app.js new file mode 100644 index 0000000..c3d4d1a --- /dev/null +++ b/tests/helpers/destroy-app.js @@ -0,0 +1,5 @@ +import Ember from 'ember'; + +export default function destroyApp(application) { + Ember.run(application, 'destroy'); +} diff --git a/tests/helpers/module-for-acceptance.js b/tests/helpers/module-for-acceptance.js new file mode 100644 index 0000000..76996fd --- /dev/null +++ b/tests/helpers/module-for-acceptance.js @@ -0,0 +1,23 @@ +import { module } from 'qunit'; +import Ember from 'ember'; +import startApp from '../helpers/start-app'; +import destroyApp from '../helpers/destroy-app'; + +const { RSVP: { Promise } } = Ember; + +export default function(name, options = {}) { + module(name, { + beforeEach() { + this.application = startApp(); + + if (options.beforeEach) { + return options.beforeEach.apply(this, arguments); + } + }, + + afterEach() { + let afterEach = options.afterEach && options.afterEach.apply(this, arguments); + return Promise.resolve(afterEach).then(() => destroyApp(this.application)); + } + }); +} diff --git a/tests/helpers/resolver.js b/tests/helpers/resolver.js new file mode 100644 index 0000000..b208d38 --- /dev/null +++ b/tests/helpers/resolver.js @@ -0,0 +1,11 @@ +import Resolver from '../../resolver'; +import config from '../../config/environment'; + +const 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 new file mode 100644 index 0000000..9a605eb --- /dev/null +++ b/tests/helpers/start-app.js @@ -0,0 +1,15 @@ +import Ember from 'ember'; +import Application from '../../app'; +import config from '../../config/environment'; + +export default function startApp(attrs) { + let attributes = Ember.merge({}, config.APP); + attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; + + return Ember.run(() => { + let application = Application.create(attributes); + application.setupForTesting(); + application.injectTestHelpers(); + return application; + }); +} diff --git a/tests/index.html b/tests/index.html new file mode 100644 index 0000000..b78ddf1 --- /dev/null +++ b/tests/index.html @@ -0,0 +1,33 @@ + + + + + + Forli 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/integration/.gitkeep b/tests/integration/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/components/app/app-container/component-test.js b/tests/integration/components/app/app-container/component-test.js new file mode 100644 index 0000000..a4ee73d --- /dev/null +++ b/tests/integration/components/app/app-container/component-test.js @@ -0,0 +1,25 @@ +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('app/app-container', 'Integration | Component | app/app container', { + integration: true +}); + +test('it renders', function(assert) { + + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.on('myAction', function(val) { ... }); + + this.render(hbs`{{app/app-container}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage: + this.render(hbs` + {{#app/app-container}} + template block text + {{/app/app-container}} + `); + + assert.equal(this.$().text().trim(), 'template block text'); +}); diff --git a/tests/test-helper.js b/tests/test-helper.js new file mode 100644 index 0000000..f219659 --- /dev/null +++ b/tests/test-helper.js @@ -0,0 +1,8 @@ +import resolver from './helpers/resolver'; +import { + setResolver +} from 'ember-qunit'; +import { start } from 'ember-cli-qunit'; + +setResolver(resolver); +start(); diff --git a/tests/unit/.gitkeep b/tests/unit/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/.gitkeep b/vendor/.gitkeep new file mode 100644 index 0000000..e69de29