Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
(#298) working webpack loading and specs
Browse files Browse the repository at this point in the history
 - for karma and HTML runners
 - with source maps and live reload
 - System.js module loader calls are stubbed out
   for now (followup work in issue #304).
  • Loading branch information
x1B committed Jun 28, 2016
1 parent 3ce1995 commit 8b61b81
Show file tree
Hide file tree
Showing 53 changed files with 504 additions and 10,495 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
@@ -0,0 +1,7 @@
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 3
insert_final_newline = true
max_line_length = 110
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -4,6 +4,9 @@
/dist
/jspm_packages
/karma-output
/spec-output
/node_modules
.sass-cache
npm-debug.log
*.bundle.js
*.js.map
2 changes: 1 addition & 1 deletion .npmignore
@@ -1,4 +1,4 @@
/jspm_packages
/.idea
/.grunt
/karma-output
/spec-output
7 changes: 2 additions & 5 deletions .travis.yml
Expand Up @@ -3,12 +3,9 @@ sudo: false
env:
global:
secure: WJ90FlrmvbBvvAGsMbl20UzAPbQSBYA6txJx1Ft8I59cBpXeTuYhae98Hd7wF1DRMN9p8EMVuPS7bxxqlATX/ymffqqwbyZ7S4pNiChnP4Jx/AVYDNOtNMcFNcPJ6tGVSokq1L6ZfPTYV6ZltooP2ZV3eahsglvVobJ3zAl2vlE=
before_install:
- npm install -g jspm
- jspm config registries.github.auth $JSPM_GITHUB_AUTH_TOKEN
node_js:
- '0.12'
- '0.10'
- '4'
- '6'
branches:
except:
- /^feature\/.*$/
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,8 @@

## Last Changes

- [#298](https://github.com/LaxarJS/laxar/issues/298): modules: load using webpack
+ **BREAKING CHANGE:** see ticket for details
- [#299](https://github.com/LaxarJS/laxar/issues/299): plain widget adapter: fixed injectable service names
- [#291](https://github.com/LaxarJS/laxar/issues/291): page loader: merged namespaces for widget- and composition-ids
- [#286](https://github.com/LaxarJS/laxar/issues/286): flow: fixed flow-validation error message format
Expand Down
58 changes: 5 additions & 53 deletions Gruntfile.js
Expand Up @@ -3,8 +3,8 @@
* Released under the MIT license.
* http://laxarjs.org/license
*/
/*eslint-env node*/
/*eslint no-var:0*/
/* eslint-env node */
/* eslint no-var:0 */
module.exports = function (grunt) {
'use strict';

Expand All @@ -13,50 +13,6 @@ module.exports = function (grunt) {
grunt.initConfig( {
pkg: pkg,
pkgFile: 'package.json',
karma: {
options: {
basePath: '',
browsers: [ 'PhantomJS' ],
browserNoActivityTimeout: 100000,
plugins: [
'karma-jspm',
'karma-jasmine',
'karma-junit-reporter',
'karma-phantomjs-launcher',
'karma-chrome-launcher'
],
reporters: [ 'progress', 'junit' ],
junitReporter: {
outputDir: 'karma-output/'
},
frameworks: [ 'jspm', 'jasmine' ],
proxies: {
'/lib/': '/base/lib/',
'/static/': '/base/static/',
'/jspm_packages/': '/base/jspm_packages/'
},
jspm: {
config: 'system.config.js',
loadFiles: [
'lib/**/*_spec.js',
],
serveFiles: [
'lib/**/!(*_spec).js',
'static/**/*.js',
'jspm_packages/**/*.js',
]
}
},
unit: {
singleRun: true,
}
},
eslint: {
options: {
config: '.eslintrc.json'
},
src: [ 'lib/**/*.js' ]
},
clean: {
apidoc: {
src: [ 'docs/api/*.js.md' ]
Expand All @@ -70,8 +26,7 @@ module.exports = function (grunt) {
'lib/file_resource_provider/file_resource_provider.js',
'lib/i18n/i18n.js',
'lib/logging/log.js',
'lib/runtime/{controls_service,flow,runtime_services,theme_manager}.js',
'lib/utilities/!(timer|path).js'
'lib/runtime/services.js'
],
dest: 'docs/api/'
} ]
Expand All @@ -80,11 +35,8 @@ module.exports = function (grunt) {
} );

grunt.loadNpmTasks( 'grunt-contrib-clean' );
grunt.loadNpmTasks( 'grunt-karma' );
grunt.loadNpmTasks( 'gruntify-eslint' );
grunt.loadNpmTasks( 'grunt-laxar' );

grunt.registerTask( 'test', [ 'eslint', 'karma' ] );
grunt.registerTask( 'apidoc', [ 'clean:apidoc', 'laxar_dox' ] );

grunt.registerTask( 'default', [ 'test', 'apidoc' ] );
grunt.registerTask( 'default', [ 'apidoc' ] );
};
30 changes: 29 additions & 1 deletion README.md
Expand Up @@ -29,7 +29,7 @@ npm install -g generator-laxarjs

_Note that_, depending on your workstation setup, you might have to use `sudo` when running `npm install` with the `-g` option.
Make sure that your `PATH` includes the global `node_modules/bin` directory.
For additional information and troubleshooting, consult the documentation of [npm](https://docs.npmjs.com) and [Yeoman](http://yeoman.io/learning) respectively.
For additional information and troubleshooting, consult the documentation of [npm](https://docs.npmjs.com) and [Yeoman](http://yeoman.io/learning) respectively.


### Create a LaxarJS Application from Our Template
Expand Down Expand Up @@ -110,3 +110,31 @@ Have fun developing your first LaxarJS application.

Make sure to have a look at the [manuals](docs/manuals/index.md) and and check out the demo applications on the [LaxarJS website](http://laxarjs.org/).
If you're already developing your first widgets and want to know which programmatic APIs are provided by LaxarJS, have a look at the [API docs](docs/api).



### Hacking LaxarJS itself

Instead of using a compiled library within a project, you can also clone this repository:

```sh
git clone https://github.com/LaxarJS/laxar.git
cd laxar
npm install
```

To see changes in your application, either configure your project to work with the sources (e.g. by using webpack), or rebuild the webpack bundles by running `npm run optimize`.

To run the automated karma tests:

```sh
npm test
```

To generate HTML spec runners for opening in your web browser, so that you can e.g. use the browser's developer tools:

```sh
npm run browser-spec
```

Now you can select a spec-runner by surfing to http://localhost:8201/spec-output/.
6 changes: 4 additions & 2 deletions bower.json
Expand Up @@ -15,7 +15,9 @@
],
"dependencies": {
"jjve": "silas/jjve#^0.5.1",
"jjv": "^1.0.2",
"page": "^1.7.1"
"jjv": "~1.0.2",
"page": "~1.7.1"
},
"devDependencies": {
}
}
19 changes: 0 additions & 19 deletions build.js

This file was deleted.

78 changes: 78 additions & 0 deletions karma.config.js
@@ -0,0 +1,78 @@
// Karma configuration for LaxarJS core
/* eslint-env node */


const webpackConfig = Object.assign( {}, require('./webpack.base.config') );
delete webpackConfig.entry;
delete webpackConfig.plugins;
webpackConfig.devtool = 'inline-source-map';

module.exports = function(config) {
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],

// list of files / patterns to load in the browser
files: [
'node_modules/babel-polyfill/dist/polyfill.js',
'lib/*/spec/spec-runner.js'
],

// list of files to exclude
exclude: [
],

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'lib/*/spec/spec-runner.js': [ 'webpack', 'sourcemap' ]
},
webpack: webpackConfig,

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
unit: {
singleRun: true,
},
junitReporter: {
outputDir: 'karma-output/'
},

// web server port
port: 9876,

// enable / disable colors in the output (reporters and logs)
colors: true,

// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: [
// 'MSIE',
'PhantomJS',
// 'Chrome',
// 'Firefox'
],
browserNoActivityTimeout: 100000,

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,

// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
});
};

0 comments on commit 8b61b81

Please sign in to comment.