Skip to content

Commit

Permalink
Switch to SvelteKit framework
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoColomb authored Aug 15, 2023
1 parent 2f54783 commit 808b238
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 93 deletions.
2 changes: 1 addition & 1 deletion src/lib/server/address.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as addresses from '../../../sdk/addresses'
import * as addresses from '$sdk/addresses'

export async function getAddresses(
env: App.Platform['env'],
Expand Down
2 changes: 1 addition & 1 deletion src/lib/server/routing.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as routing from '../../../sdk/routing'
import * as routing from '$sdk/routing'

export async function getRoutingZones(
zones: Zone[] | Promise<Zone[]>,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/server/rule.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as rules from '../../../sdk/rules'
import * as rules from '$sdk/rules'

export async function getRules(
zones: Zone[] | Promise<Zone[]>,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/server/zone.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as zones from '../../../sdk/zones'
import * as zones from '$sdk/zones'

export async function getZones(env: App.Platform['env']): Promise<Array<Zone>> {
return zones.list(env)
Expand Down
37 changes: 22 additions & 15 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"paths": {
"$lib": ["./src/lib"],
"$lib/*": ["./src/lib/*"],
"$sdk": ["./sdk"],
"$sdk/*": ["./sdk/*"]
},
"rootDirs": [".", "./.svelte-kit/types", "./workers"]
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
}
2 changes: 1 addition & 1 deletion workers/email.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Toucan } from 'toucan-js'

import { list as listRules } from 'sdk/rules'
import { list as listRules } from '../sdk/rules'

export const email = async (
message: EmailMessage,
Expand Down
71 changes: 0 additions & 71 deletions workers/fetch.ts

This file was deleted.

4 changes: 2 additions & 2 deletions workers/scheduled.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Toucan } from 'toucan-js'

import * as rulesApi from 'sdk/rules'
import * as zonesApi from 'sdk/zones'
import * as rulesApi from '../sdk/rules'
import * as zonesApi from '../sdk/zones'

function shouldAct(date: Date | string | undefined): Boolean {
return Boolean(date && new Date(date) <= new Date())
Expand Down

0 comments on commit 808b238

Please sign in to comment.