diff --git a/package.json b/package.json
index ff11e35..b1825c7 100644
--- a/package.json
+++ b/package.json
@@ -7,10 +7,12 @@
"packages/react-inertia",
"packages/vue",
"packages/vue-inertia",
- "packages/alpine"
+ "packages/alpine",
+ "packages/svelte",
+ "packages/svelte-inertia"
],
"scripts": {
- "watch": "npx concurrently \"npm run watch --workspace=packages/core\" \"npm run watch --workspace=packages/react\" \"npm run watch --workspace=packages/react-inertia\" \"npm run watch --workspace=packages/vue\" \"npm run watch --workspace=packages/vue-inertia\" \"npm run watch --workspace=packages/alpine\" --names=core,react,react-inertia,vue,vue-inertia,alpine",
+ "watch": "npx concurrently \"npm run watch --workspace=packages/core\" \"npm run watch --workspace=packages/react\" \"npm run watch --workspace=packages/react-inertia\" \"npm run watch --workspace=packages/vue\" \"npm run watch --workspace=packages/vue-inertia\" \"npm run watch --workspace=packages/alpine\" \"npm run watch --workspace=packages/svelte\" \"npm run watch --workspace=packages/svelte-inertia\" --names=core,react,react-inertia,vue,vue-inertia,alpine,svelte,svelte-inertia",
"build": "npm run build --workspaces",
"link": "npm link --workspaces",
"typeCheck": "npm run typeCheck --workspaces",
diff --git a/packages/svelte-inertia/.gitignore b/packages/svelte-inertia/.gitignore
new file mode 100644
index 0000000..c925c21
--- /dev/null
+++ b/packages/svelte-inertia/.gitignore
@@ -0,0 +1,2 @@
+/dist
+/node_modules
diff --git a/packages/svelte-inertia/LICENSE.md b/packages/svelte-inertia/LICENSE.md
new file mode 100644
index 0000000..79810c8
--- /dev/null
+++ b/packages/svelte-inertia/LICENSE.md
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Taylor Otwell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/packages/svelte-inertia/README.md b/packages/svelte-inertia/README.md
new file mode 100644
index 0000000..0b20012
--- /dev/null
+++ b/packages/svelte-inertia/README.md
@@ -0,0 +1,31 @@
+# Laravel Precognition
+
+
+
+
+
+
+
+## Introduction
+
+Laravel Precognition allows you to anticipate the outcome of a future HTTP request. One of the primary use cases of Precognition is the ability to provide "live" validation in your frontend application.
+
+## Official Documentation
+
+Documentation for Laravel Precognition can be found on the [Laravel website](https://laravel.com/docs/precognition).
+
+## Contributing
+
+Thank you for considering contributing to Laravel Precognition! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
+
+## Code of Conduct
+
+In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
+
+## Security Vulnerabilities
+
+Please review [our security policy](https://github.com/laravel/precognition/security/policy) on how to report security vulnerabilities.
+
+## License
+
+Laravel Precognition is open-sourced software licensed under the [MIT license](LICENSE.md).
diff --git a/packages/svelte-inertia/package.json b/packages/svelte-inertia/package.json
new file mode 100644
index 0000000..2289a42
--- /dev/null
+++ b/packages/svelte-inertia/package.json
@@ -0,0 +1,53 @@
+{
+ "name": "laravel-precognition-svelte-inertia",
+ "version": "0.0.1",
+ "description": "Laravel Precognition (Svelte w/ Inertia).",
+ "keywords": [
+ "laravel",
+ "precognition",
+ "svelte",
+ "inertia"
+ ],
+ "homepage": "https://github.com/laravel/precognition",
+ "type": "module",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/laravel/precognition"
+ },
+ "license": "MIT",
+ "author": "Laravel",
+ "main": "dist/index.js",
+ "files": [
+ "dist",
+ "!dist/**/*.test.*",
+ "!dist/**/*.spec.*"
+ ],
+ "svelte": "./dist/index.svelte.js",
+ "types": "./dist/index.svelte.d.ts",
+ "exports": {
+ ".": {
+ "types": "./dist/index.svelte.d.ts",
+ "svelte": "./dist/index.svelte.js"
+ }
+ },
+ "scripts": {
+ "watch": "rm -rf dist && tsc --watch --preserveWatchOutput",
+ "build": "rm -rf dist && tsc",
+ "typeCheck": "tsc --noEmit",
+ "prepublishOnly": "npm run build",
+ "version": "npm pkg set dependencies.laravel-precognition=$npm_package_version"
+ },
+ "peerDependencies": {
+ "@inertiajs/svelte": "^1.0.0 || ^2.0.0",
+ "svelte": "^5.0.0"
+ },
+ "dependencies": {
+ "laravel-precognition": "0.7.2",
+ "laravel-precognition-svelte": "0.0.1",
+ "lodash-es": "^4.17.21"
+ },
+ "devDependencies": {
+ "@types/lodash-es": "^4.17.12",
+ "typescript": "^5.0.0"
+ }
+}
diff --git a/packages/svelte-inertia/src/index.svelte.ts b/packages/svelte-inertia/src/index.svelte.ts
new file mode 100644
index 0000000..e409d87
--- /dev/null
+++ b/packages/svelte-inertia/src/index.svelte.ts
@@ -0,0 +1,185 @@
+import { FormDataConvertible, VisitOptions } from '@inertiajs/core'
+import { useForm as useInertiaForm } from '@inertiajs/svelte'
+import {
+ client,
+ NamedInputEvent,
+ RequestMethod,
+ resolveMethod,
+ resolveUrl,
+ SimpleValidationErrors,
+ toSimpleValidationErrors,
+ ValidationConfig,
+ ValidationErrors,
+} from 'laravel-precognition'
+import { useForm as usePrecognitiveForm } from 'laravel-precognition-svelte'
+import { fromStore, get, writable, Writable } from 'svelte/store'
+import { Form } from './types'
+
+export { client }
+
+export const useForm = >(
+ method: RequestMethod | (() => RequestMethod),
+ url: string | (() => string),
+ inputs: Data,
+ config: ValidationConfig = {},
+): Writable