fix
This commit is contained in:
@@ -22,6 +22,7 @@ COPY package.json bun.lock ./
|
|||||||
RUN bun install --frozen-lockfile --production
|
RUN bun install --frozen-lockfile --production
|
||||||
|
|
||||||
COPY server/ ./server/
|
COPY server/ ./server/
|
||||||
|
COPY shared/ ./shared/
|
||||||
COPY --from=builder /app/dist ./dist/
|
COPY --from=builder /app/dist ./dist/
|
||||||
|
|
||||||
RUN mkdir -p data
|
RUN mkdir -p data
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { existsSync, rmSync } from 'node:fs'
|
|||||||
import { tmpdir } from 'node:os'
|
import { tmpdir } from 'node:os'
|
||||||
import { join } from 'node:path'
|
import { join } from 'node:path'
|
||||||
import { afterEach, describe, expect, it, setSystemTime } from 'bun:test'
|
import { afterEach, describe, expect, it, setSystemTime } from 'bun:test'
|
||||||
import { createEmptyBook, createEmptyTeachingDesign } from '../src/domain/teachingDesign'
|
import { createEmptyBook, createEmptyTeachingDesign } from '../shared/domain/teachingDesign'
|
||||||
import {
|
import {
|
||||||
createBook, deleteBook, getBook, listBooks, openDb, renameBook, saveBookData,
|
createBook, deleteBook, getBook, listBooks, openDb, renameBook, saveBookData,
|
||||||
createUser, findUserByUsername, findUserById, listUsers, deleteUser, updateUserPasswordHash,
|
createUser, findUserByUsername, findUserById, listUsers, deleteUser, updateUserPasswordHash,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Database } from 'bun:sqlite'
|
import { Database } from 'bun:sqlite'
|
||||||
import { createEmptyBook, type TeachingBook } from '../src/domain/teachingDesign'
|
import { createEmptyBook, type TeachingBook } from '../shared/domain/teachingDesign'
|
||||||
|
|
||||||
export interface BookSummary {
|
export interface BookSummary {
|
||||||
id: string
|
id: string
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { beforeEach, describe, expect, it } from 'bun:test'
|
import { beforeEach, describe, expect, it } from 'bun:test'
|
||||||
import type { Database } from 'bun:sqlite'
|
import type { Database } from 'bun:sqlite'
|
||||||
import { Hono } from 'hono'
|
import { Hono } from 'hono'
|
||||||
import { createEmptyBook, createEmptyTeachingDesign } from '../../src/domain/teachingDesign'
|
import { createEmptyBook, createEmptyTeachingDesign } from '../../shared/domain/teachingDesign'
|
||||||
import { openDb } from '../db'
|
import { openDb } from '../db'
|
||||||
import { createBooksRouter } from './books'
|
import { createBooksRouter } from './books'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { Database } from 'bun:sqlite'
|
import type { Database } from 'bun:sqlite'
|
||||||
import { Hono } from 'hono'
|
import { Hono } from 'hono'
|
||||||
import type { TeachingBook } from '../../src/domain/teachingDesign'
|
import type { TeachingBook } from '../../shared/domain/teachingDesign'
|
||||||
import { createBook, deleteBook, getBook, listBooks, renameBook, saveBookData } from '../db'
|
import { createBook, deleteBook, getBook, listBooks, renameBook, saveBookData } from '../db'
|
||||||
|
|
||||||
export function createBooksRouter(db: Database): Hono {
|
export function createBooksRouter(db: Database): Hono {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { flushPromises, mount } from '@vue/test-utils'
|
|||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import { createEmptyBook } from './domain/teachingDesign'
|
import { createEmptyBook } from '../shared/domain/teachingDesign'
|
||||||
import * as booksApi from './services/booksApi'
|
import * as booksApi from './services/booksApi'
|
||||||
|
|
||||||
vi.mock('./services/booksApi')
|
vi.mock('./services/booksApi')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { createEmptyTeachingDesign } from '../domain/teachingDesign'
|
import { createEmptyTeachingDesign } from '../../shared/domain/teachingDesign'
|
||||||
import A4Workspace from './A4Workspace.vue'
|
import A4Workspace from './A4Workspace.vue'
|
||||||
|
|
||||||
describe('A4Workspace', () => {
|
describe('A4Workspace', () => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { flushPromises, mount } from '@vue/test-utils'
|
import { flushPromises, mount } from '@vue/test-utils'
|
||||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
import { createEmptyBook } from '../domain/teachingDesign'
|
import { createEmptyBook } from '../../shared/domain/teachingDesign'
|
||||||
import * as booksApi from '../services/booksApi'
|
import * as booksApi from '../services/booksApi'
|
||||||
import BookListPage from './BookListPage.vue'
|
import BookListPage from './BookListPage.vue'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { createEmptyTeachingDesign } from '../domain/teachingDesign'
|
import { createEmptyTeachingDesign } from '../../shared/domain/teachingDesign'
|
||||||
import LessonSidebar from './LessonSidebar.vue'
|
import LessonSidebar from './LessonSidebar.vue'
|
||||||
|
|
||||||
describe('LessonSidebar', () => {
|
describe('LessonSidebar', () => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { createEmptyTeachingDesign } from '../domain/teachingDesign'
|
import { createEmptyTeachingDesign } from '../../shared/domain/teachingDesign'
|
||||||
import PrintBook from './PrintBook.vue'
|
import PrintBook from './PrintBook.vue'
|
||||||
|
|
||||||
describe('PrintBook', () => {
|
describe('PrintBook', () => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { createEmptyTeachingDesign, type TeachingDesign } from '../domain/teachingDesign'
|
import { createEmptyTeachingDesign, type TeachingDesign } from '../../shared/domain/teachingDesign'
|
||||||
import TeachingDesignPage from './TeachingDesignPage.vue'
|
import TeachingDesignPage from './TeachingDesignPage.vue'
|
||||||
|
|
||||||
describe('TeachingDesignPage', () => {
|
describe('TeachingDesignPage', () => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { flushPromises, mount } from '@vue/test-utils'
|
import { flushPromises, mount } from '@vue/test-utils'
|
||||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
import { createEmptyBook, createEmptyTeachingDesign } from '../domain/teachingDesign'
|
import { createEmptyBook, createEmptyTeachingDesign } from '../../shared/domain/teachingDesign'
|
||||||
import * as booksApi from '../services/booksApi'
|
import * as booksApi from '../services/booksApi'
|
||||||
import * as zipExporter from '../services/zipExporter'
|
import * as zipExporter from '../services/zipExporter'
|
||||||
import BatchGenerateDialog from './BatchGenerateDialog.vue'
|
import BatchGenerateDialog from './BatchGenerateDialog.vue'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { flushPromises } from '@vue/test-utils'
|
import { flushPromises } from '@vue/test-utils'
|
||||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
import { createEmptyBook, createEmptyTeachingDesign, type TeachingBook } from '../domain/teachingDesign'
|
import { createEmptyBook, createEmptyTeachingDesign, type TeachingBook } from '../../shared/domain/teachingDesign'
|
||||||
import * as booksApi from '../services/booksApi'
|
import * as booksApi from '../services/booksApi'
|
||||||
import { useTeachingBook } from './useTeachingBook'
|
import { useTeachingBook } from './useTeachingBook'
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
type DesignId,
|
type DesignId,
|
||||||
type TeachingBook,
|
type TeachingBook,
|
||||||
type TeachingDesign,
|
type TeachingDesign,
|
||||||
} from '../domain/teachingDesign'
|
} from '../../shared/domain/teachingDesign'
|
||||||
import * as booksApi from '../services/booksApi'
|
import * as booksApi from '../services/booksApi'
|
||||||
import { parseTeachingDesign } from '../services/markdownParser'
|
import { parseTeachingDesign } from '../services/markdownParser'
|
||||||
import { sortFilesNaturally } from '../services/naturalSort'
|
import { sortFilesNaturally } from '../services/naturalSort'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
import { createEmptyBook } from '../domain/teachingDesign'
|
import { createEmptyBook } from '../../shared/domain/teachingDesign'
|
||||||
import * as booksApi from './booksApi'
|
import * as booksApi from './booksApi'
|
||||||
|
|
||||||
describe('booksApi', () => {
|
describe('booksApi', () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { TeachingBook } from '../domain/teachingDesign'
|
import type { TeachingBook } from '../../shared/domain/teachingDesign'
|
||||||
import { authedFetch } from '../composables/useAuth'
|
import { authedFetch } from '../composables/useAuth'
|
||||||
|
|
||||||
export interface BookSummary {
|
export interface BookSummary {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
type ParseWarning,
|
type ParseWarning,
|
||||||
type TeachingDesign,
|
type TeachingDesign,
|
||||||
type TeachingStep,
|
type TeachingStep,
|
||||||
} from '../domain/teachingDesign'
|
} from '../../shared/domain/teachingDesign'
|
||||||
import { extractMarkdownTable } from './markdownTable'
|
import { extractMarkdownTable } from './markdownTable'
|
||||||
|
|
||||||
const BR = /<br\s*\/?>/gi
|
const BR = /<br\s*\/?>/gi
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { TeachingDesign } from '../domain/teachingDesign'
|
import type { TeachingDesign } from '../../shared/domain/teachingDesign'
|
||||||
|
|
||||||
function escapeCell(value: string): string {
|
function escapeCell(value: string): string {
|
||||||
return value
|
return value
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import JSZip from 'jszip'
|
import JSZip from 'jszip'
|
||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { createEmptyTeachingDesign } from '../domain/teachingDesign'
|
import { createEmptyTeachingDesign } from '../../shared/domain/teachingDesign'
|
||||||
import { createBookZip } from './zipExporter'
|
import { createBookZip } from './zipExporter'
|
||||||
|
|
||||||
describe('createBookZip', () => {
|
describe('createBookZip', () => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import JSZip from 'jszip'
|
import JSZip from 'jszip'
|
||||||
import type { TeachingDesign } from '../domain/teachingDesign'
|
import type { TeachingDesign } from '../../shared/domain/teachingDesign'
|
||||||
import { writeTeachingDesignMarkdown } from './markdownWriter'
|
import { writeTeachingDesignMarkdown } from './markdownWriter'
|
||||||
|
|
||||||
export async function createBookZip(designs: readonly TeachingDesign[]): Promise<Blob> {
|
export async function createBookZip(designs: readonly TeachingDesign[]): Promise<Blob> {
|
||||||
|
|||||||
Reference in New Issue
Block a user