Skip to content

Commit d7ca639

Browse files
committed
Merge remote-tracking branch 'upstream/master' into unity-client-sdk
2 parents 8b1eff0 + ac31311 commit d7ca639

File tree

229 files changed

+7351
-1225
lines changed

Some content is hidden

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

229 files changed

+7351
-1225
lines changed

.github/workflows/djlint.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Twig Linting
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**.twig'
7+
- '.github/workflows/djlint.yml'
8+
- 'pyproject.toml'
9+
push:
10+
branches:
11+
- master
12+
paths:
13+
- '**.twig'
14+
- '.github/workflows/djlint.yml'
15+
- 'pyproject.toml'
16+
17+
jobs:
18+
djlint:
19+
name: djLint - Twig Linter
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v4
28+
29+
- name: Run djLint linter
30+
run: |
31+
uvx djlint templates/ --lint
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
name: Appwrite SDK Build Validation
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on: [pull_request]
8+
9+
jobs:
10+
generate-and-build:
11+
name: ${{ matrix.sdk }} (${{ matrix.platform }})
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
# Client SDKs
18+
- sdk: web
19+
platform: client
20+
21+
- sdk: flutter
22+
platform: client
23+
24+
- sdk: apple
25+
platform: client
26+
27+
- sdk: android
28+
platform: client
29+
30+
- sdk: react-native
31+
platform: client
32+
33+
# Server SDKs
34+
- sdk: node
35+
platform: server
36+
37+
- sdk: php
38+
platform: server
39+
40+
- sdk: python
41+
platform: server
42+
43+
- sdk: ruby
44+
platform: server
45+
46+
- sdk: dart
47+
platform: server
48+
49+
- sdk: go
50+
platform: server
51+
52+
- sdk: swift
53+
platform: server
54+
55+
- sdk: dotnet
56+
platform: server
57+
58+
- sdk: kotlin
59+
platform: server
60+
61+
# Console SDKs
62+
- sdk: cli
63+
platform: console
64+
65+
steps:
66+
- name: Checkout repository
67+
uses: actions/checkout@v4
68+
with:
69+
submodules: recursive
70+
71+
- name: Setup PHP
72+
uses: shivammathur/setup-php@v2
73+
with:
74+
php-version: '8.3'
75+
extensions: curl
76+
77+
- name: Install Composer Dependencies
78+
run: composer install
79+
80+
- name: Generate SDK for ${{ matrix.sdk }}
81+
run: php example.php ${{ matrix.sdk }} ${{ matrix.platform }}
82+
83+
# Language-specific setup
84+
- name: Setup Node.js
85+
if: matrix.sdk == 'web' || matrix.sdk == 'node' || matrix.sdk == 'cli' || matrix.sdk == 'react-native'
86+
uses: actions/setup-node@v4
87+
with:
88+
node-version: '20'
89+
90+
- name: Setup Flutter
91+
if: matrix.sdk == 'flutter'
92+
uses: subosito/flutter-action@v2
93+
with:
94+
channel: 'stable'
95+
96+
- name: Setup Swift
97+
if: matrix.sdk == 'apple' || matrix.sdk == 'swift'
98+
run: |
99+
sudo apt-get update
100+
sudo apt-get install -y wget
101+
wget https://download.swift.org/swift-5.9.2-release/ubuntu2204/swift-5.9.2-RELEASE/swift-5.9.2-RELEASE-ubuntu22.04.tar.gz
102+
tar xzf swift-5.9.2-RELEASE-ubuntu22.04.tar.gz
103+
sudo mv swift-5.9.2-RELEASE-ubuntu22.04 /usr/share/swift
104+
echo "/usr/share/swift/usr/bin" >> $GITHUB_PATH
105+
106+
- name: Setup Java
107+
if: matrix.sdk == 'android' || matrix.sdk == 'kotlin'
108+
uses: actions/setup-java@v4
109+
with:
110+
distribution: 'temurin'
111+
java-version: '17'
112+
113+
- name: Setup Python
114+
if: matrix.sdk == 'python'
115+
uses: actions/setup-python@v5
116+
with:
117+
python-version: '3.11'
118+
119+
- name: Setup Ruby
120+
if: matrix.sdk == 'ruby'
121+
uses: ruby/setup-ruby@v1
122+
with:
123+
ruby-version: '3.1'
124+
125+
- name: Setup Dart
126+
if: matrix.sdk == 'dart'
127+
uses: dart-lang/setup-dart@v1
128+
with:
129+
sdk: 'stable'
130+
131+
- name: Setup Go
132+
if: matrix.sdk == 'go'
133+
uses: actions/setup-go@v5
134+
with:
135+
go-version: '1.21'
136+
137+
- name: Setup .NET
138+
if: matrix.sdk == 'dotnet'
139+
uses: actions/setup-dotnet@v4
140+
with:
141+
dotnet-version: '8.0.x'
142+
143+
- name: Build SDK
144+
working-directory: examples/${{ matrix.sdk }}
145+
run: |
146+
case "${{ matrix.sdk }}" in
147+
web|node)
148+
npm install
149+
npm run build
150+
;;
151+
cli)
152+
npm install
153+
npm run linux-x64
154+
;;
155+
react-native)
156+
npm install
157+
npm run build || echo "No build script, checking syntax only"
158+
;;
159+
flutter)
160+
flutter pub get
161+
dart analyze --no-fatal-warnings
162+
;;
163+
apple|swift)
164+
swift build
165+
;;
166+
android)
167+
chmod +x ./gradlew || true
168+
./gradlew build -x lint
169+
;;
170+
kotlin)
171+
chmod +x ./gradlew || true
172+
./gradlew build
173+
;;
174+
php)
175+
composer install
176+
find . -name "*.php" ! -path "./vendor/*" -exec php -l {} +
177+
;;
178+
python)
179+
pip install -e .
180+
python -m compileall appwrite/
181+
;;
182+
ruby)
183+
bundle install
184+
;;
185+
dart)
186+
dart pub get
187+
dart analyze --no-fatal-warnings
188+
;;
189+
go)
190+
go mod tidy || true
191+
go build ./...
192+
;;
193+
dotnet)
194+
dotnet build
195+
;;
196+
*)
197+
echo "Unknown SDK: ${{ matrix.sdk }}"
198+
exit 1
199+
;;
200+
esac

