Skip to content

Commit

Permalink
chore: fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nknapp committed May 29, 2024
1 parent e3b82a6 commit e44a278
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 338 deletions.
335 changes: 34 additions & 301 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion packages/@dom-preview/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"typescript-eslint": "7.10.0",
"vite": "^5.2.11",
"vite-bundle-visualizer": "1.2.1",
"vite-plugin-static-copy": "1.0.5",
"vue": "3.4.27",
"vue-tsc": "^2.0.19",
"whatwg-fetch": "3.6.20"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script setup lang="ts">
import "@shoelace-style/shoelace/dist/components/tree-item/tree-item.js";
import { DomPreview } from "@/model/DomPreview";
import {computed, watchEffect, watchSyncEffect} from "vue";
import { computed } from "vue";
import { cls } from "@/utils/cls.ts";
import { useUnmountSignal } from "@/composables/useUnmountSignal.ts";
import { useRelativeTime } from "@/composables/useRelativeTime.ts";
Expand All @@ -13,7 +11,6 @@ const props = defineProps<{
selected: boolean;
}>();
const emit = defineEmits<{
(name: "click", event: MouseEvent): void;
}>();
Expand All @@ -40,11 +37,6 @@ const dateTime = computed(() => {
const label = computed(() => {
return props.preview.alias ?? `Preview ${props.index + 1}`;
});
watchSyncEffect(() => {
console.log("selected", label.value, props.selected)
})
</script>

<template>
Expand Down
25 changes: 14 additions & 11 deletions packages/@dom-preview/ui/src/components/PreviewList/PreviewList.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
<template>
<ul role="tree">
<li :key="key" v-for="(previews, key) in domPreviews" class="text-white" role="none">
<div role='treeitem'
<li
:key="key"
v-for="(previews, key) in domPreviews"
class="text-white"
role="none"
>
<div
role="treeitem"
class="text-xs text-slate-300 bg-neutral-700 px-8 py-2 flex justify-between gap-2 items-top"
>
<div>{{ key }}</div>
<div>
<div class="rounded-full bg-neutral-200 text-black px-2" data-testid="previewlist-counter">
<div
class="rounded-full bg-neutral-200 text-black px-2"
data-testid="previewlist-counter"
>
{{ previews.length }}
</div>
</div>
Expand All @@ -28,25 +37,19 @@
<script setup lang="ts">
import { domPreviews } from "@/store/domPreviews.ts";
import "@shoelace-style/shoelace/dist/components/tree/tree.js";
import "@shoelace-style/shoelace/dist/components/tree-item/tree-item.js";
import "@shoelace-style/shoelace/dist/components/badge/badge.js";
import PreviewItem from "@/components/PreviewList/PreviewItem.vue";
import {DomPreview} from "@/model/DomPreview.ts";
import { DomPreview } from "@/model/DomPreview.ts";
export interface PreviewListProps {
modelValue: string | null;
}
const props = defineProps<PreviewListProps>();
function select(preview: DomPreview) {
console.log("selecting", preview.id)
emit('update:modelValue', preview.id)
emit("update:modelValue", preview.id);
}
const emit = defineEmits<{
(event: "update:modelValue", value: string | null): void;
}>();
</script>
3 changes: 0 additions & 3 deletions packages/@dom-preview/ui/src/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import "@testing-library/jest-dom/vitest";
import "eventsource/lib/eventsource-polyfill";
import { setBasePath } from "@shoelace-style/shoelace";
import { clearPreviewStore } from "./store/domPreviews.ts";
import buffer from "node:buffer";
import { mockObjectUrl } from "@/test-utils/mockObjectUrl.ts";
Expand All @@ -18,5 +17,3 @@ beforeEach(() => {
});

mockObjectUrl();

setBasePath("./node_modules/@shoelace-style/shoelace/cdn/");
9 changes: 0 additions & 9 deletions packages/@dom-preview/ui/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
/// <reference types="vitest/config" />
import { defineConfig } from "vite";
import { viteStaticCopy } from "vite-plugin-static-copy";
import vue from "@vitejs/plugin-vue";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
viteStaticCopy({
targets: [
{
src: "./node_modules/shoelace-style/shoelace/cdn",
dest: "./public/shoelace",
},
],
}),
vue({
template: {
compilerOptions: {
Expand Down
5 changes: 1 addition & 4 deletions playground/counter.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createCounter } from "./counter.js";
import { userEvent } from "@testing-library/user-event";
import { debug, showDomPreviewErrors } from "dom-preview";
import { debug } from "dom-preview";
import { screen } from "@testing-library/dom";

describe("counter", () => {
Expand All @@ -9,9 +9,6 @@ describe("counter", () => {
document.body.innerHTML = "";
user = userEvent.setup();
});
afterEach(() => {
showDomPreviewErrors();
});

it("adds 1 for each click", async () => {
const counter = createCounter();
Expand Down

0 comments on commit e44a278

Please sign in to comment.