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
43 changes: 0 additions & 43 deletions .docker/40-substitute-base-url.sh

This file was deleted.

27 changes: 20 additions & 7 deletions .docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ server {
root /usr/share/nginx/html;
server_tokens off;

# Standard static-file performance knobs.
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;

access_log off;

# Compression for text-y assets — icons (PNG) are excluded.
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types
text/plain
Expand All @@ -16,6 +25,14 @@ server {
application/xml
image/svg+xml;

# Vite code-split chunks carry a content hash in their filename (chunks/[name]-[hash].js).
# They are truly immutable — cache forever. ^~ skips regex matching for this prefix.
location ^~ /chunks/ {
add_header Cache-Control "public, max-age=31536000, immutable" always;
add_header X-Content-Type-Options "nosniff" always;
try_files $uri =404;
}

# Entry points: HTML pages + the manifest XML are mutable URLs.
# No caching — Outlook always pulls a fresh copy when reopening the add-in.
location ~ \.(html|xml)$ {
Expand All @@ -33,20 +50,16 @@ server {
try_files $uri =404;
}

# JS / CSS — moderate cache, ETag-based revalidation.
# Filenames are not content-hashed (manifest references stable names) so we keep TTL short.
# Entry JS + CSS — stable (unhashed) filenames, short cache with ETag revalidation.
location ~ \.(js|css)$ {
add_header Cache-Control "public, max-age=300, must-revalidate" always;
add_header X-Content-Type-Options "nosniff" always;
try_files $uri =404;
}

# Bare-domain hits redirect to the marketing site. The add-in itself is loaded by Outlook
# at /taskpane.html (and its sibling assets), so this only affects users typing the
# asset host directly into a browser. LANDING_URL is resolved at container start
# by .docker/40-substitute-base-url.sh.
location = / {
return 302 __LANDING_URL__;
absolute_redirect off;
return 302 /taskpane.html;
}

# Catch-all: serve as static, otherwise 404.
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@ on:

jobs:
ci:
name: Build & Type-check (Node ${{ matrix.node }})
name: Build & Type-check
runs-on: ubuntu-latest
strategy:
matrix:
node: ['18', '20', '22']

steps:
- uses: actions/checkout@v6

- name: Set up Node.js ${{ matrix.node }}
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
node-version: '24'
cache: 'npm'

- name: Install dependencies
Expand All @@ -34,6 +31,5 @@ jobs:
continue-on-error: true

- name: Validate manifest
# Pin to 1.x: 2.x requires Node 20+ (ESM strip-bom), and we still test Node 18.
run: npx --yes -p office-addin-manifest@1.13.6 office-addin-manifest validate manifest.xml
run: npx --yes -p office-addin-manifest@latest office-addin-manifest validate manifest.xml
continue-on-error: true
13 changes: 7 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ on:
branches: ['**']
paths: &code_paths
- 'src/**'
- 'assets/**'
- 'public/**'
- 'taskpane.html'
- 'manifest.xml'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- 'webpack.config.js'
- 'tsconfig.node.json'
- 'vite.config.mts'
- 'eslint.config.mjs'
- 'nginx.conf'
- '.nvmrc'
- 'Dockerfile'
- '.dockerignore'
- '.github/workflows/main.yml'
- '.github/workflows/_ci.yml'
- '.github/workflows/_docker.yml'
- '.docker/**'
- '.github/workflows/**'
pull_request:
paths: *code_paths

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
node-version: '24'
cache: 'npm'

- name: Install dependencies
Expand Down Expand Up @@ -71,8 +71,7 @@ jobs:
run: npm run build

- name: Validate manifest
# Pin to 1.x: 2.x requires Node 20+ (ESM strip-bom). Local dev runs on Node 18.
run: npx --yes -p office-addin-manifest@1.13.6 office-addin-manifest validate manifest.xml
run: npx --yes -p office-addin-manifest@latest office-addin-manifest validate manifest.xml

- name: Create release archive
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
/.idea
/.certs
/manifest.*.xml
/auto-imports.d.ts
/components.d.ts
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
Loading