Skip to content

Commit

Permalink
Merge branch 'geoffrich:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
FlippingBinary authored Aug 24, 2024
2 parents 5c64c99 + a86dff7 commit e168354
Show file tree
Hide file tree
Showing 46 changed files with 3,891 additions and 6,539 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Azure Static Web Apps CI/CD

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main

jobs:
clean:
if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && github.event.action != 'closed'
runs-on: ubuntu-latest
name: Delete old bot comment
steps:
- name: pr-deleter
uses: maheshrayas/action-pr-comment-delete@06d7254b4aeba4491a66a7e0f755b107f7373ccd
with:
github_token: '${{ secrets.GITHUB_TOKEN }}'
org: 'geoffrich'
repo: 'svelte-adapter-azure-swa'
user: 'github-actions[bot]'
issue: '${{github.event.number}}'
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
env:
# workaround for Oryx issue: see https://github.com/Azure/static-web-apps/issues/909#issuecomment-1320077142
CUSTOM_BUILD_COMMAND: 'chown -R root:root . && npm install --unsafe-perm && npm run build'
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_POLITE_DESERT_00B80111E }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: 'upload'
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: '/demo' # App source code path
api_location: 'demo/func' # Api source code path - optional
output_location: 'build/static' # Built app content directory - optional
# needed when we set CUSTOM_BUILD_COMMAND
skip_api_build: true
###### End of Repository/Build Configurations ######
outputs:
preview_url: ${{ steps.builddeploy.outputs.static_web_app_url }}
test:
needs: build_and_deploy_job
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && github.event.action != 'closed')
name: Run E2E Tests
timeout-minutes: 10
runs-on: ubuntu-latest
defaults:
run:
working-directory: demo
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: '18.x'
- name: Install dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install chromium --with-deps
- name: Run Playwright tests
run: npm test
env:
PLAYWRIGHT_TEST_BASE_URL: ${{ needs.build_and_deploy_job.outputs.preview_url }}

close_pull_request_job:
if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_POLITE_DESERT_00B80111E }}
action: 'close'
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

- uses: actions/setup-node@v1
with:
node-version: 16
node-version: 18
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}

Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Run Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.x'
- run: npm ci
- run: npm run check-types
- run: npm run check-format
- run: npm test
118 changes: 2 additions & 116 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,118 +1,4 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
coverage/
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
.env.production

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.vscode/
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CHANGELOG.md
coverage/
build/
.svelte-kit/
sk_render/
103 changes: 103 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,108 @@
# Changelog

### [0.20.1](https://www.github.com/geoffrich/svelte-adapter-azure-swa/compare/v0.20.0...v0.20.1) (2024-07-13)


### Bug Fixes

