Skip to content

Commit d831a09

Browse files
authored
Merge pull request #13 from labelzoom/feature/MigrateToHono
Feature/migrate to hono
2 parents 653d613 + bce10e3 commit d831a09

39 files changed

+10488
-3570
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ charset = utf-8
99
trim_trailing_whitespace = true
1010
insert_final_newline = true
1111

12-
[*.yml]
13-
indent_style = space
12+
[*.{yaml,yml}]
13+
indent_size = 2

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616

17-
- name: Use Node.js 18
17+
- name: Use Node.js 22
1818
uses: actions/setup-node@v4
1919
with:
20-
node-version: '18.x'
20+
node-version: '22.x'
2121

2222
- run: npm ci
2323

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
name: Build and Test
1717
steps:
1818
- uses: actions/checkout@v4
19-
- name: Use Node.js 18
19+
- name: Use Node.js 22
2020
uses: actions/setup-node@v4
2121
with:
22-
node-version: '18.x'
22+
node-version: '22.x'
2323
- run: npm ci
2424
- run: npm run build --if-present
2525
- run: npm test

.gitignore

Lines changed: 21 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -1,173 +1,28 @@
11
# Logs
2-
32
logs
4-
_.log
5-
npm-debug.log_
3+
*.log
4+
npm-debug.log*
65
yarn-debug.log*
76
yarn-error.log*
7+
pnpm-debug.log*
88
lerna-debug.log*
9-
.pnpm-debug.log*
10-
11-
# Diagnostic reports (https://nodejs.org/api/report.html)
12-
13-
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
14-
15-
# Runtime data
16-
17-
pids
18-
_.pid
19-
_.seed
20-
\*.pid.lock
21-
22-
# Directory for instrumented libs generated by jscoverage/JSCover
23-
24-
lib-cov
25-
26-
# Coverage directory used by tools like istanbul
27-
28-
coverage
29-
\*.lcov
30-
31-
# nyc test coverage
32-
33-
.nyc_output
34-
35-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
36-
37-
.grunt
38-
39-
# Bower dependency directory (https://bower.io/)
40-
41-
bower_components
42-
43-
# node-waf configuration
44-
45-
.lock-wscript
46-
47-
# Compiled binary addons (https://nodejs.org/api/addons.html)
48-
49-
build/Release
50-
51-
# Dependency directories
52-
53-
node_modules/
54-
jspm_packages/
55-
56-
# Snowpack dependency directory (https://snowpack.dev/)
57-
58-
web_modules/
59-
60-
# TypeScript cache
61-
62-
\*.tsbuildinfo
63-
64-
# Optional npm cache directory
65-
66-
.npm
67-
68-
# Optional eslint cache
69-
70-
.eslintcache
71-
72-
# Optional stylelint cache
73-
74-
.stylelintcache
75-
76-
# Microbundle cache
77-
78-
.rpt2_cache/
79-
.rts2_cache_cjs/
80-
.rts2_cache_es/
81-
.rts2_cache_umd/
82-
83-
# Optional REPL history
84-
85-
.node_repl_history
86-
87-
# Output of 'npm pack'
889

