Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ziggy-js

Package Overview
Dependencies
Maintainers
8
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ziggy-js - npm Package Compare versions

Comparing version 1.7.2 to 1.8.0

src/js/index.d.ts

17

package.json
{
"name": "ziggy-js",
"version": "1.7.2",
"version": "1.8.0",
"description": "Use your Laravel named routes in JavaScript.",

@@ -28,3 +28,3 @@ "keywords": [

"files": [
"src/js",
"src/js/index.d.ts",
"dist"

@@ -39,2 +39,3 @@ ],

"esmodule": "dist/index.es.js",
"types": "src/js/index.d.ts",
"repository": {

@@ -45,9 +46,9 @@ "type": "git",

"scripts": {
"build": "microbundle --name route --format modern,es,umd --external none --no-sourcemap",
"build:vue": "microbundle --entry src/js/vue.js --output dist/vue.js --name ZiggyVue --format modern,es,umd --external none --no-sourcemap",
"build:react": "microbundle --entry src/js/react.js --output dist/react.js --name ZiggyReact --format modern,es,umd --external none --no-sourcemap",
"build": "microbundle --name route --format modern,es,umd --external none --no-sourcemap --no-generateTypes",
"build:vue": "microbundle --entry src/js/vue.js --output dist/vue.js --name ZiggyVue --format modern,es,umd --external none --no-sourcemap --no-generateTypes",
"build:react": "microbundle --entry src/js/react.js --output dist/react.js --name ZiggyReact --format modern,es,umd --external none --no-sourcemap --no-generateTypes",
"watch": "npm run build watch",
"build:npm": "microbundle --name route --format modern,es,umd --no-sourcemap",
"build:npm:vue": "microbundle --entry src/js/vue.js --output dist/vue.js --name ZiggyVue --format modern,es,umd --no-sourcemap",
"build:npm:react": "microbundle --entry src/js/react.js --output dist/react.js --name ZiggyReact --format modern,es,umd --no-sourcemap",
"build:npm": "microbundle --name route --format modern,es,umd --no-sourcemap --no-generateTypes",
"build:npm:vue": "microbundle --entry src/js/vue.js --output dist/vue.js --name ZiggyVue --format modern,es,umd --no-sourcemap --no-generateTypes",
"build:npm:react": "microbundle --entry src/js/react.js --output dist/react.js --name ZiggyReact --format modern,es,umd --no-sourcemap --no-generateTypes",
"test": "jest --verbose",

@@ -54,0 +55,0 @@ "prepublishOnly": "npm run build:npm && npm run build:npm:vue && npm run build:npm:react"

@@ -20,3 +20,3 @@ ![Ziggy - Use your Laravel named routes in JavaScript](https://raw.githubusercontent.com/tighten/ziggy/main/ziggy-banner.png)

- [Route-model binding](#route-model-binding)
- [TypeScript support](#typescript-support)
- [TypeScript](#typescript)
- [**Advanced Setup**](#advanced-setup)

@@ -35,4 +35,8 @@ - [JavaScript frameworks](#javascript-frameworks)

Install Ziggy into your Laravel app with `composer require tightenco/ziggy`.
Install Ziggy in your Laravel app:
```bash
composer require tightenco/ziggy
```
Add the `@routes` Blade directive to your main layout (_before_ your application's JavaScript), and the `route()` helper function will now be available globally!

@@ -286,6 +290,34 @@

#### TypeScript support
#### TypeScript
Unofficial TypeScript type definitions for Ziggy are maintained by [benallfree](https://github.com/benallfree) as part of [Definitely Typed](https://github.com/DefinitelyTyped/DefinitelyTyped), and can be installed with `npm install @types/ziggy-js`.
Ziggy includes TypeScript type definitions, and a helper command that can generate additional type definitions to enable route name and parameter autocompletion.
To generate the route types, run Ziggy's Artisan command with the `--types` or `--types-only` option:
```bash
php artisan ziggy:generate --types
```
To make your IDE aware that Ziggy's `route()` helper is available globally, and to type it correctly, add a declaration like this in a `.d.ts` file somewhere in your project:
```ts
import routeFn from 'ziggy-js';
declare global {
var route: typeof routeFn;
}
```
If you don't have Ziggy's NPM package installed, add the following to your `jsconfig.json` or `tsconfig.json` to load Ziggy's types from the Composer vendor directory:
```json
{
"compilerOptions": {
"paths": {
"ziggy-js": ["./vendor/tightenco/ziggy"]
}
}
}
```
## Advanced Setup

@@ -292,0 +324,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc