Maybe fix module imports
This commit is contained in:
parent
47a28204ac
commit
decce4a910
13 changed files with 303 additions and 45 deletions
33
packages/music-library/.eslintrc.json
Normal file
33
packages/music-library/.eslintrc.json
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{
|
||||||
|
"extends": [
|
||||||
|
"../../.eslintrc.json"
|
||||||
|
],
|
||||||
|
"ignorePatterns": [
|
||||||
|
"!**/*"
|
||||||
|
],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"*.ts",
|
||||||
|
"*.tsx",
|
||||||
|
"*.js",
|
||||||
|
"*.jsx"
|
||||||
|
],
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"*.ts",
|
||||||
|
"*.tsx"
|
||||||
|
],
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"*.js",
|
||||||
|
"*.jsx"
|
||||||
|
],
|
||||||
|
"rules": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
13
packages/music-library/README.md
Normal file
13
packages/music-library/README.md
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# music-library
|
||||||
|
|
||||||
|
This library was generated with [Nx](https://nx.dev).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
Run `nx build music-library` to build the library.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
5
packages/music-library/package.json
Normal file
5
packages/music-library/package.json
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"name": "@euterpe-js/music-library",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"type": "commonjs"
|
||||||
|
}
|
40
packages/music-library/project.json
Normal file
40
packages/music-library/project.json
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
"name": "music-library",
|
||||||
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||||
|
"sourceRoot": "packages/music-library/src",
|
||||||
|
"projectType": "library",
|
||||||
|
"targets": {
|
||||||
|
"build": {
|
||||||
|
"executor": "@nx/js:tsc",
|
||||||
|
"outputs": [
|
||||||
|
"{options.outputPath}"
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"outputPath": "dist/packages/music-library",
|
||||||
|
"main": "packages/music-library/src/index.ts",
|
||||||
|
"tsConfig": "packages/music-library/tsconfig.lib.json",
|
||||||
|
"assets": [
|
||||||
|
"packages/music-library/*.md"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"publish": {
|
||||||
|
"command": "node tools/scripts/publish.mjs music-library {args.ver} {args.tag}",
|
||||||
|
"dependsOn": [
|
||||||
|
"build"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"executor": "@nx/linter:eslint",
|
||||||
|
"outputs": [
|
||||||
|
"{options.outputFile}"
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"lintFilePatterns": [
|
||||||
|
"packages/music-library/**/*.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": []
|
||||||
|
}
|
65
packages/music-library/src/index.ts
Normal file
65
packages/music-library/src/index.ts
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
import { writeFile, readFile } from "node:fs"
|
||||||
|
type ID = number
|
||||||
|
type URL = string
|
||||||
|
enum RefTo {
|
||||||
|
Artists,
|
||||||
|
Songs,
|
||||||
|
Collections
|
||||||
|
}
|
||||||
|
enum Platforms {
|
||||||
|
Youtube,
|
||||||
|
Linktree,
|
||||||
|
Bandcamp,
|
||||||
|
Spotify,
|
||||||
|
Portfolio,
|
||||||
|
BeatPort,
|
||||||
|
SoundCloud,
|
||||||
|
}
|
||||||
|
type Ref<T> = [T, ID]
|
||||||
|
|
||||||
|
type Song = {
|
||||||
|
id: ID,
|
||||||
|
name: string,
|
||||||
|
artists: Ref<RefTo.Artists>[],
|
||||||
|
url: URL,
|
||||||
|
publish_date?: Date,
|
||||||
|
remix_artists?: Ref<RefTo.Artists>[],
|
||||||
|
in_collection?: Ref<RefTo.Collections>,
|
||||||
|
cover?: URL,
|
||||||
|
duration: number,
|
||||||
|
bpm?: number,
|
||||||
|
key?: string,
|
||||||
|
fft_data?: number[]
|
||||||
|
}
|
||||||
|
type Artist = {
|
||||||
|
id: ID,
|
||||||
|
name: string,
|
||||||
|
pfp?: URL,
|
||||||
|
songs?: Ref<RefTo.Songs>[],
|
||||||
|
collections?: Ref<RefTo.Collections>[],
|
||||||
|
links: [Platforms, URL][],
|
||||||
|
}
|
||||||
|
type Collection = {
|
||||||
|
id: ID,
|
||||||
|
publish_date?: Date,
|
||||||
|
artists: Ref<RefTo.Artists>[],
|
||||||
|
songs: Ref<RefTo.Songs>[],
|
||||||
|
cover: URL,
|
||||||
|
duration: number,
|
||||||
|
}
|
||||||
|
type DB = {
|
||||||
|
artists?: Artist[],
|
||||||
|
songs?: Song[],
|
||||||
|
Collections?: Collection[],
|
||||||
|
}
|
||||||
|
const db: DB = {}
|
||||||
|
db.songs?.push(
|
||||||
|
{
|
||||||
|
id: 0,
|
||||||
|
artists: [RefTo.Artists, 0] as Ref<RefTo.Artists>,
|
||||||
|
duration: 13,
|
||||||
|
songs: [RefTo.Songs, 0] as Ref<RefTo.Songs>,
|
||||||
|
name: "Just the two of us",
|
||||||
|
url: "Huehue" as URL,
|
||||||
|
|
||||||
|
} as Song)
|
3
packages/music-library/src/lib/music-library.ts
Normal file
3
packages/music-library/src/lib/music-library.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export function musicLibrary(): string {
|
||||||
|
return "music-library"
|
||||||
|
}
|
53
packages/music-library/src/refrence db.json
Normal file
53
packages/music-library/src/refrence db.json
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
{
|
||||||
|
"artist": {
|
||||||
|
"id": 0,
|
||||||
|
"name": "",
|
||||||
|
"pfp?": "url('')",
|
||||||
|
"songs?": [
|
||||||
|
"ref(songs,0)",
|
||||||
|
"ref(songs,2)"
|
||||||
|
],
|
||||||
|
"collections?": [
|
||||||
|
"ref(collections,0)"
|
||||||
|
],
|
||||||
|
"links?": [
|
||||||
|
"(youtube, url(''))",
|
||||||
|
"(key, url(''))"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"song": {
|
||||||
|
"id": 0,
|
||||||
|
"publish-date?": "00-00-0000",
|
||||||
|
"name": "",
|
||||||
|
"artists": [
|
||||||
|
"ref(artists, 0)",
|
||||||
|
"ref(artists, 1)"
|
||||||
|
],
|
||||||
|
"remix_artists": [
|
||||||
|
"ref(artists,3)"
|
||||||
|
],
|
||||||
|
"in_collection?": "ref(collections,0)",
|
||||||
|
"url": "url('')",
|
||||||
|
"cover?": "either url or use collections cover",
|
||||||
|
"duration": 123,
|
||||||
|
"bpm?": 120,
|
||||||
|
"key": "A Minor",
|
||||||
|
"fft_data?": [
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"collection": {
|
||||||
|
"id": 0,
|
||||||
|
"publish-date?": "00-00-0000",
|
||||||
|
"artists": [
|
||||||
|
"ref(artists, 0)"
|
||||||
|
],
|
||||||
|
"songs": [
|
||||||
|
"ref(songs, 1)",
|
||||||
|
"ref(songs, 2)"
|
||||||
|
],
|
||||||
|
"cover": "url('')",
|
||||||
|
"duration": 123
|
||||||
|
}
|
||||||
|
}
|
19
packages/music-library/tsconfig.json
Normal file
19
packages/music-library/tsconfig.json
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "commonjs",
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
|
"noPropertyAccessFromIndexSignature": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noFallthroughCasesInSwitch": true
|
||||||
|
},
|
||||||
|
"files": [],
|
||||||
|
"include": [],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.lib.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
10
packages/music-library/tsconfig.lib.json
Normal file
10
packages/music-library/tsconfig.lib.json
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../dist/out-tsc",
|
||||||
|
"declaration": true,
|
||||||
|
"types": ["node"]
|
||||||
|
},
|
||||||
|
"include": ["src/**/*.ts"],
|
||||||
|
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
|
||||||
|
}
|
|
@ -1,25 +1,32 @@
|
||||||
{
|
{
|
||||||
"name": "@euterpe.js/player",
|
"name": "@euterpe.js/player",
|
||||||
"version": "1.0.21",
|
"version": "1.0.22",
|
||||||
"type": "commonjs",
|
"type": "module",
|
||||||
"description": "A simple, safe AudioContext web music player",
|
"description": "A simple, safe AudioContext web music player",
|
||||||
"main": "index.ts",
|
"main": "./src/index.js",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Djkáťo",
|
"name": "Djkáťo",
|
||||||
"email": "djkatovfx@gmail.com"
|
"email": "djkatovfx@gmail.com"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/euterpe-js/euterpe-source.git"
|
"url": "git+https://github.com/euterpe-js/euterpe-source.git"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/euterpe-js/euterpe-source/tree/master/packages/player#readme",
|
"homepage": "https://github.com/euterpe-js/euterpe-source/tree/master/packages/player#readme",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"audio",
|
"audio",
|
||||||
"player",
|
"player",
|
||||||
"music-player",
|
"music-player",
|
||||||
"audio-visualizer",
|
"audio-visualizer",
|
||||||
"webaudio",
|
"webaudio",
|
||||||
"vizualizer"
|
"vizualizer"
|
||||||
]
|
],
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"types": "./src/index.d.ts",
|
||||||
|
"import": "./src/index.js",
|
||||||
|
"require": "./src/lib/player.js"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,23 +1,30 @@
|
||||||
{
|
{
|
||||||
"name": "@euterpe.js/visualizer",
|
"name": "@euterpe.js/visualizer",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"type": "commonjs",
|
"type": "module",
|
||||||
"description": "Music visualizer based on SVG and AudioContext",
|
"description": "Music visualizer based on SVG and AudioContext",
|
||||||
"main": "index.ts",
|
"main": "./src/index.js",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Djkáťo",
|
"name": "Djkáťo",
|
||||||
"email": "djkatovfx@gmail.com"
|
"email": "djkatovfx@gmail.com"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/euterpe-js/euterpe-source.git"
|
"url": "git+https://github.com/euterpe-js/euterpe-source.git"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/euterpe-js/euterpe-source/tree/master/packages/visualizer#readme",
|
"homepage": "https://github.com/euterpe-js/euterpe-source/tree/master/packages/visualizer#readme",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"audio",
|
"audio",
|
||||||
"audio-visualizer",
|
"audio-visualizer",
|
||||||
"webaudio",
|
"webaudio",
|
||||||
"vizualizer"
|
"vizualizer"
|
||||||
]
|
],
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"types": "./src/index.d.ts",
|
||||||
|
"import": "./src/index.js",
|
||||||
|
"require": "./src/lib/visualizer.js"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "ESNext",
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noImplicitOverride": true,
|
"noImplicitOverride": true,
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
"skipDefaultLibCheck": true,
|
"skipDefaultLibCheck": true,
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
|
"@euterpe-js/music-library": [
|
||||||
|
"packages/music-library/src/index.ts"
|
||||||
|
],
|
||||||
"@euterpe/player": [
|
"@euterpe/player": [
|
||||||
"packages/player/src/index.ts"
|
"packages/player/src/index.ts"
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in a new issue