Skip to content
Snippets Groups Projects
Commit 394d7e5d authored by René Schöne's avatar René Schöne
Browse files

One step forward (build still fails)

parent b64ab782
Branches
No related tags found
No related merge requests found
Showing
with 12879 additions and 0 deletions
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "rd-view"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"data",
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"styles.css",
"../node_modules/codemirror/lib/codemirror.css",
"../node_modules/codemirror/theme/mbo.css"
],
"scripts": [
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json"
},
{
"project": "src/tsconfig.spec.json"
},
{
"project": "e2e/tsconfig.e2e.json"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"component": {}
}
}
# Editor configuration, see http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false
# See http://help.github.com/ignore-files/ for more about ignoring files.
/src/data/
# compiled output
/dist
/tmp
/out-tsc
# dependencies
/node_modules
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
testem.log
/typings
# e2e
/e2e/*.js
/e2e/*.map
# System Files
.DS_Store
Thumbs.db
# RagDoc View
This is a viewer for JastAdd documentation generated by RagDoc Builder.
## Generating Documentation
Generate the documentation by using the ragdoc task with JastAddGradle.
The documentation metadata is output into build/docs/ragdoc. Copy the contents into
rd-view/src/data.
## Customizing
Change the title by editing the `title = ...;` line in `src/app/app.component.ts`.
## Angular CLI
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.1.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. For example:
ng build --prod --base-href "/doc/"
rsync -avz dist/ server:doc
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
++ Separate attribute declarations and equations in type view.
++ Add thrown type descriptions.
++ Make current member filter more noticeable.
++ Add class overview as default page.
++ Make the title be a link to the default page.
++ Add modifier information to non-attribute members (public, static, etc.).
++ Don't display "extends Object"
-- Add structured production representation.
-- Add type hierarchy in type details.
-- Add direct subtypes.
-- Add declared-at info for types.
#!/bin/bash
set -eu
if [ ! -d 'rd-builder' ] || [ ! -e "rd-builder/build.gradle" ]; then
echo 'Pulling RD-Builder'
git submodule init
fi
git submodule update
EXTENDJ="rd-builder/extendj"
echo "ExtendJ path: $EXTENDJ"
if [ ! -d '$EXTENDJ' ] || [ ! -e "$EXTENDJ/build.gradle" ]; then
echo 'Pulling ExtendJ'
(cd rd-builder; git submodule init)
fi
(cd rd-builder; git submodule update)
# Optional debug flags.
DEBUG="${DEBUG:-}"
#DEBUG="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
(cd rd-builder; ./gradlew fatJar)
(cd $EXTENDJ; ./gradlew :java8:jar)
java \
$DEBUG \
-jar rd-builder/rd-builder.jar \
-d src/data \
-ragroot $EXTENDJ \
$(find $EXTENDJ/src -name '*.java') \
$(find $EXTENDJ/java8/src -name '*.java')
# Build packed assets for publishing.
ng build --prod --base-href "/doc/"
import { RdViewPage } from './app.po';
describe('rd-view App', () => {
let page: RdViewPage;
beforeEach(() => {
page = new RdViewPage();
});
it('should display message saying app works', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('app works!');
});
});
import { browser, element, by } from 'protractor';
export class RdViewPage {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types":[
"jasmine",
"node"
]
}
}
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
files: [
{ pattern: './src/test.ts', watched: false }
],
preprocessors: {
'./src/test.ts': ['@angular/cli']
},
mime: {
'text/x-typescript': ['ts','tsx']
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'coverage-istanbul']
: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};
This diff is collapsed.
{
"name": "rd-view",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"core-js": "^2.4.1",
"rxjs": "^5.1.0",
"zone.js": "^0.8.4",
"codemirror": "5.25.2"
},
"devDependencies": {
"@angular/cli": "^1.7.3",
"@angular/compiler-cli": "^4.0.0",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
}
}
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
beforeLaunch: function() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
},
onPrepare() {
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
nav, article, h1 {
font-family: "Roboto",Helvetica,sans-serif;
}
.selected {
background-color: #BBD8DC !important;
}
.types {
list-style-type: none;
margin: 0;
padding: 0;
background-color: #607D8B;
}
.types li {
cursor: pointer;
position: relative;
left: 0;
background-color: #EEE;
margin: 1px 0;
padding: .3em 0 0 .7em;
height: 1.6em;
}
.types li:hover {
background-color: #CFD8DC;
}
.type .text {
position: relative;
top: -3px;
}
.topnav {
z-index: 5;
position: fixed;
top: 0;
left: 0;
right: 0;
box-sizing: border-box;
height: 65px;
background-color: #CFD8DC;
box-shadow: 0 0 10px grey;
}
.topnav img {
visibility: hidden;
display: inline-block;
box-sizing: border-box;
width: 65px;
height: 65px;
padding: 15px;
position: absolute;
}
.topnav h1 {
display: inline-block;
vertical-align: middle;
box-sizing: border-box;
line-height: 65px;
padding: 0;
margin: 0 0 0 1em;
pointer-events: none;
white-space: nowrap;
overflow: hidden;
}
.sidenav {
width: 16em;
overflow-y: auto;
overflow-x: hidden;
z-index: 4;
position: fixed;
top: 65px;
left: 0;
bottom: 0;
box-shadow: 0 0 8px #888888;
background: white;
}
.package {
padding: .5em;
}
.group {
cursor: pointer;
padding: .5em .5em .5em 1em;
font-weight: bold;
}
.group img {
float: right;
}
article {
margin-left: 16em;
margin-top: 65px;
margin-bottom: 4em;
padding-top: 1em;
padding-left: 1em;
}
.search {
padding-left: 1em;
padding-top: 1em;
padding-right: 1em;
padding-bottom: 0.7em;
}
.search input {
border: 4px solid grey;
border-radius: 4px;
background: white url('../assets/search_grey_24px.svg') 10px 8px no-repeat;
padding: 10px 20px 10px 40px;
font-size: 16px;
width: 144px;
}
.search input:focus {
outline: none;
border-color: #79a;
}
@media all and (max-width: 1024px) {
.hidemenu {
visibility: hidden;
}
.sidenav {
width: 100%;
height: 100%;
}
.topnav h1 {
padding: 0 0 0 64px;
}
.topnav img {
visibility: visible;
}
article {
margin-left: 1em;
}
}
import { AppComponent } from './app.component';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
describe('AppComponent', function () {
let de: DebugElement;
let comp: AppComponent;
let fixture: ComponentFixture<AppComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AppComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AppComponent);
comp = fixture.componentInstance;
de = fixture.debugElement.query(By.css('h1'));
});
it('should create component', () => expect(comp).toBeDefined() );
it('should have expected <h1> text', () => {
fixture.detectChanges();
const h1 = de.nativeElement;
expect(h1.innerText).toMatch(/angular/i,
'<h1> should say something about "Angular"');
});
});
import { Component } from '@angular/core';
import { OnInit } from '@angular/core';
import { Package } from './package';
import { Type } from './type';
import { PackageService } from './package.service';
import { SelectionService } from './selection.service';
import { Member } from './member';
import { Parameter } from './parameter';
import { ActivatedRoute, Params } from '@angular/router';
import { Location } from '@angular/common';
@Component({
selector: 'app-root',
styleUrls: ['./app.component.css'],
template: `
<nav class="topnav">
<img src="assets/hamburger_24px.svg" (click)="showMenu = !showMenu"><h1>{{title}}</h1>
</nav>
<nav class="sidenav" [class.hidemenu]="!showMenu">
<div class="search"><input [(ngModel)]="filter" placeholder="Search..."></div>
<ng-template ngFor let-package [ngForOf]="packages">
<div *ngIf="filteredPackage(package)">
<div class="package"><b>{{package.name}}</b></div>
<ng-template ngFor let-group [ngForOf]="package.groups">
<div *ngIf="filteredGroup(group)">
<div class="group" (click)="group.hidden = !group.hidden">{{typeKindNames[group.kind]}}<img src="assets/eye_24px.svg" *ngIf="!group.hidden"><img src="assets/eye_off_24px.svg" *ngIf="group.hidden"></div>
<ul class="types" [hidden]="group.hidden">
<li *ngFor="let type of group.members | nameFilter:filter" class="type"
[class.selected]="type.id === selectedType"
[routerLink]="['/type', type.id]"
(click)="showMenu = false">
{{type.name}}
</li>
</ul>
</div>
</ng-template>
</div>
</ng-template>
</nav>
<article>
<router-outlet></router-outlet>
</article>
`,
providers: [
PackageService,
SelectionService,
],
})
export class AppComponent implements OnInit {
title = 'ExtendJ API Documentation';
showMenu = false;
packages : Package[];
filter = '';
selectedType = '';
private typeKindNames = {
'ast-class': 'AST CLASSES',
'interface': 'INTERFACES',
'class': 'CLASSES',
};
constructor(private packageService: PackageService,
private selectionService: SelectionService) {
selectionService.selection$.subscribe(id => this.selectedType = id);
}
ngOnInit(): void {
this.packageService.getPackages().then(packages => this.packages = packages);
}
filteredPackage(pkg: Package): boolean {
var filter = this.filter.toLowerCase();
for (var i = 0; i < pkg.groups.length; i++) {
if (this.filteredGroup(pkg.groups[i])) {
return true;
}
}
return false;
}
filteredGroup(group: any): boolean {
var filter = this.filter.toLowerCase();
var filtered = group.members.filter(member => member.name.toLowerCase().indexOf(filter) >= 0);
return filtered.length > 0;
}
}
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
import { TypeDetailsComponent } from './type-details.component';
import { ParametersComponent } from './parameters.component';
import { TypeReferenceComponent } from './type-ref.component';
import { NameFilterPipe } from './name-filter.pipe';
import { StringFilterPipe } from './string-filter.pipe';
import { SourceViewComponent } from './source-view/source-view.component';
import { EditorDirective } from './editor.directive';
import { DeclaredAtComponent } from './declared-at/declared-at.component';
import { AstDeclComponent } from './ast-decl/ast-decl.component';
@NgModule({
imports: [
BrowserModule,
FormsModule,
HttpModule,
RouterModule.forRoot([
{
path: 'type/:id',
component: TypeDetailsComponent
},
{
path: 'source/:filename/:line',
component: SourceViewComponent
}
]),
],
declarations: [
AppComponent,
TypeDetailsComponent,
ParametersComponent,
TypeReferenceComponent,
NameFilterPipe,
StringFilterPipe,
SourceViewComponent,
EditorDirective,
DeclaredAtComponent,
AstDeclComponent,
],
bootstrap: [ AppComponent ]
})
export class AppModule { }
import {TypeRef} from '../type-ref';
export class AstComponent {
name: string;
type: TypeRef;
kind: string;
static fromJson(json: any): AstComponent {
var name: string = undefined;
if (json.n) {
name = json.n as string;
}
var kind = "regular";
if (json.k) {
kind = json.k;
}
return {
name: json.n as string,
type: TypeRef.fromJson(json.e),
kind: kind,
};
}
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AstDeclComponent } from './ast-decl.component';
describe('AstDeclComponent', () => {
let component: AstDeclComponent;
let fixture: ComponentFixture<AstDeclComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AstDeclComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AstDeclComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, Input } from '@angular/core';
import {Doc} from '../doc';
import {TypeRef} from '../type-ref';
import {AstDecl} from './ast-decl';
@Component({
selector: 'ast-decl',
styles: [`
.ast-decl {
font-weight: bold;
padding-left: 3em;
}
.ast-component {
padding-left: 4em;
}
`],
template: `
<p *ngIf="decl">JastAdd production: <br>
<div class="ast-decl">{{decl.name}}<ng-container *ngIf="decl.extends">: <type-ref [type]="decl.extends"></type-ref></ng-container><!--
--><ng-container *ngIf="decl.components"> ::= <!--
--><ng-container *ngFor="let comp of decl.components"><!--
--><div class="ast-component"><!--
--><ng-container *ngIf="comp.kind == 'regular'"><!--
--><ng-container *ngIf="comp.name">{{comp.name}}:</ng-container><type-ref [type]="comp.type"></type-ref> <!--
--></ng-container><!--
--><ng-container *ngIf="comp.kind == 'list'"><!--
--><ng-container *ngIf="comp.name">{{comp.name}}:</ng-container><type-ref [type]="comp.type"></type-ref>* <!--
--></ng-container><!--
--><ng-container *ngIf="comp.kind == 'opt'"><!--
-->[<ng-container *ngIf="comp.name">{{comp.name}}:</ng-container><type-ref [type]="comp.type"></type-ref>] <!--
--></ng-container><!--
--><ng-container *ngIf="comp.kind == 'token'"><!--
-->&lt;<ng-container *ngIf="comp.name">{{comp.name}}:</ng-container><type-ref [type]="comp.type"></type-ref>&gt; <!--
--></ng-container><!--
--></div><!--
--></ng-container><!--
--></ng-container>
</div>
`,
})
export class AstDeclComponent {
private _decl: AstDecl;
constructor() { }
@Input()
set decl(decl: AstDecl) {
this._decl = decl;
}
get decl(): AstDecl {
return this._decl;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment