Skip to content

Commit

Permalink
- Updated dependencies (#448)
Browse files Browse the repository at this point in the history
- moved common utilities to '#shared' folder
  • Loading branch information
mlhaufe authored Nov 5, 2024
1 parent eaf1875 commit 8695997
Show file tree
Hide file tree
Showing 41 changed files with 1,912 additions and 2,351 deletions.
2 changes: 2 additions & 0 deletions components/TopNavigation.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script lang="ts" setup>
import deSlugify from '#shared/deSlugify.js';
const { data, signIn, signOut } = useAuth(),
router = useRouter()
Expand Down
2 changes: 1 addition & 1 deletion components/XDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type Dialog from 'primevue/dialog'
import type DataTable from 'primevue/datatable'
import { FilterMatchMode } from 'primevue/api';
import camelCaseToTitle from '~/utils/camelCaseToTitle.js';
import camelCaseToTitle from '#shared/camelCaseToTitle.js';
export type ViewFieldType = 'text' | 'textarea' | 'number' | 'date' | 'boolean' | 'hidden' | 'object'
Expand Down
2 changes: 1 addition & 1 deletion domain/requirements/Organization.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Entity, Property } from "@mikro-orm/core";
import slugify from "../../utils/slugify.js";
import slugify from "../../shared/slugify.js";
import { Requirement } from "./Requirement.js";
import { type Properties } from "../types/index.js";
import { ReqType } from "./ReqType.js";
Expand Down
2 changes: 1 addition & 1 deletion domain/requirements/Solution.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Entity, Property } from '@mikro-orm/core';
import { type Properties } from '../types/index.js';
import slugify from '../../utils/slugify.js';
import slugify from '../../shared/slugify.js';
import { Requirement } from './Requirement.js';
import { ReqType } from './ReqType.js';