89-
\*.tgz
90-
91-
# Yarn Integrity file
92-
93-
.yarn-integrity
94-
95-
# dotenv environment variable files
96-
97-
.env
98-
.env.development.local
99-
.env.test.local
100-
.env.production.local
101-
.env.local
102-
103-
# parcel-bundler cache (https://parceljs.org/)
104-
105-
.cache
106-
.parcel-cache
107-
108-
# Next.js build output
109-
110-
.next
111-
out
112-
113-
# Nuxt.js build / generate output
114-
115-
.nuxt
10+
node_modules
11611
dist
117-
118-
# Gatsby files
119-
120-
.cache/
121-
122-
# Comment in the public line in if your project uses Gatsby and not Next.js
123-
124-
# https://nextjs.org/blog/next-9-1#public-directory-support
125-
126-
# public
127-
128-
# vuepress build output
129-
130-
.vuepress/dist
131-
132-
# vuepress v2.x temp and cache directory
133-
134-
.temp
135-
.cache
136-
137-
# Docusaurus cache and generated files
138-
139-
.docusaurus
140-
141-
# Serverless directories
142-
143-
.serverless/
144-
145-
# FuseBox cache
146-
147-
.fusebox/
148-
149-
# DynamoDB Local files
150-
151-
.dynamodb/
152-
153-
# TernJS port file
154-
155-
.tern-port
156-
157-
# Stores VSCode versions used for testing VSCode extensions
158-
159-
.vscode-test
160-
161-
# yarn v2
162-
163-
.yarn/cache
164-
.yarn/unplugged
165-
.yarn/build-state.yml
166-
.yarn/install-state.gz
167-
.pnp.\*
168-
169-
# wrangler project
170-
171-
.dev.vars
172-
.wrangler/
173-
junit-report.xml
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
25+
26+
# wrangler files
27+
.wrangler
28+
.dev.vars*

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22.15.0

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 LabelZoom
3+
Copyright (c) 2025 LabelZoom
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,49 @@
44

55
[![Build Status](https://github.com/labelzoom/labelzoom-cf-api-proxy/actions/workflows/deploy.yml/badge.svg?branch=main)](https://github.com/labelzoom/labelzoom-cf-api-proxy/actions?query=branch%3Amain)
66

7-
Cloudflare Worker that serves as a reverse proxy for LabelZoom's public REST API
7+
A Cloudflare Worker that serves as a reverse proxy for LabelZoom's public REST API. This project was bootstrapped using the [React + Vite + Hono + Cloudflare Workers](https://github.com/cloudflare/templates/tree/main/vite-react-template) template.
8+
9+
[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/templates/tree/main/vite-react-template)
10+
11+
## Development
12+
13+
Install dependencies:
14+
15+
```bash
16+
npm install
17+
```
18+
19+
Start the development server with:
20+
21+
```bash
22+
npm run dev
23+
```
24+
25+
Your application will be available at [http://localhost:5173](http://localhost:5173).
26+
27+
## Production
28+
29+
Build your project for production:
30+
31+
```bash
32+
npm run build
33+
```
34+
35+
Preview your build locally:
36+
37+
```bash
38+
npm run preview
39+
```
40+
41+
Deploy your project to Cloudflare Workers:
42+
43+
```bash
44+
npx wrangler deploy
45+
```
46+
47+
## Additional Resources
48+
49+
- [Cloudflare Workers Documentation](https://developers.cloudflare.com/workers/)
50+
- [Vite Documentation](https://vitejs.dev/guide/)
51+
- [React Documentation](https://reactjs.org/)
52+
- [Hono Documentation](https://hono.dev/)

eslint.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import reactHooks from "eslint-plugin-react-hooks";
4+
import reactRefresh from "eslint-plugin-react-refresh";
5+
import tseslint from "typescript-eslint";
6+
7+
export default tseslint.config(
8+
{ ignores: ["dist"] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ["**/*.{ts,tsx}"],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
"react-hooks": reactHooks,
18+
"react-refresh": reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
"react-refresh/only-export-components": [
23+
"warn",
24+
{ allowConstantExport: true },
25+
],
26+
},
27+
},
28+
);

index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Error | LabelZoom</title>
5+
</head>
6+
<body>
7+
<h1>Oh no!</h1>
8+
<p>If you are seeing this message, it's because we made a mistake. Can you please let us know about it? <a href="https://labelzoom.atlassian.net/servicedesk/customer/portals">LabelZoom Support</a></p>
9+
<p>Click <a href="https://www.labelzoom.net/">here</a> to go to our homepage.</p>
10+
</body>
11+
</html>

index.html.disabled

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React + TS</title>
8+
</head>
9+
10+
<body>
11+
<div id="root"></div>
12+
<script type="module" src="/src/react-app/main.tsx"></script>
13+
</body>
14+
</html>

0 commit comments

Comments
 (0)