Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
samjsmith authored Mar 13, 2017
2 parents c2b4ee4 + 35afb4d commit 756bdc7
Show file tree
Hide file tree
Showing 18 changed files with 146 additions and 106 deletions.
17 changes: 8 additions & 9 deletions .travis/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ if [[ "${TRAVIS_REPO_SLUG}" != fabric-composer* ]]; then
exit 0
fi

# are we building the docs?
if [ "${DOCS}" != "" ]; then
./.travis/deploy_docs.sh
exit 0
fi


# Set the NPM access token we will use to publish.
npm config set registry https://registry.npmjs.org/
Expand All @@ -61,7 +55,7 @@ export DOCKER_IMAGES="composer-ui composer-playground"

# Push the code to npm.
if [ -z "${TRAVIS_TAG}" ]; then

DOCS="unstable"
# Set the prerelease version.
npm run pkgstamp
export VERSION=$(node -e "console.log(require('${DIR}/package.json').version)")
Expand Down Expand Up @@ -102,7 +96,7 @@ if [ -z "${TRAVIS_TAG}" ]; then
popd

else

DOCS="full"
# Grab the current version.
export VERSION=$(node -e "console.log(require('${DIR}/package.json').version)")

Expand Down Expand Up @@ -158,4 +152,9 @@ else
git push origin master

fi
date

# are we building the docs?
if [ "${DOCS}" != "" ]; then
./.travis/deploy_docs.sh
exit 0
fi
6 changes: 5 additions & 1 deletion .travis/deploy_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ git config push.default simple
echo ${DIR}
cd "${DIR}/packages/composer-website/out"

export REPO="fabric-composer.github.io"
if [ "${DOCS}" == "unstable" ]; then
export REPO="fabric-composer-ubstable.github.io"
else
export REPO="fabric-composer.github.io"
fi

git clone [email protected]:fabric-composer/${REPO}.git
git remote set-url origin ${REPO}.git
Expand Down
14 changes: 7 additions & 7 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!--- Provide a general summary of the pull request in the Title above -->

## Checklist
[ ] A link to the issue/user story that the pull request relates to
[ ] How to recreate the problem without the fix
[ ] Design of the fix
[ ] How to prove that the fix works
[ ] Automated tests that prove the fix keeps on working
[ ] Documentation - any JSDoc, website, or Stackoverflow answers?
- [ ] A link to the issue/user story that the pull request relates to
- [ ] How to recreate the problem without the fix
- [ ] Design of the fix
- [ ] How to prove that the fix works
- [ ] Automated tests that prove the fix keeps on working
- [ ] Documentation - any JSDoc, website, or Stackoverflow answers?


## Issue/User story
Expand Down Expand Up @@ -39,4 +39,4 @@
<!-- Please describe the automated tests that are put in place to stop this recurring -->