.github/workflows/tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ jobs:
2323
CLINode18,
2424
DartBeta,
2525
DartStable,
26-
Deno1193,
27-
Deno1303,
2826
DotNet60,
2927
DotNet80,
3028
DotNet90,
@@ -100,7 +98,7 @@ jobs:
10098
- name: Setup PHP with PECL extension
10199
uses: shivammathur/setup-php@v2
102100
with:
103-
php-version: ${{ matrix.php-version }}
101+
php-version: '8.3'
104102
extensions: curl
105103

106104
- name: Install

CONTRIBUTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,31 @@ docker run --rm -v $(pwd):/app -w /app php:8.3-cli php example.php
122122
123123
Check your output files at: /examples/new-lang and make sure the SDK works. When possible, add some unit tests.
124124

125+
## Linting Twig Templates
126+
127+
We use [djLint](https://djlint.com/) to lint Twig template files for syntax errors and common issues. The linter runs automatically on pull requests.
128+
129+
**To lint templates locally:**
130+
```bash
131+
composer lint-twig
132+
```
133+
134+
**Requirements:**
135+
- [uv](https://github.com/astral-sh/uv) must be installed (for running `uvx` commands)
136+
137+
**Configuration:**
138+
- Located in `pyproject.toml`
139+
- Only linting is enabled (formatting is disabled to avoid breaking code generation)
140+
- Several rules are ignored as they produce false positives for code generation templates
141+
142+
**What the linter catches:**
143+
- Template syntax errors
144+
- Missing closing tags
145+
- Extra blank lines
146+
- Basic HTML structure issues
147+
148+
**Note:** If you encounter linting errors that seem incorrect for code generation templates, please discuss in your PR rather than disabling the linter.
149+
125150
## SDK Checklist
126151

127152
It is very important for us to create a consistent structure and architecture, as well as a language-native feel for the SDKs we generate.

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,19 @@ $sdk->generate(__DIR__ . '/examples/php'); // Generate source code
7070

7171
```
7272

73+
## Linting Twig Templates
74+
75+
This project uses [djLint](https://djlint.com/) to lint Twig template files for syntax and common issues.
76+
77+
**Note:** Formatting is disabled as it breaks code generation syntax. Only linting is used.
78+
79+
**Available command:**
80+
```bash
81+
composer lint-twig # Check for linting errors
82+
```
83+
84+
Requires [uv](https://github.com/astral-sh/uv) to be installed. Configuration is in `pyproject.toml`. The linter runs automatically on pull requests via GitHub Actions.
85+
7386
## Supported Specs
7487

7588
* [Swagger 2](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md)

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"scripts": {
1515
"test": "vendor/bin/phpunit",
1616
"lint": "vendor/bin/phpcs",
17-
"format": "vendor/bin/phpcbf"
17+
"format": "vendor/bin/phpcbf",
18+
"lint-twig": "uvx djlint templates/ --lint"
1819
},
1920
"autoload": {
2021
"psr-4": {

0 commit comments

Comments
 (0)