Skip to content

Commit

Permalink
Fix module import path issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dispatchrabbi committed Mar 12, 2024
1 parent f61480a commit 29055c1
Show file tree
Hide file tree
Showing 19 changed files with 47 additions and 67 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/chart/LineChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { computed, toValue, defineProps } from 'vue';
import { Line } from 'vue-chartjs';
import { Chart as ChartJS, Title, Tooltip, Legend, LineController, LineElement, PointElement, CategoryScale, LinearScale } from 'chart.js';
import type { ChartData, ChartOptions } from 'chart.js';
import { provideLineChartDataDefaults, provideLineChartOptionsDefaults } from './line-chart-defaults';
import { provideLineChartDataDefaults, provideLineChartOptionsDefaults } from './line-chart-defaults.ts';
export type LineChartOptions = ChartOptions<'line'>;
export type LineChartData = ChartData<'line'>;
Expand Down
2 changes: 1 addition & 1 deletion src/components/chart/calendar-matrix-chart-defaults.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MatrixChartOptions, MatrixChartData } from './CalendarMatrixChart.vue';

import twColors from 'tailwindcss/colors';
import twColors from 'tailwindcss/colors.js';
import themeColors from 'src/themes/primevue.ts';
import Color from 'color';
import { usePreferredColorScheme } from '@vueuse/core';
Expand Down
2 changes: 1 addition & 1 deletion src/components/chart/line-chart-defaults.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LineChartOptions, LineChartData } from './LineChart.vue';

import twColors from 'tailwindcss/colors';
import twColors from 'tailwindcss/colors.js';
import themeColors from 'src/themes/primevue.ts';

