ref: put components into shared "@core" package
This commit is contained in:
parent
3830df1eec
commit
734bce13f6
@ -2,7 +2,7 @@
|
|||||||
import { processImage } from '@core/graphics';
|
import { processImage } from '@core/graphics';
|
||||||
import blobToImageData from '@core/graphics/blob2imageData';
|
import blobToImageData from '@core/graphics/blob2imageData';
|
||||||
import imageDataToBlob from '@core/graphics/imageData2blob';
|
import imageDataToBlob from '@core/graphics/imageData2blob';
|
||||||
import localforage from '$lib/utils/storage';
|
import localforage from '@core/utils/storage';
|
||||||
export let coverId: string;
|
export let coverId: string;
|
||||||
let canvas: HTMLCanvasElement;
|
let canvas: HTMLCanvasElement;
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import formatDuration from "$lib/utils/formatDuration";
|
import formatDuration from "@core/utils/formatDuration";
|
||||||
import { formatViews } from "$lib/utils/formatViews";
|
import { formatViews } from "@core/utils/formatViews";
|
||||||
|
import { type MusicMetadata } from '@core/server/database/musicInfo';
|
||||||
|
|
||||||
export let songData: MusicMetadata;
|
export let songData: MusicMetadata;
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { useAtom } from 'jotai-svelte';
|
import { useAtom } from 'jotai-svelte';
|
||||||
import { fileListState, finalFileListState } from '$lib/state/fileList.state';
|
import { fileListState, finalFileListState } from '@core/state/fileList.state';
|
||||||
import toHumanSize from '$lib/utils/humanSize';
|
import toHumanSize from '@core/utils/humanSize';
|
||||||
import formatText from '$lib/utils/formatText';
|
import formatText from '@core/utils/formatText';
|
||||||
import extractFileName from '$lib/utils/extractFileName';
|
import extractFileName from '@core/utils/extractFileName';
|
||||||
import getAudioMeta from '$lib/utils/getAudioCoverURL';
|
import getAudioMeta from '@core/utils/getAudioCoverURL';
|
||||||
import convertCoverData from '$lib/utils/convertCoverData';
|
import convertCoverData from '@core/utils/convertCoverData';
|
||||||
import type { IAudioMetadata } from 'music-metadata-browser';
|
import type { IAudioMetadata } from 'music-metadata-browser';
|
||||||
import formatDuration from '$lib/utils/formatDuration';
|
import formatDuration from '@core/utils/formatDuration';
|
||||||
const items = useAtom(fileListState);
|
const items = useAtom(fileListState);
|
||||||
const finalItems = useAtom(finalFileListState);
|
const finalItems = useAtom(finalFileListState);
|
||||||
let displayItems: any[] = [];
|
let displayItems: any[] = [];
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
import ImportIcon from './importIcon.svelte';
|
import ImportIcon from './importIcon.svelte';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { useAtom } from 'jotai-svelte';
|
import { useAtom } from 'jotai-svelte';
|
||||||
import { fileListState } from '$lib/state/fileList.state';
|
import { fileListState } from '@core/state/fileList.state';
|
||||||
import AddIcon from './addIcon.svelte';
|
import AddIcon from './addIcon.svelte';
|
||||||
const fileItems = useAtom(fileListState);
|
const fileItems = useAtom(fileListState);
|
||||||
export let accept: string = ".aac, .mp3, .wav, .ogg, .flac";
|
export let accept: string = ".aac, .mp3, .wav, .ogg, .flac";
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import formatDuration from '$lib/utils/formatDuration';
|
import formatDuration from '../utils/formatDuration';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import userAdjustingProgress from '$lib/state/userAdjustingProgress';
|
import userAdjustingProgress from '../state/userAdjustingProgress';
|
||||||
import progressBarSlideValue from '$lib/state/progressBarSlideValue';
|
import progressBarSlideValue from '../state/progressBarSlideValue';
|
||||||
import truncate from '$lib/utils/truncate';
|
import truncate from '../utils/truncate';
|
||||||
|
|
||||||
export let name: string;
|
export let name: string;
|
||||||
export let singer: string = '';
|
export let singer: string = '';
|
||||||
|
6
packages/core/postcss.config.js
Normal file
6
packages/core/postcss.config.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export default {
|
||||||
|
plugins: {
|
||||||
|
tailwindcss: {},
|
||||||
|
autoprefixer: {},
|
||||||
|
},
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { globalMemoryStorage, songData, songNameCache } from '$lib/server/cache.js';
|
import { globalMemoryStorage, songData, songNameCache } from '@core/server/cache.js';
|
||||||
import { getDirectoryHash } from '../dirHash';
|
import { getDirectoryHash } from '../dirHash';
|
||||||
import { safePath } from '../safePath';
|
import { safePath } from '../safePath';
|
||||||
|
|
||||||
|
8
packages/core/tailwind.config.js
Normal file
8
packages/core/tailwind.config.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/** @type {import('tailwindcss').Config} */
|
||||||
|
export default {
|
||||||
|
content: ['./**/*.{html,js,svelte,ts}'],
|
||||||
|
theme: {
|
||||||
|
extend: {},
|
||||||
|
},
|
||||||
|
plugins: [],
|
||||||
|
}
|
18
packages/core/tsconfig.json
Normal file
18
packages/core/tsconfig.json
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"extends": ["../../tsconfig.base.json"],
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"@core/*": ["./*"]
|
||||||
|
},
|
||||||
|
"allowJs": true,
|
||||||
|
"checkJs": false,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"strict": true,
|
||||||
|
"types": ["bun"]
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import extractFileName from '$lib/utils/extractFileName';
|
import extractFileName from '@core/utils/extractFileName';
|
||||||
import getVersion from '$lib/utils/getVersion';
|
import getVersion from '@core/utils/getVersion';
|
||||||
import toHumanSize from '$lib/utils/humanSize';
|
import toHumanSize from '@core/utils/humanSize';
|
||||||
import localforage from '$lib/utils/storage';
|
import localforage from '@core/utils/storage';
|
||||||
interface Song {
|
interface Song {
|
||||||
name: string;
|
name: string;
|
||||||
singer?: string;
|
singer?: string;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getCurrentFormattedDateTime } from '$lib/utils/songUpdateTime';
|
import { getCurrentFormattedDateTime } from '@core/utils/songUpdateTime';
|
||||||
import type { MusicMetadata } from '@core/server/database/musicInfo';
|
import type { MusicMetadata } from '@core/server/database/musicInfo';
|
||||||
let templateSongData: MusicMetadata = {
|
let templateSongData: MusicMetadata = {
|
||||||
id: '',
|
id: '',
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import FileList from '@core/components/import/fileList.svelte';
|
import FileList from '@core/components/import/fileList.svelte';
|
||||||
import FileSelector from '@core/components/import/fileSelector.svelte';
|
import FileSelector from '@core/components/import/fileSelector.svelte';
|
||||||
import localforage from '$lib/utils/storage';
|
import localforage from '@core/utils/storage';
|
||||||
import { fileListState } from '$lib/state/fileList.state';
|
import { fileListState } from '@core/state/fileList.state';
|
||||||
import { useAtom } from 'jotai-svelte';
|
import { useAtom } from 'jotai-svelte';
|
||||||
const fileList = useAtom(fileListState);
|
const fileList = useAtom(fileListState);
|
||||||
const audioId = $page.params.id;
|
const audioId = $page.params.id;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<script>
|
<script>
|
||||||
import FileList from '@core/components/import/fileList.svelte';
|
import FileList from '@core/components/import/fileList.svelte';
|
||||||
import FileSelector from '@core/components/import/fileSelector.svelte';
|
import FileSelector from '@core/components/import/fileSelector.svelte';
|
||||||
import { fileListState, finalFileListState } from '$lib/state/fileList.state';
|
import { fileListState, finalFileListState } from '@core/state/fileList.state';
|
||||||
import { localImportFailed, localImportSuccess } from '$lib/state/localImportStatus.state';
|
import { localImportFailed, localImportSuccess } from '@core/state/localImportStatus.state';
|
||||||
import { useAtom } from 'jotai-svelte';
|
import { useAtom } from 'jotai-svelte';
|
||||||
import localforage from '$lib/utils/storage';
|
import localforage from '@core/utils/storage';
|
||||||
import { v1 as uuidv1 } from 'uuid';
|
import { v1 as uuidv1 } from 'uuid';
|
||||||
const fileList = useAtom(fileListState);
|
const fileList = useAtom(fileListState);
|
||||||
const finalFiles = useAtom(finalFileListState);
|
const finalFiles = useAtom(finalFileListState);
|
||||||
|
@ -4,15 +4,15 @@
|
|||||||
import Background from '@core/components/background.svelte';
|
import Background from '@core/components/background.svelte';
|
||||||
import Cover from '@core/components/cover.svelte';
|
import Cover from '@core/components/cover.svelte';
|
||||||
import InteractiveBox from '@core/components/interactiveBox.svelte';
|
import InteractiveBox from '@core/components/interactiveBox.svelte';
|
||||||
import extractFileName from '$lib/utils/extractFileName';
|
import extractFileName from '@core/utils/extractFileName';
|
||||||
import localforage from 'localforage';
|
import localforage from 'localforage';
|
||||||
import { writable } from 'svelte/store';
|
import { writable } from 'svelte/store';
|
||||||
import lrcParser from '@core/lyrics/lrc/parser';
|
import lrcParser from '@core/lyrics/lrc/parser';
|
||||||
import type { LrcJsonData } from '@core/lyrics/type';
|
import type { LrcJsonData } from '@core/lyrics/type';
|
||||||
import userAdjustingProgress from '$lib/state/userAdjustingProgress';
|
import userAdjustingProgress from '@core/state/userAdjustingProgress';
|
||||||
import type { IAudioMetadata } from 'music-metadata-browser';
|
import type { IAudioMetadata } from 'music-metadata-browser';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import progressBarRaw from '$lib/state/progressBarRaw';
|
import progressBarRaw from '@core/state/progressBarRaw';
|
||||||
import { parseTTML } from '@core/lyrics/ttml';
|
import { parseTTML } from '@core/lyrics/ttml';
|
||||||
import NewLyrics from '@core/components/lyrics/newLyrics.svelte';
|
import NewLyrics from '@core/components/lyrics/newLyrics.svelte';
|
||||||
|
|
||||||
@ -213,8 +213,6 @@
|
|||||||
|
|
||||||
<NewLyrics {originalLyrics} progress={currentProgress} player={audioPlayer}/>
|
<NewLyrics {originalLyrics} progress={currentProgress} player={audioPlayer}/>
|
||||||
|
|
||||||
<!-- <Lyrics lyrics={lyricsText} {originalLyrics} progress={currentProgress} player={audioPlayer} class="hidden" /> -->
|
|
||||||
|
|
||||||
<audio
|
<audio
|
||||||
bind:this={audioPlayer}
|
bind:this={audioPlayer}
|
||||||
controls
|
controls
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
export default {
|
export default {
|
||||||
content: ['./src/**/*.{html,js,svelte,ts}'],
|
content: ['./src/**/*.{html,js,svelte,ts}', '../../packages/core/components/**/*.{html,js,svelte,ts}'],
|
||||||
theme: {
|
theme: {
|
||||||
extend: {},
|
extend: {},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user