## What documentation has been provided for this pull request
<!-- JSDocs, WebSite and answers to StackOverflow questions are possible documentation sources -->
<!-- JSDocs, WebSite and answers to StackOverflow questions are possible documentation sources -->
2 changes: 1 addition & 1 deletion packages/composer-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"all": true,
"check-coverage": true,
"statements": 97,
"branches": 93,
"branches": 92,
"functions": 98,
"lines": 97
}
Expand Down
2 changes: 1 addition & 1 deletion packages/composer-playground/config/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function(config) {
*
* available frameworks: https://npmjs.org/browse/keyword/karma-adapter
*/
frameworks: ['jasmine'],
frameworks: ['jasmine', 'chai', 'sinon', 'sinon-chai'],

// list of files to exclude
exclude: [ ],
Expand Down
43 changes: 33 additions & 10 deletions packages/composer-playground/config/webpack.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,39 @@ const ProvidePlugin = require('webpack/lib/ProvidePlugin');
const DefinePlugin = require('webpack/lib/DefinePlugin');
const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin');

/**
* Webpack Constants
*/
const ENV = process.env.ENV = process.env.NODE_ENV = 'test';
const DOCKER = !!process.env.DOCKER;
const DOCKER_COMPOSE = !!process.env.DOCKER_COMPOSE;
const PLAYGROUND_API = process.env.PLAYGROUND_API;
const PLAYGROUND_API = process.env.PLAYGROUND_API || 'playground-api';

/**
* Webpack configuration
*
* See: http://webpack.github.io/docs/configuration.html#cli
*/
module.exports = function (options) {
return {

/**
* Source map for Karma from the help of karma-sourcemap-loader & karma-webpack
*
* Do not change, leave as is or it wont work.
* See: https://github.com/webpack/karma-webpack#source-maps
*/
devtool: 'inline-source-map',

/**
* Options affecting the resolving of modules.
*
* See: http://webpack.github.io/docs/configuration.html#resolve
*/
/*
* Options affecting the resolving of modules.
*
* See: http://webpack.github.io/docs/configuration.html#resolve
*/
resolve: {
/*

/**
* An array of extensions that should be used to resolve modules.
*
* See: http://webpack.github.io/docs/configuration.html#resolve-extensions
Expand All @@ -59,9 +59,11 @@ module.exports = function (options) {
'path': 'browserfs/dist/shims/path.js',
'processGlobal': 'browserfs/dist/shims/process.js',
'bufferGlobal': 'browserfs/dist/shims/bufferGlobal.js',
'bfsGlobal': require.resolve('browserfs')
'bfsGlobal': require.resolve('browserfs'),
sinon: 'sinon/pkg/sinon'
}
},

/**
* Options affecting the normal modules.
*
Expand All @@ -71,6 +73,9 @@ module.exports = function (options) {
* See: https://github.com/AngularClass/angular2-webpack-starter/issues/1188#issuecomment-262872034
*/
module: {

noParse: [/sinon/],

rules: [
/*
* Typescript loader support for .ts and Angular 2 async routes via .async.ts
Expand Down Expand Up @@ -111,6 +116,7 @@ module.exports = function (options) {
presets: [require.resolve('babel-preset-es2015')]
}
},

/**
* Json loader support for *.json files.
*
Expand All @@ -132,6 +138,7 @@ module.exports = function (options) {
loader: ['to-string-loader', 'css-loader'],
exclude: [helpers.root('src/index.html')]
},

/**
* Raw loader support for *.scss files
*
Expand All @@ -142,6 +149,7 @@ module.exports = function (options) {
loader: ['raw-loader', 'sass-loader'],
exclude: [helpers.root('src/index.html')]
},

/**
* Raw loader support for *.html
* Returns file content as string
Expand All @@ -153,6 +161,9 @@ module.exports = function (options) {
loader: 'raw-loader',
exclude: [helpers.root('src/index.html')]
},

{ test: /sinon.*\.js$/, loader: "imports-loader?define=>false,require=>false" },

/**
* Instruments JS files with Istanbul for subsequent code coverage reporting.
* Instrument only testing sources.
Expand All @@ -165,10 +176,10 @@ module.exports = function (options) {
loader: 'istanbul-instrumenter-loader',
include: helpers.root('src'),
exclude: [
/\.ts$/,
/node_modules/
]
},

{
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
loader: "url-loader?limit=10000&minetype=application/font-woff"
Expand All @@ -189,6 +200,7 @@ module.exports = function (options) {
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: "url-loader?limit=10000&minetype=image/svg+xml"
},

/**
* BrowserFS has a crap implementation of setImmediate:
* https://github.com/jvilk/BrowserFS/issues/169
Expand All @@ -202,12 +214,14 @@ module.exports = function (options) {
}
]
},

/**
* Add additional plugins to the compiler.
*
* See: http://webpack.github.io/docs/configuration.html#plugins
*/
plugins: [

/**
* Plugin: DefinePlugin
* Description: Define free variables.
Expand All @@ -222,13 +236,15 @@ module.exports = function (options) {
'ENV': JSON.stringify(ENV),
'HMR': false,
'DOCKER': DOCKER,
'DOCKER_COMPOSE': DOCKER_COMPOSE
'DOCKER_COMPOSE': DOCKER_COMPOSE,
'PLAYGROUND_API' : JSON.stringify(PLAYGROUND_API)
/* 'process.env': {
'ENV': JSON.stringify(ENV),
'NODE_ENV': JSON.stringify(ENV),
'HMR': false,
} */
}),

/**
* Plugin: ContextReplacementPlugin
* Description: Provides context to Angular's use of System.import
Expand All @@ -244,6 +260,7 @@ module.exports = function (options) {
// your Angular Async Route paths relative to this root directory
}
),

/**
* Plugin LoaderOptionsPlugin (experimental)
*
Expand All @@ -252,15 +269,20 @@ module.exports = function (options) {
new LoaderOptionsPlugin({
debug: true,
options: {

}
}),

new webpack.ProvidePlugin({
jQuery: 'jquery',
$: 'jquery',
jquery: 'jquery'
}),

new webpack.ProvidePlugin({ BrowserFS: 'bfsGlobal', process: 'processGlobal', Buffer: 'bufferGlobal' })

],

/**
* Include polyfills or mocks for various node stuff
* Description: Node configuration
Expand All @@ -275,5 +297,6 @@ module.exports = function (options) {
clearImmediate: false,
setImmediate: true
}

};
}
13 changes: 11 additions & 2 deletions packages/composer-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,16 @@
"@angularclass/conventions-loader": "^1.0.13",
"@angularclass/hmr": "^1.2.2",
"@angularclass/hmr-loader": "^3.0.2",
"@types/chai": "^3.4.35",
"@types/dropboxjs": "^0.0.29",
"@types/filesystem": "^0.0.28",
"@types/hammerjs": "^2.0.34",
"@types/jasmine": "^2.5.40",
"@types/left-pad": "^1.1.0",
"@types/node": "^7.0.5",
"@types/selenium-webdriver": "^2.53.38",
"@types/sinon": "^1.16.35",
"@types/sinon-chai": "^2.7.27",
"@types/source-map": "^0.5.0",
"@types/uglify-js": "^2.6.28",
"@types/webpack": "^2.1.0",
Expand All @@ -119,6 +122,7 @@
"babel-preset-es2015": "^6.18.0",
"bootstrap": "4.0.0-alpha.5",
"browserfs": "^1.1.0",
"chai": "^3.5.0",
"codelyzer": "^2.0.0-beta.4",
"codemirror": "^5.22.0",
"composer-admin": "^0.5.2",
Expand Down Expand Up @@ -148,11 +152,14 @@
"jsonata": "^1.1.1",
"jszip": "^3.1.3",
"karma": "^1.3.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.1.1",
"karma-jasmine": "^1.1.0",
"karma-mocha-reporter": "^2.2.1",
"karma-remap-coverage": "^0.1.4",
"karma-sinon": "^1.0.5",
"karma-sinon-chai": "^1.2.4",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.2",
"left-pad": "^1.1.3",
Expand All @@ -171,6 +178,8 @@
"script-ext-html-webpack-plugin": "^1.3.5",
"semver": "^5.3.0",
"setimmediate": "^1.0.5",
"sinon": "^1.17.7",
"sinon-chai": "^2.8.0",
"source-map-loader": "^0.1.5",
"spa-http-server": "^0.9.0",
"string-replace-loader": "^1.0.5",
Expand All @@ -185,10 +194,10 @@
"tslint": "^4.2.0",
"tslint-loader": "^3.3.0",
"typedoc": "^0.5.3",
"typescript": "^2.1.4",
"typescript": "^2.2.1",
"url-loader": "^0.5.7",
"v8-lazy-parse-webpack-plugin": "^0.3.0",
"webpack": "^2.1.0-beta.22",
"webpack": "^2.2.1",
"webpack-dev-middleware": "^1.9.0",
"webpack-dev-server": "^2.1.0-beta.11",
"webpack-md5-hash": "^0.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ describe('AboutComponent', () => {

it ('Should display the correct title for the AboutComponent', () => {
fixture.detectChanges();
expect(el.textContent).toContain('About');
el.textContent.should.equal('About');
});

it ('Should call getVersions when the component is created', fakeAsync(() => {
fixture.detectChanges();
tick();
fixture.detectChanges();
expect(fixture.componentInstance.playground).toBe(MOCK_RETURN.playground);
fixture.componentInstance.playground.should.equal(MOCK_RETURN.playground);
}));
});
Loading

0 comments on commit 756bdc7

Please sign in to comment.