Skip to content

Commit 4815596

Browse files
committed
init
0 parents  commit 4815596

30 files changed

+8309
-0
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: DevWizard

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Bug Report
2+
description: Report an Issue or Bug with the Package
3+
title: '[Bug]: '
4+
labels: ['bug']
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
We're sorry to hear you have a problem. Can you help us solve it by providing the following details.
10+
- type: textarea
11+
id: what-happened
12+
attributes:
13+
label: What happened?
14+
description: What did you expect to happen?
15+
placeholder: I cannot currently do X thing because when I do, it breaks X thing.
16+
validations:
17+
required: true
18+
- type: textarea
19+
id: how-to-reproduce
20+
attributes:
21+
label: How to reproduce the bug
22+
description: How did this occur, please add any config values used and provide a set of reliable steps if possible.
23+
placeholder: When I do X I see Y.
24+
validations:
25+
required: true
26+
- type: input
27+
id: package-version
28+
attributes:
29+
label: Package Version
30+
description: What version of our Package are you running? Please be as specific as possible
31+
placeholder: 0.1.0
32+
validations:
33+
required: true
34+
- type: input
35+
id: node-version
36+
attributes:
37+
label: Node.js Version
38+
description: What version of Node.js are you running? Please be as specific as possible
39+
placeholder: 20.0.0
40+
validations:
41+
required: true
42+
- type: input
43+
id: react-version
44+
attributes:
45+
label: React Version
46+
description: What version of React are you running? Please be as specific as possible
47+
placeholder: 18.0.0
48+
validations:
49+
required: true
50+
- type: input
51+
id: inertia-version
52+
attributes:
53+
label: Inertia.js Version
54+
description: What version of Inertia.js are you running? Please be as specific as possible
55+
placeholder: 1.0.0
56+
validations:
57+
required: true
58+
- type: input
59+
id: typescript-version
60+
attributes:
61+
label: TypeScript Version (if applicable)
62+
description: What version of TypeScript are you running? Please be as specific as possible
63+
placeholder: 5.0.0
64+
validations:
65+
required: false
66+
- type: dropdown
67+
id: operating-systems
68+
attributes:
69+
label: Which operating systems does this happen with?
70+
description: You may select more than one.
71+
multiple: true
72+
options:
73+
- macOS
74+
- Windows
75+
- Linux
76+
- type: textarea
77+
id: notes
78+
attributes:
79+
label: Notes
80+
description: Use this field to provide any other notes that you feel might be relevant to the issue.
81+
validations:
82+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Ask a question
4+
url: https://github.com/devwizardHq/laravel-react-permissions/discussions/new?category=q-a
5+
about: Ask the community for help
6+
- name: Request a feature
7+
url: https://github.com/devwizardHq/laravel-react-permissions/discussions/new?category=ideas
8+
about: Share ideas for new features
9+
- name: Report a security issue
10+
url: https://github.com/devwizardHq/laravel-react-permissions/security/policy
11+
about: Learn how to notify us for sensitive bugs

.github/ISSUE_TEMPLATE/feature.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Feature Request
2+
description: Suggest a new feature or enhancement
3+
title: '[Feature]: '
4+
labels: ['enhancement']
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thank you for taking the time to suggest a new feature! Please provide the following details.
10+
11+
- type: textarea
12+
id: feature-description
13+
attributes:
14+
label: Feature Description
15+
description: Describe the feature you'd like to see added
16+
placeholder: I would like to have...
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: use-case
22+
attributes:
23+
label: Use Case
24+
description: Describe your use case and why this feature would be helpful
25+
placeholder: This would help me to...
26+
validations:
27+
required: true
28+
29+
- type: textarea
30+
id: proposed-solution
31+
attributes:
32+
label: Proposed Solution
33+
description: If you have ideas on how this could be implemented, please share them
34+
placeholder: This could be implemented by...
35+
validations:
36+
required: false
37+
38+
- type: textarea
39+
id: alternatives
40+
attributes:
41+
label: Alternatives Considered
42+
description: Have you considered any alternative solutions or workarounds?
43+
placeholder: I have tried...
44+
validations:
45+
required: false
46+
47+
- type: checkboxes
48+
id: feature-type
49+
attributes:
50+
label: Feature Type
51+
description: What type of feature is this?
52+
options:
53+
- label: New component
54+
- label: New hook
55+
- label: API enhancement
56+
- label: Performance improvement
57+
- label: Developer experience improvement
58+
- label: Documentation improvement
59+
- label: Other
60+
61+
- type: textarea
62+
id: additional-context
63+
attributes:
64+
label: Additional Context
65+
description: Add any other context, screenshots, or examples about the feature request
66+
validations:
67+
required: false

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Please see the documentation for all configuration options:
2+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: 'github-actions'
7+
directory: '/'
8+
schedule:
9+
interval: 'weekly'
10+
labels:
11+
- 'dependencies'
12+
- 'github-actions'
13+
14+
- package-ecosystem: 'npm'
15+
directory: '/'
16+
schedule:
17+
interval: 'weekly'
18+
labels:
19+
- 'dependencies'
20+
- 'npm'
21+
open-pull-requests-limit: 5

