Skip to content

Commit c929344

Browse files
author
Damian Kaminski
committed
Initial code drop
1 parent ee9da81 commit c929344

33 files changed

+1880
-0
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# 2 space indentation
12+
[**.*]
13+
indent_style = space
14+
indent_size = 2

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules
2+
jspm_packages
3+
bower_components
4+
.idea
5+
.DS_STORE
6+
build/reports
7+
typings
8+
dev
9+
dist/buildSyncFile.txt

.jshintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"esnext": true
3+
}

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
jspm_packages
2+
bower_components
3+
.idea

.vscode/settings.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"files.exclude": {
4+
"**/.git": true,
5+
"**/.DS_Store": true,
6+
"**/node_modules/**/*": true,
7+
"**/dist/**/*": true,
8+
"jspm_packages": true,
9+
"dev": true
10+
},
11+
"editor.tabSize": 2
12+
}

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Getting started
2+
The `marvelous-query-language` (`MQL`) is an open source domain specific language built on top of <code>.NET</code> platform.
3+
It has been desinged to help semi-technical users filter large data sources. To be as user-friendly as possible it offers
4+
auto completions.
5+
6+
If you would like to use it along with Aurelia checkout
7+
[https://github.com/MarvelousSoftware/marvelous-aurelia-query-language](this) project.
8+
9+
Project documentation: [http://marvelous.software/docs.html#/query-language](http://marvelous.software/docs.html#/query-language)
10+
11+
.NET backend source code: https://github.com/MarvelousSoftware/MarvelousSoftwareDotNet
12+
13+
## Installation
14+
The `marvelous-query-language` consists of 2 packages: client side and server side. First install client side library:
15+
```
16+
jspm install marvelous-query-language
17+
```
18+
Then load the css file:
19+
```javascript
20+
import 'marvelous-aurelia-query-language/styles/default.css!';
21+
```
22+
To install server side part of the library use following NuGet install command:
23+
```
24+
Install-Package MarvelousSoftware.QueryLanguage
25+
```
26+
Once you do that install either `MarvelousSoftware.Core.Host.Owin` or `MarvelousSoftware.Core.Host.SystemWeb` NuGet package and use
27+
it on the application start up:
28+
```csharp
29+
using System.Web;
30+
using MarvelousSoftware.Core.Host.SystemWeb;
31+
32+
namespace MarvelousSoftware.Examples.API
33+
{
34+
public class WebApiApplication : HttpApplication
35+
{
36+
protected void Application_Start()
37+
{
38+
// This line allows to use MarvelousSoftware products with SystemWeb
39+
// It comes from MarvelousSoftware.Core.Host.SystemWeb package
40+
MarvelousSoftwareHost.UseSystemWeb();
41+
42+
// If you would like to use MarvelousSoftware products with more modern, Owin based applications
43+
// then use MarvelousSoftware.Core.Host.Owin package and place below line in Startup.cs file
44+
// app.UseMarvelousSoftware();
45+
46+
//.. rest of app's startup configuration
47+
}
48+
}
49+
}
50+
```
51+
Now you are ready to go.
52+
53+
## Browser support
54+
All modern browsers and IE >= 9.
55+
56+
## License
57+
MIT

build/args.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
var yargs = require('yargs');
2+
3+
var argv = yargs.argv,
4+
validBumpTypes = "major|minor|patch|prerelease".split("|"),
5+
bump = (argv.bump || 'patch').toLowerCase();
6+
7+
if(validBumpTypes.indexOf(bump) === -1) {
8+
throw new Error('Unrecognized bump "' + bump + '".');
9+
}
10+
11+
module.exports = {
12+
bump: bump
13+
};

build/core.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
var ts = require('gulp-typescript');
2+
var gulp = require('gulp');
3+
var paths = require('./paths');
4+
var typeScriptOptions = require('../tsconfig.json');
5+
var merge = require('merge2');
6+
var concat = require('gulp-concat');
7+
var assign = Object.assign || require('object.assign');
8+
var changed = require('gulp-changed');
9+
var filelog = require('gulp-filelog');
10+
11+
function swallowError(error) {
12+
console.log(error.toString());
13+
this.emit('end');
14+
}
15+
16+
function buildTypeScript(files, relativePath, module) {
17+
var options = assign({ module: module }, typeScriptOptions.compilerOptions);
18+
return gulp.src(files)
19+
.pipe(changed(paths.output + relativePath, {extension: '.js'}))
20+
//.pipe(filelog('Compiling typescript'))
21+
.pipe(ts(options))
22+
.pipe(gulp.dest(paths.output + relativePath));
23+
}
24+
25+
function getRelativeDirPath(filePath, baseDir) {
26+
var indexOfBaseDir = filePath.indexOf(baseDir);
27+
var relativeDirPath = filePath.substr(indexOfBaseDir + baseDir.length);
28+
var indexOfFileName = relativeDirPath.lastIndexOf('\\');
29+
return relativeDirPath.substr(0, indexOfFileName);
30+
}
31+
32+
module.exports = {
33+
buildTypeScript: buildTypeScript,
34+
swallowError: swallowError,
35+
getRelativeDirPath: getRelativeDirPath
36+
};

build/paths.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
var pkg = require('../package.json');
2+
var appRoot = 'src/';
3+
var jspmPackages = 'jspm_packages';
4+
5+
module.exports = {
6+
root: appRoot,
7+
javascript: appRoot + '**/*.js',
8+
typescript: appRoot + '**/*.ts',
9+
typesciptDefinitions: ['./typings/**/*.ts', './jspm_packages/**/*.d.ts'],
10+
unitTesting: 'src/unitTesting/**/*.ts',
11+
specs: 'src/**/*.spec.ts',
12+
html: [appRoot + '**/*.html', appRoot + '**/*.gif'],
13+
sass: appRoot + '**/*.scss',
14+
output: 'dev/',
15+
doc: './doc',
16+
jspmPackages: jspmPackages,
17+
buildSyncFile: 'dev/buildSyncFile.txt',
18+
release: {
19+
output: 'dist/'
20+
},
21+
deps: [
22+
]
23+
};
24+
var deps = module.exports.deps;
25+
deps.watch = deps.map(function (x) { return x.buildSyncFile; });
26+
27+
function getDependencyInfo (packageName, mainFile) {
28+
var packagesDirectory = jspmPackages + '/github/marveloussoftware/';
29+
30+
var jspmPackageDefinition = pkg.jspm.dependencies[packageName];
31+
var versionStartIndex = jspmPackageDefinition.indexOf('@');
32+
var version = jspmPackageDefinition.substr(versionStartIndex + 1);
33+
if(isNaN(parseInt(version[0]))) {
34+
version = version.substr(1);
35+
}
36+
37+
var fullPackageName = packageName + '@' + version;
38+
39+
return {
40+
name: packageName,
41+
fullPackageName: fullPackageName,
42+
main: 'github:marveloussoftware/' + fullPackageName + '/' + mainFile,
43+
packagesDirectory: packagesDirectory,
44+
copy: [
45+
{
46+
src: pkg.marvelous.projects[packageName] + 'dev/system/**/*.*',
47+
dest: packagesDirectory + fullPackageName
48+
},
49+
{
50+
src: pkg.marvelous.projects[packageName] + 'dev/' + packageName + '.d.ts',
51+
dest: packagesDirectory + fullPackageName
52+
}],
53+
buildSyncFile: pkg.marvelous.projects[packageName] + 'dev/buildSyncFile.txt'
54+
}
55+
}

build/tasks/build.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
var gulp = require('gulp');
2+
var runSequence = require('run-sequence');
3+
var paths = require('../paths');
4+
var sass = require('gulp-sass');
5+
var core = require('../core');
6+
var _ = require('lodash');
7+
var changed = require('gulp-changed');
8+
9+
function buildSass(moduleName) {
10+
return gulp.src(paths.sass)
11+
.pipe(sass.sync().on('error', sass.logError))
12+
.pipe(gulp.dest(paths.output + moduleName));
13+
}
14+
15+
function buildTypeScript(moduleName) {
16+
return core.buildTypeScript(_.flatten([paths.typescript, paths.typesciptDefinitions]), moduleName, moduleName);
17+
}
18+
19+
gulp.task('build-html-commonjs', function () {
20+
return gulp.src(paths.html)
21+
.pipe(changed(paths.output + 'common'))
22+
.pipe(gulp.dest(paths.output + 'common'));
23+
});
24+
gulp.task('build-sass-commonjs', function () {
25+
return buildSass('common');
26+
});
27+
gulp.task('build-commonjs', ['build-html-commonjs', 'build-sass-commonjs'], function () {
28+
return buildTypeScript('common');
29+
});
30+
31+
gulp.task('build-html-amd', function () {
32+
return gulp.src(paths.html)
33+
.pipe(changed(paths.output + 'amd'))
34+
.pipe(gulp.dest(paths.output + 'amd'));
35+
});
36+
gulp.task('build-sass-amd', function () {
37+
return buildSass('amd');
38+
});
39+
gulp.task('build-amd', ['build-html-amd', 'build-sass-amd'], function () {
40+
return buildTypeScript('amd');
41+
});
42+
43+
gulp.task('build-javascript-system', function () {
44+
return gulp.src(paths.javascript)
45+
.pipe(changed(paths.output + 'system'))
46+
.pipe(gulp.dest(paths.output + 'system'));
47+
});
48+
gulp.task('build-html-system', function () {
49+
return gulp.src(paths.html)
50+
.pipe(changed(paths.output + 'system'))
51+
.pipe(gulp.dest(paths.output + 'system'));
52+
});
53+
gulp.task('build-sass-system', function () {
54+
return buildSass('system');
55+
});
56+
gulp.task('build-typescript-system', function () {
57+
return buildTypeScript('system');
58+
});
59+
gulp.task('build-system', ['build-javascript-system', 'build-html-system', 'build-sass-system', 'build-typescript-system']);
60+
61+
gulp.task('build', function (callback) {
62+
return runSequence(
63+
'clean',
64+
'clean-internal-dependencies',
65+
'copy-internal-dependencies',
66+
['build-commonjs', 'build-amd', 'build-system', 'build-tsd'],
67+
'build-dev-sync-file',
68+
callback
69+
);
70+
});

0 commit comments

Comments
 (0)