initial commit

This commit is contained in:
webstar1987923 2020-04-13 12:20:34 +01:00
commit f86bfc5569
39 changed files with 650 additions and 0 deletions

4
.bowerrc Normal file
View File

@ -0,0 +1,4 @@
{
"directory": "bower_components",
"analytics": false
}

33
.editorconfig Normal file
View File

@ -0,0 +1,33 @@
# 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
[*.js]
indent_style = space
indent_size = 2
[*.hbs]
indent_style = space
indent_size = 2
[*.css]
indent_style = space
indent_size = 2
[*.html]
indent_style = space
indent_size = 2
[*.{diff,md}]
trim_trailing_whitespace = false

9
.ember-cli Normal file
View File

@ -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
}

17
.gitignore vendored Normal file
View File

@ -0,0 +1,17 @@
# See http://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

32
.jshintrc Normal file
View File

@ -0,0 +1,32 @@
{
"predef": [
"document",
"window",
"-Promise"
],
"browser": true,
"boss": true,
"curly": true,
"debug": false,
"devel": true,
"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,
"unused": true
}

20
.travis.yml Normal file
View File

@ -0,0 +1,20 @@
---
language: node_js
sudo: false
cache:
directories:
- node_modules
before_install:
- "npm config set spin false"
- "npm install -g npm@^2"
install:
- npm install -g bower
- npm install
- bower install
script:
- npm test

20
Brocfile.js Normal file
View File

@ -0,0 +1,20 @@
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var app = new EmberApp();
// 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.
module.exports = app.toTree();

9
LICENSE.md Normal file
View File

@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright (c) 2015
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 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.

16
README.md Normal file
View File

@ -0,0 +1,16 @@
# Ember-cli-make-buildinfo
This very simple add-on that will create a buildinfo.txt in your dist dir that
looks similar to the following:
```
[App Name]
configuration=test
built_by=davidmcnamara
build_date=Thu Feb 12 2015 17:05:17 GMT+0000 (GMT)
build_dir=/Users/davidmcnamara/workspace/client-hg
build_host=dmcnamara-imac.local
branch=default
revision=hg:185:365c0862bdc5
tag=2015-w07-rc1
```

0
addon/.gitkeep Normal file
View File

0
app/.gitkeep Normal file
View File

17
bower.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "ember-cli-make-concoction",
"dependencies": {
"handlebars": "~1.3.0",
"jquery": "^1.11.1",
"ember": "1.8.1",
"ember-data": "1.0.0-beta.12",
"ember-resolver": "~0.1.11",
"loader.js": "ember-cli/loader.js#1.0.1",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "rwjblue/ember-cli-test-loader#0.0.4",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.0.2",
"ember-qunit": "0.1.8",
"ember-qunit-notifications": "0.0.4",
"qunit": "~1.15.0"
}
}

5
config/environment.js Normal file
View File

@ -0,0 +1,5 @@
'use strict';
module.exports = function(/* environment, appConfig */) {
return { };
};

107
index.js Normal file
View File

