Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
dist/
.idea/
node_modules/
.nyc_output/
coverage/
yarn-error.log
npm-error.log
.idea/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.tgz
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ git:
notifications:
email: false
node_js:
- "8"
- "9"
cache:
yarn: true
directories:
- "node_modules"

script:
- "npm run prod"
- "npm run test:ci"
- "cd packages/core"
- "yarn prod"
- "yarn test:ci"
after_success:
- "./node_modules/.bin/nyc report --reporter=text-lcov | coveralls"
- "yarn nyc report --reporter=text-lcov | coveralls"
62 changes: 4 additions & 58 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,60 +1,6 @@
{
"name": "query-language",
"version": "0.1.0",
"description": "An intuitive and powerful query language for the web",
"main": "dist/qlang.js",
"typings": "dist/qlang.d.ts",
"scripts": {
"build": "webpack --progress",
"watch": "webpack --progress --watch",
"prod": "webpack --progress --env.production",
"test": "nyc --reporter=html --reporter=text-summary mocha src/**/*.spec.ts tests/**/*.test.ts",
"test:ci": "nyc --reporter=lcovonly --reporter=text-summary mocha src/**/*.spec.ts tests/**/*.test.ts",
"test:watch": "nodemon -e js,ts -w tests -w src --exec 'npm run test'",
"test:conformance": "mocha --require ts-node/register tests/**/*.test.ts",
"test:library": "mocha --require ts-node/register src/**/*.spec.ts"
},
"nyc": {
"all": true,
"produce-source-map": true,
"report-dir": "./coverage",
"extension": [
".ts",
".tsx"
],
"require": [
"ts-node/register",
"source-map-support/register"
],
"include": [
"src/**/*.ts"
],
"exclude": [
"**/*.d.ts",
"**/*.spec.ts",
"**/*.tests.ts"
]
},
"author": "James Ferguson",
"license": "MIT",
"dependencies": {
"@types/chai": "^4.0.2",
"@types/lodash": "^4.14.72",
"@types/mocha": "^2.2.41",
"@types/node": "^8.0.24",
"chai": "^4.1.1",
"clean-webpack-plugin": "^0.1.17",
"coveralls": "^3.0.0",
"lodash": "^4.17.4",
"mocha": "^3.5.0",
"nodemon": "^1.14.3",
"nyc": "^11.4.1",
"rxjs": "^5.5.0",
"source-map-support": "^0.5.0",
"ts-loader": "^3.1.1",
"ts-node": "^3.3.0",
"typescript": "^2.4.2",
"uglifyjs-webpack-plugin": "^0.4.6",
"webpack": "^3.6.0"
}
"private": true,
"workspaces": [
"packages/*"
]
}
3 changes: 3 additions & 0 deletions packages/core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage
.nyc_output
dist
60 changes: 60 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "query-language",
"version": "0.1.0",
"description": "An intuitive and powerful query language for the web",
"main": "dist/qlang.js",
"typings": "dist/qlang.d.ts",
"scripts": {
"build": "webpack --progress",
"watch": "webpack --progress --watch",
"prod": "webpack --progress --env.production",
"test": "nyc --reporter=html --reporter=text-summary mocha src/**/*.spec.ts tests/**/*.test.ts",
"test:ci": "nyc --reporter=lcovonly --reporter=text-summary mocha src/**/*.spec.ts tests/**/*.test.ts",
"test:watch": "nodemon -e js,ts -w tests -w src --exec 'npm run test'",
"test:conformance": "mocha --require ts-node/register tests/**/*.test.ts",
"test:library": "mocha --require ts-node/register src/**/*.spec.ts"
},
"nyc": {
"all": true,
"produce-source-map": true,
"report-dir": "./coverage",
"extension": [
".ts",
".tsx"
],
"require": [
"ts-node/register",
"source-map-support/register"
],
"include": [
"src/**/*.ts"
],
"exclude": [
"**/*.d.ts",
"**/*.spec.ts",
"**/*.tests.ts"
]
},
"author": "James Ferguson",
"license": "MIT",
"dependencies": {
"@types/chai": "^4.0.2",
"@types/lodash": "^4.14.72",
"@types/mocha": "^2.2.41",
"@types/node": "^8.0.24",
"chai": "^4.1.1",
"clean-webpack-plugin": "^0.1.17",
"coveralls": "^3.0.0",
"lodash": "^4.17.4",
"mocha": "^3.5.0",
"nodemon": "^1.14.3",
"nyc": "^11.4.1",
"rxjs": "^5.5.0",
"source-map-support": "^0.5.0",
"ts-loader": "^3.1.1",
"ts-node": "^3.3.0",
"typescript": "^2.4.2",
"uglifyjs-webpack-plugin": "^0.4.6",
"webpack": "^3.6.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions tsconfig.json → packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"noImplicitThis": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2016"
]
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/editor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
coverage
.nyc_output
8 changes: 8 additions & 0 deletions packages/editor/demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<ql-demo></ql-demo>
</body>
</html>
4 changes: 4 additions & 0 deletions packages/editor/demo/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
body {
margin: 0;
background: #f9f9f9;
}
35 changes: 35 additions & 0 deletions packages/editor/demo/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import 'reflect-metadata';

import 'zone.js/dist/zone';

import 'codemirror/theme/monokai.css';

import 'codemirror/lib/codemirror.css';
import 'codemirror/lib/codemirror.js';

