Skip to content

Commit 53648ca

Browse files
json-derulojfcere
andcommittedNov 11, 2023
feat!: update to angular 17 (#480)
* feat!: update to angular 17 * chore(deps): re-build lock file * ci: update to node 18 * Sync with new Angular 17 project config --------- Co-authored-by: Daniel Kimmich <json-derulo@users.noreply.github.com> Co-authored-by: jfcere <jfcere@sherweb.com>
1 parent d5a7e3e commit 53648ca

31 files changed

+3565
-2686
lines changed
 

‎.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ orbs:
44
jobs:
55
build:
66
docker:
7-
- image: cimg/node:16.15-browsers
7+
- image: cimg/node:18.18-browsers
88
steps:
99
# Install chrome via browser tools
1010
- browser-tools/install-chrome
@@ -55,7 +55,7 @@ jobs:
5555
command: yarn build:lib
5656
deploy:
5757
docker:
58-
- image: cimg/node:16.15
58+
- image: cimg/node:18.18
5959
steps:
6060
# Checkout the code from the branch into the working_directory
6161
- checkout

‎angular.json

+6-8
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
},
1616
"architect": {
1717
"build": {
18-
"builder": "@angular-devkit/build-angular:browser",
18+
"builder": "@angular-devkit/build-angular:application",
1919
"options": {
2020
"outputPath": "dist/demo",
2121
"index": "demo/src/index.html",
22-
"main": "demo/src/main.ts",
22+
"browser": "demo/src/main.ts",
2323
"polyfills": [
2424
"zone.js"
2525
],
@@ -28,6 +28,7 @@
2828
"demo/src/favicon.ico",
2929
"demo/src/assets",
3030
"demo/src/app/bindings/remote",
31+
"demo/src/app/cheat-sheet/remote",
3132
"demo/src/app/syntax-highlight/remote",
3233
"demo/src/app/plugins/remote"
3334
],
@@ -88,12 +89,9 @@
8889
"outputHashing": "all"
8990
},
9091
"development": {
91-
"buildOptimizer": false,
9292
"optimization": false,
93-
"vendorChunk": true,
9493
"extractLicenses": false,
95-
"sourceMap": true,
96-
"namedChunks": true
94+
"sourceMap": true
9795
}
9896
},
9997
"defaultConfiguration": "production"
@@ -102,10 +100,10 @@
102100
"builder": "@angular-devkit/build-angular:dev-server",
103101
"configurations": {
104102
"production": {
105-
"browserTarget": "demo:build:production"
103+
"buildTarget": "demo:build:production"
106104
},
107105
"development": {
108-
"browserTarget": "demo:build:development"
106+
"buildTarget": "demo:build:development"
109107
}
110108
},
111109
"defaultConfiguration": "development"

‎demo/src/app/bindings/bindings.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h2 id="remote-url">Remote Url</h2>
1414
Using component with static `python` code block
1515
</markdown>
1616

17-
<markdown>{{ demoPython | language: 'python' }}</markdown>
17+
<markdown [data]="demoPython$ | async | language: 'python'"></markdown>
1818

1919
<markdown>
2020
Using directive with `src` property to fetch remote html file `app/bindings/remote/demo.html`

‎demo/src/app/bindings/bindings.component.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ChangeDetectionStrategy, Component, ElementRef, OnInit } from '@angular/core';
2+
import { HttpRawLoaderService } from '@shared/http-raw-loader';
23