@ -0,0 +1,107 @@
/* jshint node: true */
// https://github.com/walter/ember-cli-make-concoction
// https://gist.github.com/novaugust/9d0133588fc29844afaf
// https://github.com/heyjinkim/ember-cli-index-fragment/blob/master/index.js
var path = require('path');
var fs = require('fs');
var execSync = require('child_process').execSync; // node 0.12
var git = require('git-rev');
var RSVP = require('rsvp');
/*
*[App Name]
*configuration=test
*built_by=davidmcnamara
*build_date=Thu Feb 12 2015 17:05:17 GMT+0000 (GMT)
*build_dir=/Users/davidmcnamara/workspace/client-hg
*build_host=dmcnamara-imac.local
*branch=default
*revision=hg:client:185:365c0862bdc5
*tag=2015-w07-rc1
*/
var appEnv,
revInfo = {};
var getRevInfo = function(project, cb) {
if (fs.existsSync(path.join(project.root, '.hg')) || fs.existsSync(path.join(project.root, '..', '.hg'))) {
var out = execSync('git describe --tags', {encoding: 'utf8'});
revInfo.tag = out.trim();
out = execSync("git branch | sed -n '/\* /s///p'", {encoding: 'utf8'});
revInfo.branch = out.trim();
out = execSync('git describe', {encoding: 'utf8'});
revInfo.revision = 'git:' + out.trim();
cb();
} else if (fs.existsSync(path.join(project.root, '.git'))) {
git.short(function(str) {
revInfo.revision = 'git:' + str;
git.branch(function(branch) {
revInfo.branch = branch;
git.tag(function(tag) {
revInfo.tag = tag;
cb();
});
});
});
} else {
throw 'No hg or git revision found';
}
};
function getBuildInfo(project, cb) {
var buildInfo = '';
fs.readFile(path.join(project.root, 'package.json'), {encoding: 'utf8'}, function(err, data) {
if (err) {
throw err;
}
getRevInfo(project, function() {
var pkg = JSON.parse(data);
buildInfo += '[' + pkg.name + ']\n' +
'configuration=' + appEnv + '\n' +
'built_by=' + process.env.USER + '\n' +
'build_date=' + (new Date()) + '\n' +
'build_dir=' + (project.root) + '\n' +
'build_host=' + require('os').hostname() + '\n' +
'branch=' + (revInfo.branch?revInfo.branch:'Unknown') + '\n' +
'revision=' + (revInfo.revision?revInfo.revision:'Unknown') + '\n' +
'tag=' + (revInfo.tag?revInfo.tag:'') + '\n';
cb(buildInfo);
});
});
}
module.exports = {
name: 'ember-cli-make-buildinfo',
config: function(env/*, appConfig*/) {
appEnv = env;
},
postBuild: function(result) {
var project = this.project;
return new RSVP.Promise(function (resolve) {
getBuildInfo(project, function(buildInfo) {
fs.writeFileSync(path.join(result.directory, 'buildinfo.txt'), buildInfo, 'utf8');
resolve();
});
});
}
};

63
package.json Normal file
View File

@ -0,0 +1,63 @@
{
"name": "ember-cli-make-buildinfo",
"version": "0.0.1",
"description": "Adds buildinfo.txt to builds of your app.",
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"start": "ember server",
"build": "ember build",
"test": "ember test"
},
"repository": {
"type": "git",
"url": "git://github.com/mackers/ember-cli-make-buildinfo.git"
},
"engines": {
"node": ">= 0.10.0"
},
"author": {
"name": "David McNamara",
"email": "david@rocksteady.com"
},
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.0.0",
"broccoli-ember-hbs-template-compiler": "^1.6.1",
"ember-cli": "0.1.7",
"ember-cli-content-security-policy": "0.3.0",
"ember-cli-dependency-checker": "0.0.7",
"ember-cli-6to5": "0.2.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"
],
"ember-addon": {
"configPath": "tests/dummy/config"
},
"dependencies": {
"git-rev": "~0.2.1",
"glob": "^4.3.2",
"rsvp": "^3.2.1"
},
"gitHead": "b0d367ddf015e29e0b83146490b6aa5933524ee9",
"readme": "# Ember-cli-make-buildinfo\n\nThis very simple add-on that will create a buildinfo.txt in your dist dir that\nlooks similar to the following:\n\n<pre>\n[App Name]\nconfiguration=test\nbuilt_by=davidmcnamara\nbuild_date=Thu Feb 12 2015 17:05:17 GMT+0000 (GMT)\nbuild_dir=/Users/davidmcnamara/workspace/client-hg\nbuild_host=dmcnamara-imac.local\nbranch=default\nrevision=hg:185:365c0862bdc5\ntag=2015-w07-rc1\n</pre>\n\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/mackers/ember-cli-make-buildinfo/issues"
},
"homepage": "https://github.com/mackers/ember-cli-make-buildinfo#readme",
"_id": "ember-cli-make-buildinfo@0.0.1",
"_shasum": "488b0b48d0cbddeaf3f648fbd6d75ae4e284f508",
"_from": "git://github.com/mackers/ember-cli-make-buildinfo.git",
"_resolved": "git://github.com/mackers/ember-cli-make-buildinfo.git#b0d367ddf015e29e0b83146490b6aa5933524ee9"
}

