Skip to content

Commit 11db64c

Browse files
authored
Merge pull request #1 from appwrite/chore-release-preps
Chore: Prepare for replease
2 parents b2c7268 + de1a17e commit 11db64c

13 files changed

+1052
-60
lines changed

.github/workflows/check.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Check"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
check:
10+
name: "Check"
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: '18'
20+
21+
- name: Install PNPM
22+
run: npm i -g pnpm
23+
24+
- name: Install dependencies
25+
run: pnpm install
26+
27+
- name: Format
28+
run: pnpm run check

.github/workflows/lint.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Lint"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
lint:
10+
name: "Lint"
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: '18'
20+
21+
- name: Install PNPM
22+
run: npm i -g pnpm
23+
24+
- name: Install dependencies
25+
run: pnpm install
26+
27+
- name: Format
28+
run: pnpm run lint

.github/workflows/release.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Release"
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
tests:
9+
name: Release
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v3
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
22+
- name: Login to Docker Hub
23+
uses: docker/login-action@v3
24+
with:
25+
username: ${{ vars.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_TOKEN }}
27+
28+
- name: Extract metadata (tags, labels) for Docker
29+
id: meta
30+
uses: docker/metadata-action@v5
31+
with:
32+
images: appwrite/browser
33+
tags: type=semver,pattern={{major}}.{{minor}}.{{patch}}
34+
35+
- name: Build and push
36+
uses: docker/build-push-action@v5
37+
with:
38+
context: .
39+
platforms: linux/amd64,linux/arm64
40+
push: true
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}

.gitignore

+136-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,136 @@
1-
/node_modules
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
.pnpm-debug.log*
9+
10+
# Diagnostic reports (https://nodejs.org/api/report.html)
11+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12+
13+
# Runtime data
14+
pids
15+
*.pid
16+
*.seed
17+
*.pid.lock
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
25+
26+
# nyc test coverage
27+
.nyc_output
28+
29+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30+
.grunt
31+
32+
# Bower dependency directory (https://bower.io/)
33+
bower_components
34+
35+
# node-waf configuration
36+
.lock-wscript
37+
38+
# Compiled binary addons (https://nodejs.org/api/addons.html)
39+
build/Release
40+
41+
# Dependency directories
42+
node_modules/
43+
jspm_packages/
44+
45+
# Snowpack dependency directory (https://snowpack.dev/)
46+
web_modules/
47+
48+
# TypeScript cache
49+
*.tsbuildinfo
50+
51+
# Optional npm cache directory
52+
.npm
53+
54+
# Optional eslint cache
55+
.eslintcache
56+
57+
# Optional stylelint cache
58+
.stylelintcache
59+
60+
# Microbundle cache
61+
.rpt2_cache/
62+
.rts2_cache_cjs/
63+
.rts2_cache_es/
64+
.rts2_cache_umd/
65+
66+
# Optional REPL history
67+
.node_repl_history
68+
69+
# Output of 'npm pack'
70+
*.tgz
71+
72+
# Yarn Integrity file
73+
.yarn-integrity
74+
75+
# dotenv environment variable files
76+
.env
77+
.env.development.local
78+
.env.test.local
79+
.env.production.local
80+
.env.local
81+
82+
# parcel-bundler cache (https://parceljs.org/)
83+
.cache
84+
.parcel-cache
85+
86+
# Next.js build output
87+
.next
88+
out
89+
90+
# Nuxt.js build / generate output
91+
.nuxt
92+
dist
93+
94+
# Gatsby files
95+
.cache/
96+
# Comment in the public line in if your project uses Gatsby and not Next.js
97+
# https://nextjs.org/blog/next-9-1#public-directory-support
98+
# public
99+
100+
# vuepress build output
101+
.vuepress/dist
102+
103+
# vuepress v2.x temp and cache directory
104+
.temp
105+
.cache
106+
107+
# vitepress build output
108+
**/.vitepress/dist
109+
110+
# vitepress cache directory
111+
**/.vitepress/cache
112+
113+
# Docusaurus cache and generated files
114+
.docusaurus
115+
116+
# Serverless directories
117+
.serverless/
118+
119+
# FuseBox cache
120+
.fusebox/
121+
122+
# DynamoDB Local files
123+
.dynamodb/
124+
125+
# TernJS port file
126+
.tern-port
127+
128+
# Stores VSCode versions used for testing VSCode extensions
129+
.vscode-test
130+
131+
# yarn v2
132+
.yarn/cache
133+
.yarn/unplugged
134+
.yarn/build-state.yml
135+
.yarn/install-state.gz
136+
.pnp.*

