Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 13 additions & 1 deletion .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@ const { overrides } = require('@netlify/eslint-config-node')
module.exports = {
extends: '@netlify/eslint-config-node',
rules: {
'max-depth': 0,
complexity: 0,
'fp/no-let': 0,
'fp/no-loops': 0,
'fp/no-mutation': 0,
'fp/no-mutating-methods': 0,
'func-style': ['error', 'declaration'],
'id-length': 0,
'import/extensions': [
'error',
'ignorePackages',
{
js: 'always',
},
],
'max-depth': 0,
'max-statements': 0,
'no-await-in-loop': 0,
'node/exports-style': 0,
Expand All @@ -31,4 +39,8 @@ module.exports = {
'unicorn/no-array-push-push': 0,
},
overrides: [...overrides],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
}
4 changes: 2 additions & 2 deletions .github/workflows/failure-notifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if: always()
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}

Expand All @@ -35,7 +35,7 @@ jobs:
issues: write
steps:
- name: Check out the repository
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: Check conditions for failure notification
id: check_label
uses: actions/github-script@v8
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
token: ${{ steps.get-token.outputs.token }}
release-type: node
package-name: '@netlify/angular-runtime'
- uses: actions/checkout@v5
- uses: actions/checkout@v6
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v6
with:
Expand Down
21 changes: 7 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,21 @@ on:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [18.19.1, 20.19.1, 22]
exclude:
- os: macOS-latest
node-version: 18.19.1
- os: windows-latest
node-version: 18.19.1
- os: macOS-latest
node-version: 20.19.1
- os: windows-latest
node-version: 20.19.1
node-version: [22, 24]
fail-fast: false

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
Expand All @@ -35,10 +29,9 @@ jobs:
name: NPM Install
- name: Linting
run: npm run format:ci
if: "${{ matrix.node-version == '20.19.1' }}"
- name: Install Deno
uses: denoland/setup-deno@v1
uses: denoland/setup-deno@v2
with:
deno-version: 2.5.6
deno-version: 2.4.5
- name: Run tests
run: npm run test
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run format
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ node_modules
test
tests/fixtures
tools/known-server-ts-signatures

package-lock.json
6 changes: 6 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const prettierConfig = require('@netlify/eslint-config-node/.prettierrc.json')

module.exports = {
...prettierConfig,
endOfLine: 'auto',
}
6 changes: 0 additions & 6 deletions .prettierrc.js

This file was deleted.

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class FooComponent {
console.log(`Rendering Foo for path ${request?.url} from location ${context?.geo?.city}`)
// ...
}

}
```

Expand Down Expand Up @@ -98,15 +98,15 @@ export class FooComponent {
console.log(`Rendering Foo for path ${request?.url} from location ${context?.geo?.city}`)
// ...
}

}
```

Note that App Engine in Angular 19 is in Developer Preview and requires explicit opt-in.

## Request handling

Starting with Angular@19. The build plugin makes use of the `server.ts` file to handle requests. The default Angular scaffolding generates incompatible code for Netlify so the build plugin will swap it for compatible `server.ts` file automatically if it detects default version being used.
Starting with Angular@19. The build plugin makes use of the `server.ts` file to handle requests. The default Angular scaffolding generates incompatible code for Netlify so the build plugin will swap it for compatible `server.ts` file automatically if it detects default version being used.

Make sure you have `@netlify/angular-runtime` version 2.2.0 or later installed in your project. Netlify compatible `server.ts` file imports utilities from this package and Angular Compiler need to be able to resolve it and it can only do that if it's installed in your project and not when it's auto-installed by Netlify.

Expand All @@ -118,7 +118,7 @@ If you are using Angular 20 or Angular 19 with App Engine Developer Preview:

```ts
import { AngularAppEngine, createRequestHandler } from '@angular/ssr'
import { getContext } from '@netlify/angular-runtime/context.mjs'
import { getContext } from '@netlify/angular-runtime/context.js'

const angularAppEngine = new AngularAppEngine()

Expand Down Expand Up @@ -146,7 +146,7 @@ If you are using Angular 19 and did not opt into the App Engine Developer Previe

```ts
import { CommonEngine } from '@angular/ssr/node'
import { render } from '@netlify/angular-runtime/common-engine.mjs'
import { render } from '@netlify/angular-runtime/common-engine.js'

const commonEngine = new CommonEngine()

Expand Down Expand Up @@ -181,7 +181,7 @@ The [`server.ts` file](https://angular.dev/guide/ssr#configure-server-side-rende

### Requirements

To use the Angular Runtime while building and deploying with the CLI, you need to have `netlify-cli v17.0.0` installed (or a later version).
To use the Angular Runtime while building and deploying with the CLI, you need to have `netlify-cli v26.0.0` installed (or a later version).

Please also make sure to use `ntl deploy --build` (rather than `ntl build && ntl deploy`).

Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] }
export default { extends: ['@commitlint/config-conventional'] }
2 changes: 1 addition & 1 deletion common-engine.d.mts → common-engine.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This is duplicating module resolution from package.json#exports
// because some module resolution settings in tsconfig.json are not honoring export maps
// https://www.typescriptlang.org/docs/handbook/modules/theory.html#module-resolution
export * from './src/common-engine.mjs'
export * from './src/common-engine.js'
2 changes: 1 addition & 1 deletion common-engine.mjs → common-engine.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This is duplicating module resolution from package.json#exports
// because some module resolution settings in tsconfig.json are not honoring export maps
// https://www.typescriptlang.org/docs/handbook/modules/theory.html#module-resolution
export * from './src/common-engine.mjs'
export * from './src/common-engine.js'
2 changes: 1 addition & 1 deletion context.d.mts → context.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This is duplicating module resolution from package.json#exports
// because some module resolution settings in tsconfig.json are not honoring export maps
// https://www.typescriptlang.org/docs/handbook/modules/theory.html#module-resolution
export * from './src/context.mjs'
export * from './src/context.js'
2 changes: 1 addition & 1 deletion context.mjs → context.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This is duplicating module resolution from package.json#exports
// because some module resolution settings in tsconfig.json are not honoring export maps
// https://www.typescriptlang.org/docs/handbook/modules/theory.html#module-resolution
export * from './src/context.mjs'
export * from './src/context.js'
27 changes: 6 additions & 21 deletions demo/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,10 @@
"options": {
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": [],
"server": "src/main.server.ts",
"outputMode": "server",
Expand Down Expand Up @@ -78,18 +71,10 @@
"test": {
"builder": "@angular/build:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": []
}
}
Expand Down
46 changes: 46 additions & 0 deletions demo/deno.lock

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

Loading
Loading