.github/workflows/code-quality.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
paths:
7+
- '**.ts'
8+
- '**.tsx'
9+
- '**.js'
10+
- '**.jsx'
11+
- '**.json'
12+
- '**.md'
13+
- '.github/workflows/code-quality.yml'
14+
- 'tsconfig.json'
15+
- 'package.json'
16+
# pull_request:
17+
# branches: [main, develop]
18+
19+
permissions:
20+
contents: write
21+
22+
jobs:
23+
quality-check:
24+
name: Code Quality Check
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 10
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v5
30+
with:
31+
ref: ${{ github.head_ref }}
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v5
36+
with:
37+
node-version: '20'
38+
cache: 'npm'
39+
40+
- name: Install dependencies
41+
run: npm ci
42+
43+
# Auto-fix formatting on push to main/develop (not on PRs)
44+
- name: Format code
45+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
46+
run: npx prettier --write .
47+
48+
- name: Run ESLint
49+
run: npm run lint
50+
51+
- name: Commit formatting changes
52+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
53+
uses: stefanzweifel/git-auto-commit-action@v6
54+
with:
55+
commit_message: 'style: fix code formatting [skip ci]'
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: dependabot-auto-merge
2+
on: pull_request_target
3+
4+
permissions:
5+
pull-requests: write
6+
contents: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 5
12+
if: ${{ github.actor == 'dependabot[bot]' }}
13+
steps:
14+
- name: Dependabot metadata
15+
id: metadata
16+
uses: dependabot/fetch-metadata@v2.4.0
17+
with:
18+
github-token: '${{ secrets.GITHUB_TOKEN }}'
19+
20+
- name: Auto-merge Dependabot PRs for semver-minor updates
21+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
22+
run: gh pr merge --auto --merge "$PR_URL"
23+
env:
24+
PR_URL: ${{github.event.pull_request.html_url}}
25+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
26+
27+
- name: Auto-merge Dependabot PRs for semver-patch updates
28+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
29+
run: gh pr merge --auto --merge "$PR_URL"
30+
env:
31+
PR_URL: ${{github.event.pull_request.html_url}}
32+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
id-token: write # Required for provenance
9+
contents: read
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v5
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v5
20+
with:
21+
node-version: '22'
22+
registry-url: 'https://registry.npmjs.org'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Run tests and build
28+
run: npm run prepublishOnly
29+
30+
- name: Publish to npm with provenance
31+
run: npm publish --provenance --access public
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
34+

.github/workflows/run-tests.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Test & Build
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
paths:
7+
- '**.ts'
8+
- '**.tsx'
9+
- '**.js'
10+
- '**.jsx'
11+
- '.github/workflows/run-tests.yml'
12+
- 'package.json'
13+
- 'package-lock.json'
14+
- 'tsconfig.json'
15+
- 'tsup.config.ts'
16+
pull_request:
17+
branches: [main, develop]
18+
workflow_run:
19+
workflows: ['Code Quality']
20+
types:
21+
- completed
22+
branches: [main, develop]
23+
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.ref }}
26+
cancel-in-progress: true
27+
28+
jobs:
29+
ci:
30+
runs-on: ${{ matrix.os }}
31+
timeout-minutes: 10
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
os: [ubuntu-latest, windows-latest, macos-latest]
36+
node-version: [20, 22]
37+
38+
name: Node ${{ matrix.node-version }} - ${{ matrix.os }}
39+
40+
steps:
41+
- name: Checkout code
42+
uses: actions/checkout@v5
43+
44+
- name: Setup Node.js
45+
uses: actions/setup-node@v5
46+
with:
47+
node-version: ${{ matrix.node-version }}
48+
cache: 'npm'
49+
50+
- name: Install dependencies
51+
run: npm ci
52+
53+
- name: Type-check, lint, test & build
54+
run: npm run prepublishOnly
55+
56+
- name: Verify build outputs
57+
run: |
58+
node -e "const fs=require('fs'); console.log('dist/ contents:'); fs.readdirSync('dist').forEach(f => console.log(f)); ['dist/index.js','dist/index.d.ts'].forEach(f => {if(!fs.existsSync(f)) throw new Error(f+' not found')}); console.log('All required files exist')"
59+
60+
- name: Verify package imports
61+
run: |
62+
node -e "
63+
console.log('Testing ESM import...');
64+
import('./dist/index.js').then(esm => {
65+
console.log('ESM exports:', Object.keys(esm));
66+
console.log('Package imports working correctly!');
67+
}).catch(err => {
68+
console.error('ESM import failed:', err);
69+
process.exit(1);
70+
});
71+
"

0 commit comments

Comments
 (0)