Skip to content

Commit 3348c00

Browse files
Merge pull request #2 from DevWizardHQ/fix/improve-import-suggestions
Fix: Improve TypeScript import suggestions and module exports
2 parents 449c3c7 + 120e465 commit 3348c00

File tree

5 files changed

+18
-57
lines changed

5 files changed

+18
-57
lines changed

CHANGELOG.md

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,6 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project
66
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## v1.1.0 - 2025-08-31
9-
10-
### Release Notes - v1.1.0
11-
12-
#### 🎉 What's New
13-
14-
- Initial release of @devwizard/laravel-react-permissions
15-
- Core `<Can>` component for conditional rendering
16-
- `usePermissions` hook for programmatic permission checking
17-
- `withPermission` HOC for component wrapping
18-
- Advanced pattern matching with wildcards (`*`) and single chars (`?`)
19-
- Boolean logic support with logical operators (`||`, `&&`, `|`, `&`)
20-
- Custom permissions array support
21-
- Expression validation and safe evaluation
22-
- Full TypeScript support with type definitions
23-
- Comprehensive documentation and examples
24-
- Laravel Spatie Permission integration
25-
- Performance optimizations with memoization
26-
- Zero-dependency architecture (only peer dependencies)
27-
28-
###### Features
29-
30-
- Pattern matching: `users.*`, `admin.?dit`
31-
- Boolean expressions: `(users.* || posts.*) && admin.access`
32-
- Custom permissions: Override auth with custom arrays
33-
- Safe evaluation: Protected against code injection
34-
- Laravel conventions: Follows `@can` directive patterns
35-
- TypeScript: Complete type safety and IntelliSense
36-
37-
###### Documentation
38-
39-
- Complete setup guide
40-
- Pattern matching examples
41-
- API reference documentation
42-
- Real-world usage scenarios
43-
- Migration guide from other solutions
44-
45-
---
46-
47-
**Full Changelog**: [View on GitHub](your-repo-url/compare/v1.0.0...v1.1.0)
48-
498
## 0.1.0 - 2025-08-31
509

5110
##### Added

index.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
// Main permissions system components
1+
// Main exports
22
export { Can } from './components/can';
33
export { withPermission } from './components/with-permission';
4-
5-
// Hooks
64
export { usePermissions } from './hooks/use-permissions';
75

8-
// Types
6+
// Type exports
97
export type {
108
Auth,
119
SharedData,
@@ -16,9 +14,3 @@ export type {
1614
UsePermissionsReturn,
1715
WithPermissionOptions,
1816
} from './types';
19-
20-
// Re-export everything for convenience
21-
export * from './components/can';
22-
export * from './components/with-permission';
23-
export * from './hooks/use-permissions';
24-
export * from './types';

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devwizard/laravel-react-permissions",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"type": "module",
55
"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.",
66
"main": "dist/index.js",
@@ -9,8 +9,11 @@
99
"exports": {
1010
".": {
1111
"types": "./dist/index.d.ts",
12-
"import": "./dist/index.js"
13-
}
12+
"import": "./dist/index.js",
13+
"require": "./dist/index.js",
14+
"default": "./dist/index.js"
15+
},
16+
"./package.json": "./package.json"
1417
},
1518
"sideEffects": false,
1619
"files": [

tsup.config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import { defineConfig } from 'tsup';
33
export default defineConfig({
44
entry: ['index.ts'],
55
format: ['esm'],
6-
dts: true,
6+
dts: {
7+
resolve: true,
8+
entry: './index.ts',
9+
},
710
splitting: false,
811
sourcemap: true,
912
clean: true,
@@ -16,4 +19,8 @@ export default defineConfig({
1619
js: '.js',
1720
};
1821
},
22+
// Ensure proper bundling for better imports
23+
bundle: true,
24+
// Keep names for better debugging and IDE support
25+
keepNames: true,
1926
});

0 commit comments

Comments
 (0)