import { deepMergeWithDefaults } from 'src/lib/obj.ts';
Expand Down
6 changes: 3 additions & 3 deletions src/components/dashboard/StreakChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { getISODay, addDays } from 'date-fns';
import { parseDateString, formatDate } from 'src/lib/date.ts';
import Color from 'color';
import twColors from 'tailwindcss/colors';
import { DEFAULT_MATRIX_COLORS } from '../chart/calendar-matrix-chart-defaults';
import twColors from 'tailwindcss/colors.js';
import { DEFAULT_MATRIX_COLORS } from '../chart/calendar-matrix-chart-defaults.ts';
import { usePreferredColorScheme } from '@vueuse/core';
const colorScheme = usePreferredColorScheme();
import { normalizeTallies, densifyTallies, listEachDayOfData } from '../chart/chart-functions';
import { normalizeTallies, densifyTallies, listEachDayOfData } from '../chart/chart-functions.ts';
import CalendarMatrixChart from '../chart/CalendarMatrixChart.vue';
import { MatrixChartData } from '../chart/CalendarMatrixChart.vue';
Expand Down
2 changes: 1 addition & 1 deletion src/components/dashboard/StreakCounter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { computed, defineProps } from 'vue';
import type { Tally } from 'src/lib/api/tally.ts';
import { getStreakInfo } from 'src/lib/streak';
import { getStreakInfo } from 'src/lib/streak.ts';
import Card from 'primevue/card';
import { PrimeIcons } from 'primevue/api';
Expand Down
6 changes: 3 additions & 3 deletions src/components/tag/CreateTagForm.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script setup lang="ts">
import { ref, reactive, computed, defineEmits } from 'vue';
import wait from 'src/lib/wait.ts';
import { toTitleCase } from 'src/lib/str';
import { toTitleCase } from 'src/lib/str.ts';
import { z } from 'zod';
import { NonEmptyArray } from 'server/lib/validators.ts';
import { useValidation } from 'src/lib/form.ts';
import { createTag, TagPayload } from 'src/lib/api/tag';
import { TAG_COLORS, TAG_DEFAULT_COLOR } from 'server/lib/entities/tag';
import { createTag, TagPayload } from 'src/lib/api/tag.ts';
import { TAG_COLORS, TAG_DEFAULT_COLOR } from 'server/lib/entities/tag.ts';
import { TAG_COLOR_CLASSES } from 'src/components/tag/tag-color-classes.ts';
import IconField from 'primevue/iconfield';
Expand Down
6 changes: 3 additions & 3 deletions src/components/tag/EditTagForm.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script setup lang="ts">
import { ref, reactive, computed, defineProps, defineEmits } from 'vue';
import wait from 'src/lib/wait.ts';
import { toTitleCase } from 'src/lib/str';
import { toTitleCase } from 'src/lib/str.ts';
import { z } from 'zod';
import { NonEmptyArray } from 'server/lib/validators.ts';
import { useValidation } from 'src/lib/form.ts';
import { updateTag, Tag, TagPayload } from 'src/lib/api/tag';
import { TAG_COLORS } from 'server/lib/entities/tag';
import { updateTag, Tag, TagPayload } from 'src/lib/api/tag.ts';
import { TAG_COLORS } from 'server/lib/entities/tag.ts';
import { TAG_COLOR_CLASSES } from 'src/components/tag/tag-color-classes.ts';
import IconField from 'primevue/iconfield';
Expand Down
2 changes: 1 addition & 1 deletion src/components/tag/TbTag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { computed, defineProps } from 'vue';
import { Tag } from 'src/lib/api/tag.ts';
import { TAG_COLORS, TAG_DEFAULT_COLOR } from 'server/lib/entities/tag';
import { TAG_COLORS, TAG_DEFAULT_COLOR } from 'server/lib/entities/tag.ts';
import { TAG_COLOR_CLASSES } from 'src/components/tag/tag-color-classes.ts';
import Chip from 'primevue/chip';
Expand Down
12 changes: 5 additions & 7 deletions src/components/tally/TallyForm.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script setup lang="ts">
import { ref, reactive, computed, watch, defineEmits } from 'vue';
import { useEventBus } from 'src/lib/use-event-bus';
const eventBus = useEventBus();
import { useEventBus } from '@vueuse/core';
import { useWorkStore } from 'src/stores/work.ts';
const workStore = useWorkStore();
Expand All @@ -17,8 +15,8 @@ import { NonEmptyArray } from 'server/lib/validators.ts';
import { formatDateSafe } from 'src/lib/date.ts';
import { useValidation } from 'src/lib/form.ts';
import { TallyPayload } from 'server/api/v1/tally';
import { createTally } from 'src/lib/api/tally';
import { TallyPayload } from 'server/api/v1/tally.ts';
import { createTally, Tally } from 'src/lib/api/tally.ts';
import { TALLY_MEASURE } from 'server/lib/entities/tally.ts';
import { TALLY_MEASURE_INFO } from 'src/lib/tally.ts';
Expand Down Expand Up @@ -104,8 +102,8 @@ async function handleSubmit() {
const data = formData();
const createdTally = await createTally(data as TallyPayload);
eventBus.emit('tally:create', { tally: createdTally });
emit('tally:create', { tally: createdTally });
const tallyEventBus = useEventBus<{ tally: Tally }>('tally:create');
tallyEventBus.emit({ tally: createdTally });
successMessage.value = `Progress logged!`;
// clear out the form
Expand Down
4 changes: 2 additions & 2 deletions src/components/work/CreateWorkForm.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script setup lang="ts">
import { ref, reactive, computed, defineEmits } from 'vue';
import wait from 'src/lib/wait.ts';
import { toTitleCase } from 'src/lib/str';
import { toTitleCase } from 'src/lib/str.ts';
import { z } from 'zod';
import { NonEmptyArray } from 'server/lib/validators.ts';
import { useValidation } from 'src/lib/form.ts';
import { createWork, WorkPayload } from 'src/lib/api/work.ts';
import { WORK_PHASE } from 'server/lib/entities/work';
import { WORK_PHASE } from 'server/lib/entities/work.ts';
import InputText from 'primevue/inputtext';
import Dropdown from 'primevue/dropdown';
Expand Down
4 changes: 2 additions & 2 deletions src/components/work/EditWorkForm.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script setup lang="ts">
import { ref, reactive, computed, defineProps, defineEmits } from 'vue';
import wait from 'src/lib/wait.ts';
import { toTitleCase } from 'src/lib/str';
import { toTitleCase } from 'src/lib/str.ts';
import { z } from 'zod';
import { NonEmptyArray } from 'server/lib/validators.ts';
import { useValidation } from 'src/lib/form.ts';
import { updateWork, Work, WorkPayload } from 'src/lib/api/work.ts';
import { WORK_PHASE } from 'server/lib/entities/work';
import { WORK_PHASE } from 'server/lib/entities/work.ts';
import InputText from 'primevue/inputtext';
import Dropdown from 'primevue/dropdown';
Expand Down
4 changes: 2 additions & 2 deletions src/components/work/WorkTallyLineChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { formatCount } from 'src/lib/tally.ts';
import { toTitleCase } from 'src/lib/str.ts';
import { TALLY_MEASURE_INFO } from 'src/lib/tally.ts';
import { normalizeTallies, accumulateTallies, listEachDayOfData } from '../chart/chart-functions';
import { normalizeTallies, accumulateTallies, listEachDayOfData } from '../chart/chart-functions.ts';
import TabView from 'primevue/tabview';
import TabPanel from 'primevue/tabpanel';
import LineChart from 'src/components/chart/LineChart.vue';
import type { LineChartOptions } from 'src/components/chart/LineChart.vue';
import { TALLY_MEASURE } from 'server/lib/entities/tally';
import { TALLY_MEASURE } from 'server/lib/entities/tally.ts';
const props = defineProps<{
work: Work;
Expand Down
2 changes: 1 addition & 1 deletion src/components/work/WorkTallyStreakChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { Tag } from 'src/lib/api/tag.ts';
import { getISODay, addDays } from 'date-fns';
import { parseDateString, formatDate } from 'src/lib/date.ts';
import { normalizeTallies, densifyTallies, listEachDayOfData } from '../chart/chart-functions';
import { normalizeTallies, densifyTallies, listEachDayOfData } from '../chart/chart-functions.ts';
import CalendarMatrixChart from '../chart/CalendarMatrixChart.vue';
import { MatrixChartData } from '../chart/CalendarMatrixChart.vue';
Expand Down
4 changes: 2 additions & 2 deletions src/components/work/WorkTile.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { defineProps } from 'vue';
import type { WorkWithTotals } from 'src/lib/api/work.ts';
import { WORK_PHASE } from 'server/lib/entities/work';
import { TALLY_MEASURE_INFO } from 'src/lib/tally';
import { WORK_PHASE } from 'server/lib/entities/work.ts';
import { TALLY_MEASURE_INFO } from 'src/lib/tally.ts';
const props = defineProps<{
work: WorkWithTotals;
Expand Down
25 changes: 0 additions & 25 deletions src/lib/use-event-bus.ts

This file was deleted.

9 changes: 5 additions & 4 deletions src/pages/works/WorkDetailPage.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<script setup lang="ts">
import { ref, computed, watch } from 'vue';
import { useEventBus } from '@vueuse/core';
import { useRoute, useRouter } from 'vue-router';
const route = useRoute();
const router = useRouter();
import { useWorkStore } from 'src/stores/work';
import { useWorkStore } from 'src/stores/work.ts';
const workStore = useWorkStore();
import { getWork, WorkWithTallies } from 'src/lib/api/work.ts';
import { Tally } from 'src/lib/api/tally.ts';
import { PrimeIcons } from 'primevue/api';
import ApplicationLayout from 'src/layouts/ApplicationLayout.vue';
Expand Down Expand Up @@ -65,9 +67,8 @@ const reloadWorks = async function() {
loadWork();
}
import { useEventBus } from 'src/lib/use-event-bus';
const eventBus = useEventBus();
eventBus.on('tally:create', reloadWorks);
const tallyEventBus = useEventBus<{ tally: Tally }>('tally:create');
tallyEventBus.on(reloadWorks);
loadWork();
Expand Down
2 changes: 1 addition & 1 deletion src/pages/works/WorksListPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { ref } from 'vue';
import { RouterLink } from 'vue-router';
import { useWorkStore } from 'src/stores/work';
import { useWorkStore } from 'src/stores/work.ts';
const workStore = useWorkStore();
import { getWorks, WorkWithTotals } from 'src/lib/api/work.ts';
Expand Down
16 changes: 11 additions & 5 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import path from 'path';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
// import { visualizer } from 'rollup-plugin-visualizer';
import { visualizer } from 'rollup-plugin-visualizer';

const CHUNKS_MAP = {
'chart.js': 'node_modules/chart.js',
'vuestic-ui': 'node_modules/vuestic-ui',
'primevue': 'node_modules/primevue',
'themes': 'src/themes',
};

// https://vitejs.dev/config/
export default defineConfig({
Expand All @@ -11,14 +18,13 @@ export default defineConfig({
"server": path.resolve(__dirname, "./server"),
},
},
plugins: [ vue()/*, visualizer()*/ ],
plugins: [ vue(), visualizer() ],
build: {
outDir: 'dist',
rollupOptions: {
output: {
manualChunks: {
chartjs: ['chart.js'],
vuestic: ['vuestic-ui'],
manualChunks: function(id) {
return Object.keys(CHUNKS_MAP).find(chunk => id.includes(CHUNKS_MAP[chunk]));
},
},
},
Expand Down

0 comments on commit 29055c1

Please sign in to comment.