Skip to content

Commit fc5bd86

Browse files
committed
fix(composer): Correct package metadata and autoloading
Add the description, license, homepage, keywords, support links and PHP version constraint that were missing from composer.json, and point the authors entry at Seam Labs rather than a personal address. Move the Tests\ PSR-4 mapping from autoload to autoload-dev so the test namespace is no longer registered in consumer projects, and add an archive exclude list so a built package ships only the runtime files. package.json is deliberately kept in the archive because Seam\Utils\PackageVersion reads it at runtime. Define the primary development tasks as Composer scripts (build, test, lint) and configure PHPUnit in phpunit.xml.dist so the suite is declared rather than passed by path. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RFK47311nWtbd3gHmjdknR
1 parent 3bb09fc commit fc5bd86

6 files changed

Lines changed: 424 additions & 109 deletions

File tree

.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,3 @@ indent_size = 2
1010

1111
[*.php]
1212
indent_size = 4
13-
14-
[Makefile]
15-
indent_style = tab

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ CODEGEN.md
1212
vendor
1313
tmp
1414

15+
# PHPUnit result cache
16+
.phpunit.result.cache
17+
1518
# Build directories
1619
package
20+
/pkg/
1721

1822
# Environment versions file
1923
.versions

LICENSE.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2021-2024 Seam Labs, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

composer.json

Lines changed: 81 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,94 @@
11
{
22
"name": "seamapi/seam",
3+
"description": "SDK for the Seam API written in PHP.",
34
"type": "library",
5+
"keywords": [
6+
"seam",
7+
"sdk",
8+
"api",
9+
"iot",
10+
"smart-lock",
11+
"access-control"
12+
],
13+
"homepage": "https://github.com/seamapi/php",
14+
"license": "MIT",
15+
"authors": [
16+
{
17+
"name": "Seam Labs, Inc.",
18+
"email": "engineering@getseam.com",
19+
"homepage": "https://www.seam.co"
20+
}
21+
],
22+
"support": {
23+
"docs": "https://docs.seam.co",
24+
"issues": "https://github.com/seamapi/php/issues",
25+
"source": "https://github.com/seamapi/php"
26+
},
427
"require": {
28+
"php": "^8.0",
529
"guzzlehttp/guzzle": "^7.5"
630
},
31+
"require-dev": {
32+
"phpunit/phpunit": "^9.5",
33+
"squizlabs/php_codesniffer": "^3.7"
34+
},
735
"autoload": {
836
"psr-4": {
9-
"Seam\\": ["src/", "src/Exceptions/"],
10-
"Tests\\": "tests/"
37+
"Seam\\": [
38+
"src/",
39+
"src/Exceptions/"
40+
]
1141
},
12-
"classmap": ["src/Resources/"]
42+
"classmap": [
43+
"src/Resources/"
44+
]
1345
},
14-
"authors": [
15-
{
16-
"name": "seveibar",
17-
"email": "seveibar@gmail.com"
46+
"autoload-dev": {
47+
"psr-4": {
48+
"Tests\\": "tests/"
1849
}
19-
],
20-
"require-dev": {
21-
"phpunit/phpunit": "^9.5",
22-
"squizlabs/php_codesniffer": "^3.7"
50+
},
51+
"config": {
52+
"sort-packages": true
53+
},
54+
"archive": {
55+
"exclude": [
56+
"/.devcontainer",
57+
"/.github",
58+
"/codegen",
59+
"/node_modules",
60+
"/pkg",
61+
"/tests",
62+
"/tmp",
63+
"/vendor",
64+
"/.editorconfig",
65+
"/.env.example",
66+
"/.npmrc",
67+
"/.phpunit.result.cache",
68+
"/.prettierignore",
69+
"/.prettierrc.json",
70+
"/.releaserc.json",
71+
"/eslint.config.ts",
72+
"/package-lock.json",
73+
"/phpunit.xml.dist",
74+
"/tsconfig.json"
75+
]
76+
},
77+
"scripts": {
78+
"build": "@composer archive --format=zip --dir=pkg --file=seam",
79+
"test": "phpunit",
80+
"lint": [
81+
"@lint:composer",
82+
"@lint:syntax"
83+
],
84+
"lint:composer": "@composer validate --strict",
85+
"lint:syntax": "! find src tests -name '*.php' -exec php -l {} \\; | grep -v '^No syntax errors detected'"
86+
},
87+
"scripts-descriptions": {
88+
"build": "Build a distributable archive of this package into pkg/.",
89+
"test": "Run the test suite.",
90+
"lint": "Run all lint checks.",
91+
"lint:composer": "Validate composer.json and composer.lock.",
92+
"lint:syntax": "Check every PHP source file for syntax errors."
2393
}
2494
}

0 commit comments

Comments
 (0)