* work around SWA issue with empty form bodies ([#179](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/179)) ([d14aae1](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/d14aae1bd35a68ed6836db6277753f2e3619de1b))

## [0.20.0](https://www.github.com/geoffrich/svelte-adapter-azure-swa/compare/v0.19.1...v0.20.0) (2024-01-01)


### Features

* require SvelteKit 2 and Node 18 ([c77c842](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/c77c842659297a687239b33ba52546285d7b26d3))

### [0.19.1](https://www.github.com/geoffrich/svelte-adapter-azure-swa/compare/v0.19.0...v0.19.1) (2023-11-20)


### Bug Fixes

* do not rewrite /api and /data-api requests to SvelteKit ([#162](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/162)) ([aa36771](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/aa3677133d404cf7bb396ea3f4c41ea026598ce7))
* do not throw on parsing client principal ([#160](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/160)) ([0fe3eaa](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/0fe3eaa593e3f58044b230957e190cb3011ea4d5))

## [0.19.0](https://www.github.com/geoffrich/svelte-adapter-azure-swa/compare/v0.18.0...v0.19.0) (2023-08-17)


### Features

* add `loader` to `esbuildOptions` ([#153](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/153)) ([f1f4ec6](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/f1f4ec6800a3d90e8002207c0609939fa1ccc049))

## [0.18.0](https://www.github.com/geoffrich/svelte-adapter-azure-swa/compare/v0.17.0...v0.18.0) (2023-08-03)


### Features

* add `keepNames` to `esbuildOptions` ([#150](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/150)) ([dbe44ba](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/dbe44ba4d239a4bc1db238b909fd8a5f55b5baf4))

## [0.17.0](https://www.github.com/geoffrich/svelte-adapter-azure-swa/compare/v0.16.0...v0.17.0) (2023-07-02)


### Features

* allow overriding `platform.apiRuntime` ([#144](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/144)) ([fd8241a](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/fd8241a7a02846d846fc291cb4c74a966d00db14))
* throw error if /api routes defined ([#142](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/142)) ([036cf64](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/036cf64fbedc3f4ec95271be03f75ada66eb7f2e))

## [0.16.0](https://www.github.com/geoffrich/svelte-adapter-azure-swa/compare/v0.15.0...v0.16.0) (2023-05-12)


### Features

* add `staticDir` setting ([#117](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/117)) ([4f2ff41](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/4f2ff41a8355ce070fc96f7d9c709806a74a2341))

## [0.15.0](https://www.github.com/geoffrich/svelte-adapter-azure-swa/compare/v0.14.0...v0.15.0) (2023-03-18)


### Features

* add context to the platform object ([#127](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/127)) ([e597d0c](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/e597d0cbd54a0e486a6bedc93d6b8071bb25f2b8))


### Bug Fixes

* await server init ([#128](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/128)) ([4900a35](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/4900a351ee78fcecf3050cf0a28696548646cd1a))

## [0.14.0](https://www.github.com/geoffrich/svelte-adapter-azure-swa/compare/v0.13.0...v0.14.0) (2023-03-15)


### Features

* expose client principal through platform ([#107](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/107)) ([e41f89c](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/e41f89cde57858b76df61a7ba6316f5ac0a4498d))


### Bug Fixes

* binary body is incorrectly parsed as UTF-8 ([#123](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/123)) ([4869959](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/48699595be4cabe355f070250780492bba5a1fdb))

## [0.13.0](https://www.github.com/geoffrich/svelte-adapter-azure-swa/compare/v0.12.0...v0.13.0) (2023-01-23)


### Features

* bump deps to SvelteKit 1.0 ([d050933](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/d050933b237530b6064351fe619c6f36bbee66d2))

## [0.12.0](https://www.github.com/geoffrich/svelte-adapter-azure-swa/compare/v0.11.0...v0.12.0) (2022-11-21)


### Features

* auto-create required function files ([#92](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/92)) ([c682164](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/c682164dfcc35045fbb66cc1ea31f3a8e253a411))
* implement getClientAddress ([#71](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/71)) ([56b5380](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/56b5380c8ebb29c2678bb83ea3cbf9189dd09ee6))

## [0.11.0](https://www.github.com/geoffrich/svelte-adapter-azure-swa/compare/v0.10.0...v0.11.0) (2022-10-18)


### Features

* generate sourcemaps ([#75](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/75)) ([90e19bd](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/90e19bdbec8dbc7833d54246bf61bbf3d9c93d89))


### Bug Fixes

* copy over necessary files ([#84](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/84)) ([f503556](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/f5035567c923f1583fd2c3c9330e7668c9334239))
* handle multiple Set-Cookie headers ([#74](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/74)) ([5a6a64f](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/5a6a64f42349aad0da2d61b11e63189130eaf1dd))

## [0.10.0](https://www.github.com/geoffrich/svelte-adapter-azure-swa/compare/v0.9.0...v0.10.0) (2022-08-23)


Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

See the [GitHub Issues](https://github.com/geoffrich/svelte-adapter-azure-swa/issues) list for any open Issue.

General improvements to any aspect of this adapter are welcome, just ensure major work is preceeded by a conversation in a [GitHub Issue](https://github.com/geoffrich/svelte-adapter-azure-swa/issues).
General improvements to any aspect of this adapter are welcome, just ensure major work is preceded by a conversation in a [GitHub Issue](https://github.com/geoffrich/svelte-adapter-azure-swa/issues).

## Package scripts

- `npm run format`: format the code using Prettier
- `npm run format`: check that the code is correctly formated
- `npm run format`: check that the code is correctly formatted
- `npm run test`: run the unit tests using [Vitest](https://vitest.dev/)
- `npm run test:coverage`: check test coverage

Expand Down
Loading

0 comments on commit e168354

Please sign in to comment.