widefleet 0.0.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +110 -48
- package/esbuild +0 -0
- package/licenses/esbuild.txt +21 -0
- package/package.json +19 -26
- package/release.json +5 -0
- package/starter/.gitignore +19 -0
- package/starter/.oxfmtrc.json +33 -0
- package/starter/.oxlintrc.json +69 -0
- package/starter/AGENTS.md +31 -0
- package/starter/LICENSE +21 -0
- package/starter/README.md +143 -0
- package/starter/package.json +41 -0
- package/starter/pnpm-lock.yaml +2374 -0
- package/starter/pnpm-workspace.yaml +5 -0
- package/starter/src/app.d.ts +15 -0
- package/starter/src/app.html +11 -0
- package/starter/src/hooks.client.ts +11 -0
- package/starter/src/hooks.server.ts +50 -0
- package/starter/src/lib/capture-error.ts +48 -0
- package/starter/src/lib/errors.ts +42 -0
- package/starter/src/lib/server/browser-errors.ts +88 -0
- package/starter/src/lib/server/capture-error.ts +24 -0
- package/starter/src/lib/server/data.ts +48 -0
- package/starter/src/lib/server/identity.ts +30 -0
- package/starter/src/routes/+page.server.ts +72 -0
- package/starter/src/routes/+page.svelte +45 -0
- package/starter/src/routes/photos/[id]/+server.ts +21 -0
- package/starter/tools/oxlint/anti-slop/LICENSE +21 -0
- package/starter/tools/oxlint/anti-slop/UPSTREAM.md +7 -0
- package/starter/tools/oxlint/anti-slop/effect/index.ts +21 -0
- package/starter/tools/oxlint/anti-slop/effect/rules/no-manual-effect-error-tag.ts +52 -0
- package/starter/tools/oxlint/anti-slop/effect/rules/no-manual-tag-comparison.ts +45 -0
- package/starter/tools/oxlint/anti-slop/effect/rules/no-manual-tagged-construction.ts +37 -0
- package/starter/tools/oxlint/anti-slop/effect/rules/no-service-constructor-imports.ts +52 -0
- package/starter/tools/oxlint/anti-slop/effect/rules/prefer-effect-match.ts +54 -0
- package/starter/tools/oxlint/anti-slop/effect/shared/tagged-values.ts +97 -0
- package/starter/tools/oxlint/anti-slop/index.ts +47 -0
- package/starter/tools/oxlint/anti-slop/rules/no-array-filter-map.ts +28 -0
- package/starter/tools/oxlint/anti-slop/rules/no-chained-type-assertions.ts +77 -0
- package/starter/tools/oxlint/anti-slop/rules/no-conditional-empty-object-spread.ts +49 -0
- package/starter/tools/oxlint/anti-slop/rules/no-known-value-widening.ts +415 -0
- package/starter/tools/oxlint/anti-slop/rules/no-module-mocking.ts +80 -0
- package/starter/tools/oxlint/anti-slop/rules/no-object-parameters.ts +83 -0
- package/starter/tools/oxlint/anti-slop/rules/no-reduce-accumulator-copy.ts +109 -0
- package/starter/tools/oxlint/anti-slop/rules/no-reflect-apply.ts +28 -0
- package/starter/tools/oxlint/anti-slop/rules/no-reflect-get.ts +28 -0
- package/starter/tools/oxlint/anti-slop/rules/no-runtime-typeof.ts +77 -0
- package/starter/tools/oxlint/anti-slop/rules/no-shape-in-symbol-names.ts +46 -0
- package/starter/tools/oxlint/anti-slop/rules/no-unknown-parameters.ts +69 -0
- package/starter/tools/oxlint/anti-slop/rules/no-unknown-returns.ts +82 -0
- package/starter/tools/oxlint/anti-slop/rules/no-unknown-type-aliases.ts +54 -0
- package/starter/tools/oxlint/anti-slop/rules/no-unsafe-dictionary-type.ts +154 -0
- package/starter/tools/oxlint/anti-slop/rules/no-widen-then-assert.ts +366 -0
- package/starter/tools/oxlint/anti-slop/rules/require-readable-spacing.ts +47 -0
- package/starter/tools/oxlint/anti-slop/rules/require-safety-comment-for-type-assertion.ts +131 -0
- package/starter/tools/oxlint/anti-slop/shared/array-method.ts +94 -0
- package/starter/tools/oxlint/anti-slop/shared/dictionary-types.ts +515 -0
- package/starter/tools/oxlint/anti-slop/shared/function-parameters.ts +49 -0
- package/starter/tools/oxlint/anti-slop/shared/lexical-type-parameters.ts +61 -0
- package/starter/tools/oxlint/anti-slop/shared/reflect-method.ts +24 -0
- package/starter/tools/oxlint/anti-slop/shared/scope.ts +15 -0
- package/starter/tools/oxlint/anti-slop/shared/type-alias-resolution.ts +250 -0
- package/starter/tools/oxlint/anti-slop/vendor/eslint-stylistic/LICENSE +22 -0
- package/starter/tools/oxlint/anti-slop/vendor/eslint-stylistic/UPSTREAM.md +28 -0
- package/starter/tools/oxlint/anti-slop/vendor/eslint-stylistic/padding-line-ast.ts +51 -0
- package/starter/tools/oxlint/anti-slop/vendor/eslint-stylistic/padding-line-between-statements.ts +906 -0
- package/starter/tools/oxlint/anti-slop/vendor/eslint-stylistic/padding-line-options.d.ts +87 -0
- package/starter/tools/prepare.ts +5 -0
- package/starter/tools/types.ts +18 -0
- package/starter/tsconfig.json +17 -0
- package/starter/vite.config.ts +8 -0
- package/starter/wrangler.jsonc +17 -0
- package/widefleet +4 -0
- package/bin/widefleet.js +0 -78
- package/src/check.js +0 -44
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* GENERATED, DO NOT EDIT DIRECTLY */
|
|
2
|
+
|
|
3
|
+
/* @checksum: 3QCTtOH6rJM5_AGJ58rGpeEaBEfaJz17MSCxWB4X_PU */
|
|
4
|
+
|
|
5
|
+
export type PaddingType = 'any' | 'never' | 'always'
|
|
6
|
+
export type StatementOption =
|
|
7
|
+
| StatementMatcher
|
|
8
|
+
| [StatementMatcher, ...StatementMatcher[]]
|
|
9
|
+
export type StatementMatcher =
|
|
10
|
+
| StatementType
|
|
11
|
+
| SelectorOption
|
|
12
|
+
export type StatementType =
|
|
13
|
+
| '*'
|
|
14
|
+
| 'exports'
|
|
15
|
+
| 'require'
|
|
16
|
+
| 'directive'
|
|
17
|
+
| 'iife'
|
|
18
|
+
| 'block'
|
|
19
|
+
| 'empty'
|
|
20
|
+
| 'function'
|
|
21
|
+
| 'ts-method'
|
|
22
|
+
| 'break'
|
|
23
|
+
| 'case'
|
|
24
|
+
| 'class'
|
|
25
|
+
| 'continue'
|
|
26
|
+
| 'debugger'
|
|
27
|
+
| 'default'
|
|
28
|
+
| 'do'
|
|
29
|
+
| 'for'
|
|
30
|
+
| 'if'
|
|
31
|
+
| 'import'
|
|
32
|
+
| 'switch'
|
|
33
|
+
| 'throw'
|
|
34
|
+
| 'try'
|
|
35
|
+
| 'while'
|
|
36
|
+
| 'with'
|
|
37
|
+
| 'cjs-export'
|
|
38
|
+
| 'cjs-import'
|
|
39
|
+
| 'enum'
|
|
40
|
+
| 'interface'
|
|
41
|
+
| 'function-overload'
|
|
42
|
+
| 'block-like'
|
|
43
|
+
| 'singleline-block-like'
|
|
44
|
+
| 'multiline-block-like'
|
|
45
|
+
| 'expression'
|
|
46
|
+
| 'singleline-expression'
|
|
47
|
+
| 'multiline-expression'
|
|
48
|
+
| 'return'
|
|
49
|
+
| 'singleline-return'
|
|
50
|
+
| 'multiline-return'
|
|
51
|
+
| 'export'
|
|
52
|
+
| 'singleline-export'
|
|
53
|
+
| 'multiline-export'
|
|
54
|
+
| 'var'
|
|
55
|
+
| 'singleline-var'
|
|
56
|
+
| 'multiline-var'
|
|
57
|
+
| 'let'
|
|
58
|
+
| 'singleline-let'
|
|
59
|
+
| 'multiline-let'
|
|
60
|
+
| 'const'
|
|
61
|
+
| 'singleline-const'
|
|
62
|
+
| 'multiline-const'
|
|
63
|
+
| 'using'
|
|
64
|
+
| 'singleline-using'
|
|
65
|
+
| 'multiline-using'
|
|
66
|
+
| 'type'
|
|
67
|
+
| 'singleline-type'
|
|
68
|
+
| 'multiline-type'
|
|
69
|
+
export type PaddingLineBetweenStatementsSchema0 = {
|
|
70
|
+
blankLine: PaddingType
|
|
71
|
+
prev: StatementOption
|
|
72
|
+
next: StatementOption
|
|
73
|
+
}[]
|
|
74
|
+
|
|
75
|
+
export interface SelectorOption {
|
|
76
|
+
selector: string
|
|
77
|
+
lineMode?: 'any' | 'singleline' | 'multiline'
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type PaddingLineBetweenStatementsRuleOptions
|
|
81
|
+
= PaddingLineBetweenStatementsSchema0
|
|
82
|
+
|
|
83
|
+
export type RuleOptions
|
|
84
|
+
= PaddingLineBetweenStatementsRuleOptions
|
|
85
|
+
export type MessageIds =
|
|
86
|
+
| 'unexpectedBlankLine'
|
|
87
|
+
| 'expectedBlankLine'
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { rm } from "node:fs/promises";
|
|
2
|
+
|
|
3
|
+
// The adapter already separates its worker from public files. This extra file
|
|
4
|
+
// describes Wrangler's upload exclusions; celld does not interpret it.
|
|
5
|
+
await rm(new URL("../build/public/.assetsignore", import.meta.url), { force: true });
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { mkdir } from "node:fs/promises";
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { once } from "node:events";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
|
|
6
|
+
await mkdir(new URL("../.platform", import.meta.url), { recursive: true });
|
|
7
|
+
|
|
8
|
+
const child = spawn(
|
|
9
|
+
process.platform === "win32" ? "pnpm.cmd" : "pnpm",
|
|
10
|
+
["exec", "wrangler", "types", ".platform/worker-configuration.d.ts"],
|
|
11
|
+
{ stdio: "inherit" },
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
const [code] = z
|
|
15
|
+
.tuple([z.number().nullable(), z.string().nullable()])
|
|
16
|
+
.parse(await once(child, "exit"));
|
|
17
|
+
|
|
18
|
+
if (code !== 0) throw new Error("Wrangler type generation failed");
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["$app/tsconfig", "@tsconfig/strictest/tsconfig.json"],
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "ES2023",
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "Bundler",
|
|
7
|
+
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
|
8
|
+
"verbatimModuleSyntax": true,
|
|
9
|
+
"isolatedModules": true,
|
|
10
|
+
"noEmit": true,
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"allowJs": false,
|
|
13
|
+
"checkJs": false
|
|
14
|
+
},
|
|
15
|
+
"include": ["src", "tools", "vite.config.ts", ".platform/worker-configuration.d.ts"],
|
|
16
|
+
"exclude": ["tools/oxlint"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "node_modules/wrangler/config-schema.json",
|
|
3
|
+
"name": "team-notes",
|
|
4
|
+
"main": "build/worker.js",
|
|
5
|
+
"compatibility_date": "2026-10-01",
|
|
6
|
+
"compatibility_flags": ["nodejs_compat"],
|
|
7
|
+
"assets": { "directory": "build/public", "binding": "ASSETS" },
|
|
8
|
+
"vars": { "APP_NAME": "Team-Notizen" },
|
|
9
|
+
"d1_databases": [
|
|
10
|
+
{
|
|
11
|
+
"binding": "DB",
|
|
12
|
+
"database_name": "notes",
|
|
13
|
+
"database_id": "00000000-0000-4000-8000-000000000010",
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
"r2_buckets": [{ "binding": "FILES", "bucket_name": "photos" }],
|
|
17
|
+
}
|
package/widefleet
ADDED
package/bin/widefleet.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { readFileSync } from "node:fs";
|
|
3
|
-
import { parseArgs } from "node:util";
|
|
4
|
-
import { checkUrl } from "../src/check.js";
|
|
5
|
-
|
|
6
|
-
const help = `Widefleet HTTP checks
|
|
7
|
-
|
|
8
|
-
Usage:
|
|
9
|
-
widefleet check <url> [url ...] [--timeout <ms>] [--json]
|
|
10
|
-
|
|
11
|
-
Options:
|
|
12
|
-
-t, --timeout <ms> Timeout per URL in milliseconds (default: 5000)
|
|
13
|
-
--json Print a JSON array of results
|
|
14
|
-
-h, --help Show help
|
|
15
|
-
-v, --version Show the package version
|
|
16
|
-
|
|
17
|
-
Checks send GET requests and follow redirects. HTTP 200-299 is healthy.
|
|
18
|
-
Exit codes: 0 = all healthy, 1 = an endpoint failed, 2 = invalid arguments.
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
async function main() {
|
|
22
|
-
const { values, positionals } = parseArgs({
|
|
23
|
-
allowPositionals: true,
|
|
24
|
-
options: {
|
|
25
|
-
timeout: { type: "string", short: "t", default: "5000" },
|
|
26
|
-
json: { type: "boolean", default: false },
|
|
27
|
-
help: { type: "boolean", short: "h" },
|
|
28
|
-
version: { type: "boolean", short: "v" },
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
if (values.help || process.argv.length === 2) {
|
|
33
|
-
process.stdout.write(help);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
if (values.version) {
|
|
37
|
-
const manifest = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
38
|
-
console.log(manifest.version);
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const [command, ...inputs] = positionals;
|
|
43
|
-
if (command !== "check" || inputs.length === 0) {
|
|
44
|
-
throw new Error("Usage: widefleet check <url> [url ...] [--timeout <ms>] [--json]");
|
|
45
|
-
}
|
|
46
|
-
if (!/^[1-9]\d*$/.test(values.timeout) || Number(values.timeout) > 2147483647) {
|
|
47
|
-
throw new Error("Timeout must be an integer between 1 and 2147483647 milliseconds.");
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Validate every URL before making requests, even when a later input is invalid.
|
|
51
|
-
const urls = inputs.map((input) => {
|
|
52
|
-
const url = new URL(input);
|
|
53
|
-
if (!['http:', 'https:'].includes(url.protocol) || url.username || url.password) {
|
|
54
|
-
throw new Error("Use http:// or https:// URLs without embedded credentials.");
|
|
55
|
-
}
|
|
56
|
-
return url;
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
const results = [];
|
|
60
|
-
for (const url of urls) {
|
|
61
|
-
const result = await checkUrl(url, { timeoutMs: Number(values.timeout) });
|
|
62
|
-
results.push(result);
|
|
63
|
-
if (!values.json) {
|
|
64
|
-
console.log(`${result.ok ? "OK" : "FAIL"} ${result.url} ${result.status ?? result.error} (${result.durationMs} ms)`);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (values.json) {
|
|
68
|
-
console.log(JSON.stringify(results, null, 2));
|
|
69
|
-
}
|
|
70
|
-
process.exitCode = results.every((result) => result.ok) ? 0 : 1;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
try {
|
|
74
|
-
await main();
|
|
75
|
-
} catch (error) {
|
|
76
|
-
console.error(`widefleet: ${error instanceof Error ? error.message : String(error)}`);
|
|
77
|
-
process.exitCode = 2;
|
|
78
|
-
}
|
package/src/check.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check an HTTP endpoint with a GET request, following redirects.
|
|
3
|
-
* The timeout covers receiving response headers; the response body is not read.
|
|
4
|
-
* Invalid inputs throw. HTTP and network failures return an unsuccessful result.
|
|
5
|
-
*/
|
|
6
|
-
export async function checkUrl(input, { timeoutMs = 5000 } = {}) {
|
|
7
|
-
const url = new URL(input);
|
|
8
|
-
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
9
|
-
throw new TypeError("Only http:// and https:// URLs are supported.");
|
|
10
|
-
}
|
|
11
|
-
if (url.username || url.password) {
|
|
12
|
-
throw new TypeError("URLs containing credentials are not supported.");
|
|
13
|
-
}
|
|
14
|
-
if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 1 || timeoutMs > 2147483647) {
|
|
15
|
-
throw new TypeError("Timeout must be an integer between 1 and 2147483647 milliseconds.");
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const started = performance.now();
|
|
19
|
-
const signal = AbortSignal.timeout(timeoutMs);
|
|
20
|
-
try {
|
|
21
|
-
const response = await fetch(url, {
|
|
22
|
-
method: "GET",
|
|
23
|
-
redirect: "follow",
|
|
24
|
-
signal,
|
|
25
|
-
headers: { "user-agent": "widefleet-http-check" },
|
|
26
|
-
});
|
|
27
|
-
const durationMs = Math.round(performance.now() - started);
|
|
28
|
-
// Stop streaming immediately: a health check does not need the response body.
|
|
29
|
-
if (response.body) {
|
|
30
|
-
await response.body.cancel();
|
|
31
|
-
}
|
|
32
|
-
return { url: url.href, ok: response.ok, status: response.status, durationMs };
|
|
33
|
-
} catch (error) {
|
|
34
|
-
return {
|
|
35
|
-
url: url.href,
|
|
36
|
-
ok: false,
|
|
37
|
-
status: null,
|
|
38
|
-
durationMs: Math.round(performance.now() - started),
|
|
39
|
-
error: signal.aborted
|
|
40
|
-
? `Timed out after ${timeoutMs} ms`
|
|
41
|
-
: error instanceof Error ? error.message : String(error),
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
}
|