Skip to content

Commit bc371cd

Browse files
committed
vitepress
1 parent 76b4714 commit bc371cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+29170
-151
lines changed

.github/workflows/ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "CI Tests"
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
env:
8+
fail-fast: true
9+
PHPUNIT_FLAGS: "-v"
10+
SYMFONY_DEPRECATIONS_HELPER: weak
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
name: PHP v${{ matrix.php }}, Symfony v${{ matrix.symfony }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- { php: 7.4, symfony: "5.4.*", composer-flags: '--prefer-stable'}
21+
- { php: 8.3, symfony: "6.4.*", composer-flags: '--prefer-stable'}
22+
- { php: 8.2, symfony: "6.3.*", composer-flags: '--prefer-stable'}
23+
- { php: 8.2, symfony: "6.4.*", composer-flags: '--prefer-stable' }
24+
- { php: 8.3, symfony: "7.0.*", composer-flags: '--prefer-stable' }
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: "Installing php"
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.php }}
32+
extensions: curl,mbstring,xdebug
33+
ini-values: date.timezone="Europe/Paris"
34+
coverage: xdebug
35+
tools: "composer:v2,flex"
36+
37+
- name: Show PHP version
38+
run: php -v && composer -V
39+
40+
- name: Download Composer cache dependencies from cache
41+
id: composer-cache
42+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
43+
44+
- name: Cache Composer dependencies
45+
uses: actions/cache@v2
46+
with:
47+
path: ${{ steps.composer-cache.outputs.dir }}
48+
key: ${{ matrix.os }}-composer-${{ hashFiles('**/composer.json') }}
49+
restore-keys: ${{ matrix.os }}-composer-
50+
51+
- name: Install dependencies
52+
run: |
53+
perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json
54+
composer update ${{ matrix.composer-flags }} --prefer-dist
55+
env:
56+
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
57+
58+
- name: "Run PHPUnit Tests"
59+
run: "composer test"

.github/workflows/deploy.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Sample workflow for building and deploying a VitePress site to GitHub Pages
2+
#
3+
name: Deploy docs site to Pages
4+
5+
on:
6+
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
7+
# using the `master` branch as the default branch.
8+
push:
9+
branches: [main]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
22+
concurrency:
23+
group: pages
24+
cancel-in-progress: false
25+
26+
jobs:
27+
# Build job
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
35+
# - uses: pnpm/action-setup@v3 # Uncomment this if you're using pnpm
36+
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
37+
- name: Setup Node
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: 20
41+
cache: npm # or pnpm / yarn
42+
- name: Setup Pages
43+
uses: actions/configure-pages@v4
44+
- name: Install dependencies
45+
run: npm ci # or pnpm install / yarn install / bun install
46+
- name: Build with VitePress
47+
run: npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v3
50+
with:
51+
path: docs/.vitepress/dist
52+
53+
# Deployment job
54+
deploy:
55+
environment:
56+
name: github-pages
57+
url: ${{ steps.deployment.outputs.page_url }}
58+
needs: build
59+
runs-on: ubuntu-latest
60+
name: Deploy
61+
steps:
62+
- name: Deploy to GitHub Pages
63+
id: deployment
64+
uses: actions/deploy-pages@v4

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Spiriit Excel Rust
22
==================
33

4-
# Rust Excel Library: A High-Performance Solution for Generating Excel Files from PHP
4+
# Supercharge Excel generation in PHP with Rust's blazing speed!
55

66
This PHP library leverages the power of Rust to create Excel files quickly and efficiently.
77

@@ -26,9 +26,12 @@ Once the data is received, the Rust binary uses the **excelrust** library to cre
2626

2727
## With WorkbookFactory
2828

29-
First create a class implements `ExcelInterface`
29+
First create a class implements `ExcelInterface` and add attribute 'AsExcelRust'
3030

3131
```php
32+
use Spiriit\Rustsheet\Attributes\AsExcelRust;
33+
34+
#[AsExcelRust(outputName: "myexcel.xlsx")] // optionnal outputName
3235
class MyExcel implements ExcelInterface
3336
{
3437
public function buildSheet(WorkbookBuilder $builder): void
@@ -57,13 +60,6 @@ class MyExcel implements ExcelInterface
5760
),
5861
);
5962
}
60-
61-
public function configureOptions(OptionsResolver $resolver): void
62-
{
63-
$resolver->setDefaults([
64-
'filename' => '/path/to/output/myexcel.xlsx', // path where file will be generated
65-
]);
66-
}
6763
}
6864
```
6965

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"symfony/options-resolver": "5.4 | 6.4 | 7.*",
99
"psr/log": "^3.0",
1010
"symfony/framework-bundle": "6.4 | 7.*",
11-
"symfony/string": "6.4 | 7.*"
11+
"symfony/string": "6.4 | 7.*",
12+
"webmozart/assert": "^1.11"
1213
},
1314
"require-dev": {
1415
"phpunit/phpunit": "10.*",

docs/.gitignore

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

0 commit comments

Comments
 (0)