Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nakasyou committed Nov 7, 2024
1 parent 15805ba commit f37c864
Show file tree
Hide file tree
Showing 50 changed files with 143 additions and 140 deletions.
6 changes: 3 additions & 3 deletions astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { defineConfig } from 'astro/config'
import sitemap from '@astrojs/sitemap'
import solidJs from '@astrojs/solid-js'
import tailwind from '@astrojs/tailwind'
import { defineConfig } from 'astro/config'
import { passthroughImageService } from 'astro/config'
import sitemap from '@astrojs/sitemap'
import cloudflare from './src/integrations/cloudflare'
import { imagetools } from 'vite-imagetools'
import cloudflare from './src/integrations/cloudflare'

import qwikdev from '@qwikdev/astro'
import type { AstroIntegration } from 'astro'
Expand Down
3 changes: 3 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@
"formatter": {
"indentWidth": 2,
"indentStyle": "space"
},
"files": {
"ignore": ["node_modules", "**/*.css"]
}
}
8 changes: 4 additions & 4 deletions src/components/Button.qwik.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/** @jsxImportSource @builder.io/qwik */
import {
component$,
$,
type HTMLAttributes,
type NoSerialize,
noSerialize,
Slot,
component$,
noSerialize,
useOnDocument,
useSignal,
useVisibleTask$,
useOnDocument,
$,
} from '@builder.io/qwik'
import { type Wave, wave } from '@ns/ha'

Expand Down
2 changes: 1 addition & 1 deletion src/components/datas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getHash, getBranch } from './macros.ts' with { type: 'macro' }
import { getBranch, getHash } from './macros.ts' with { type: 'macro' }

export const commitHash = getHash()
export const gitBranch = getBranch()
6 changes: 3 additions & 3 deletions src/integrations/cloudflare/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { AstroConfig, AstroIntegration } from 'astro'
import * as fs from 'node:fs/promises'
import fg from 'fast-glob'
import path from 'node:path'
import type { AstroConfig, AstroIntegration } from 'astro'
import fg from 'fast-glob'