.gitpod.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This configuration file was automatically generated by Gitpod.
2+
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
3+
# and commit this file to your remote git repository to share the goodness with others.
4+
5+
# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart
6+
7+
tasks:
8+
- init: pnpm install
9+
command: pnpm run start
10+
11+

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ COPY . .
1414

1515
FROM base
1616
COPY --from=prod-deps /app/node_modules /app/node_modules
17-
COPY --from=build /app/index.js /app/index.js
1817
RUN pnpm playwright install --with-deps chromium
18+
COPY --from=build /app/src/index.js /app/src/index.js
1919
CMD ["pnpm", "start"]

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Appwrite
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, 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,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Docker Browser 🖥️
2+
3+
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
4+
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
5+
[![appwrite.io](https://img.shields.io/badge/appwrite-.io-f02e65?style=flat-square)](https://appwrite.io)
6+
7+
Docker Browser is simple to use and extend REST API meant to simplify screenshot preview, reports, and analysis.
8+
9+
## Usage
10+
11+
Add Docker Browser to your `docker-compose.yml`.
12+
13+
```
14+
services:
15+
appwrite-browser:
16+
image: appwrite/browser:0.1.0
17+
```
18+
19+
Start Docker Browser alongside rest of your services.
20+
21+
```
22+
docker compose up -d
23+
```
24+
25+
Communicate with Docker Browser endpoints.
26+
27+
```bash
28+
curl -X POST -H 'content-type: application/json' -d '{"url":"http://google.com/ping"}' http://appwrite-browser:3000/v1/screenshots
29+
```
30+
31+
## Development
32+
33+
Make sure you have [pnpm](https://pnpm.io/) installed.
34+
35+
To install dependencies, run the following command.
36+
37+
```bash
38+
pnpm i
39+
```
40+
41+
Next, start the server by running `npm start`, and visit use endpoint `http://localhost:3000` as REST API endpoint.
42+
43+
## Contributing
44+
45+
All code contributions, including those of people having commit access, must go through a pull request and be approved by a core developer before being merged. This is to ensure a proper review of all the code.
46+
47+
We truly ❤️ pull requests! If you wish to help, you can learn more about how you can contribute to this project in the [contribution guide](CONTRIBUTING.md).

biome.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json"
3+
}

eslint.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import globals from "globals";
2+
import pluginJs from "@eslint/js";
3+
4+
5+
/** @type {import('eslint').Linter.Config[]} */
6+
export default [
7+
{languageOptions: { globals: globals.node }},
8+
pluginJs.configs.recommended,
9+
];

package.json

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
{
2-
"name": "browser",
3-
"version": "1.0.0",
2+
"name": "appwrite-browser",
3+
"version": "0.1.0",
44
"description": "",
5-
"main": "index.js",
5+
"main": "src/index.js",
66
"type": "module",
77
"scripts": {
8-
"start": "node index.js",
8+
"start": "node src/index.js",
9+
"format": "biome check --write ./src",
10+
"lint": "biome check ./src",
11+
"check": "eslint ./src",
912
"test": "echo \"Error: no test specified\" && exit 1"
1013
},
1114
"keywords": [],
@@ -18,5 +21,11 @@
1821
"playwright": "^1.48.1",
1922
"playwright-lighthouse": "^4.0.0",
2023
"zod": "^3.23.8"
24+
},
25+
"devDependencies": {
26+
"@biomejs/biome": "^1.9.4",
27+
"@eslint/js": "^9.20.0",
28+
"eslint": "^9.20.1",
29+
"globals": "^15.15.0"
2130
}
2231
}

0 commit comments

Comments
 (0)