import 'codemirror/mode/javascript/javascript.js';

import './index.scss';

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { QLDemoModule } from './ql-demo.module';


export const platformRef = platformBrowserDynamic();

export function main() {
return platformRef.bootstrapModule(QLDemoModule)
.catch(err => console.error(err));
}

// support async tag or hmr
switch (document.readyState) {
case 'interactive':
case 'complete':
main();
break;
case 'loading':
default:
document.addEventListener('DOMContentLoaded', () => main());
}
25 changes: 25 additions & 0 deletions packages/editor/demo/ql-demo.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<div class="content">
<h1>Query Language Editor</h1>

<div class="editor-wrapper">
<ql-editor class="code" readOnly="false" theme="monokai" [value]="initialContent"></ql-editor>

<ql-editor class="results" theme="monokai" [value]="resultString$ | async"></ql-editor>

<!--<div class="results-panel">-->
<!--<div class="fake-gutter"></div>-->

<!--<div class="results">-->
<!--<h2>Result</h2>-->

<!--<p class="result-string">-->
<!--{{ resultString$ | async }}-->
<!--{{ '{ name: "James Ferguson", password: "Password" }' }}-->
<!--</p>-->
<!--</div>-->

<!--</div>-->
</div>


</div>
40 changes: 40 additions & 0 deletions packages/editor/demo/ql-demo.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.content {
font-family: 'Helvetica', sans-serif;
padding: 40px;
max-width: 800px;
margin: auto;
}


.editor-wrapper {
//box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
//box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
border-radius: 1px;
}

.code, .results {
display: block;
box-sizing: border-box;
}

.code {
height: 400px;
}

.results {
height: 100px;
border-top: 1px solid rgba(0, 0, 0, 0.5);
}

//.results {
// border-top: 1px solid #F0F0F0;
// padding-top: 15px;
// padding-bottom: 15px;
//
// h2 {
// font-size: 1em;
// opacity: 0.75;
// margin: 0 0 5px;
// }
//}
23 changes: 23 additions & 0 deletions packages/editor/demo/ql-demo.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { AfterViewInit, Component, ViewChild } from '@angular/core';
import { QLEditorComponent } from '../src/ql-editor.component';
import { Observable } from 'rxjs/Observable';

@Component({
selector: 'ql-demo',
templateUrl: './ql-demo.component.html',
styleUrls: [ './ql-demo.component.scss' ],
})
export class QLDemoComponent implements AfterViewInit {
resultString$: Observable<string>;

initialContent = `map(sin & tan, [ 0.1, 0.5, 0.9 ])`;

@ViewChild(QLEditorComponent)
protected editor: QLEditorComponent;

ngAfterViewInit() {
this.resultString$ = this.editor.compilerService.result$.map(result => {
return JSON.stringify(result);
});
}
}
23 changes: 23 additions & 0 deletions packages/editor/demo/ql-demo.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { QLEditorModule } from '../src/ql-editor.module';

import { QLDemoComponent } from './ql-demo.component';
import { CommonModule } from '@angular/common';


@NgModule({
bootstrap: [
QLDemoComponent,
],
imports: [
BrowserModule,
QLEditorModule,
CommonModule,
],
declarations: [
QLDemoComponent,
],
})
export class QLDemoModule {}
54 changes: 54 additions & 0 deletions packages/editor/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "query-language-editor",
"version": "1.0.0",
"main": "index.js",
"author": "James Ferguson <jamesferguson497@gmail.com>",
"license": "MIT",
"scripts": {
"build": "webpack --progress",
"build:demo": "webpack --progress --env.demo=true",
"watch": "webpack --progress --watch",
"watch:demo": "webpack --progress --env.demo=true --watch"
},
"dependencies": {
"@angular/common": "^5.1.0",
"@angular/compiler": "^5.1.0",
"@angular/core": "^5.1.0",
"@angular/platform-browser": "^5.1.0",
"@angular/platform-browser-dynamic": "^5.1.0",
"@types/clean-webpack-plugin": "^0.1.0",
"@types/codemirror": "^0.0.53",
"@types/extract-text-webpack-plugin": "^3.0.0",
"@types/lodash": "^4.14.88",
"@types/node": "^8.0.57",
"@types/webpack": "^3.8.1",
"angular2-template-loader": "^0.6.2",
"autoprefixer": "^7.2.2",
"clean-webpack-plugin": "^0.1.17",
"codelyzer": "^4.0.1",
"codemirror": "^5.32.0",
"css-loader": "^0.28.7",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^1.1.5",
"fork-ts-checker-webpack-plugin": "^0.2.9",
"html-loader": "^0.5.1",
"html-webpack-plugin": "^2.30.1",
"lodash": "^4.17.4",
"node-sass": "^4.7.2",
"postcss-loader": "^2.0.9",
"query-language": "0.1.0",
"raw-loader": "^0.5.1",
"reflect-metadata": "^0.1.10",
"rxjs": "^5.5.5",
"sass-loader": "^6.0.6",
"style-loader": "^0.19.0",
"to-string-loader": "^1.1.5",
"ts-loader": "^3.2.0",
"ts-node": "^4.0.1",
"tslint": "^5.8.0",
"tslint-loader": "^3.5.3",
"typescript": "^2.6.2",
"webpack": "^3",
"zone.js": "^0.8.18"
}
}
Loading