Skip to content

Commit

Permalink
fix: more issues with angular 18 compatibility in other repos
Browse files Browse the repository at this point in the history
  • Loading branch information
steveblue committed Sep 27, 2024
1 parent 229bfaa commit 8675139
Show file tree
Hide file tree
Showing 16 changed files with 367 additions and 325 deletions.
54 changes: 21 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
"@angular/router": "18.0.0",
"@angular/service-worker": "18.0.0",
"@mapbox/rehype-prism": "^0.5.0",
"@ngx-loading-bar/core": "^5.1.2",
"@ngx-loading-bar/http-client": "^5.1.2",
"@ngx-loading-bar/core": "^6.0.2",
"@ngx-loading-bar/http-client": "^6.0.2",
"@stackblitz/sdk": "^1.5.3",
"@swimlane/docspa-core": "^6.0.0",
"@swimlane/docspa-remark-preset": "^6.0.0",
Expand All @@ -78,7 +78,7 @@
"hast-util-to-dom": "^2.0.6",
"intersection-observer": "^0.12.0",
"lunr": "^2.3.9",
"ngx-logger": "^5.0.11",
"ngx-logger": "5.0.12",
"normalize-path": "^3.0.0",
"path": "^0.12.7",
"path-browserify": "^1.0.1",
Expand Down
71 changes: 37 additions & 34 deletions projects/swimlane/docspa-core/src/lib/docspa-core.module.ts
Original file line number Diff line number Diff line change
@@ -1,66 +1,69 @@
import { NgModule, ModuleWithProviders } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule } from '@angular/forms';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { RouterModule } from '@angular/router';

import { LoggerModule } from 'ngx-logger';
import { NgModule, ModuleWithProviders } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { FormsModule } from "@angular/forms";
import { RouterModule } from "@angular/router";
import {
provideHttpClient,
withInterceptorsFromDi,
HTTP_INTERCEPTORS,
} from "@angular/common/http";
// import { LoggerModule } from "ngx-logger";

// Internal
import { MarkdownElementsModule } from './modules/markdown-elements/markdown-elements.module';
import { MarkdownModule } from './modules/markdown/markdown.module';
import { MarkdownElementsModule } from "./modules/markdown-elements/markdown-elements.module";
import { MarkdownModule } from "./modules/markdown/markdown.module";

import { SettingsService } from './services/settings.service';
import { FetchService } from './services/fetch.service';
import { RouterService } from './services/router.service';
import { CacheInterceptor } from './services/cache.interceptor';
import { HooksService } from './services/hooks.service';
import { SectionScrollSpyDirective } from './directives/section-spy.directive';
import { ListCollapseDirective } from './directives/list-collapse.directive';
import { SettingsService } from "./services/settings.service";
import { FetchService } from "./services/fetch.service";
import { RouterService } from "./services/router.service";
import { CacheInterceptor } from "./services/cache.interceptor";
import { HooksService } from "./services/hooks.service";
import { SectionScrollSpyDirective } from "./directives/section-spy.directive";
import { ListCollapseDirective } from "./directives/list-collapse.directive";

import { DocSPACoreComponent } from './docspa-core.component';
import { SafeHtmlPipe } from './pipes/safe-html.pipe';
import { DocSPACoreComponent } from "./docspa-core.component";
import { PipesModule } from "./pipes";

import { DOCSPA_CONFIG_TOKEN, DOCSPA_ENVIRONMENT } from './docspa-core.tokens';
import { DOCSPA_CONFIG_TOKEN, DOCSPA_ENVIRONMENT } from "./docspa-core.tokens";

@NgModule({
imports: [
BrowserModule,
FormsModule,
HttpClientModule,
BrowserAnimationsModule,
MarkdownModule,
LoggerModule,
PipesModule,
// LoggerModule,
MarkdownElementsModule,
RouterModule
RouterModule,
],
declarations: [
DocSPACoreComponent,
SafeHtmlPipe,
SectionScrollSpyDirective,
ListCollapseDirective
],
exports: [
DocSPACoreComponent,
SafeHtmlPipe,
ListCollapseDirective,
],
exports: [DocSPACoreComponent],
providers: [
SettingsService,
FetchService,
RouterService,
HooksService,
{ provide: HTTP_INTERCEPTORS, useClass: CacheInterceptor, multi: true }
]
provideHttpClient(withInterceptorsFromDi()),
{ provide: HTTP_INTERCEPTORS, useClass: CacheInterceptor, multi: true },
],
})
export class DocspaCoreModule {
static forRoot(config: any = {}, environment: any = {}): ModuleWithProviders<DocspaCoreModule> {
static forRoot(
config: any = {},
environment: any = {}
): ModuleWithProviders<DocspaCoreModule> {
return {
ngModule: DocspaCoreModule,
providers: [
{ provide: DOCSPA_ENVIRONMENT, useValue: environment },
{ provide: DOCSPA_CONFIG_TOKEN, useValue: config }
]
{ provide: DOCSPA_CONFIG_TOKEN, useValue: config },
],
};
}

Expand Down
Loading

0 comments on commit 8675139

Please sign in to comment.