Skip to content
Draft
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
82 changes: 82 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Tests

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.4]

name: PHP ${{ matrix.php }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv
coverage: none

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress

- name: Execute tests
run: vendor/bin/pest

phpstan:
runs-on: ubuntu-latest

name: PHPStan

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv
coverage: none

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress

- name: Run PHPStan
run: vendor/bin/phpstan analyse --error-format=github

code-style:
runs-on: ubuntu-latest

name: Code Style

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv
coverage: none

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress

- name: Check code style
run: vendor/bin/pint --test
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/vendor/
node_modules/
.idea/
.vscode/
.phpunit.result.cache
.phpunit.cache
.DS_Store
Thumbs.db
*.log
composer.lock
package-lock.json
dist/
build/
.pest/
phpstan-baseline.neon
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Changelog

All notable changes to `filament-codemirror-plugin` will be documented in this file.

## v1.0.0 - 2024-11-11

### Added
- Initial release of Filament CodeMirror Plugin
- CodeMirror form component for Filament v4
- Dynamic language loading supporting all CodeMirror 6 language packages:
- JavaScript/TypeScript
- Python, PHP, Java, C++, Rust, Go, Ruby
- HTML/CSS/XML
- JSON, YAML, TOML
- SQL
- Markdown
- And many more...
- Dynamic theme loading supporting all CodeMirror 6 themes
- Configurable editor options:
- Line numbers toggle
- Line wrapping toggle
- Read-only mode
- Custom tab size
- Min/max height constraints
- Custom extensions support
- Comprehensive test suite with Pest
- PHPStan static analysis
- GitHub Actions CI/CD pipeline
- Complete documentation with usage examples
- Example Filament Resource implementation
- Service provider with config file publishing

### Changed
- Namespace changed from `Gosuperscript` to `Superscript`
- Updated to support Filament 4.x (stable release)
- Minimum PHP version requirement updated to 8.4
- Made language and theme loading fully dynamic instead of hardcoded switch statements
- CI/CD pipeline updated to test on PHP 8.4 only
56 changes: 56 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Contributing

Contributions are **welcome** and will be fully **credited**.

We accept contributions via Pull Requests on [Github](https://github.com/gosuperscript/filament-codemirror-plugin).

## Pull Requests

- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.

- **Create feature branches** - Don't ask us to pull from your master branch.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.

## Development Setup

1. Clone the repository:
```bash
git clone https://github.com/gosuperscript/filament-codemirror-plugin.git
cd filament-codemirror-plugin
```

2. Install dependencies:
```bash
composer install
```

3. Run tests:
```bash
composer test
```

4. Format code:
```bash
composer format
```

## Testing

```bash
composer test
```

## Code Style

We use [Laravel Pint](https://github.com/laravel/pint) for code formatting:

```bash
composer format
```

**Happy coding**!
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 gosuperscript

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading