Skip to content

Commit 0989712

Browse files
authored
fix: upgrade golang version and npm dependencies to reduce CVE (#95)
The following critical CVEs are fixed by bumping the Go version: GHSA-8c83-vp4v-h7fq, GHSA-v4m2-x4rp-hv22 and GHSA-7qhm-5mxq-x7vp
1 parent 691b2e8 commit 0989712

File tree

9 files changed

+2356
-1993
lines changed

9 files changed

+2356
-1993
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ typings/
6969

7070
# Others
7171
.vscode
72+
.nx
7273
dist
7374
junit.xml
7475

cli/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
FROM golang:1.17-alpine
1+
FROM golang:1.22-alpine
22
RUN apk add upx
33
RUN apk add git

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module ngssc
22

3-
go 1.17
3+
go 1.22
44

55
require (
66
github.com/bmatcuk/doublestar v1.3.2

package.json

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "17.0.2",
44
"description": "Configure an angular application on the server",
55
"scripts": {
6-
"build:lib": "ts-node --project scripts/tsconfig.json --esm ./scripts/build-lib.mts",
6+
"build:lib": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only ./scripts/build-lib.mts",
77
"build:cli": "docker-compose run --rm build-go",
88
"build:cli:upx": "docker-compose run --rm -e BUILD_UPX=true build-go",
99
"build:ngssc": "ng run ngssc-app:ngsscbuild:production",
@@ -45,59 +45,56 @@
4545
"homepage": "https://github.com/kyubisation/angular-server-side-configuration#readme",
4646
"private": true,
4747
"dependencies": {
48-
"@angular/animations": "^17.0.1",
49-
"@angular/common": "^17.0.1",
50-
"@angular/compiler": "^17.0.1",
51-
"@angular/core": "^17.0.1",
52-
"@angular/forms": "^17.0.1",
53-
"@angular/platform-browser": "^17.0.1",
54-
"@angular/platform-browser-dynamic": "^17.0.1",
55-
"@angular/platform-server": "^17.0.1",
56-
"@angular/router": "^17.0.1",
57-
"@angular/ssr": "^17.0.0",
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",
5858
"rxjs": "7.8.1",
5959
"tslib": "^2.6.2",
6060
"zone.js": "~0.14.2"
6161
},
6262
"devDependencies": {
63-
"@angular-devkit/architect": "^0.1700.0",
64-
"@angular-devkit/build-angular": "^17.0.0",
65-
"@angular-devkit/core": "^17.0.0",
66-
"@angular-devkit/schematics": "^17.0.0",
67-
"@angular-eslint/builder": "17.0.0",
68-
"@angular-eslint/eslint-plugin": "17.0.0",
69-
"@angular-eslint/eslint-plugin-template": "17.0.0",
70-
"@angular-eslint/schematics": "17.0.0",
71-
"@angular-eslint/template-parser": "17.0.0",
72-
"@angular/cli": "^17.0.0",
73-
"@angular/compiler-cli": "^17.0.1",
74-
"@angular/localize": "17.0.1",
75-
"@schematics/angular": "^17.0.0",
76-
"@types/jasmine": "~5.1.0",
77-
"@types/node": "^20.8.10",
78-
"@typescript-eslint/eslint-plugin": "^6.10.0",
79-
"@typescript-eslint/parser": "^6.10.0",
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",
76+
"@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",
8080
"cross-env": "^7.0.3",
81-
"eslint": "^8.53.0",
82-
"eslint-plugin-import": "2.29.0",
83-
"glob": "^10.3.10",
81+
"eslint": "^8.57.0",
82+
"eslint-plugin-import": "npm:eslint-plugin-i@^2.29.1",
83+
"glob": "^10.3.14",
8484
"jasmine": "~5.1.0",
8585
"jasmine-core": "~5.1.1",
86-
"karma": "~6.4.2",
86+
"karma": "~6.4.3",
8787
"karma-chrome-launcher": "~3.2.0",
8888
"karma-coverage": "~2.2.1",
8989
"karma-jasmine": "~5.1.0",
9090
"karma-jasmine-html-reporter": "~2.1.0",
91-
"ng-packagr": "^17.0.0",
91+
"ng-packagr": "^17.3.0",
9292
"npm-run-all": "^4.1.5",
93-
"prettier": "3.0.3",
93+
"prettier": "3.2.5",
9494
"standard-version": "^9.5.0",
95-
"ts-node": "^10.9.1",
95+
"ts-node": "^10.9.2",
9696
"typescript": "~5.2.2"
9797
},
98-
"resolutions": {
99-
"cliui": "^7.0.0"
100-
},
10198
"prettier": {
10299
"singleQuote": true,
103100
"endOfLine": "lf",

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,7 @@
279279
},
280280
"deployUrl": {
281281
"type": "string",
282-
"description": "URL where files will be deployed.",
283-
"x-deprecated": "Use \"baseHref\" option, \"APP_BASE_HREF\" DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url."
282+
"description": "Customize the base path for the URLs of resources in 'index.html' and component stylesheets. This option is only necessary for specific deployment scenarios, such as with Angular Elements or when utilizing different CDN locations."
284283
},
285284
"verbose": {
286285
"type": "boolean",
@@ -445,7 +444,7 @@
445444
]
446445
},
447446
"allowedCommonJsDependencies": {
448-
"description": "A list of CommonJS packages that are allowed to be used without a build time warning.",
447+
"description": "A list of CommonJS or AMD packages that are allowed to be used without a build time warning. Use `'*'` to allow all.",
449448
"type": "array",
450449
"items": {
451450
"type": "string"
@@ -524,11 +523,11 @@
524523
"properties": {
525524
"src": {
526525
"type": "string",
527-
"pattern": "\\.(([cm]?j|t)sx?|json)$"
526+
"pattern": "\\.(([cm]?[jt])sx?|json)$"
528527
},
529528
"replaceWith": {
530529
"type": "string",
531-
"pattern": "\\.(([cm]?j|t)sx?|json)$"
530+
"pattern": "\\.(([cm]?[jt])sx?|json)$"
532531
}
533532
},
534533
"additionalProperties": false,
@@ -542,11 +541,11 @@
542541
"properties": {
543542
"replace": {
544543
"type": "string",
545-
"pattern": "\\.(([cm]?j|t)sx?|json)$"
544+
"pattern": "\\.(([cm]?[jt])sx?|json)$"
546545
},
547546
"with": {
548547
"type": "string",
549-
"pattern": "\\.(([cm]?j|t)sx?|json)$"
548+
"pattern": "\\.(([cm]?[jt])sx?|json)$"
550549
}
551550
},
552551
"additionalProperties": false,

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

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"buildTarget": {
1414
"type": "string",
1515
"description": "A build builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
16-
"pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
16+
"pattern": "^[^:\\s]*:[^:\\s]*(:[^\\s]+)?$"
1717
},
1818
"port": {
1919
"type": "number",
@@ -69,11 +69,11 @@
6969
},
7070
"publicHost": {
7171
"type": "string",
72-
"description": "The URL that the browser client (or live-reload client, if enabled) should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies."
72+
"description": "The URL that the browser client (or live-reload client, if enabled) should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies. This option has no effect when using the 'application' or other esbuild-based builders."
7373
},
7474
"allowedHosts": {
7575
"type": "array",
76-
"description": "List of hosts that are allowed to access the dev server.",
76+
"description": "List of hosts that are allowed to access the dev server. This option has no effect when using the 'application' or other esbuild-based builders.",
7777
"default": [],
7878
"items": {
7979
"type": "string"
@@ -85,7 +85,7 @@
8585
},
8686
"disableHostCheck": {
8787
"type": "boolean",
88-
"description": "Don't verify connected clients are part of allowed hosts.",
88+
"description": "Don't verify connected clients are part of allowed hosts. This option has no effect when using the 'application' or other esbuild-based builders.",
8989
"default": false
9090
},
9191
"hmr": {
@@ -107,6 +107,30 @@
107107
"description": "Force the development server to use the 'browser-esbuild' builder when building. This is a developer preview option for the esbuild-based build system.",
108108
"default": false
109109
},
110+
"prebundle": {
111+
"description": "Enable and control the Vite-based development server's prebundling capabilities. To enable prebundling, the Angular CLI cache must also be enabled. This option has no effect when using the 'browser' or other Webpack-based builders.",
112+
"oneOf": [
113+
{
114+
"type": "boolean"
115+
},
116+
{
117+
"type": "object",
118+
"properties": {
119+
"exclude": {
120+
"description": "List of package imports that should not be prebundled by the development server. The packages will be bundled into the application code itself.",
121+
"type": "array",
122+
"items": {
123+
"type": "string"
124+
}
125+
}
126+
},
127+
"additionalProperties": false,
128+
"required": [
129+
"exclude"
130+
]
131+
}
132+
]
133+
},
110134
"additionalEnvironmentVariables": {
111135
"type": "array",
112136
"description": "Additional environment variables that should be added to ngssc.json"

projects/angular-server-side-configuration/builders/ngsscbuild/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Architect } from '@angular-devkit/architect';
22
import { TestProjectHost } from '@angular-devkit/architect/testing';
33
import { normalize, virtualFs } from '@angular-devkit/core';
44

5-
import { Ngssc } from 'angular-server-side-configuration';
5+
import type { Ngssc } from 'angular-server-side-configuration';
66

77
import { applicationHost, createArchitect, legacyHost } from '../../../../test/test-utils';
88

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export async function detectVariablesAndBuildNgsscJson(
5454
applicationBuilderVariant: ApplicationBuilderVariant = undefined,
5555
) {
5656
const ngsscContext = await detectVariables(context, options.searchPattern);
57-
let outputPath = join(context.workspaceRoot, builderOptions.outputPath);
57+
// TODO: Fix possible outputPath options.
58+
let outputPath = join(context.workspaceRoot, builderOptions.outputPath as string);
5859
const ngssc = buildNgssc(
5960
ngsscContext,
6061
options,

0 commit comments

Comments
 (0)