Skip to content

feat: support Angular 18 #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"pretest:fixtures:application-builder": "cd tests/fixtures/application-builder && npm ci",
"pretest:fixtures:browser-builder": "cd tests/fixtures/browser-builder && npm ci",
"pretest:fixtures:prerender-false": "cd tests/fixtures/prerender-false && npm ci",
"pretest:fixtures:angular-18": "cd tests/fixtures/angular-18 && npm ci",
"pretest": "run-s pretest:*",
"test": "node --test"
},
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/validateAngularVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const validateAngularVersion = async function (root) {
}

const { version } = await readJSON(packagePath)
if (!satisfies(version, '^17.0.0-rc', { includePrerelease: true })) {
console.warn(`This site does not seem to be using Angular 17.`)
if (!satisfies(version, '>=17.0.0-rc', { includePrerelease: true })) {
console.warn(`This site does not seem to be using Angular 17 or later. Found: ${version}.`)
return false
}

Expand Down
101 changes: 101 additions & 0 deletions tests/fixtures/angular-18/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"angular-demo": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/angular-demo",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"src/styles.css"
],
"scripts": [],
"server": "src/main.server.ts",
"prerender": true,
"ssr": {
"entry": "server.ts"
}
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kB",
"maximumError": "1MB"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kB",
"maximumError": "4kB"
}
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "angular-demo:build:production"
},
"development": {
"buildTarget": "angular-demo:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"src/styles.css"
],
"scripts": []
}
}
}
}
}
}
6 changes: 6 additions & 0 deletions tests/fixtures/angular-18/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build]
command="npm run build"
ignore="exit 1" ## always build, there might be changes in the plugin

[[plugins]]
package="@netlify/angular-runtime"
Loading
Loading