Skip to content

Commit

Permalink
Merge pull request filamentphp#34 from filamentphp/3.x-wip
Browse files Browse the repository at this point in the history
Chore: merge in wip branch to sync changes
  • Loading branch information
awcodes authored Jul 16, 2023
2 parents 2bd9cd6 + 4896b7a commit a52bffb
Show file tree
Hide file tree
Showing 34 changed files with 481 additions and 345 deletions.
36 changes: 22 additions & 14 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,26 @@
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml.dist export-ignore
/art export-ignore
/docs export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.php_cs.dist.php export-ignore
/psalm.xml export-ignore
/psalm.xml.dist export-ignore
/testbench.yaml export-ignore
/UPGRADING.md export-ignore
/phpstan.neon.dist export-ignore
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.idea export-ignore
/.prettierrc export-ignore
/.package-lock.json export-ignore
/.editorconfig export-ignore
/.php_cs.dist.php export-ignore
/.vscode export-ignore
/art export-ignore
/docs export-ignore
/images export-ignore
/tests export-ignore
/package.json export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon.dist export-ignore
/postcss.config.js export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
/psalm.xml.dist export-ignore
/tailwind.config.js export-ignore
/testbench.yaml export-ignore
/UPGRADING.md export-ignore
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Please be considerate towards maintainers when raising issues or presenting pull
world that developers are civilized and selfless people.

It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.
quality to benefit the project. Many developers have different skills, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.

## Viability

Expand Down
66 changes: 66 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Bug Report
description: Report an Issue or Bug with the Package
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
We're sorry to hear you have a problem. Can you help us solve it by providing the following details.
- type: textarea
id: what-happened
attributes:
label: What happened?
description: What did you expect to happen?
placeholder: I cannot currently do X thing because when I do, it breaks X thing.
validations:
required: true
- type: textarea
id: how-to-reproduce
attributes:
label: How to reproduce the bug
description: How did this occur, please add any config values used and provide a set of reliable steps if possible.
placeholder: When I do X I see Y.
validations:
required: true
- type: input
id: package-version
attributes:
label: Package Version
description: What version of our Package are you running? Please be as specific as possible
placeholder: 2.0.0
validations:
required: true
- type: input
id: php-version
attributes:
label: PHP Version
description: What version of PHP are you running? Please be as specific as possible
placeholder: 8.2.0
validations:
required: true
- type: input
id: laravel-version
attributes:
label: Laravel Version
description: What version of Laravel are you running? Please be as specific as possible
placeholder: 9.0.0
validations:
required: true
- type: dropdown
id: operating-systems
attributes:
label: Which operating systems does with happen with?
description: You may select more than one.
multiple: true
options:
- macOS
- Windows
- Linux
- type: textarea
id: notes
attributes:
label: Notes
description: Use this field to provide any other notes that you feel might be relevant to the issue.
validations:
required: false
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,3 @@ contact_links:
- name: Report a security issue
url: https://github.com/:vendor_name/:package_name/security/policy
about: Learn how to notify us for sensitive bugs
- name: Report a bug
url: https://github.com/:vendor_name/:package_name/issues/new
about: Report a reproducible bug
4 changes: 2 additions & 2 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Dependabot Auto Merge
name: "Dependabot Auto-Merge"

on: pull_request_target

Expand All @@ -14,7 +14,7 @@ jobs:

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.4.0
uses: dependabot/fetch-metadata@v1.6.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Fix PHP Code Styling
name: "Fix PHP Code Styling"

on: [push]
on:
push:
paths:
- '**.php'

permissions:
contents: write

jobs:
php-code-styling:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
uses: ramsey/composer-install@v2

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
run: ./vendor/bin/phpstan --error-format=github
18 changes: 11 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Tests
name: run-tests