export default (): AstroIntegration => {
let buildConfig: AstroConfig['build']
Expand Down Expand Up @@ -97,7 +97,7 @@ export default (): AstroIntegration => {
await fs.mkdir(path.dirname(targetPath), {
recursive: true,
})
await fs.writeFile(targetPath, content)
await fs.writeFile(targetPath, content.toString('utf-8'))
}
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/integrations/cloudflare/server/server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { App } from 'astro/app'
// @ts-check
import { Hono } from 'hono'
import { App } from 'astro/app'

export function createExports(manifest: import('astro').SSRManifest) {
const app = new App(manifest)
Expand Down
2 changes: 1 addition & 1 deletion src/islands/ai-quiz/components/Finished.qwik.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
useContext,
useVisibleTask$,
} from '@builder.io/qwik'
import { QUIZ_STATE_CTX, SCREEN_STATE_CTX } from '../store'
import { QuizDB } from '../storage'
import { QUIZ_STATE_CTX, SCREEN_STATE_CTX } from '../store'

export const FinishedScreen = component$(() => {
const screenState = useContext(SCREEN_STATE_CTX)
Expand Down
12 changes: 6 additions & 6 deletions src/islands/ai-quiz/components/Incorrect.qwik.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/** @jsxImportSource @builder.io/qwik */
import {
$,
type NoSerialize,
type QRL,
component$,
noSerialize,
type NoSerialize,
useComputed$,
useSignal,
type QRL,
} from '@builder.io/qwik'
import { type Signal, useContext } from '@builder.io/qwik'
import type { ChatSession } from '@google/generative-ai'
import dedent from 'dedent'
import { icon } from '../../../utils/icons'
import { useContext, type Signal } from '@builder.io/qwik'
import { QUIZ_STATE_CTX } from '../store'
import { getGoogleGenerativeAI } from '../../shared/gemini'
import dedent from 'dedent'
import type { ChatSession } from '@google/generative-ai'
import { QUIZ_STATE_CTX } from '../store'
import { Loading } from './Utils.qwik'

const NextButton = component$<{
Expand Down
10 changes: 5 additions & 5 deletions src/islands/ai-quiz/components/InitialScreen.qwik.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/** @jsxImportSource @builder.io/qwik */
import {
type JSXOutput,
component$,
noSerialize,
useContext,
useSignal,
useVisibleTask$,
type JSXOutput,
noSerialize,
} from '@builder.io/qwik'
import { SCREEN_STATE_CTX } from '../store'
import type { TextNoteData } from '../../note/components/notes/TextNote/types'
import { load } from '../../note/utils/file-format'
import { loadNoteFromType } from '../../shared/storage'
import { getGeminiApiToken } from '../../shared/store'
import { load } from '../../note/utils/file-format'
import type { TextNoteData } from '../../note/components/notes/TextNote/types'
import { SCREEN_STATE_CTX } from '../store'

/**
* 最初の画面
Expand Down
24 changes: 12 additions & 12 deletions src/islands/ai-quiz/components/Quiz.qwik.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ import {
useStylesScoped$,
useVisibleTask$,
} from '@builder.io/qwik'
import {
QUIZ_STATE_CTX,
SCREEN_STATE_CTX,
SETTINGS_CTX,
type Quiz,
type QuizFrom,
type QuizState,
} from '../store'
import { safeParse } from 'valibot'
import { shuffle } from '../../../utils/arr'
import { Incorrect } from './Incorrect.qwik'
import { FinishedScreen } from './Finished.qwik'
import { getGoogleGenerativeAI } from '../../shared/gemini'
import {
CONTENT_SCHEMA,
PROMPT_TO_GENERATE_SELECT_QUIZ,
type QuizContent,
} from '../constants'
import { safeParse } from 'valibot'
import { Loading } from './Utils.qwik'
import { QuizDB } from '../storage'
import {
QUIZ_STATE_CTX,
type Quiz,
type QuizFrom,
type QuizState,
SCREEN_STATE_CTX,
SETTINGS_CTX,
} from '../store'
import { quizzesGenerator } from '../utils/generate-quizzes'
import { FinishedScreen } from './Finished.qwik'
import { Incorrect } from './Incorrect.qwik'
import { Loading } from './Utils.qwik'

export const QuizScreen = component$(() => {
const quizState = useStore<QuizState>(
Expand Down
2 changes: 1 addition & 1 deletion src/islands/ai-quiz/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { array, object, string, type InferOutput } from 'valibot'
import { type InferOutput, array, object, string } from 'valibot'
import selectQuestion from './schemas/select-question.json'

/**
Expand Down
12 changes: 6 additions & 6 deletions src/islands/ai-quiz/index.qwik.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/** @jsxImportSource @builder.io/qwik */

import { component$, useContextProvider, useStore } from '@builder.io/qwik'
import type { NoteLoadType } from '../note/note-load-types'
import { InitialScreen } from './components/InitialScreen.qwik'
import { Navbar } from './components/Navbar.qwik'
import { QuizScreen } from './components/Quiz.qwik'
import {
type ScreenState,
type Settings,
SCREEN_STATE_CTX,
SETTINGS_CTX,
type ScreenState,
type Settings,
} from './store'
import { InitialScreen } from './components/InitialScreen.qwik'
import type { NoteLoadType } from '../note/note-load-types'
import { QuizScreen } from './components/Quiz.qwik'
import { Navbar } from './components/Navbar.qwik'

export default component$<{
noteLoadType: NoteLoadType
Expand Down
6 changes: 3 additions & 3 deletions src/islands/ai-quiz/store.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createContextId, type NoSerialize } from '@builder.io/qwik'
import type { QuizContent } from './constants'
import type { NoteLoadType } from '../note/note-load-types'
import { type NoSerialize, createContextId } from '@builder.io/qwik'
import type { TextNoteData } from '../note/components/notes/TextNote/types'
import type { NoteLoadType } from '../note/note-load-types'
import type { QuizContent } from './constants'

/**
* クイズ
Expand Down
10 changes: 5 additions & 5 deletions src/islands/app/CreateNote.qwik.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/** @jsxImportSource @builder.io/qwik */
import {
component$,
useSignal,
useStore,
$,
type NoSerialize,
component$,
noSerialize,
useSignal,
useStore,
} from '@builder.io/qwik'
import { NotesDB } from '../shared/storage'
import { load, saveNoteDatas } from '../note/utils/file-format'
import { icon } from '../../utils/icons'
import { load, saveNoteDatas } from '../note/utils/file-format'
import { NotesDB } from '../shared/storage'

export const CreateNote = component$(() => {
const isOpenedCreateNoteDialog = useSignal(false)
Expand Down
4 changes: 2 additions & 2 deletions src/islands/note-list/list.qwik.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/** @jsxImportSource @builder.io/qwik */
import {
$,
component$,
type QRL,
component$,
useOnDocument,
useSignal,
useVisibleTask$,
} from '@builder.io/qwik'
import { type Notes, NotesDB } from '../note/notes-schema'
import classnames from 'classnames'
import { Button } from '../../components/Button.qwik'
import { type Notes, NotesDB } from '../note/notes-schema'

const NoteListItem = component$<{
note: Notes
Expand Down
20 changes: 10 additions & 10 deletions src/islands/note/App.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { Show, createEffect, createSignal, onCleanup, onMount } from 'solid-js'
import Fab from './components/Fab'
import Header from './components/Header'
import Notes from './components/Notes'
import { createTextNote } from './components/notes/TextNote'
import Header from './components/Header'
import Fab from './components/Fab'
import { Show, createSignal, onMount, onCleanup, createEffect } from 'solid-js'

import './App.css'
import { createImageNote } from './components/notes/ImageNote'
import type { Props } from '.'
import { NotesDB } from '../shared/storage'
import { Menu } from './components/Menu'
import { loadFromBlob } from './components/load-process'
import { createImageNote } from './components/notes/ImageNote'
import { Dialog } from './components/utils/Dialog'
import {
noteBookMetadata,
noteBookState,
notes,
setNoteBookState,
setNoteBookMetadata,
noteBookMetadata,
setNoteBookState,
} from './store'
import type { Props } from '.'
import { Dialog } from './components/utils/Dialog'
import { NotesDB } from '../shared/storage'
import { loadFromBlob } from './components/load-process'
import { save as saveFromNotes } from './utils/file-format'

import iconSvg from '../../assets/icon-new.svg?raw'
Expand Down
2 changes: 1 addition & 1 deletion src/islands/note/components/Fab.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createSignal } from 'solid-js'
import { noteBookState, setNoteBookState } from '../store'
import { icon } from '../../../utils/icons'
import { noteBookState, setNoteBookState } from '../store'

export interface Props {
onAddTextNote?: () => void
Expand Down
4 changes: 2 additions & 2 deletions src/islands/note/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import iconAiQuiz from '../../../assets/icons/aiquiz.svg?raw'

import { icon } from '../../../utils/icons'

import { noteBookState, setNoteBookState } from '../store'
import { Show, createSignal, onMount } from 'solid-js'
import { getGeminiApiToken } from '../../shared/store'
import { Dialog } from './utils/Dialog'
import type { NoteLoadType } from '../note-load-types'
import { noteBookState, setNoteBookState } from '../store'
import { Dialog } from './utils/Dialog'

const Header = () => {
const [getIsAIQuizActive, setIsAIQuizActive] = createSignal<boolean>()
Expand Down
4 changes: 2 additions & 2 deletions src/islands/note/components/Menu.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Show, createSignal } from 'solid-js'
import { icon } from '../../../utils/icons'
import {
noteBookMetadata,
Expand All @@ -6,9 +7,8 @@ import {
setNoteBookMetadata,
setNoteBookState,
} from '../store'
import { save, type LoadError } from '../utils/file-format'
import { type LoadError, save } from '../utils/file-format'
import { Dialog } from './utils/Dialog'
import { Show, createSignal } from 'solid-js'

const CloseBtn = () => {
return (
Expand Down
12 changes: 6 additions & 6 deletions src/islands/note/components/Notes.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Key } from '@solid-primitives/keyed'
import {
createSignal,
type Accessor,
type Setter,
type JSX,
createEffect,
type Setter,
Show,
createEffect,
createSignal,
onMount,
} from 'solid-js'
import { Key } from '@solid-primitives/keyed'
import { moveArray } from '../utils/array/moveArray'

import type { Note } from './notes-utils'
import { icon } from '../../../utils/icons'
import { noteBookState, notes, setNoteBookState } from '../store'
import type { Note } from './notes-utils'
import { Dialog } from './utils/Dialog'
import { icon } from '../../../utils/icons'

export default (props: {
notes: Note[]
Expand Down
6 changes: 3 additions & 3 deletions src/islands/note/components/notes-utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { createSignal, type Accessor, type Setter } from 'solid-js'
import { type Accessor, type Setter, createSignal } from 'solid-js'
import type { JSX } from 'solid-js/jsx-runtime'
import type { Note0 } from '../utils/file-format/manifest-schema'
import type { SetStoreFunction } from 'solid-js/store'
import type { TextNoteData } from './notes/TextNote/types'
import type { Note0 } from '../utils/file-format/manifest-schema'
import type { ImageNoteData } from './notes/ImageNote/types'
import type { TextNoteData } from './notes/TextNote/types'

export type MargedNoteData = TextNoteData | ImageNoteData

Expand Down
10 changes: 5 additions & 5 deletions src/islands/note/components/notes/ImageNote/ImageNote.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { NoteComponent, NoteComponentProps } from '../../notes-utils'
import { Show, createMemo, createSignal } from 'solid-js'
import type { SetStoreFunction } from 'solid-js/store'
import type { NoteComponent, NoteComponentProps } from '../../notes-utils'
import type { ImageNoteData } from './types'
import { Show, createMemo, createSignal } from 'solid-js'

import { Dialog } from '../../utils/Dialog'
import { Controller } from '../../note-components/Controller'
import { noteBookState, setNoteBookState } from '../../../store'
import { ScanedImageEditor } from './components/ScanedImageEditor'
import { Controller } from '../../note-components/Controller'
import { Dialog } from '../../utils/Dialog'
import Player from './components/Player'
import { ScanedImageEditor } from './components/ScanedImageEditor'

export const ImageNote = ((props) => {
const [getIsActive, setIsActive] = createSignal(false)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createEffect, onMount, onCleanup, createSignal, Show } from 'solid-js'
import { Show, createEffect, createSignal, onCleanup, onMount } from 'solid-js'
import Sheet, { type Sheets } from './Sheet'

import { Dialog } from '../../../utils/Dialog'
import { icon } from '../../../../../../utils/icons'
import { Dialog } from '../../../utils/Dialog'

export interface Props {
scanedImage?: Blob | undefined
Expand Down
Loading

0 comments on commit f37c864

Please sign in to comment.