Skip to content

Commit

Permalink
Merge branch 'release/0.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
DominusKelvin committed Feb 25, 2025
2 parents c54687f + 2b593de commit c55ec8f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "boring-stack",
"version": "0.5.0",
"version": "0.5.1",
"private": "true",
"description": "The Boring JavaScript Stack 🥱 - an opinionated project starter for fullstack JavaScript",
"scripts": {
Expand Down
14 changes: 6 additions & 8 deletions packages/inertia-sails/lib/location.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
const { INERTIA, LOCATION } = require('./helpers/inertia-headers')

module.exports = function (req, res, url) {
// If this is an Inertia request, send a 409 Conflict response
// with the X-Inertia-Location header so the client performs a full window.location visit.
if (req.get(INERTIA)) {
// If the method is PUT, PATCH, or DELETE, force a 303 redirect (so the next request is a GET)
if (['PUT', 'PATCH', 'DELETE'].includes(req.method)) {
return res.redirect(303, url)
}
// If this is an Inertia request, send a 409 Conflict response
// with the X-Inertia-Location header so the client performs a full window.location visit.
res.set(LOCATION, url)
return res.status(409).end()
}

// For non-Inertia requests:
// If the method is PUT, PATCH, or DELETE, force a 303 redirect (so the next request is a GET)
if (['PUT', 'PATCH', 'DELETE'].includes(req.method)) {
return res.redirect(303, url)
}

// Otherwise, perform a standard redirect (default is typically a 302)
return res.redirect(url)
}
2 changes: 1 addition & 1 deletion packages/inertia-sails/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "inertia-sails",
"version": "0.3.0",
"version": "0.3.1",
"description": "The Sails adapter for Inertia.",
"main": "index.js",
"sails": {
Expand Down
11 changes: 6 additions & 5 deletions templates/mellow-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"@sailshq/connect-redis": "^6.1.3",
"@sailshq/lodash": "^3.10.6",
"@sailshq/socket.io-redis": "^6.1.2",
"inertia-sails": "^0.2.2",
"inertia-sails": "^0.3.0",
"nodemailer": "^6.9.15",
"sails": "^1.5.14",
"sails": "^1.5.12",
"sails-flash": "^0.0.1",
"sails-hook-mail": "^0.1.0",
"sails-hook-organics": "^3.0.0",
Expand All @@ -22,14 +22,15 @@
"svelte": "^5.19.10"
},
"devDependencies": {
"@rsbuild/plugin-svelte": "^1.0.7",
"create-sails-generator": "^0.0.3",
"@rsbuild/plugin-svelte": "^1.0.1",
"@types/node": "^22.5.5",
"create-sails-generator": "^0.1.0",
"postcss": "^8.4.47",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.6",
"prettier-plugin-tailwindcss": "^0.4.1",
"sails-hook-dev": "^1.3.0",
"sails-hook-shipwright": "^0.3.2",
"sails-hook-shipwright": "^0.3.0",
"sails.io.js": "^1.2.1",
"socket.io-client": "^4.8.0",
"tailwindcss": "^3.4.12"
Expand Down

0 comments on commit c55ec8f

Please sign in to comment.