style: reformat codes

This commit is contained in:
zihluwang committed 2025-06-28 23:23:06 +08:00
1 parent 0a39b99e08
commit 3f8ac14297
7 files changed
+114 -122

No files matched your search

-12
View File
@@ -1,12 +0,0 @@
# http://editorconfig.org
root = true
[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.yml]
indent_style = space
+5 -5
View File
@@ -1,7 +1,7 @@
{ {
"printWidth": 100, "printWidth": 100,
"singleQuote": false, "singleQuote": false,
"semi": false, "semi": false,
"useTabs": false, "useTabs": false,
"tabWidth": 2 "tabWidth": 2
} }
+17 -17
View File
@@ -1,19 +1,19 @@
{ {
"name": "uniapi-monitor", "name": "uniapi-monitor",
"version": "0.0.0", "version": "0.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"deploy": "wrangler deploy", "deploy": "wrangler deploy",
"dev": "wrangler dev", "dev": "wrangler dev",
"start": "wrangler dev", "start": "wrangler dev",
"test": "vitest", "test": "vitest",
"cf-typegen": "wrangler types" "cf-typegen": "wrangler types"
}, },
"devDependencies": { "devDependencies": {
"@cloudflare/vitest-pool-workers": "^0.8.19", "@cloudflare/vitest-pool-workers": "^0.8.19",
"prettier": "^3.6.2", "prettier": "^3.6.2",
"typescript": "^5.5.2", "typescript": "^5.5.2",
"vitest": "~3.2.0", "vitest": "~3.2.0",
"wrangler": "^4.22.0" "wrangler": "^4.22.0"
} }
} }
+43 -42
View File
@@ -1,45 +1,46 @@
{ {
"compilerOptions": { "compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */ /* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"target": "es2021", "target": "es2021",
/* Specify a set of bundled library declaration files that describe the target runtime environment. */ /* Specify a set of bundled library declaration files that describe the target runtime environment. */
"lib": ["es2021"], "lib": [
/* Specify what JSX code is generated. */ "es2021"
"jsx": "react-jsx", ],
/* Specify what JSX code is generated. */
/* Specify what module code is generated. */ "jsx": "react-jsx",
"module": "es2022", /* Specify what module code is generated. */
/* Specify how TypeScript looks up a file from a given module specifier. */ "module": "es2022",
"moduleResolution": "Bundler", /* Specify how TypeScript looks up a file from a given module specifier. */
/* Enable importing .json files */ "moduleResolution": "Bundler",
"resolveJsonModule": true, /* Enable importing .json files */
"resolveJsonModule": true,
/* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
"allowJs": true, "allowJs": true,
/* Enable error reporting in type-checked JavaScript files. */ /* Enable error reporting in type-checked JavaScript files. */
"checkJs": false, "checkJs": false,
/* Disable emitting files from a compilation. */
/* Disable emitting files from a compilation. */ "noEmit": true,
"noEmit": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
"isolatedModules": true,
/* Ensure that each file can be safely transpiled without relying on other imports. */ /* Allow 'import x from y' when a module doesn't have a default export. */
"isolatedModules": true, "allowSyntheticDefaultImports": true,
/* Allow 'import x from y' when a module doesn't have a default export. */ /* Ensure that casing is correct in imports. */
"allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true,
/* Ensure that casing is correct in imports. */ /* Enable all strict type-checking options. */
"forceConsistentCasingInFileNames": true, "strict": true,
/* Skip type checking all .d.ts files. */
/* Enable all strict type-checking options. */ "skipLibCheck": true,
"strict": true, "types": [
"./worker-configuration.d.ts"
/* Skip type checking all .d.ts files. */ ]
"skipLibCheck": true, },
"types": [ "exclude": [
"./worker-configuration.d.ts" "test"
] ],
}, "include": [
"exclude": ["test"], "worker-configuration.d.ts",
"include": ["worker-configuration.d.ts", "src/**/*.ts"] "src/**/*.ts"
]
} }
+9 -9
View File
@@ -1,11 +1,11 @@
import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config'; import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"
export default defineWorkersConfig({ export default defineWorkersConfig({
test: { test: {
poolOptions: { poolOptions: {
workers: { workers: {
wrangler: { configPath: './wrangler.jsonc' }, wrangler: { configPath: "./wrangler.jsonc" },
}, },
}, },
}, },
}); })
+3
View File
@@ -3,6 +3,9 @@
// Runtime types generated with workerd@1.20250617.0 2025-06-28 // Runtime types generated with workerd@1.20250617.0 2025-06-28
declare namespace Cloudflare { declare namespace Cloudflare {
interface Env { interface Env {
LARK_BOT_ID: string
LARK_SIGN_KEY: string
UNIAPI_TOKEN: string
} }
} }
interface Env extends Cloudflare.Env {} interface Env extends Cloudflare.Env {}
+37 -37
View File
@@ -3,45 +3,45 @@
* https://developers.cloudflare.com/workers/wrangler/configuration/ * https://developers.cloudflare.com/workers/wrangler/configuration/
*/ */
{ {
"$schema": "node_modules/wrangler/config-schema.json", "$schema": "node_modules/wrangler/config-schema.json",
"name": "uniapi-monitor", "name": "uniapi-monitor",
"main": "src/index.ts", "main": "src/index.ts",
"compatibility_date": "2025-06-28", "compatibility_date": "2025-06-28",
"observability": { "observability": {
"enabled": true "enabled": true
} }
/** /**
* Smart Placement * Smart Placement
* Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement * Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
*/ */
// "placement": { "mode": "smart" }, // "placement": { "mode": "smart" },
/** /**
* Bindings * Bindings
* Bindings allow your Worker to interact with resources on the Cloudflare Developer Platform, including * Bindings allow your Worker to interact with resources on the Cloudflare Developer Platform, including
* databases, object storage, AI inference, real-time communication and more. * databases, object storage, AI inference, real-time communication and more.
* https://developers.cloudflare.com/workers/runtime-apis/bindings/ * https://developers.cloudflare.com/workers/runtime-apis/bindings/
*/ */
/** /**
* Environment Variables * Environment Variables
* https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables * https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
*/ */
// "vars": { "MY_VARIABLE": "production_value" }, // "vars": { "MY_VARIABLE": "production_value" },
/** /**
* Note: Use secrets to store sensitive data. * Note: Use secrets to store sensitive data.
* https://developers.cloudflare.com/workers/configuration/secrets/ * https://developers.cloudflare.com/workers/configuration/secrets/
*/ */
/** /**
* Static Assets * Static Assets
* https://developers.cloudflare.com/workers/static-assets/binding/ * https://developers.cloudflare.com/workers/static-assets/binding/
*/ */
// "assets": { "directory": "./public/", "binding": "ASSETS" }, // "assets": { "directory": "./public/", "binding": "ASSETS" },
/** /**
* Service Bindings (communicate between multiple Workers) * Service Bindings (communicate between multiple Workers)
* https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings * https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
*/ */
// "services": [{ "binding": "MY_SERVICE", "service": "my-service" }] // "services": [{ "binding": "MY_SERVICE", "service": "my-service" }]
} }