Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<Can>` 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
Expand Down
12 changes: 2 additions & 10 deletions index.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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';
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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": [
Expand Down
9 changes: 8 additions & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
});