diff --git a/CHANGELOG.md b/CHANGELOG.md index 775a57c..bf6b665 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,47 +5,6 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## v1.1.0 - 2025-08-31 - -### Release Notes - v1.1.0 - -#### 🎉 What's New - -- Initial release of @devwizard/laravel-react-permissions -- Core `` component for conditional rendering -- `usePermissions` hook for programmatic permission checking -- `withPermission` HOC for component wrapping -- Advanced pattern matching with wildcards (`*`) and single chars (`?`) -- Boolean logic support with logical operators (`||`, `&&`, `|`, `&`) -- Custom permissions array support -- Expression validation and safe evaluation -- Full TypeScript support with type definitions -- Comprehensive documentation and examples -- Laravel Spatie Permission integration -- Performance optimizations with memoization -- Zero-dependency architecture (only peer dependencies) - -###### Features - -- Pattern matching: `users.*`, `admin.?dit` -- Boolean expressions: `(users.* || posts.*) && admin.access` -- Custom permissions: Override auth with custom arrays -- Safe evaluation: Protected against code injection -- Laravel conventions: Follows `@can` directive patterns -- TypeScript: Complete type safety and IntelliSense - -###### Documentation - -- Complete setup guide -- Pattern matching examples -- API reference documentation -- Real-world usage scenarios -- Migration guide from other solutions - ---- - -**Full Changelog**: [View on GitHub](your-repo-url/compare/v1.0.0...v1.1.0) - ## 0.1.0 - 2025-08-31 ##### Added diff --git a/index.ts b/index.ts index 1e5d1ba..9e9577a 100644 --- a/index.ts +++ b/index.ts @@ -1,11 +1,9 @@ -// Main permissions system components +// Main exports export { Can } from './components/can'; export { withPermission } from './components/with-permission'; - -// Hooks export { usePermissions } from './hooks/use-permissions'; -// Types +// Type exports export type { Auth, SharedData, @@ -16,9 +14,3 @@ export type { UsePermissionsReturn, WithPermissionOptions, } from './types'; - -// Re-export everything for convenience -export * from './components/can'; -export * from './components/with-permission'; -export * from './hooks/use-permissions'; -export * from './types'; diff --git a/package-lock.json b/package-lock.json index b57e366..22d865f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devwizard/laravel-react-permissions", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devwizard/laravel-react-permissions", - "version": "1.1.0", + "version": "1.1.1", "license": "MIT", "devDependencies": { "@testing-library/jest-dom": "^6.8.0", diff --git a/package.json b/package.json index 9c80739..e830679 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devwizard/laravel-react-permissions", - "version": "1.1.0", + "version": "1.1.1", "type": "module", "description": "🔐 Modern, Laravel-inspired permissions system for React/Inertia.js with advanced pattern matching, boolean expressions, and zero dependencies. Features wildcard patterns, custom permissions, and full TypeScript support.", "main": "dist/index.js", @@ -9,8 +9,11 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.js" - } + "import": "./dist/index.js", + "require": "./dist/index.js", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" }, "sideEffects": false, "files": [ diff --git a/tsup.config.ts b/tsup.config.ts index 7f95c06..ef88456 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -3,7 +3,10 @@ import { defineConfig } from 'tsup'; export default defineConfig({ entry: ['index.ts'], format: ['esm'], - dts: true, + dts: { + resolve: true, + entry: './index.ts', + }, splitting: false, sourcemap: true, clean: true, @@ -16,4 +19,8 @@ export default defineConfig({ js: '.js', }; }, + // Ensure proper bundling for better imports + bundle: true, + // Keep names for better debugging and IDE support + keepNames: true, });