mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-22 19:18:31 +00:00
Merge pull request #902 from tidalcycles/build-warnings
fix some build warnings
This commit is contained in:
commit
a053f40e59
@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it } from 'vitest';
|
import { describe, expect, it } from 'vitest';
|
||||||
import { getMetadata } from '../website/src/pages/metadata_parser';
|
import { getMetadata } from '../website/src/metadata_parser';
|
||||||
|
|
||||||
describe.concurrent('Metadata parser', () => {
|
describe.concurrent('Metadata parser', () => {
|
||||||
it('loads a tag from inline comment', async () => {
|
it('loads a tag from inline comment', async () => {
|
||||||
|
|||||||
10
website/src/my_patterns.js
Normal file
10
website/src/my_patterns.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { getMetadata } from './metadata_parser';
|
||||||
|
|
||||||
|
export function getMyPatterns() {
|
||||||
|
const my = import.meta.glob('../../my-patterns/**', { as: 'raw', eager: true });
|
||||||
|
return Object.fromEntries(
|
||||||
|
Object.entries(my)
|
||||||
|
.filter(([name]) => name.endsWith('.txt'))
|
||||||
|
.map(([name, raw]) => [getMetadata(raw)['title'] || name.split('/').slice(-1), raw]),
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -2,7 +2,7 @@
|
|||||||
import * as tunes from '../../../src/repl/tunes.mjs';
|
import * as tunes from '../../../src/repl/tunes.mjs';
|
||||||
import HeadCommon from '../../components/HeadCommon.astro';
|
import HeadCommon from '../../components/HeadCommon.astro';
|
||||||
|
|
||||||
import { getMetadata } from '../metadata_parser';
|
import { getMetadata } from '../../metadata_parser';
|
||||||
|
|
||||||
const { BASE_URL } = import.meta.env;
|
const { BASE_URL } = import.meta.env;
|
||||||
const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL;
|
const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL;
|
||||||
@ -25,3 +25,4 @@ const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
../../metadata_parser
|
||||||
@ -2,9 +2,9 @@ import { createCanvas } from 'canvas';
|
|||||||
import { pianoroll } from '@strudel.cycles/core';
|
import { pianoroll } from '@strudel.cycles/core';
|
||||||
import { evaluate } from '@strudel.cycles/transpiler';
|
import { evaluate } from '@strudel.cycles/transpiler';
|
||||||
import '../../../../test/runtime.mjs';
|
import '../../../../test/runtime.mjs';
|
||||||
import { getMyPatterns } from './list.json';
|
import { getMyPatterns } from '../../my_patterns';
|
||||||
|
|
||||||
export async function get({ params, request }) {
|
export async function GET({ params, request }) {
|
||||||
const patterns = await getMyPatterns();
|
const patterns = await getMyPatterns();
|
||||||
const { name } = params;
|
const { name } = params;
|
||||||
const tune = patterns[name];
|
const tune = patterns[name];
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
import { getMyPatterns } from './list.json';
|
import { getMyPatterns } from '../../my_patterns.js';
|
||||||
|
|
||||||
import { Content } from '../../../../my-patterns/README.md';
|
import { Content } from '../../../../my-patterns/README.md';
|
||||||
import HeadCommon from '../../components/HeadCommon.astro';
|
import HeadCommon from '../../components/HeadCommon.astro';
|
||||||
@ -37,3 +37,4 @@ const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
../../list.json
|
||||||
|
|||||||
@ -1,17 +0,0 @@
|
|||||||
import { getMetadata } from '../metadata_parser';
|
|
||||||
|
|
||||||
export function getMyPatterns() {
|
|
||||||
const my = import.meta.glob('../../../../my-patterns/**', { as: 'raw', eager: true });
|
|
||||||
return Object.fromEntries(
|
|
||||||
Object.entries(my)
|
|
||||||
.filter(([name]) => name.endsWith('.txt'))
|
|
||||||
.map(([name, raw]) => [getMetadata(raw)['title'] || name.split('/').slice(-1), raw]),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function get() {
|
|
||||||
const all = await getMyPatterns();
|
|
||||||
return {
|
|
||||||
body: JSON.stringify(all),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user