11
testem.json Normal file
View File

@ -0,0 +1,11 @@
{
"framework": "qunit",
"test_page": "tests/index.html",
"launch_in_ci": [
"PhantomJS"
],
"launch_in_dev": [
"PhantomJS",
"Chrome"
]
}

74
tests/.jshintrc Normal file
View File

@ -0,0 +1,74 @@
{
"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
}

16
tests/dummy/app/app.js Normal file
View File

@ -0,0 +1,16 @@
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;

View File

View File

View File

View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Dummy</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{content-for 'head'}}
<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/dummy.css">
{{content-for 'head-footer'}}
</head>
<body>
{{content-for 'body'}}
<script src="assets/vendor.js"></script>
<script src="assets/dummy.js"></script>
{{content-for 'body-footer'}}
</body>
</html>

View File

11
tests/dummy/app/router.js Normal file
View File

@ -0,0 +1,11 @@
import Ember from 'ember';
import config from './config/environment';
var Router = Ember.Router.extend({
location: config.locationType
});
Router.map(function() {
});
export default Router;

View File

View File

@ -0,0 +1,3 @@
html, body {
margin: 20px;
}

View File

@ -0,0 +1,3 @@
<h2 id="title">Welcome to Ember.js</h2>
{{outlet}}

View File

View File

@ -0,0 +1,47 @@
/* 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;
};

View File

View File

@ -0,0 +1,15 @@
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->
<!-- Most restrictive policy: -->
<site-control permitted-cross-domain-policies="none"/>
<!-- Least restrictive policy: -->
<!--
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" to-ports="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
-->
</cross-domain-policy>

View File

@ -0,0 +1,2 @@
# http://www.robotstxt.org
User-agent: *

11
tests/helpers/resolver.js Normal file
View File

@ -0,0 +1,11 @@
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;

View File

@ -0,0 +1,19 @@
import Ember from 'ember';
import Application from '../../app';
import Router from '../../router';
import config from '../../config/environment';
export default function startApp(attrs) {
var application;
var attributes = Ember.merge({}, config.APP);
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
Ember.run(function() {
application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
});
return application;
}

49
tests/index.html Normal file
View File

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Dummy Tests</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{content-for 'head'}}
{{content-for 'test-head'}}
<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/dummy.css">
<link rel="stylesheet" href="assets/test-support.css">
<style>
#ember-testing-container {
position: absolute;
background: white;
bottom: 0;
right: 0;
width: 640px;
height: 384px;
overflow: auto;
z-index: 9999;
border: 1px solid #ccc;
}
#ember-testing {
zoom: 50%;
}
</style>
{{content-for 'head-footer'}}
{{content-for 'test-head-footer'}}
</head>
<body>
{{content-for 'body'}}
{{content-for 'test-body'}}
<script src="assets/vendor.js"></script>
<script src="assets/test-support.js"></script>
<script src="assets/dummy.js"></script>
<script src="testem.js"></script>
<script src="assets/test-loader.js"></script>
{{content-for 'body-footer'}}
{{content-for 'test-body-footer'}}
</body>
</html>

12
tests/test-helper.js Normal file
View File

@ -0,0 +1,12 @@
import resolver from './helpers/resolver';
import {
setResolver
} from 'ember-qunit';
setResolver(resolver);
document.write('<div id="ember-testing-container"><div id="ember-testing"></div></div>');
QUnit.config.urlConfig.push({ id: 'nocontainer', label: 'Hide container'});
var containerVisibility = QUnit.urlParams.nocontainer ? 'hidden' : 'visible';
document.getElementById('ember-testing-container').style.visibility = containerVisibility;

0
tests/unit/.gitkeep Normal file
View File

0
vendor/.gitkeep vendored Normal file
View File