Skip to content

Commit 8dca692

Browse files
authored
feat: upgrade to Angular 18 (#101)
BREAKING CHANGE: Upgrade to Angular 18
1 parent a233f81 commit 8dca692

File tree

16 files changed

+1693
-1512
lines changed

16 files changed

+1693
-1512
lines changed

go.mod

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ module ngssc
33
go 1.22
44

55
require (
6-
github.com/bmatcuk/doublestar v1.3.2
7-
github.com/urfave/cli v1.22.4
6+
github.com/bmatcuk/doublestar v1.3.4
7+
github.com/urfave/cli v1.22.15
88
)
99

1010
require (
11-
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
12-
github.com/russross/blackfriday/v2 v2.0.1 // indirect
13-
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
11+
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
12+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
1413
)

go.sum

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
1-
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
2-
github.com/bmatcuk/doublestar v1.3.2 h1:mzUncgFmpzNUhIITFqGdZ8nUU0O7JTJzRO8VdkeLCSo=
3-
github.com/bmatcuk/doublestar v1.3.2/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=
4-
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
5-
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
1+
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
2+
github.com/bmatcuk/doublestar v1.3.4 h1:gPypJ5xD31uhX6Tf54sDPUOBXTqKH4c9aPY66CyQrS0=
3+
github.com/bmatcuk/doublestar v1.3.4/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=
4+
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
5+
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
6+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
8+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
69
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
710
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
8-
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
9-
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
10-
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
11-
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
12-
github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA=
13-
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
11+
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
12+
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
13+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
14+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
15+
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
16+
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
17+
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
18+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
19+
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
20+
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
21+
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
22+
github.com/urfave/cli v1.22.15 h1:nuqt+pdC/KqswQKhETJjo7pvn/k4xMUxgW6liI7XpnM=
23+
github.com/urfave/cli v1.22.15/go.mod h1:wSan1hmo5zeyLGBjRJbzRTNk8gwoYa2B9n4q9dmRIc0=
1424
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
15-
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
25+
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
26+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
27+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
28+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

package.json

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -45,55 +45,56 @@
4545
"homepage": "https://github.com/kyubisation/angular-server-side-configuration#readme",
4646
"private": true,
4747
"dependencies": {
48-
"@angular/animations": "^17.3.8",
49-
"@angular/common": "^17.3.8",
50-
"@angular/compiler": "^17.3.8",
51-
"@angular/core": "^17.3.8",
52-
"@angular/forms": "^17.3.8",
53-
"@angular/platform-browser": "^17.3.8",
54-
"@angular/platform-browser-dynamic": "^17.3.8",
55-
"@angular/platform-server": "^17.3.8",
56-
"@angular/router": "^17.3.8",
57-
"@angular/ssr": "^17.3.7",
48+
"@angular/animations": "^18.0.0",
49+
"@angular/common": "^18.0.0",
50+
"@angular/compiler": "^18.0.0",
51+
"@angular/core": "^18.0.0",
52+
"@angular/forms": "^18.0.0",
53+
"@angular/platform-browser": "^18.0.0",
54+
"@angular/platform-browser-dynamic": "^18.0.0",
55+
"@angular/platform-server": "^18.0.0",
56+
"@angular/router": "^18.0.0",
57+
"@angular/ssr": "^18.0.1",
5858
"rxjs": "7.8.1",
5959
"tslib": "^2.6.2",
60-
"zone.js": "~0.14.2"
60+
"zone.js": "~0.14.6"
6161
},
6262
"devDependencies": {
63-
"@angular-devkit/architect": "^0.1703.7",
64-
"@angular-devkit/build-angular": "^17.3.7",
65-
"@angular-devkit/core": "^17.3.7",
66-
"@angular-devkit/schematics": "^17.3.7",
67-
"@angular-eslint/builder": "17.4.0",
68-
"@angular-eslint/eslint-plugin": "17.4.0",
69-
"@angular-eslint/eslint-plugin-template": "17.4.0",
70-
"@angular-eslint/schematics": "17.4.0",
71-
"@angular-eslint/template-parser": "17.4.0",
72-
"@angular/cli": "^17.3.7",
73-
"@angular/compiler-cli": "^17.3.8",
74-
"@angular/localize": "17.3.8",
75-
"@schematics/angular": "^17.3.7",
63+
"@angular-devkit/architect": "^0.1800.1",
64+
"@angular-devkit/build-angular": "^18.0.1",
65+
"@angular-devkit/core": "^18.0.1",
66+
"@angular-devkit/schematics": "^18.0.1",
67+
"@angular-eslint/builder": "17.5.1",
68+
"@angular-eslint/eslint-plugin": "17.5.1",
69+
"@angular-eslint/eslint-plugin-template": "17.5.1",
70+
"@angular-eslint/schematics": "17.5.1",
71+
"@angular-eslint/template-parser": "17.5.1",
72+
"@angular/build": "^18.0.1",
73+
"@angular/cli": "^18.0.1",
74+
"@angular/compiler-cli": "^18.0.0",
75+
"@angular/localize": "18.0.0",
76+
"@schematics/angular": "^18.0.1",
7677
"@types/jasmine": "~5.1.4",
77-
"@types/node": "^20.12.11",
78-
"@typescript-eslint/eslint-plugin": "^7.2.0",
79-
"@typescript-eslint/parser": "^7.2.0",
78+
"@types/node": "^20.12.12",
79+
"@typescript-eslint/eslint-plugin": "^7.10.0",
80+
"@typescript-eslint/parser": "^7.10.0",
8081
"cross-env": "^7.0.3",
8182
"eslint": "^8.57.0",
8283
"eslint-plugin-import": "npm:eslint-plugin-i@^2.29.1",
83-
"glob": "^10.3.14",
84+
"glob": "^10.4.1",
8485
"jasmine": "~5.1.0",
85-
"jasmine-core": "~5.1.1",
86+
"jasmine-core": "~5.1.2",
8687
"karma": "~6.4.3",
8788
"karma-chrome-launcher": "~3.2.0",
8889
"karma-coverage": "~2.2.1",
8990
"karma-jasmine": "~5.1.0",
9091
"karma-jasmine-html-reporter": "~2.1.0",
91-
"ng-packagr": "^17.3.0",
92+
"ng-packagr": "^18.0.0",
9293
"npm-run-all": "^4.1.5",
9394
"prettier": "3.2.5",
9495
"standard-version": "^9.5.0",
9596
"ts-node": "^10.9.2",
96-
"typescript": "~5.2.2"
97+
"typescript": "~5.4.5"
9798
},
9899
"prettier": {
99100
"singleQuote": true,

projects/angular-server-side-configuration/builders/browser/index.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
import { BuilderContext, createBuilder } from '@angular-devkit/architect';
1+
import { type BuilderContext, createBuilder } from '@angular-devkit/architect';
22
import {
3-
BrowserBuilderOptions,
4-
BrowserBuilderOutput,
3+
type BrowserBuilderOptions,
4+
type BrowserBuilderOutput,
55
executeBrowserBuilder,
6-
ExecutionTransformer,
6+
type ExecutionTransformer,
77
} from '@angular-devkit/build-angular';
8-
import { IndexHtmlTransform } from '@angular-devkit/build-angular/src/utils/index-file/index-html-generator';
9-
import { WebpackLoggingCallback } from '@angular-devkit/build-webpack';
10-
import { json } from '@angular-devkit/core';
11-
import webpack from 'webpack';
12-
import { Observable } from 'rxjs';
8+
import type { WebpackLoggingCallback } from '@angular-devkit/build-webpack';
9+
import type { json } from '@angular-devkit/core';
10+
import type webpack from 'webpack';
11+
import type { Observable } from 'rxjs';
1312
import { switchMap } from 'rxjs/operators';
1413

1514
import { detectVariablesAndBuildNgsscJson, NgsscBuildSchema } from '../ngsscbuild/index';
1615

1716
export type NgsscBrowserBuilderOptions = BrowserBuilderOptions & NgsscBuildSchema;
17+
// Copied from https://github.com/angular/angular-cli/blob/main/packages/angular/build/src/utils/index-file/index-html-generator.ts
18+
type IndexHtmlTransform = (content: string) => Promise<string>;
1819

1920
/**
2021
* Experimental wrapper of the @angular-devkit/build-angular:browser builder for ngssc.
@@ -28,6 +29,10 @@ export function ngsscBuildWebpackBrowser(
2829
indexHtml?: IndexHtmlTransform;
2930
} = {},
3031
): Observable<BrowserBuilderOutput> {
32+
context.logger.warn(`
33+
The angular-server-side-configuration:browser builder is deprecated with no replacement.
34+
Please create an issue at https://github.com/kyubisation/angular-server-side-configuration
35+
if you need a angular-server-side-configuration:application builder.`);
3136
return executeBrowserBuilder(options, context, transforms).pipe(
3237
switchMap(async (result) => {
3338
if (result.success) {

projects/angular-server-side-configuration/builders/browser/schema.json

Lines changed: 68 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@
6464
}
6565
},
6666
"additionalProperties": false,
67-
"required": ["input"]
67+
"required": [
68+
"input"
69+
]
6870
},
6971
{
7072
"type": "string",
@@ -100,7 +102,9 @@
100102
}
101103
},
102104
"additionalProperties": false,
103-
"required": ["input"]
105+
"required": [
106+
"input"
107+
]
104108
},
105109
{
106110
"type": "string",
@@ -114,7 +118,12 @@
114118
"description": "The stylesheet language to use for the application's inline component styles.",
115119
"type": "string",
116120
"default": "css",
117-
"enum": ["css", "less", "sass", "scss"]
121+
"enum": [
122+
"css",
123+
"less",
124+
"sass",
125+
"scss"
126+
]
118127
},
119128
"stylePreprocessorOptions": {
120129
"description": "Options to pass to style preprocessors.",
@@ -285,13 +294,21 @@
285294
"i18nMissingTranslation": {
286295
"type": "string",
287296
"description": "How to handle missing translations for i18n.",
288-
"enum": ["warning", "error", "ignore"],
297+
"enum": [
298+
"warning",
299+
"error",
300+
"ignore"
301+
],
289302
"default": "warning"
290303
},
291304
"i18nDuplicateTranslation": {
292305
"type": "string",
293306
"description": "How to handle duplicate translations for i18n.",
294-
"enum": ["warning", "error", "ignore"],
307+
"enum": [
308+
"warning",
309+
"error",
310+
"ignore"
311+
],
295312
"default": "warning"
296313
},
297314
"localize": {
@@ -321,7 +338,12 @@
321338
"type": "string",
322339
"description": "Define the output filename cache-busting hashing mode.",
323340
"default": "none",
324-
"enum": ["none", "all", "media", "bundles"]
341+
"enum": [
342+
"none",
343+
"all",
344+
"media",
345+
"bundles"
346+
]
325347
},
326348
"poll": {
327349
"type": "number",
@@ -388,7 +410,9 @@
388410
"description": "The output path of the application's generated HTML index file. The full provided path will be used and will be considered relative to the application's configured output path."
389411
}
390412
},
391-
"required": ["input"]
413+
"required": [
414+
"input"
415+
]
392416
}
393417
]
394418
},
@@ -413,7 +437,11 @@
413437
"type": "string",
414438
"description": "Define the crossorigin attribute setting of elements that provide CORS support.",
415439
"default": "none",
416-
"enum": ["none", "anonymous", "use-credentials"]
440+
"enum": [
441+
"none",
442+
"anonymous",
443+
"use-credentials"
444+
]
417445
},
418446
"allowedCommonJsDependencies": {
419447
"description": "A list of CommonJS or AMD packages that are allowed to be used without a build time warning. Use `'*'` to allow all.",
@@ -439,7 +467,12 @@
439467
}
440468
},
441469
"additionalProperties": false,
442-
"required": ["outputPath", "index", "main", "tsConfig"],
470+
"required": [
471+
"outputPath",
472+
"index",
473+
"main",
474+
"tsConfig"
475+
],
443476
"definitions": {
444477
"assetPattern": {
445478
"oneOf": [
@@ -468,11 +501,15 @@
468501
},
469502
"output": {
470503
"type": "string",
504+
"default": "",
471505
"description": "Absolute path within the output."
472506
}
473507
},
474508
"additionalProperties": false,
475-
"required": ["glob", "input", "output"]
509+
"required": [
510+
"glob",
511+
"input"
512+
]
476513
},
477514
{
478515
"type": "string"
@@ -494,7 +531,10 @@
494531
}
495532
},
496533
"additionalProperties": false,
497-
"required": ["src", "replaceWith"]
534+
"required": [
535+
"src",
536+
"replaceWith"
537+
]
498538
},
499539
{
500540
"type": "object",
@@ -509,7 +549,10 @@
509549
}
510550
},
511551
"additionalProperties": false,
512-
"required": ["replace", "with"]
552+
"required": [
553+
"replace",
554+
"with"
555+
]
513556
}
514557
]
515558
},
@@ -519,7 +562,15 @@
519562
"type": {
520563
"type": "string",
521564
"description": "The type of budget.",
522-
"enum": ["all", "allScript", "any", "anyScript", "anyComponentStyle", "bundle", "initial"]
565+
"enum": [
566+
"all",
567+
"allScript",
568+
"any",
569+
"anyScript",
570+
"anyComponentStyle",
571+
"bundle",
572+
"initial"
573+
]
523574
},
524575
"name": {
525576
"type": "string",
@@ -555,7 +606,9 @@
555606
}
556607
},
557608
"additionalProperties": false,
558-
"required": ["type"]
609+
"required": [
610+
"type"
611+
]
559612
}
560613
}
561-
}
614+
}

0 commit comments

Comments
 (0)