Skip to content

Commit 4099b40

Browse files
authored
feat: add Vite support (#829)
1 parent 5abb74b commit 4099b40

Some content is hidden

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

64 files changed

+2741
-6
lines changed

.github/workflows/coding-conventions.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ jobs:
2626
# env:
2727
# PHP_CS_FIXER_IGNORE_ENV: true
2828

29+
- name: Setup Bun
30+
uses: oven-sh/setup-bun@v2
31+
32+
- name: Install dependencies
33+
run: bun install --frozen-lockfile
34+
35+
- name: Run eslint
36+
run: bun run lint
37+
2938
phpstan:
3039
name: "Run Static Analysis: PHPStan"
3140
runs-on: ubuntu-latest

.github/workflows/integration-tests.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,42 @@ on:
77
- cron: '0 0 * * *'
88

99
jobs:
10+
vitest:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
php:
16+
- 8.4
17+
os:
18+
- ubuntu-latest
19+
- windows-latest
20+
21+
name: "Run Tests: ${{ matrix.os }}"
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php }}
31+
extensions: dom, curl, libxml, mbstring, pcntl, fileinfo, pdo, sqlite, pdo_sqlite, pdo_mysql
32+
coverage: pcov
33+
34+
- name: Setup Bun
35+
uses: oven-sh/setup-bun@v2
36+
37+
- name: Install dependencies
38+
run: bun install --frozen-lockfile
39+
40+
- name: Run build
41+
run: bun run build
42+
43+
- name: Run tests
44+
run: bun run test
45+
1046
phpunit:
1147
runs-on: ${{ matrix.os }}
1248
strategy:
@@ -72,4 +108,4 @@ jobs:
72108
uses: coverallsapp/github-action@v2
73109
with:
74110
github-token: '${{ secrets.GITHUB_TOKEN }}'
75-
file: build/reports/clover.xml
111+
file: build/reports/clover.xml

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ debug.log
1313
tempest.log
1414
public/static
1515
tests/Unit/Log
16-
log/
16+
log/
17+
node_modules
18+
dist

bun.lockb

249 KB
Binary file not shown.

composer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@
7474
"tempest/router": "self.version",
7575
"tempest/support": "self.version",
7676
"tempest/validation": "self.version",
77-
"tempest/view": "self.version"
77+
"tempest/view": "self.version",
78+
"tempest/vite": "self.version"
7879
},
7980
"minimum-stability": "dev",
8081
"prefer-stable": true,
@@ -101,7 +102,8 @@
101102
"Tempest\\Router\\": "src/Tempest/Router/src",
102103
"Tempest\\Support\\": "src/Tempest/Support/src",
103104
"Tempest\\Validation\\": "src/Tempest/Validation/src",
104-
"Tempest\\View\\": "src/Tempest/View/src"
105+
"Tempest\\View\\": "src/Tempest/View/src",
106+
"Tempest\\Vite\\": "src/Tempest/Vite/src"
105107
},
106108
"files": [
107109
"src/Tempest/CommandBus/src/functions.php",
@@ -113,7 +115,8 @@
113115
"src/Tempest/Reflection/src/functions.php",
114116
"src/Tempest/Router/src/functions.php",
115117
"src/Tempest/Support/src/functions.php",
116-
"src/Tempest/View/src/functions.php"
118+
"src/Tempest/View/src/functions.php",
119+
"src/Tempest/Vite/src/functions.php"
117120
]
118121
},
119122
"autoload-dev": {
@@ -140,6 +143,7 @@
140143
"Tempest\\Router\\Tests\\": "src/Tempest/Router/tests",
141144
"Tempest\\Support\\Tests\\": "src/Tempest/Support/tests",
142145
"Tempest\\Validation\\Tests\\": "src/Tempest/Validation/tests",
146+
"Tempest\\Vite\\Tests\\": "src/Tempest/Vite/tests",
143147
"Tests\\Tempest\\": "tests/"
144148
}
145149
},

eslint.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import defineEslintConfig from '@innocenzi/eslint-config'
2+
3+
export default defineEslintConfig()

package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"private": true,
3+
"workspaces": ["packages/*"],
4+
"scripts": {
5+
"qa": "bun lint:fix && bun run test run && bun run build",
6+
"lint": "eslint packages",
7+
"lint:fix": "eslint --fix packages",
8+
"build": "bun --filter '*' build",
9+
"dev": "bun --filter '*' build:stub",
10+
"test": "vitest",
11+
"release": "bumpp package.json --push --tag --commit \"release: v\""
12+
},
13+
"devDependencies": {
14+
"@innocenzi/eslint-config": "^0.22.4",
15+
"@types/bun": "latest",
16+
"bumpp": "^9.9.0",
17+
"eslint": "^9.16.0",
18+
"typescript": "^5.7.2",
19+
"unbuild": "^2.0.0",
20+
"vite-plugin-tempest": "workspace:*",
21+
"vitest": "^2.1.8"
22+
}
23+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineBuildConfig } from 'unbuild'
2+
3+
export default defineBuildConfig({
4+
entries: [
5+
'src/index',
6+
],
7+
clean: true,
8+
declaration: true,
9+
})
219 KB
Binary file not shown.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "vite-plugin-tempest",
3+
"type": "module",
4+
"version": "0.0.0",
5+
"author": "Enzo Innocenzi",
6+
"license": "MIT",
7+
"sideEffects": false,
8+
"exports": {
9+
".": {
10+
"types": "./dist/index.d.ts",
11+
"import": "./dist/index.mjs"
12+
}
13+
},
14+
"main": "./dist/index.mjs",
15+
"module": "./dist/index.mjs",
16+
"types": "./dist/index.d.ts",
17+
"files": [
18+
"*.d.ts",
19+
"dist"
20+
],
21+
"scripts": {
22+
"build": "unbuild",
23+
"build:stub": "unbuild --stub",
24+
"test": "vitest"
25+
},
26+
"peerDependencies": {
27+
"typescript": "^5.0.0",
28+
"vite": "^6.0.3"
29+
},
30+
"dependencies": {
31+
"@innocenzi/utils": "^0.3.0",
32+
"picocolors": "^1.1.1"
33+
}
34+
}

0 commit comments

Comments
 (0)