Expand Down
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2024-07-22',
compatibilityDate: '2024-11-05',
devtools: {
enabled: process.env.NODE_ENV === 'development'
},
Expand Down
4,200 changes: 1,870 additions & 2,330 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@
},
"dependencies": {
"@azure/monitor-opentelemetry": "^1.8.0",
"@azure/openai": "^2.0.0-beta.2",
"@azure/openai": "^2.0.0-beta.3",
"@mikro-orm/core": "^6.3.13",
"@mikro-orm/postgresql": "^6.3.13",
"@mikro-orm/reflection": "^6.3.13",
"@mikro-orm/seeder": "^6.3.13",
"@sidebase/nuxt-auth": "^0.9.4",
"@slack/web-api": "^7.7.0",
"@vite-pwa/nuxt": "^0.10.5",
"mermaid": "^11.3.0",
"@vite-pwa/nuxt": "^0.10.6",
"mermaid": "^11.4.0",
"mitt": "^3.0.1",
"nuxt": "^3.13.2",
"nuxt": "^3.14.0",
"nuxt-primevue": "^3.0.0",
"nuxt-security": "^2.0.0",
"openai": "^4.68.4",
"openai": "^4.71.0",
"pg": "^8.13.1",
"primeflex": "^3.3.1",
"primeicons": "^7.0.0",
Expand All @@ -64,17 +64,17 @@
"@mikro-orm/migrations": "^6.3.13",
"@nuxt/devtools": "^1.6.0",
"@nuxt/test-utils": "^3.14.4",
"@types/node": "^22.8.1",
"@types/node": "^22.9.0",
"@types/pg": "^8.11.10",
"@types/uuid": "^10.0.0",
"@vite-pwa/assets-generator": "^0.2.6",
"@vue/test-utils": "^2.4.6",
"happy-dom": "^15.7.4",
"happy-dom": "^15.9.0",
"playwright-core": "^1.48.2",
"ts-node": "^10.9.2",
"tsx": "^4.19.2",
"typescript": "^5.6.3",
"vitest": "^2.1.4",
"vue-tsc": "^2.1.8"
"vue-tsc": "^2.1.10"
}
}
}
2 changes: 2 additions & 0 deletions pages/new-organization.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script lang="ts" setup>
import slugify from '#shared/slugify.js';
useHead({ title: 'New Organization' })
definePageMeta({ name: 'New Organization' })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script lang="ts" setup>
import slugify from '#shared/slugify.js';
useHead({ title: 'Edit Solution' })
definePageMeta({ name: 'Edit Solution' })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script lang="ts" setup>
import debounce from '#shared/debounce';
type OutcomeViewModel = {
id: string;
reqId: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script lang="ts" setup>
import debounce from '#shared/debounce';
type ObstacleViewModel = {
id: string;
reqId: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts" setup>
import snakeCaseToTitle from '~/utils/snakeCaseToTitle.js';
import camelCaseToTitle from '~/utils/camelCaseToTitle.js';
import snakeCaseToTitle from '#shared/snakeCaseToTitle.js';
import camelCaseToTitle from '#shared/camelCaseToTitle.js';
import snakeCaseToSlug from '#shared/snakeCaseToSlug.js';
import type { DataTableRowExpandEvent, DataTableRowCollapseEvent, DataTableExpandedRows } from 'primevue/datatable';
import type { ReqType } from '~/domain/requirements/ReqType.js';
Expand Down
2 changes: 2 additions & 0 deletions pages/o/[organization-slug]/edit-entry.client.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script lang="ts" setup>
import slugify from '#shared/slugify.js';
useHead({ title: 'Edit Organization' })
definePageMeta({ name: 'Edit Organization' })
Expand Down
2 changes: 2 additions & 0 deletions pages/o/[organization-slug]/new-solution.client.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script lang="ts" setup>
import slugify from '#shared/slugify.js';
useHead({ title: 'New Solution' })
definePageMeta({ name: 'New Solution' })
Expand Down
2 changes: 1 addition & 1 deletion server/api/organization/[id].put.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { z } from "zod"
import { fork } from "~/server/data/orm.js"
import slugify from "~/utils/slugify.js"
import slugify from "~/shared/slugify.js"

const paramSchema = z.object({
id: z.string().uuid()
Expand Down
2 changes: 1 addition & 1 deletion server/api/organization/index.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { fork } from "~/server/data/orm.js"
import { AppRole, AppUserOrganizationRole, AppUser } from "~/domain/application/index.js"
import { Organization } from "~/domain/requirements/index.js"
import { getServerSession } from '#auth'
import slugify from "~/utils/slugify"
import slugify from "~/shared/slugify"

const bodySchema = z.object({
name: z.string().default("{Untitled Organization}"),
Expand Down
1 change: 1 addition & 0 deletions server/api/parse-requirement/follows.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { z } from "zod"
import { fork } from "~/server/data/orm.js"
import { ParsedRequirement, Requirement } from "~/domain/requirements/index.js"
import { Follows } from "~/domain/relations/index.js"
import groupBy from "#shared/groupBy.js"

const querySchema = z.object({
solutionId: z.string().uuid(),
Expand Down
2 changes: 2 additions & 0 deletions server/api/parse-requirement/index.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {
} from "~/domain/requirements/index.js";
import { Belongs } from "~/domain/relations/Belongs.js";
import { Follows } from "~/domain/relations/Follows.js";
import groupBy from "#shared/groupBy.js";
import dedent from '#shared/dedent.js'

const bodySchema = z.object({
solutionId: z.string().uuid(),
Expand Down
2 changes: 1 addition & 1 deletion server/api/solution/index.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { z } from "zod"
import { fork } from "~/server/data/orm.js"
import { Obstacle, Solution, Outcome } from "~/domain/requirements/index.js"
import { Belongs } from "~/domain/relations"
import slugify from "~/utils/slugify"
import slugify from "~/shared/slugify"

const bodySchema = z.object({
name: z.string().min(1).max(100),
Expand Down
1 change: 1 addition & 0 deletions server/data/llm-zod-schemas/FunctionalBehaviorSchema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { z } from "zod";
import dedent from "#shared/dedent";

export default z.object({
type: z.literal('FunctionalBehavior'),
Expand Down
1 change: 1 addition & 0 deletions server/data/llm-zod-schemas/NonFunctionalBehaviorSchema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { z } from "zod";
import dedent from "#shared/dedent";

export default z.object({
type: z.literal('NonFunctionalBehavior'),
Expand Down
1 change: 1 addition & 0 deletions server/data/llm-zod-schemas/UseCaseSchema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { z } from "zod";
import dedent from "#shared/dedent";

export default z.object({
type: z.literal('UseCase'),
Expand Down
1 change: 1 addition & 0 deletions server/data/llm-zod-schemas/UserStorySchema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { z } from "zod";
import dedent from "#shared/dedent";

export default z.object({
type: z.literal('UserStory'),
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion utils/camelCaseToSlug.ts → shared/camelCaseToSlug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* @example
* camelCaseToSlug('camelCase') // 'camel-case'
*/

export default (input: string): string =>
input.trim() // Remove leading and trailing whitespace
.replace(/[^a-zA-Z0-9]+/g, '-') // Replace non-alphanumeric characters with hyphens
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion server/utils/groupBy.test.ts → shared/groupBy.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import { groupBy } from './groupBy';
import groupBy from '#shared/groupBy';

describe('groupBy', () => {
it('should group items by a string key', () => {
Expand Down
2 changes: 1 addition & 1 deletion server/utils/groupBy.ts → shared/groupBy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The server is currently Node 20 which does not support Object.groupBy.
// See: https://github.com/final-hill/cathedral/issues/371
export const groupBy = function <K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>> {
export default function <K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>> {
return [...items].reduce((acc, item, index) => {
const key = keySelector(item, index),
group = (acc as any)[key as any] ?? ((acc as any)[key as any] = [])
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 8695997

Please sign in to comment.