34
@Component({
45
selector: 'app-bindings',
@@ -9,8 +10,7 @@ import { ChangeDetectionStrategy, Component, ElementRef, OnInit } from '@angular
910
export class BindingsComponent implements OnInit {
1011

1112
// remote url
12-
demoPython = require('raw-loader!./remote/demo.py').default;
13-
languagePipe = require('raw-loader!./remote/language-pipe.html').default;
13+
demoPython$ = this.rawLoaderService.get('app/bindings/remote/demo.py');
1414

1515
// variable-binding
1616
markdown =
@@ -46,6 +46,7 @@ export class MarkdownDemoComponent {
4646

4747
constructor(
4848
private elementRef: ElementRef<HTMLElement>,
49+
private rawLoaderService: HttpRawLoaderService,
4950
) { }
5051

5152
ngOnInit(): void {

‎demo/src/app/bindings/bindings.module.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { FormsModule } from '@angular/forms';
33
import { MatInputModule } from '@angular/material/input';
44
import { MarkdownModule } from 'ngx-markdown';
55

6+
import { HttpRawLoaderModule } from '@shared/http-raw-loader';
67
import { ScrollspyNavLayoutModule } from '@shared/scrollspy-nav-layout/scrollspy-nav-layout.module';
78
import { SharedModule } from '@shared/shared.module';
89
import { BindingsRoutingModule } from './bindings-routing.module';
@@ -12,6 +13,7 @@ import { BindingsComponent } from './bindings.component';
1213
imports: [
1314
BindingsRoutingModule,
1415
FormsModule,
16+
HttpRawLoaderModule,
1517
MarkdownModule.forChild(),
1618
MatInputModule,
1719
ScrollspyNavLayoutModule,

‎demo/src/app/cheat-sheet/cheat-sheet.component.html

+18-18
Original file line numberDiff line numberDiff line change
@@ -7,58 +7,58 @@ <h1>Cheat Sheet</h1>
77

88
<section>
99
<h2 id="headers">Headers</h2>
10-
<pre class="language-none">{{ headers }}</pre>
11-
<markdown>{{ headers }}</markdown>
10+
<pre class="language-none">{{ headers$ | async }}</pre>
11+
<markdown [data]="headers$ | async"></markdown>
1212
</section>
1313

1414
<section>
1515
<h2 id="emphasis">Emphasis</h2>
16-
<pre class="language-none">{{ emphasis }}</pre>
17-
<markdown>{{ emphasis }}</markdown>
16+
<pre class="language-none">{{ emphasis$ | async }}</pre>
17+
<markdown [data]="emphasis$ | async"></markdown>
1818
</section>
1919

2020
<section>
2121
<h2 id="lists">Lists</h2>
2222
<p>
2323
In this example, leading and trailing spaces are shown with with dots (⋅)
2424
</p>
25-
<pre class="language-none">{{ listsDot }}</pre>
26-
<markdown>{{ lists }}</markdown>
25+
<pre class="language-none">{{ listsDot$ | async }}</pre>
26+
<markdown [data]="lists$ | async"></markdown>
2727
</section>
2828

2929
<section>
3030
<h2 id="links">Links</h2>
31-
<pre class="language-none">{{ links }}</pre>
32-
<markdown>{{ links }}</markdown>
31+
<pre class="language-none">{{ links$ | async }}</pre>
32+
<markdown [data]="links$ | async"></markdown>
3333
</section>
3434

3535
<section>
3636
<h2 id="images">Images</h2>
37-
<pre class="language-none">{{ images }}</pre>
38-
<markdown>{{ images }}</markdown>
37+
<pre class="language-none">{{ images$ | async }}</pre>
38+
<markdown [data]="images$ | async"></markdown>
3939
</section>
4040

4141
<section>
4242
<h2 id="code-and-synthax">Code and Syntax Highlighting</h2>
43-
<pre class="language-none">{{ codeAndSynthaxHighlighting }}</pre>
44-
<markdown>{{ codeAndSynthaxHighlighting }}</markdown>
43+
<pre class="language-none">{{ codeAndSynthaxHighlighting$ | async }}</pre>
44+
<markdown [data]="codeAndSynthaxHighlighting$ | async"></markdown>
4545
</section>
4646

4747
<section>
4848
<h2 id="tables">Tables</h2>
49-
<pre class="language-none">{{ tables }}</pre>
50-
<markdown>{{ tables }}</markdown>
49+
<pre class="language-none">{{ tables$ | async }}</pre>
50+
<markdown [data]="tables$ | async"></markdown>
5151
</section>
5252

5353
<section>
5454
<h2 id="blockquotes">Blockquotes</h2>
55-
<pre class="language-none">{{ blockquotes }}</pre>
56-
<markdown>{{ blockquotes }}</markdown>
55+
<pre class="language-none">{{ blockquotes$ | async }}</pre>
56+
<markdown [data]="blockquotes$ | async"></markdown>
5757
</section>
5858

5959
<section>
6060
<h2 id="horizontal-rule">Horizontal Rule</h2>
61-
<pre class="language-none">{{ horizontalRule }}</pre>
62-
<markdown>{{ horizontalRule }}</markdown>
61+
<pre class="language-none">{{ horizontalRule$ | async }}</pre>
62+
<markdown [data]="horizontalRule$ | async"></markdown>
6363
</section>
6464
</app-scrollspy-nav-layout>

‎demo/src/app/cheat-sheet/cheat-sheet.component.ts

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ChangeDetectionStrategy, Component, ElementRef, OnInit } from '@angular/core';
2+
import { HttpRawLoaderService } from '@shared/http-raw-loader';
23

34
@Component({
45
selector: 'app-cheat-sheet',
@@ -8,21 +9,22 @@ import { ChangeDetectionStrategy, Component, ElementRef, OnInit } from '@angular
89
})
910
export class CheatSheetComponent implements OnInit {
1011

11-
blockquotes = require('raw-loader!./markdown/blockquotes.md').default;
12-
codeAndSynthaxHighlighting = require('raw-loader!./markdown/code-and-synthax-highlighting.md').default;
13-
emphasis = require('raw-loader!./markdown/emphasis.md').default;
14-
headers = require('raw-loader!./markdown/headers.md').default;
15-
horizontalRule = require('raw-loader!./markdown/horizontal-rule.md').default;
16-
images = require('raw-loader!./markdown/images.md').default;
17-
links = require('raw-loader!./markdown/links.md').default;
18-
lists = require('raw-loader!./markdown/lists.md').default;
19-
listsDot = require('raw-loader!./markdown/lists-dot.md').default;
20-
tables = require('raw-loader!./markdown/tables.md').default;
12+
blockquotes$ = this.rawLoaderService.get('app/cheat-sheet/remote/blockquotes.md');
13+
codeAndSynthaxHighlighting$ = this.rawLoaderService.get('app/cheat-sheet/remote/code-and-synthax-highlighting.md');
14+
emphasis$ = this.rawLoaderService.get('app/cheat-sheet/remote/emphasis.md');
15+
headers$ = this.rawLoaderService.get('app/cheat-sheet/remote/headers.md');
16+
horizontalRule$ = this.rawLoaderService.get('app/cheat-sheet/remote/horizontal-rule.md');
17+
images$ = this.rawLoaderService.get('app/cheat-sheet/remote/images.md');
18+
links$ = this.rawLoaderService.get('app/cheat-sheet/remote/links.md');
19+
lists$ = this.rawLoaderService.get('app/cheat-sheet/remote/lists.md');
20+
listsDot$ = this.rawLoaderService.get('app/cheat-sheet/remote/lists-dot.md');
21+
tables$ = this.rawLoaderService.get('app/cheat-sheet/remote/tables.md');
2122

2223
headings: Element[] | undefined;
2324

2425
constructor(
2526
private elementRef: ElementRef<HTMLElement>,
27+
private rawLoaderService: HttpRawLoaderService,
2628
) { }
2729

2830
ngOnInit(): void {

‎demo/src/app/cheat-sheet/cheat-sheet.module.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { NgModule } from '@angular/core';
22
import { MarkdownModule } from 'ngx-markdown';
33

4+
import { HttpRawLoaderModule } from '@shared/http-raw-loader';
45
import { ScrollspyNavLayoutModule } from '@shared/scrollspy-nav-layout/scrollspy-nav-layout.module';
56
import { SharedModule } from '@shared/shared.module';
67
import { CheatSheetRoutingModule } from './cheat-sheet-routing.module';
@@ -9,6 +10,7 @@ import { CheatSheetComponent } from './cheat-sheet.component';
910
@NgModule({
1011
imports: [
1112
CheatSheetRoutingModule,
13+
HttpRawLoaderModule,
1214
MarkdownModule.forChild(),
1315
ScrollspyNavLayoutModule,
1416
SharedModule,

‎demo/src/app/plugins/plugins.component.html

+24-24
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ <h2 id="line-numbers">Line Numbers plugin</h2>
7676

7777
function square(number) &#123;
7878
return number * number;
79-
}
79+
&#125;
8080
```
8181
</markdown>
8282

@@ -101,8 +101,8 @@ <h2 id="line-numbers">Line Numbers plugin</h2>
101101
n = Math.pow(possible, n);
102102
if (Math.abs(x - n) < 1 && (x > 0 == n > 0))
103103
return negate ? -possible : possible;
104-
} catch (e) &#123; }
105-
}
104+
&#125; catch (e) &#123; &#125;
105+
&#125;
106106
```
107107
</markdown>
108108
</section>
@@ -150,8 +150,8 @@ <h2 id="line-highlight">Line Highlight plugin</h2>
150150
n = Math.pow(possible, n);
151151
if (Math.abs(x - n) < 1 && (x > 0 == n > 0))
152152
return negate ? -possible : possible;
153-
} catch (e) &#123; }
154-
}
153+
&#125; catch (e) &#123; &#125;
154+
&#125;
155155
```
156156
</markdown>
157157
</section>
@@ -305,15 +305,15 @@ <h2 id="katex">KaTeX plugin</h2>
305305

306306
**example.component.ts**
307307
```typescript
308-
import &#123; KatexOptions } from 'ngx-markdown';
308+
import &#123; KatexOptions &#125; from 'ngx-markdown';
309309

310310
public options: KatexOptions = &#123;
311311
displayMode: true,
312312
throwOnError: false,
313313
errorColor: '#cc0000',
314314
delimiters: [...],
315315
...
316-
};
316+
&#125;;
317317
```
318318

319319
**example.component.html**
@@ -361,14 +361,14 @@ <h2 id="mermaid">Mermaid plugin</h2>
361361

362362
**example.component.ts**
363363
```typescript
364-
import &#123; MermaidAPI } from 'ngx-markdown';
364+
import &#123; MermaidAPI &#125; from 'ngx-markdown';
365365

366366
public options: MermaidAPI.Config = &#123;
367367
fontFamily: '"trebuchet ms", verdana, arial, sans-serif',
368368
logLevel: MermaidAPI.LogLevel.Info,
369369
theme: MermaidAPI.Theme.Dark,
370370
...
371-
};
371+
&#125;;
372372
```
373373

374374
**example.component.html**
@@ -424,20 +424,20 @@ <h2 id="clipboard">Clipboard plugin</h2>
424424
padding: 4px 0;
425425
width: 50px;
426426
transition: all 250ms ease-out;
427-
}
427+
&#125;
428428

429429
.markdown-clipboard-button:hover &#123;
430430
background-color: rgba(255, 255, 255, 0.14);
431-
}
431+
&#125;
432432

433433
.markdown-clipboard-button:active &#123;
434434
transform: scale(0.95);
435-
}
435+
&#125;
436436

437437
.markdown-clipboard-button.copied &#123;
438438
background-color: rgba(0, 255, 0, 0.1);
439439
color: #00ff00;
440-
}
440+
&#125;
441441
```
442442
</markdown>
443443

@@ -453,9 +453,9 @@ <h2 id="clipboard">Clipboard plugin</h2>
453453
provide: ClipboardOptions,
454454
useValue: &#123;
455455
buttonComponent: ClipboardButtonComponent,
456-
},
457-
},
458-
}),
456+
&#125;,
457+
&#125;,
458+
&#125;),
459459
```
460460
</markdown>
461461

@@ -465,26 +465,26 @@ <h2 id="clipboard">Clipboard plugin</h2>
465465
You can also provide your custom component using the `clipboardButtonComponent` input property when using the `clipboard` directive.
466466

467467
```typescript
468-
import &#123; Component } from '@angular/core';
468+
import &#123; Component &#125; from '&#64;angular/core';
469469

470-
@Component(&#123;
470+
&#64;Component(&#123;
471471
selector: 'app-clipboard-button',
472472
template: `&lt;button (click)="onClick()">Copy&lt;/button>`,
473-
})
473+
&#125;)
474474
export class ClipboardButtonComponent &#123;
475475
onClick() &#123;
476476
alert('Copied to clipboard!');
477-
}
478-
}
477+
&#125;
478+
&#125;
479479
```
480480

481481
```typescript
482-
import &#123; ClipboardButtonComponent } from './clipboard-button-component';
482+
import &#123; ClipboardButtonComponent &#125; from './clipboard-button-component';
483483

484-
@Component(&#123; ... })
484+
&#64;Component(&#123; ... &#125;)
485485
export class ExampleComponent &#123;
486486
readonly clipboardButton = ClipboardButtonComponent;
487-
}
487+
&#125;
488488
```
489489

490490
```html

0 commit comments

Comments
 (0)
Please sign in to comment.