-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use valibot for type checking
- Loading branch information
Showing
35 changed files
with
249 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
{ | ||
"tasks": { | ||
"dev": "deno run -A --watch=static/,routes/ dev.ts", | ||
"dev": "deno run -A --watch=sr/static/,src/routes/ src/dev.ts", | ||
"build": "deno run -A dev.ts build", | ||
"start": "deno run -A main.ts", | ||
"update": "deno run -A -r jsr:@fresh/update ." | ||
}, | ||
"imports": { | ||
"$fresh/": "https://deno.land/x/[email protected]/", | ||
"@valibot/valibot": "jsr:@valibot/valibot@^0.42.1", | ||
"chartjs": "https://esm.sh/[email protected]", | ||
"preact": "npm:preact@^10.24.1", | ||
"tailwindcss": "npm:tailwindcss@^3.4.14" | ||
|
@@ -26,4 +27,4 @@ | |
"exclude": [ | ||
"**/_fresh/*" | ||
] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import dev from "$fresh/dev.ts"; | ||
import config from "../src/fresh.config.ts"; | ||
|
||
await dev(import.meta.url, "./main.ts", config); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { defineConfig } from "$fresh/server.ts"; | ||
import tailwind from "$fresh/plugins/tailwind.ts"; | ||
import googleAnalyticsPlugin from "./plugins/google_analytics.ts"; | ||
import googleAnalyticsPlugin from "./lib/plugins/google_analytics.ts"; | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
tailwind(), | ||
googleAnalyticsPlugin("G-LG7XQ7H5RG"), | ||
], | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
components/search_input.tsx → src/islands/address_search/search_input.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
components/search_options.tsx → ...islands/address_search/search_options.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as v from "@valibot/valibot"; | ||
|
||
/** Historical Property Data | ||
* https://data.edmonton.ca/City-Administration/Property-Assessment-Data-Historical-/qi6a-xuwt | ||
*/ | ||
export const PropertySchema = v.object({ | ||
account_number: v.string(), | ||
assessment_year: v.pipe(v.string(), v.transform(Number)), | ||
suite: v.string(), | ||
house_number: v.string(), | ||
street_name: v.string(), | ||
legal_description: v.string(), | ||
latitude: v.pipe(v.string(), v.transform(Number)), | ||
longitude: v.pipe(v.string(), v.transform(Number)), | ||
point_location: v.object({ | ||
type: v.string("Point"), | ||
coordinates: v.tuple([v.number(), v.number()]), | ||
}), | ||
neighbourhood_name: v.string(), | ||
year_built: v.pipe(v.string(), v.transform(Number)), | ||
garage: v.union([v.literal("Y"), v.literal("N")]), | ||
zoning: v.string(), | ||
lot_size: v.pipe(v.string(), v.transform(Number)), | ||
assessed_value: v.pipe(v.string(), v.transform(Number)), | ||
mill_class_1: v.string(), | ||
tax_class_pct_1: v.string(), | ||
mill_class_2: v.string(), | ||
tax_class_pct_2: v.string(), | ||
mill_class_3: v.string(), | ||
tax_class_pct_3: v.string(), | ||
}); | ||
|
||
export type Property = v.InferOutput<typeof PropertySchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
plugins/google_analytics.ts → src/lib/plugins/google_analytics.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.