compodoc / ngd

View the dependencies tree of you Angular application
MIT License
619 stars 86 forks source link

not working for me - no deps #46

Closed crh225 closed 7 years ago

crh225 commented 7 years ago

image

I can provide you with what you need to help you debug, I just don't have a plunkr.

crh225 commented 7 years ago

It turns out it did run, but for some reason, it is including all the soundcloud stuff in the graph mixed with my project. image

manekinekko commented 7 years ago

did you try with both "-f" or "-p" flag? Can you post your tsconfig.json and app.component.ts?

crh225 commented 7 years ago

I will post them Tuesday. I just left for the holidays. Great work by the way!

manekinekko commented 7 years ago

Sure. Im also taking a break for the holidays starting from tomorrow 🎅🎄

Merry Christmas bro and thanks for your you support.

On Fri, Dec 23, 2016, 00:39 CH notifications@github.com wrote:

I will post them Tuesday. I just left for the holidays. Great work by the way!

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/compodoc/angular2-dependencies-graph/issues/46#issuecomment-268914769, or mute the thread https://github.com/notifications/unsubscribe-auth/ABnuHYHVWyrBe8XGRFRZucCoLsM1HycYks5rKwocgaJpZM4LUVJS .

--

Wassim Chegham Developer Advocate at SFEIR Google Developer Expert in Web Technologies http://fr.linkedin.com/in/wassimchegham http://twitter.com/manekinekko http://plus.google.com/+WassimCheghamJavaScript/posts http://flickr.com/photos/manekinekko/albums/ http://github.com/manekinekko http://wassimchegham.com/feed http://wassimchegham.com/ http://www.meetup.com/members/135357292/ http://slides.com/wassimchegham/

crh225 commented 7 years ago

tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "sourceMap": true,
    "moduleResolution": "node",
    "skipDefaultLibCheck": true
  },
  "exclude": [
    "./node_modules",
    "./typings/main.d.ts",
    "./typings/main",
   "./typings/custom-signalr.d.ts"
  ],
  "filesGlob": [
    "./client/modules/**/*.ts",
    "./client/platform/**/*.ts",
    "!./node_modules/**",
    "./client/custom-typings.d.ts",
    "./typings/index.d.ts"
  ],
  "compileOnSave": false,
  "buildOnSave": false,
  "awesomeTypescriptLoaderOptions": {
    "useWebpackText": true
  }
}
crh225 commented 7 years ago

app.component.ts

/*
 * Angular 2 decorators and services
 */
import { Component, ViewEncapsulation, OnInit, ViewContainerRef } from '@angular/core';
import { RouterModule } from '@angular/router';
import { User } from 'oidc-client';
import { LdcLocale, LocaleService, LocalizationService } from './shared/classes/ldcLocale';

import { AuthService, ProfileService } from './shared/services';
import { Title }     from '@angular/platform-browser';
import { Configuration } from './app.constants';
import { UserProfile } from './shared/models/user-profile.model';

/*
 * App Component
 * Top Level Component
 */

@Component({
  selector: 'ldc-app',
  styleUrls: ['./app.component.scss'],
  templateUrl: './app.component.html'
})
export class AppComponent extends LdcLocale implements OnInit {
    loadedUserSub: any;
    isCollapsed: boolean;
    bHasRedirected: boolean = false;
    private _user: User;
    private _viewContainerRef: ViewContainerRef;

    constructor(private authService: AuthService
        , private titleService: Title
        , private configuration: Configuration
        , private viewContainerRef: ViewContainerRef
        , public locale: LocaleService
        , public localization: LocalizationService
    ) {
        super(locale, localization);
        this._viewContainerRef = viewContainerRef;

    }
    ngOnInit() {

        this.authService.getUser(); // re-triggers emit user
        this.loadedUserSub = this.authService.userLoadededEvent
            .subscribe(user => {
                this._user = user;
                this.bHasRedirected = false;
            });
        /* this is the angular way to set the title
         * https://angular.io/docs/ts/latest/cookbook/set-document-title.html
         */
        this.titleService.setTitle(this.configuration.SITE_TITLE);
    }

    sidebarChangeEvent(tmp: boolean) {
        this.isCollapsed = tmp;
    }

}
crh225 commented 7 years ago

@manekinekko I tried with both. I posted the files above you requested.

manekinekko commented 7 years ago

@crh225 you need to provide a root entry: https://github.com/compodoc/angular2-dependencies-graph#2-provide-an-entry-file

crh225 commented 7 years ago

@manekinekko, I have a file called boot.ts (see below). It loades the app module, app component and everything else. When I use this file it doesn't work either.

//Must set Root URL at the very beginning of webpack startup.
declare var __webpack_public_path__: any; // Tell Typescript what the publicPath is.
__webpack_public_path__ = (window as any).atlasResourceBaseUrl;

import 'bootstrap/dist/css/bootstrap.css';
import 'font-awesome/css/font-awesome.css';
import 'ng2-toastr/bundles/ng2-toastr.min.css';
import 'flag-icon-css/css/flag-icon.css';

import './polyfills';
import './vendor';

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

import { AppModule }              from './modules/app.module';

declare var module: any;

if (process.env.ENV === 'Development') {
    // Development

    // Basic hot reloading support. Automatically reloads and restarts the Angular 2 app each time
    // you modify source files. This will not preserve any application state other than the URL.

    if (module.hot) {
        module.hot.accept();
    }

} else {
    // Production
    enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule);
manekinekko commented 7 years ago

That's weird, ngd should pick up your app.module from this line:

import { AppModule } from './modules/app.module';

🤔

manekinekko commented 7 years ago

can you share a repo so we can run some tests ?

crh225 commented 7 years ago

I based mine off this guy's https://github.com/asadsahi/AspNetCoreSpa

the loading of app module is the same

crh225 commented 7 years ago

I also have an issue open with compodoc/compodoc. not sure if it is related, but it could be: https://github.com/compodoc/compodoc/issues/41

manekinekko commented 7 years ago

@crh225 I just run ngd -p tsconfig.json on the project https://github.com/asadsahi/AspNetCoreSpa and I got this resulting graph:

image

Can you share your own repo (if it's public). Otherwise we'll try other solutions 😉

manekinekko commented 7 years ago

@crh225 what was your issue?