Skip to content

Commit c18873c

Browse files
chore: Prepare PHP SDK for Packagist Release (#729)
* chore: prepare PHP SDK for Packagist as lingodotdev/sdk Co-Authored-By: Max Prilutskiy <maks.prilutskiy@gmail.com> * chore: improve .gitattributes for Packagist distribution Co-Authored-By: Max Prilutskiy <maks.prilutskiy@gmail.com> * chore: fix negation pattern in .gitattributes Co-Authored-By: Max Prilutskiy <maks.prilutskiy@gmail.com> * chore: simplify .gitattributes to exclude everything except composer.json and SDK source Co-Authored-By: Max Prilutskiy <maks.prilutskiy@gmail.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Max Prilutskiy <maks.prilutskiy@gmail.com>
1 parent 1a6ff6d commit c18873c

File tree

6 files changed

+42
-55
lines changed

6 files changed

+42
-55
lines changed

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Exclude everything by default
2+
* export-ignore
3+
4+
# Include only composer.json and PHP SDK source files
5+
/composer.json -export-ignore
6+
/php/sdk/src/** -export-ignore

.github/workflows/publish-php-sdk.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ jobs:
4343
'
4444
fi
4545
46-
- name: Install dependencies for SDK
47-
working-directory: ./php/sdk
46+
- name: Validate composer.json
47+
run: composer validate --strict
48+
49+
- name: Install dependencies
4850
run: composer install --prefer-dist
4951

5052
- name: Run tests
51-
working-directory: ./php/sdk
52-
run: vendor/bin/phpunit tests/
53+
run: vendor/bin/phpunit php/sdk/tests/
5354

5455
# Code style checks removed as requested by user
5556
# - name: Check code style

composer.json

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
11
{
2-
"name": "lingodotdev/lingo.dev",
3-
"description": "Lingo.dev Monorepo",
4-
"type": "project",
5-
"license": "MIT",
6-
"repositories": [
7-
{
8-
"type": "path",
9-
"url": "php/sdk",
10-
"options": {
11-
"symlink": false
12-
}
13-
}
14-
],
15-
"require": {
16-
"lingodotdev/sdk": "*"
17-
},
18-
"minimum-stability": "dev",
19-
"prefer-stable": true
2+
"name": "lingodotdev/sdk",
3+
"description": "Official Lingo SDK for PHP",
4+
"type": "library",
5+
"license": "MIT",
6+
"version": "0.1.0",
7+
"require": {
8+
"php": "^8.1",
9+
"guzzlehttp/guzzle": "^7.0",
10+
"respect/validation": "^2.0"
11+
},
12+
"autoload": {
13+
"psr-4": {
14+
"LingoDotDev\\Sdk\\": "php/sdk/src/"
15+
}
16+
},
17+
"autoload-dev": {
18+
"psr-4": {
19+
"LingoDotDev\\Sdk\\Tests\\": "php/sdk/tests/"
20+
}
21+
},
22+
"require-dev": {
23+
"phpunit/phpunit": "^9.0",
24+
"squizlabs/php_codesniffer": "^3.0"
25+
},
26+
"scripts": {
27+
"test": "phpunit",
28+
"cs": "phpcs php/sdk/src/ php/sdk/tests/",
29+
"cs-fix": "phpcbf php/sdk/src/ php/sdk/tests/"
30+
}
2031
}

php/sdk/composer.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

php/sdk/src/LingoDotDevEngine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @link https://lingo.dev
1010
*/
1111

12-
namespace Lingodotdev\Sdk;
12+
namespace LingoDotDev\Sdk;
1313

1414
use GuzzleHttp\Client;
1515
use GuzzleHttp\Exception\RequestException;

php/sdk/tests/LingoDotDevEngineTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @link https://lingo.dev
1010
*/
1111

12-
namespace Lingodotdev\Sdk\Tests;
12+
namespace LingoDotDev\Sdk\Tests;
1313

1414
use GuzzleHttp\Client;
1515
use GuzzleHttp\Handler\MockHandler;

0 commit comments

Comments
 (0)