Skip to content

Commit da9bc6e

Browse files
dmitry-kurmanovandrewtelnov
authored andcommitted
new build system (#40)
* build 2.0 - move build system to webpack 2; * build 2.0 - removed typings because of npm @types; - karma tests; * build 2.0 - fixed travis config * build 2.0 - fixed travis config * build 2.0 - added ajv for travis build; * build 2.0 - fixed build (ko templates) * build 2.0 - fixed build (ko templates)
1 parent b782a01 commit da9bc6e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+267
-476
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ project.lock.json
2020
*.js
2121
/src/template_question.html.ts
2222
/src/template_page.html.ts
23-
/src/templateEditor.ko.html.ts
23+
/src/templateEditor.ko.html.ts

.travis.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
language: node_js
2+
23
node_js:
34
- "4"
45

56
before_script:
6-
- npm install -g gulp
7-
- npm install -g typings
7+
- npm install -g concurrently
88
script:
9-
- typings install
10-
- gulp copyfiles
11-
- gulp makedist
12-
- gulp test_ci
9+
- npm run build_prod
10+
- karma start --single-run

global.json

-8
This file was deleted.

gulpfile.js

-200
This file was deleted.

karma.conf.js

+28-54
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,43 @@
1-
// Karma configuration
1+
var webpack = require('webpack');
2+
var webpackConfigCreator = require('./webpack.config');
3+
var webpackConfig = webpackConfigCreator({ buildType: "dev" });
24

3-
module.exports = function (config) {
5+
module.exports = function(config) {
46
config.set({
5-
6-
// base path that will be used to resolve all patterns (eg. files, exclude)
77
basePath: '',
8-
9-
// frameworks to use
10-
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
118
frameworks: ['qunit'],
12-
13-
// list of files / patterns to load in the browser
149
files: [
15-
"wwwroot/js/qunit.css",
16-
"wwwroot/js/knockout.js",
17-
"wwwroot/js/survey.ko.js",
18-
"wwwroot/js/surveyeditor.js",
19-
20-
"wwwroot/tests/surveyeditor.tests.js",
21-
],
22-
23-
// list of files to exclude
10+
'tests/entries/*.ts'
11+
],
2412
exclude: [
2513
],
26-
27-
// preprocess matching files before serving them to the browser
28-
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
29-
preprocessors: {
30-
'wwwroot/js/surveyeditor.js': ['coverage']
14+
mime: {
15+
'text/x-typescript': ['ts','tsx']
3116
},
32-
33-
// test results reporter to use
34-
// possible values: 'dots', 'progress'
35-
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
36-
reporters: ['progress', 'dots', 'junit', 'coverage'],
37-
3817
junitReporter: {
39-
outputDir: 'shippable/testresults/',
18+
outputDir: 'tmp/testresults/',
4019
outputFile: 'test-results.xml'
4120
},
42-
43-
coverageReporter: {
44-
type: 'cobertura',
45-
dir: 'shippable/codecoverage/'
21+
preprocessors: {
22+
'**/*.ts': ['webpack', 'sourcemap']
4623
},
47-
48-
// web server port
49-
port: 9876,
50-
51-
// enable / disable colors in the output (reporters and logs)
24+
webpack: {
25+
module: webpackConfig.module,
26+
resolve: webpackConfig.resolve,
27+
plugins: [
28+
new webpack.SourceMapDevToolPlugin({
29+
filename: null, // if no value is provided the sourcemap is inlined
30+
test: /\.(ts|js)($|\?)/i // process .js and .ts files only
31+
})
32+
]
33+
},
34+
reporters: ['progress', 'dots', 'junit'],
35+
browsers: ['PhantomJS'],
5236
colors: true,
53-
54-
// level of logging
5537
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
56-
logLevel: config.LOG_INFO,
57-
58-
// enable / disable watching file and executing tests whenever any file changes
59-
autoWatch: false,
60-
61-
// start these browsers
62-
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
63-
browsers: ['PhantomJS'],
64-
65-
// Continuous Integration mode
66-
// if true, Karma captures browsers, runs the tests and exits
67-
singleRun: true
38+
logLevel: config.LOG_WARN,
39+
autoWatch: true,
40+
singleRun: false,
41+
concurrency: Infinity
6842
})
69-
}
43+
};

npmREADME.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Use **surveyjs Editor** to create or edit JSON for surveyjs library.
2+
3+
##Getting started
4+
Build a survey JSON using [Visual Editor](http://surveyjs.org/builder/)
5+
To find our more about the surveyjs library go
6+
* to the [surveyjs.org site](http://surveyjs.org)
7+
* explore the live [Examples](http://surveyjs.org/examples/)

0 commit comments

Comments
 (0)