Skip to content

Commit 393d1cc

Browse files
Merge pull request #28 from helsingborg-stad/vite-migration
vite migration
2 parents 308a432 + b545e0a commit 393d1cc

Some content is hidden

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

46 files changed

+7251
-14355
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,19 @@ Thumbs.db
4343
*.tar
4444
*.zip
4545

46+
/assets/
47+
48+
phpunit-log.xml
49+
phpunit-testdox.txt
50+
4651
# -------------------------
4752
# BEGIN Whitelisted Files
4853
# -------------------------
4954

5055
# track these files, if they exist
5156
!.gitignore
5257
!.editorconfig
58+
!.vscode
5359

5460
dist
5561
dist/

.vscode/extensions.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"recommendations": [
3+
"biomejs.biome",
4+
"ms-azuretools.vscode-docker",
5+
"xdebug.php-debug",
6+
"bmewburn.vscode-intelephense-client",
7+
"devsense.composer-php-vscode",
8+
"jkillian.custom-local-formatters"
9+
]
10+
}

.vscode/settings.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "biomejs.biome",
4+
"editor.codeActionsOnSave": {
5+
"source.fixAll": "explicit"
6+
},
7+
"customLocalFormatters.formatters": [
8+
{
9+
"command": "vendor/bin/mago format --stdin-input",
10+
"languages": ["php"]
11+
}
12+
],
13+
"[php]": {
14+
"editor.defaultFormatter": "jkillian.custom-local-formatters"
15+
}
16+
}

api-alarm-integration.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
* Text Domain: api-alarm-integration
1313
* Domain Path: /languages
1414
*/
15+
use WpService\Implementations\NativeWpService;
16+
use WpUtilService\WpUtilService;
1517

1618
// Protect agains direct file access
1719
if (! defined('WPINC')) {
@@ -59,5 +61,8 @@
5961
$acfExportManager->import();
6062
});
6163

64+
$wpService = new NativeWpService();
65+
$wpUtilService = new WpUtilService($wpService);
66+
6267
// Start application
63-
new ApiAlarmIntegration\App();
68+
new ApiAlarmIntegration\App($wpUtilService->enqueue(__DIR__));

biome.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.5/schema.json",
3+
"linter": {
4+
"rules": {
5+
"complexity": {
6+
"noStaticOnlyClass": "off"
7+
},
8+
"style": {
9+
"noNonNullAssertion": "off"
10+
}
11+
}
12+
},
13+
"formatter": {
14+
"lineWidth": 120
15+
},
16+
"javascript": {
17+
"formatter": {
18+
"quoteStyle": "single"
19+
}
20+
},
21+
"assist": {
22+
"enabled": true,
23+
"actions": {
24+
"source": {
25+
"organizeImports": "on"
26+
}
27+
}
28+
}
29+
}

bootstrap.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
require_once './vendor/autoload.php';

composer.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,33 @@
2626
"url": "https://github.com/helsingborg-stad/acf-export-manager.git"
2727
}
2828
],
29+
"scripts": {
30+
"test": "vendor/bin/phpunit",
31+
"test:coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit",
32+
"lint": "vendor/bin/mago lint",
33+
"fix": "vendor/bin/mago lint --format-after-fix --fix",
34+
"format": "vendor/bin/mago fmt"
35+
},
2936
"require": {
3037
"php": ">=8.2",
3138
"helsingborg-stad/acf-export-manager": "^1.0.12",
3239
"helsingborg-stad/coordinate-transformation-library": "^1.0.1",
33-
"phpseclib/phpseclib": "^3.0.0",
3440
"helsingborg-stad/wpservice": "^2.0",
3541
"helsingborg-stad/acfservice": "^1.0",
42+
"helsingborg-stad/wputilservice": "^0.2.44"
43+
},
44+
"suggest": {
3645
"helsingborg-stad/municipio": "^6.0.0"
3746
},
3847
"require-dev": {
39-
"helsingborg-stad/phpcs": "^0.2.2",
4048
"phpunit/phpunit": "^11.5",
41-
"php-stubs/wordpress-stubs": "^6.8"
42-
},
43-
"scripts": {
44-
"test": "phpunit --no-coverage --testdox",
45-
"test:coverage": "XDEBUG_MODE=coverage phpunit --testdox",
46-
"lint": "vendor/bin/phpcs",
47-
"lint:changed": "vendor/bin/phpcs-changed origin/main",
48-
"fix": "vendor/bin/phpcbf",
49-
"fix:changed": "vendor/bin/phpcbf-changed origin/main"
49+
"carthage-software/mago": "^1.0.0-rc.3"
5050
},
5151
"config": {
5252
"allow-plugins": {
5353
"dealerdirect/phpcodesniffer-composer-installer": true,
54-
"composer/installers": true
54+
"composer/installers": true,
55+
"carthage-software/mago": true
5556
}
5657
},
5758
"autoload": {

0 commit comments

Comments
 (0)