on:
push:
Expand All @@ -13,12 +13,13 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.1]
laravel: [9.*]
php: [8.2, 8.1]
laravel: [10.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 9.*
testbench: 7.*
- laravel: 10.*
testbench: 8.*
carbon: ^2.63

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand All @@ -40,8 +41,11 @@ jobs:
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: List Installed Dependencies
run: composer show -D

- name: Execute tests
run: vendor/bin/pest
run: vendor/bin/pest --ci
5 changes: 4 additions & 1 deletion .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Update Changelog
name: "Update Changelog"

on:
release:
types: [released]

permissions:
contents: write

jobs:
update:
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
.DS_Store
.idea
.phpunit.result.cache
.vscode
build
composer.lock
coverage
docs
node_modules
phpunit.xml
phpstan.neon
testbench.yaml
vendor
node_modules
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# :package_description

[![Latest Version on Packagist](https://img.shields.io/packagist/v/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/:vendor_slug/:package_slug/run-tests?label=tests)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/:vendor_slug/:package_slug/Check%20&%20fix%20styling?label=code%20style)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/:vendor_slug/:package_slug/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/:vendor_slug/:package_slug/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)

<!--delete-->
Expand Down Expand Up @@ -54,8 +54,8 @@ return [
## Usage

```php
$skeleton = new VendorName\Skeleton();
echo $skeleton->echoPhrase('Hello, VendorName!');
$variable = new VendorName\Skeleton();
echo $variable->echoPhrase('Hello, VendorName!');
```

## Testing
Expand Down
50 changes: 50 additions & 0 deletions bin/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import * as esbuild from 'esbuild'

const isDev = process.argv.includes('--dev')

async function compile(options) {
const context = await esbuild.context(options)

if (isDev) {
await context.watch()
} else {
await context.rebuild()
await context.dispose()
}
}

const defaultOptions = {
define: {
'process.env.NODE_ENV': isDev ? `'development'` : `'production'`,
},
bundle: true,
mainFields: ['module', 'main'],
platform: 'neutral',
sourcemap: isDev ? 'inline' : false,
sourcesContent: isDev,
treeShaking: true,
target: ['es2020'],
minify: !isDev,
plugins: [{
name: 'watchPlugin',
setup: function (build) {
build.onStart(() => {
console.log(`Build started at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`)
})

build.onEnd((result) => {
if (result.errors.length > 0) {
console.log(`Build failed at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`, result.errors)
} else {
console.log(`Build finished at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`)
}
})
}
}],
}

compile({
...defaultOptions,
entryPoints: ['./resources/js/index.js'],
outfile: './resources/dist/skeleton.js',
})
37 changes: 16 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,52 +20,47 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.1",
"filament/filament": "^3.0",
"filament/forms": "^3.0",
"filament/tables": "^3.0",
"spatie/laravel-package-tools": "^1.13.5",
"illuminate/contracts": "^9.0|^10.0"
"spatie/laravel-package-tools": "^1.15.0",
"illuminate/contracts": "^10.0"
},
"require-dev": {
"laravel/pint": "^1.0",
"nunomaduro/collision": "^6.0",
"nunomaduro/collision": "^7.9",
"nunomaduro/larastan": "^2.0.1",
"orchestra/testbench": "^7.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.1",
"pestphp/pest-plugin-livewire": "^1.0",
"pestphp/pest-plugin-parallel": "^0.3",
"orchestra/testbench": "^8.0",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-arch": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.5",
"spatie/laravel-ray": "^1.26"
},
"autoload": {
"psr-4": {
"VendorName\\Skeleton\\": "src",
"VendorName\\Skeleton\\Database\\Factories\\": "database/factories"
"VendorName\\Skeleton\\": "src/",
"VendorName\\Skeleton\\Database\\Factories\\": "database/factories/"
}
},
"autoload-dev": {
"psr-4": {
"VendorName\\Skeleton\\Tests\\": "tests"
"VendorName\\Skeleton\\Tests\\": "tests/"
}
},
"scripts": {
"pint": "vendor/bin/pint",
"test:pest": "vendor/bin/pest --parallel",
"test:phpstan": "vendor/bin/phpstan analyse",
"test": [
"@test:pest",
"@test:phpstan"
]
"post-autoload-dump": "@php ./vendor/bin/testbench package:discover --ansi",
"analyse": "vendor/bin/phpstan analyse",
"test": "vendor/bin/pest",
"test-coverage": "vendor/bin/pest --coverage",
"format": "vendor/bin/pint"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"composer/package-versions-deprecated": true,
"pestphp/pest-plugin": true,
"phpstan/extension-installer": true
}
Expand Down
23 changes: 0 additions & 23 deletions configure-stubs/package/package.json

This file was deleted.

1 change: 0 additions & 1 deletion configure-stubs/package/plugin.css

This file was deleted.

Loading

0 comments on commit a52bffb

Please sign in to comment.