astro-lilypond 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +72 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +202 -0
- package/dist/loader.js.map +1 -0
- package/dist/utils/index.d.ts +5 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/lyImportQuery.d.ts +2 -0
- package/dist/utils/lyImportQuery.d.ts.map +1 -1
- package/dist/utils/lyImportQuery.js +2 -1
- package/dist/utils/lyImportQuery.js.map +1 -1
- package/dist/utils/lyTypeDeclarationsFor.d.ts +7 -0
- package/dist/utils/lyTypeDeclarationsFor.d.ts.map +1 -0
- package/dist/utils/lyTypeDeclarationsFor.js +12 -0
- package/dist/utils/lyTypeDeclarationsFor.js.map +1 -0
- package/dist/utils/parseLyHeader.d.ts +19 -1
- package/dist/utils/parseLyHeader.d.ts.map +1 -1
- package/dist/utils/parseLyHeader.js +233 -21
- package/dist/utils/parseLyHeader.js.map +1 -1
- package/dist/utils/splitHeaderFields.d.ts +24 -0
- package/dist/utils/splitHeaderFields.d.ts.map +1 -0
- package/dist/utils/splitHeaderFields.js +33 -0
- package/dist/utils/splitHeaderFields.js.map +1 -0
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
An [Astro](https://astro.build) integration for rendering [LilyPond](https://lilypond.org) music notation to images.
|
|
4
4
|
|
|
5
|
-
- Render
|
|
6
|
-
- Works with
|
|
7
|
-
- Zero
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
- Render musical scores via Markdown or with an Astro component.
|
|
6
|
+
- Works with remark, rehype and satteri Markdown processors out-of-the-box.
|
|
7
|
+
- Zero client-side JavaScript! Images are compiled at build time.
|
|
8
|
+
- Automatic `alt` text generated from the score’s title and composer. (Or supply your own.)
|
|
9
|
+
- Use the content loader to pass in a folder full of `.ly` files and get back an Astro content collection.
|
|
10
|
+
- Works with all LilyPond syntax.
|
|
11
|
+
|
|
12
|
+
Read the docs: https://lilypond.ky.fyi
|
|
11
13
|
|
|
12
14
|
## Quick Start
|
|
13
15
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AstroIntegration } from "astro";
|
|
2
2
|
import { type PluginOptions } from "./plugins/index.js";
|
|
3
3
|
import { type LilypondDefaults } from "./render.js";
|
|
4
|
+
export declare const LY_EXTENSIONS: readonly [".ly", ".lilypond", ".ily"];
|
|
4
5
|
export type { LilypondDefaults, PluginOptions as LilypondPluginOptions };
|
|
5
6
|
export interface LilypondPage {
|
|
6
7
|
src: string;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,EACN,KAAK,aAAa,EAKlB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEN,KAAK,gBAAgB,EAGrB,MAAM,aAAa,CAAC;AAmBrB,YAAY,EAAE,gBAAgB,EAAE,aAAa,IAAI,qBAAqB,EAAE,CAAC;AAEzE,MAAM,WAAW,YAAY;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACrD;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QAAQ,CAC/B,OAAO,GAAE,eAAoB,GAC3B,gBAAgB,CA2IlB"}
|
package/dist/index.js
CHANGED
|
@@ -5,10 +5,10 @@ import { promisify } from "node:util";
|
|
|
5
5
|
import { pruneOrphanedAssets, pruneStaleAssets } from "./deleteAssets.js";
|
|
6
6
|
import { rehypePlugin, remarkPlugin, satteriPlugin, } from "./plugins/index.js";
|
|
7
7
|
import { defaultOptions, render, resolveCrop, } from "./render.js";
|
|
8
|
-
import { altTextFor, assetsUrlBaseFor, contentHashFor, includePathsFor, parseLyHeader, parseLyImportQuery, prependVersion, resolveDefaults, sourceNameFor, titleFor, } from "./utils/index.js";
|
|
8
|
+
import { altTextFor, assetsUrlBaseFor, contentHashFor, includePathsFor, lyTypeDeclarationsFor, parseLyHeader, parseLyImportQuery, prependVersion, RECOGNIZED_QUERY_PARAMS, resolveDefaults, sourceNameFor, titleFor, } from "./utils/index.js";
|
|
9
9
|
import { writeAssets } from "./writeAsset.js";
|
|
10
10
|
const execFileAsync = promisify(execFile);
|
|
11
|
-
const LY_EXTENSIONS = [".ly", ".lilypond", ".ily"];
|
|
11
|
+
export const LY_EXTENSIONS = [".ly", ".lilypond", ".ily"];
|
|
12
12
|
function lyFilePlugin(options) {
|
|
13
13
|
return {
|
|
14
14
|
name: "vite-plugin-astro-lilypond-ly",
|
|
@@ -151,7 +151,7 @@ export default function lilypond(options = {}) {
|
|
|
151
151
|
"astro:config:done": ({ injectTypes }) => {
|
|
152
152
|
injectTypes({
|
|
153
153
|
filename: "ly-types.d.ts",
|
|
154
|
-
content: LY_EXTENSIONS
|
|
154
|
+
content: lyTypeDeclarationsFor(LY_EXTENSIONS, RECOGNIZED_QUERY_PARAMS),
|
|
155
155
|
});
|
|
156
156
|
},
|
|
157
157
|
"astro:build:done": async ({ logger }) => {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,O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AM,eAAe,GAAG,iBAAiB,CAAC,OAAO,IAAI,EAAE,CAAC;oBACxD,YAAY,CAAC;wBACZ,QAAQ,EAAE;4BACT,SAAS,EAAE,OAAO,CAAC;gCAClB,GAAG,eAAe;gCAClB,aAAa,EAAE;oCACd,GAAG,CAAC,eAAe,CAAC,aAAa,IAAI,EAAE,CAAC;oCACxC,CAAC,YAAY,EAAE,eAAe,CAAC;iCAC/B;gCACD,aAAa,EAAE;oCACd,GAAG,CAAC,eAAe,CAAC,aAAa,IAAI,EAAE,CAAC;oCACxC,CAAC,YAAY,EAAE,eAAe,CAAC;iCAC/B;6BACD,CAAC;yBACF;qBACD,CAAC,CAAC;oBACH,MAAM,EAAE,IAAI,CACX,0DAA0D,CAC1D,CAAC;oBACF,OAAO;gBACR,CAAC;gBAED,MAAM,IAAI,KAAK,CACd,mEAAmE;oBAClE,gEAAgE;oBAChE,2EAA2E;oBAC3E,uBAAuB,iBAAiB,EAAE,IAAI,IAAI,MAAM,GAAG,CAC5D,CAAC;YACH,CAAC;YAED,mBAAmB,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE;gBACxC,WAAW,CAAC;oBACX,QAAQ,EAAE,eAAe;oBACzB,OAAO,EAAE,qBAAqB,CAC7B,aAAa,EACb,uBAAuB,CACvB;iBACD,CAAC,CAAC;YACJ,CAAC;YAED,kBAAkB,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;gBACxC,IAAI,CAAC,SAAS;oBAAE,OAAO;gBACvB,MAAM,mBAAmB,CAAC;oBACzB,GAAG,EAAE,SAAS;oBACd,UAAU,EAAE,gBAAgB;oBAC5B,MAAM;iBACN,CAAC,CAAC;YACJ,CAAC;SACD;KACD,CAAC;AACH,CAAC"}
|
package/dist/loader.d.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Loader } from "astro/loaders";
|
|
2
|
+
import { z } from "astro/zod";
|
|
3
|
+
import { type LilypondContent } from "./index.js";
|
|
4
|
+
import type { PluginOptions } from "./plugins/index.js";
|
|
5
|
+
import { type KnownLyHeaderFields } from "./utils/index.js";
|
|
6
|
+
export interface GenerateIdOptions {
|
|
7
|
+
/** The path to the entry file, relative to `base`. */
|
|
8
|
+
entry: string;
|
|
9
|
+
/** The base directory URL entries are resolved from. */
|
|
10
|
+
base: URL;
|
|
11
|
+
/** The entry's parsed `\header` fields (see `parseLyHeaderFields`). */
|
|
12
|
+
header: Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
export interface LilypondLoaderOptions extends PluginOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Glob pattern(s) matching score files, relative to `base`.
|
|
17
|
+
* @default "**\/*.{ly,ily,lilypond}"
|
|
18
|
+
*/
|
|
19
|
+
pattern?: string | string[];
|
|
20
|
+
/**
|
|
21
|
+
* Base directory the pattern resolves from — relative to the project
|
|
22
|
+
* root, or an absolute file URL.
|
|
23
|
+
*/
|
|
24
|
+
base: string | URL;
|
|
25
|
+
/**
|
|
26
|
+
* Generates an entry's collection id.
|
|
27
|
+
* @default the file's path relative to `base`, POSIX-separated, with its extension stripped.
|
|
28
|
+
*/
|
|
29
|
+
generateId?: (options: GenerateIdOptions) => string;
|
|
30
|
+
/**
|
|
31
|
+
* Directory name, relative to Astro's `publicDir`, that rendered assets
|
|
32
|
+
* are written into. Exclusive to this collection — the loader prunes
|
|
33
|
+
* anything under it that isn't currently referenced by one of its own
|
|
34
|
+
* entries, so don't point two different collections (or the `lilypond()`
|
|
35
|
+
* integration's own `outputDir`) at the same directory.
|
|
36
|
+
* @default `"_lilypond/<collection name>"`
|
|
37
|
+
*/
|
|
38
|
+
outputDir?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface LilypondHeaderData extends KnownLyHeaderFields {
|
|
41
|
+
/** Header fields outside LilyPond's standard set (e.g. `mutopiacomposer`). */
|
|
42
|
+
extra: Record<string, string>;
|
|
43
|
+
}
|
|
44
|
+
export interface LilypondCollectionEntry extends LilypondContent, LilypondHeaderData {
|
|
45
|
+
}
|
|
46
|
+
export declare const lilypondEntrySchema: z.ZodObject<{
|
|
47
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
48
|
+
src: z.ZodString;
|
|
49
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
}, z.core.$strip>>;
|
|
52
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
53
|
+
dedication: z.ZodOptional<z.ZodString>;
|
|
54
|
+
title: z.ZodOptional<z.ZodString>;
|
|
55
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
56
|
+
subsubtitle: z.ZodOptional<z.ZodString>;
|
|
57
|
+
instrument: z.ZodOptional<z.ZodString>;
|
|
58
|
+
poet: z.ZodOptional<z.ZodString>;
|
|
59
|
+
composer: z.ZodOptional<z.ZodString>;
|
|
60
|
+
meter: z.ZodOptional<z.ZodString>;
|
|
61
|
+
arranger: z.ZodOptional<z.ZodString>;
|
|
62
|
+
piece: z.ZodOptional<z.ZodString>;
|
|
63
|
+
opus: z.ZodOptional<z.ZodString>;
|
|
64
|
+
copyright: z.ZodOptional<z.ZodString>;
|
|
65
|
+
tagline: z.ZodOptional<z.ZodString>;
|
|
66
|
+
extra: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
/**
|
|
69
|
+
* Content Loader to turn a directory of `.ly` files into a content collection.
|
|
70
|
+
*/
|
|
71
|
+
export declare function lilypondLoader(options: LilypondLoaderOptions): Loader;
|
|
72
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAE9B,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,YAAY,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAKN,KAAK,mBAAmB,EAOxB,MAAM,kBAAkB,CAAC;AAK1B,MAAM,WAAW,iBAAiB;IACjC,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,IAAI,EAAE,GAAG,CAAC;IACV,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC3D;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE5B;;;OAGG;IACH,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,MAAM,CAAC;IAEpD;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC9D,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,uBAChB,SAAQ,eAAe,EACtB,kBAAkB;CAAG;AAEvB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;iBAuB9B,CAAC;AA2BH;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAkLrE"}
|
package/dist/loader.js
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { glob, readFile } from "node:fs/promises";
|
|
2
|
+
import { basename, join, posix, relative, sep } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { z } from "astro/zod";
|
|
5
|
+
import { pruneOrphanedAssets } from "./deleteAssets.js";
|
|
6
|
+
import { LY_EXTENSIONS } from "./index.js";
|
|
7
|
+
import { defaultOptions, render, resolveCrop } from "./render.js";
|
|
8
|
+
import { altTextFor, assetsUrlBaseFor, contentHashFor, includePathsFor, parseLyHeaderFields, prependVersion, resolveDefaults, sourceNameFor, splitHeaderFields, titleFor, } from "./utils/index.js";
|
|
9
|
+
import { writeAssets } from "./writeAsset.js";
|
|
10
|
+
const DEFAULT_PATTERN = `**/*.{${LY_EXTENSIONS.map((ext) => ext.slice(1)).join(",")}}`;
|
|
11
|
+
export const lilypondEntrySchema = z.object({
|
|
12
|
+
pages: z.array(z.object({
|
|
13
|
+
src: z.string(),
|
|
14
|
+
width: z.number().optional(),
|
|
15
|
+
height: z.number().optional(),
|
|
16
|
+
})),
|
|
17
|
+
alt: z.string().optional(),
|
|
18
|
+
dedication: z.string().optional(),
|
|
19
|
+
title: z.string().optional(),
|
|
20
|
+
subtitle: z.string().optional(),
|
|
21
|
+
subsubtitle: z.string().optional(),
|
|
22
|
+
instrument: z.string().optional(),
|
|
23
|
+
poet: z.string().optional(),
|
|
24
|
+
composer: z.string().optional(),
|
|
25
|
+
meter: z.string().optional(),
|
|
26
|
+
arranger: z.string().optional(),
|
|
27
|
+
piece: z.string().optional(),
|
|
28
|
+
opus: z.string().optional(),
|
|
29
|
+
copyright: z.string().optional(),
|
|
30
|
+
tagline: z.string().optional(),
|
|
31
|
+
extra: z.record(z.string(), z.string()),
|
|
32
|
+
});
|
|
33
|
+
function stripLyExtension(entryPath) {
|
|
34
|
+
for (const ext of LY_EXTENSIONS) {
|
|
35
|
+
if (entryPath.endsWith(ext))
|
|
36
|
+
return entryPath.slice(0, -ext.length);
|
|
37
|
+
}
|
|
38
|
+
return entryPath;
|
|
39
|
+
}
|
|
40
|
+
function toPosixPath(path) {
|
|
41
|
+
return path.split(sep).join("/");
|
|
42
|
+
}
|
|
43
|
+
function defaultGenerateId({ entry }) {
|
|
44
|
+
return stripLyExtension(toPosixPath(entry));
|
|
45
|
+
}
|
|
46
|
+
function resolveBaseUrl(base, root) {
|
|
47
|
+
if (base instanceof URL)
|
|
48
|
+
return base;
|
|
49
|
+
const withTrailingSlash = base.endsWith("/") ? base : `${base}/`;
|
|
50
|
+
return new URL(withTrailingSlash, root);
|
|
51
|
+
}
|
|
52
|
+
function posixRelative(from, to) {
|
|
53
|
+
return toPosixPath(relative(from, to));
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Content Loader to turn a directory of `.ly` files into a content collection.
|
|
57
|
+
*/
|
|
58
|
+
export function lilypondLoader(options) {
|
|
59
|
+
const { pattern = DEFAULT_PATTERN, base, generateId = defaultGenerateId, format, defaults, timeout, outputDir, } = options;
|
|
60
|
+
const resolved = resolveDefaults(defaults);
|
|
61
|
+
const crop = resolveCrop(resolved.crop, "component");
|
|
62
|
+
const resolvedFormat = format ?? defaultOptions.format;
|
|
63
|
+
return {
|
|
64
|
+
name: "astro-lilypond-loader",
|
|
65
|
+
schema: lilypondEntrySchema,
|
|
66
|
+
async load(context) {
|
|
67
|
+
const { config, collection, store, logger, watcher, generateDigest, parseData, } = context;
|
|
68
|
+
const outputDirName = outputDir ?? posix.join("_lilypond", collection);
|
|
69
|
+
const assetsDir = join(fileURLToPath(config.publicDir), outputDirName);
|
|
70
|
+
const assetsUrlBase = assetsUrlBaseFor(config.base, outputDirName);
|
|
71
|
+
const rootDir = fileURLToPath(config.root);
|
|
72
|
+
const baseUrl = resolveBaseUrl(base, config.root);
|
|
73
|
+
const baseDir = fileURLToPath(baseUrl);
|
|
74
|
+
async function syncEntry(entry) {
|
|
75
|
+
const filePath = join(baseDir, entry);
|
|
76
|
+
let source;
|
|
77
|
+
try {
|
|
78
|
+
source = await readFile(filePath, "utf8");
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
logger.error(`astro-lilypond: error reading ${entry}: ${err.message}`);
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
const headerFields = parseLyHeaderFields(source);
|
|
85
|
+
const id = generateId({ entry, base: baseUrl, header: headerFields });
|
|
86
|
+
// Not short-circuited on a matching digest: that only proves the
|
|
87
|
+
// source is unchanged, not that the asset file still exists on
|
|
88
|
+
// disk. `writeAssets()` does the real disk-backed cache check.
|
|
89
|
+
const digest = generateDigest(source);
|
|
90
|
+
const src = prependVersion(source, resolved.version);
|
|
91
|
+
const includePaths = includePathsFor(filePath);
|
|
92
|
+
const sourceName = sourceNameFor(filePath);
|
|
93
|
+
const title = titleFor(sourceName);
|
|
94
|
+
const hash = contentHashFor({
|
|
95
|
+
source: src,
|
|
96
|
+
format: resolvedFormat,
|
|
97
|
+
resolution: resolved.resolution,
|
|
98
|
+
crop,
|
|
99
|
+
});
|
|
100
|
+
const assets = await writeAssets({
|
|
101
|
+
hash,
|
|
102
|
+
title,
|
|
103
|
+
format: resolvedFormat,
|
|
104
|
+
outputDir: assetsDir,
|
|
105
|
+
urlBase: assetsUrlBase,
|
|
106
|
+
sizeScale: crop ? resolved.cropScale : 1,
|
|
107
|
+
getBuffers: () => render(src, {
|
|
108
|
+
format: resolvedFormat,
|
|
109
|
+
crop,
|
|
110
|
+
defaults,
|
|
111
|
+
timeout,
|
|
112
|
+
includePaths,
|
|
113
|
+
sourceName,
|
|
114
|
+
}),
|
|
115
|
+
});
|
|
116
|
+
const data = await parseData({
|
|
117
|
+
id,
|
|
118
|
+
data: {
|
|
119
|
+
pages: assets.map((asset) => ({
|
|
120
|
+
src: asset.url,
|
|
121
|
+
width: asset.width,
|
|
122
|
+
height: asset.height,
|
|
123
|
+
})),
|
|
124
|
+
alt: altTextFor({
|
|
125
|
+
title: headerFields.title,
|
|
126
|
+
composer: headerFields.composer,
|
|
127
|
+
}),
|
|
128
|
+
...splitHeaderFields(headerFields),
|
|
129
|
+
},
|
|
130
|
+
filePath,
|
|
131
|
+
});
|
|
132
|
+
store.set({
|
|
133
|
+
id,
|
|
134
|
+
data,
|
|
135
|
+
filePath: posixRelative(rootDir, filePath),
|
|
136
|
+
digest,
|
|
137
|
+
});
|
|
138
|
+
return id;
|
|
139
|
+
}
|
|
140
|
+
async function runSync() {
|
|
141
|
+
const untouched = new Set(store.keys());
|
|
142
|
+
const idByPath = new Map();
|
|
143
|
+
for (const stored of store.values()) {
|
|
144
|
+
if (stored.filePath)
|
|
145
|
+
idByPath.set(stored.filePath, stored.id);
|
|
146
|
+
}
|
|
147
|
+
const entries = [];
|
|
148
|
+
for await (const entry of glob(pattern, { cwd: baseDir })) {
|
|
149
|
+
entries.push(entry);
|
|
150
|
+
}
|
|
151
|
+
if (entries.length === 0) {
|
|
152
|
+
logger.warn(`astro-lilypond: no files matched "${pattern}" in "${baseDir}"`);
|
|
153
|
+
}
|
|
154
|
+
const results = await Promise.all(entries.map(async (entry) => ({ entry, id: await syncEntry(entry) })));
|
|
155
|
+
for (const { entry, id } of results) {
|
|
156
|
+
if (id) {
|
|
157
|
+
untouched.delete(id);
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
// syncEntry() failed (e.g. a transient read error racing an
|
|
161
|
+
// editor's atomic save) — if this path previously synced
|
|
162
|
+
// successfully, keep its existing entry rather than evicting
|
|
163
|
+
// it; the next fs event will retry the read.
|
|
164
|
+
const previousId = idByPath.get(posixRelative(rootDir, join(baseDir, entry)));
|
|
165
|
+
if (previousId)
|
|
166
|
+
untouched.delete(previousId);
|
|
167
|
+
}
|
|
168
|
+
for (const id of untouched)
|
|
169
|
+
store.delete(id);
|
|
170
|
+
// Sweep the directory against every currently-stored entry's pages
|
|
171
|
+
// (not just the ones touched this pass), so a removed/renamed
|
|
172
|
+
// source's leftover files get cleaned up without needing separate
|
|
173
|
+
// per-entry bookkeeping.
|
|
174
|
+
const referenced = new Set();
|
|
175
|
+
for (const stored of store.values()) {
|
|
176
|
+
const pages = stored.data.pages;
|
|
177
|
+
for (const page of pages ?? [])
|
|
178
|
+
referenced.add(basename(page.src));
|
|
179
|
+
}
|
|
180
|
+
await pruneOrphanedAssets({ dir: assetsDir, referenced, logger });
|
|
181
|
+
}
|
|
182
|
+
await runSync();
|
|
183
|
+
if (!watcher)
|
|
184
|
+
return;
|
|
185
|
+
watcher.add(baseDir);
|
|
186
|
+
// Serializes re-syncs so overlapping fs events (e.g. an editor
|
|
187
|
+
// autosave firing "change" twice) can't race on the shared store.
|
|
188
|
+
let queue = Promise.resolve();
|
|
189
|
+
const onFsEvent = (changedPath) => {
|
|
190
|
+
if (!changedPath.startsWith(baseDir))
|
|
191
|
+
return;
|
|
192
|
+
queue = queue.then(() => runSync().catch((err) => {
|
|
193
|
+
logger.error(`astro-lilypond: reload failed: ${err.message}`);
|
|
194
|
+
}));
|
|
195
|
+
};
|
|
196
|
+
watcher.on("add", onFsEvent);
|
|
197
|
+
watcher.on("change", onFsEvent);
|
|
198
|
+
watcher.on("unlink", onFsEvent);
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAwB,aAAa,EAAE,MAAM,YAAY,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EACN,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,eAAe,EAEf,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,QAAQ,GACR,MAAM,kBAAkB,CAAC;AA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AAK,CAAC;oBACnE,KAAK,MAAM,IAAI,IAAI,KAAK,IAAI,EAAE;wBAAE,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;gBACpE,CAAC;gBACD,MAAM,mBAAmB,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC;YACnE,CAAC;YAED,MAAM,OAAO,EAAE,CAAC;YAEhB,IAAI,CAAC,OAAO;gBAAE,OAAO;YACrB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACrB,+DAA+D;YAC/D,kEAAkE;YAClE,IAAI,KAAK,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;YAC9B,MAAM,SAAS,GAAG,CAAC,WAAmB,EAAE,EAAE;gBACzC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC;oBAAE,OAAO;gBAC7C,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CACvB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;oBACvB,MAAM,CAAC,KAAK,CACX,kCAAmC,GAAa,CAAC,OAAO,EAAE,CAC1D,CAAC;gBACH,CAAC,CAAC,CACF,CAAC;YACH,CAAC,CAAC;YACF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YAC7B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;YAChC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QACjC,CAAC;KACD,CAAC;AACH,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -7,16 +7,19 @@ export type { ImageDimensions } from "./imageDimensions.js";
|
|
|
7
7
|
export { imageDimensionsFor } from "./imageDimensions.js";
|
|
8
8
|
export { includePathsFor } from "./includePathsFor.js";
|
|
9
9
|
export { isLilypondLang } from "./isLilypondLang.js";
|
|
10
|
-
export { parseLyImportQuery } from "./lyImportQuery.js";
|
|
10
|
+
export { parseLyImportQuery, RECOGNIZED_QUERY_PARAMS, } from "./lyImportQuery.js";
|
|
11
|
+
export { lyTypeDeclarationsFor } from "./lyTypeDeclarationsFor.js";
|
|
11
12
|
export { contentTypeFor, isOwnAssetFileName } from "./ownAssetFileName.js";
|
|
12
13
|
export { parseFenceMeta } from "./parseFenceMeta.js";
|
|
13
14
|
export type { LyHeaderFields } from "./parseLyHeader.js";
|
|
14
|
-
export { parseLyHeader } from "./parseLyHeader.js";
|
|
15
|
+
export { extractMarkupText, parseLyHeader, parseLyHeaderFields, } from "./parseLyHeader.js";
|
|
15
16
|
export { prependVersion } from "./prependVersion.js";
|
|
16
17
|
export type { RenderedPage } from "./renderedHtml.js";
|
|
17
18
|
export { renderedHtml } from "./renderedHtml.js";
|
|
18
19
|
export { resolveDefaults } from "./resolveDefaults.js";
|
|
19
20
|
export { sourceNameFor } from "./sourceNameFor.js";
|
|
21
|
+
export type { KnownLyHeaderFields } from "./splitHeaderFields.js";
|
|
22
|
+
export { STANDARD_HEADER_FIELDS, splitHeaderFields, } from "./splitHeaderFields.js";
|
|
20
23
|
export { titleFor } from "./titleFor.js";
|
|
21
24
|
export { unescapeQuoted } from "./unescapeQuoted.js";
|
|
22
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,eAAe,EAAE,M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AM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EACN,sBAAsB,EACtB,iBAAiB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -6,14 +6,16 @@ export { escapeHtmlAttribute } from "./escapeHtmlAttribute.js";
|
|
|
6
6
|
export { imageDimensionsFor } from "./imageDimensions.js";
|
|
7
7
|
export { includePathsFor } from "./includePathsFor.js";
|
|
8
8
|
export { isLilypondLang } from "./isLilypondLang.js";
|
|
9
|
-
export { parseLyImportQuery } from "./lyImportQuery.js";
|
|
9
|
+
export { parseLyImportQuery, RECOGNIZED_QUERY_PARAMS, } from "./lyImportQuery.js";
|
|
10
|
+
export { lyTypeDeclarationsFor } from "./lyTypeDeclarationsFor.js";
|
|
10
11
|
export { contentTypeFor, isOwnAssetFileName } from "./ownAssetFileName.js";
|
|
11
12
|
export { parseFenceMeta } from "./parseFenceMeta.js";
|
|
12
|
-
export { parseLyHeader } from "./parseLyHeader.js";
|
|
13
|
+
export { extractMarkupText, parseLyHeader, parseLyHeaderFields, } from "./parseLyHeader.js";
|
|
13
14
|
export { prependVersion } from "./prependVersion.js";
|
|
14
15
|
export { renderedHtml } from "./renderedHtml.js";
|
|
15
16
|
export { resolveDefaults } from "./resolveDefaults.js";
|
|
16
17
|
export { sourceNameFor } from "./sourceNameFor.js";
|
|
18
|
+
export { STANDARD_HEADER_FIELDS, splitHeaderFields, } from "./splitHeaderFields.js";
|
|
17
19
|
export { titleFor } from "./titleFor.js";
|
|
18
20
|
export { unescapeQuoted } from "./unescapeQuoted.js";
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EACN,kBAAkB,EAClB,uBAAuB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EACN,iBAAiB,EACjB,aAAa,EACb,mBAAmB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EACN,sBAAsB,EACtB,iBAAiB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** Query params `lyFilePlugin` recognizes as its own on a `.ly`-family import. */
|
|
2
|
+
export declare const RECOGNIZED_QUERY_PARAMS: readonly ["crop", "nocrop"];
|
|
1
3
|
export interface LyImportQuery {
|
|
2
4
|
/** The import's module id with any query string stripped. */
|
|
3
5
|
pathname: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lyImportQuery.d.ts","sourceRoot":"","sources":["../../src/utils/lyImportQuery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lyImportQuery.d.ts","sourceRoot":"","sources":["../../src/utils/lyImportQuery.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,eAAO,MAAM,uBAAuB,YAAI,MAAM,EAAE,QAAQ,CAAU,CAAC;AAInE,MAAM,WAAW,aAAa;IAC7B,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC;CAClC;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAkBxE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Query params `lyFilePlugin` recognizes as its own on a `.ly`-family import. */
|
|
2
|
-
const
|
|
2
|
+
export const RECOGNIZED_QUERY_PARAMS = ["crop", "nocrop"];
|
|
3
|
+
const RECOGNIZED_PARAMS = new Set(RECOGNIZED_QUERY_PARAMS);
|
|
3
4
|
/**
|
|
4
5
|
* Parses a Vite module id for a `.ly`/`.lilypond`/`.ily` import into its
|
|
5
6
|
* pathname and this plugin's `?crop`/`?nocrop` override.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lyImportQuery.js","sourceRoot":"","sources":["../../src/utils/lyImportQuery.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,
|
|
1
|
+
{"version":3,"file":"lyImportQuery.js","sourceRoot":"","sources":["../../src/utils/lyImportQuery.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAU,CAAC;AAEnE,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAS,uBAAuB,CAAC,CAAC;AAcnE;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAAU;IAC5C,MAAM,UAAU,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACnC,MAAM,QAAQ,GAAG,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG,IAAI,eAAe,CACjC,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CACjD,CAAC;IAEF,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QACnE,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;QACtC,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;YACrB,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,SAAS,CAAC;IAEd,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the ambient module declarations injected for `.ly`-family imports,
|
|
3
|
+
* so `import content from "./score.ly"` (and its `?crop`/`?nocrop` query
|
|
4
|
+
* variants) type-check as a default-exported `LilypondContent`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function lyTypeDeclarationsFor(extensions: readonly string[], queryParams: readonly string[]): string;
|
|
7
|
+
//# sourceMappingURL=lyTypeDeclarationsFor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lyTypeDeclarationsFor.d.ts","sourceRoot":"","sources":["../../src/utils/lyTypeDeclarationsFor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,qBAAqB,CACpC,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,WAAW,EAAE,SAAS,MAAM,EAAE,GAC5B,MAAM,CAWR"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the ambient module declarations injected for `.ly`-family imports,
|
|
3
|
+
* so `import content from "./score.ly"` (and its `?crop`/`?nocrop` query
|
|
4
|
+
* variants) type-check as a default-exported `LilypondContent`.
|
|
5
|
+
*/
|
|
6
|
+
export function lyTypeDeclarationsFor(extensions, queryParams) {
|
|
7
|
+
const suffixes = ["", ...queryParams.map((param) => `?${param}`)];
|
|
8
|
+
return extensions
|
|
9
|
+
.flatMap((ext) => suffixes.map((suffix) => `declare module "*${ext}${suffix}" {\n const content: import("astro-lilypond").LilypondContent;\n export default content;\n}`))
|
|
10
|
+
.join("\n");
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=lyTypeDeclarationsFor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lyTypeDeclarationsFor.js","sourceRoot":"","sources":["../../src/utils/lyTypeDeclarationsFor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACpC,UAA6B,EAC7B,WAA8B;IAE9B,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC;IAElE,OAAO,UAAU;SACf,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAChB,QAAQ,CAAC,GAAG,CACX,CAAC,MAAM,EAAE,EAAE,CACV,oBAAoB,GAAG,GAAG,MAAM,+FAA+F,CAChI,CACD;SACA,IAAI,CAAC,IAAI,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -2,6 +2,24 @@ export interface LyHeaderFields {
|
|
|
2
2
|
title?: string;
|
|
3
3
|
composer?: string;
|
|
4
4
|
}
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Extracts readable plain text from inside a `\markup { ... }` block: quoted-string
|
|
7
|
+
* contents and bare words are kept, `\command` tokens and `#...` Scheme literal
|
|
8
|
+
* arguments (font sizes, colors, alist overrides, etc.) are stripped, and nested
|
|
9
|
+
* `{ }` grouping is flattened — good enough for the formatting-wrapped text
|
|
10
|
+
* commonly seen in real `\header` fields (e.g. `\markup { \bold "Sonata" }`),
|
|
11
|
+
* not a full markup-language evaluator.
|
|
12
|
+
*/
|
|
13
|
+
export declare function extractMarkupText(markupInner: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Extracts every string-valued header field found anywhere in `source`,
|
|
16
|
+
* across every top-level `\header` block (there can be more than one — e.g.
|
|
17
|
+
* book-level metadata plus a per-`\score` override). When the same field name
|
|
18
|
+
* appears in more than one block, the **last occurrence in the file wins** —
|
|
19
|
+
* approximating LilyPond's own inner-scope-overrides-outer-scope header chain
|
|
20
|
+
* for the common case of a book/top-level header followed by per-score ones.
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseLyHeaderFields(source: string): Record<string, string>;
|
|
23
|
+
/** Extracts `title`/`composer` from the file's header block(s) (see `parseLyHeaderFields`); non-string values (e.g. an unbraced `\markup`, `##f`) are treated as absent. */
|
|
6
24
|
export declare function parseLyHeader(source: string): LyHeaderFields;
|
|
7
25
|
//# sourceMappingURL=parseLyHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseLyHeader.d.ts","sourceRoot":"","sources":["../../src/utils/parseLyHeader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parseLyHeader.d.ts","sourceRoot":"","sources":["../../src/utils/parseLyHeader.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAiID;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAqC7D;AAqDD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAM1E;AAED,4KAA4K;AAC5K,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAM5D"}
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { unescapeQuoted } from "./unescapeQuoted.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
/** Finds the index of the `"` that closes the quoted string starting at `source[quoteIndex]`, honoring backslash escapes. Returns -1 if unterminated. */
|
|
3
|
+
function matchQuotedStringEnd(source, quoteIndex) {
|
|
4
|
+
for (let i = quoteIndex + 1; i < source.length; i++) {
|
|
5
|
+
if (source[i] === "\\") {
|
|
6
|
+
i++;
|
|
7
|
+
continue;
|
|
8
|
+
}
|
|
9
|
+
if (source[i] === '"')
|
|
10
|
+
return i;
|
|
11
|
+
}
|
|
12
|
+
return -1;
|
|
13
|
+
}
|
|
14
|
+
/** Finds the index of the `}` that closes the brace opened at `source[openBraceIndex]`, matching by depth (ignoring braces inside quoted strings). Returns -1 if unterminated. */
|
|
15
|
+
function matchBalancedBraces(source, openBraceIndex) {
|
|
9
16
|
let depth = 1;
|
|
10
17
|
let inString = false;
|
|
11
|
-
for (let i =
|
|
18
|
+
for (let i = openBraceIndex + 1; i < source.length; i++) {
|
|
12
19
|
const ch = source[i];
|
|
13
20
|
if (inString) {
|
|
14
21
|
if (ch === "\\")
|
|
@@ -24,25 +31,230 @@ function headerBodyOf(source) {
|
|
|
24
31
|
else if (ch === "}") {
|
|
25
32
|
depth--;
|
|
26
33
|
if (depth === 0)
|
|
27
|
-
return
|
|
34
|
+
return i;
|
|
28
35
|
}
|
|
29
36
|
}
|
|
30
|
-
return
|
|
37
|
+
return -1;
|
|
31
38
|
}
|
|
32
|
-
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Strips LilyPond `%` line comments and `%{ ... %}` block comments from
|
|
41
|
+
* `source`, replacing their text with spaces (so offsets are unaffected) —
|
|
42
|
+
* quote-aware, so a literal `%` inside a `"..."` string (e.g. `"50% done"`)
|
|
43
|
+
* is left alone. Run once, up front, so neither the `\header {` block scan
|
|
44
|
+
* nor the field scan inside a block can mistake commented-out text for real
|
|
45
|
+
* source.
|
|
46
|
+
*/
|
|
47
|
+
function stripComments(source) {
|
|
48
|
+
let result = "";
|
|
49
|
+
let inString = false;
|
|
50
|
+
for (let i = 0; i < source.length; i++) {
|
|
51
|
+
const ch = source[i];
|
|
52
|
+
if (inString) {
|
|
53
|
+
result += ch;
|
|
54
|
+
if (ch === "\\") {
|
|
55
|
+
i++;
|
|
56
|
+
result += source[i] ?? "";
|
|
57
|
+
}
|
|
58
|
+
else if (ch === '"') {
|
|
59
|
+
inString = false;
|
|
60
|
+
}
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (ch === '"') {
|
|
64
|
+
inString = true;
|
|
65
|
+
result += ch;
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (ch === "%" && source[i + 1] === "{") {
|
|
69
|
+
const end = source.indexOf("%}", i + 2);
|
|
70
|
+
const stop = end === -1 ? source.length : end + 2;
|
|
71
|
+
result += " ".repeat(stop - i);
|
|
72
|
+
i = stop - 1;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (ch === "%") {
|
|
76
|
+
const end = source.indexOf("\n", i);
|
|
77
|
+
const stop = end === -1 ? source.length : end;
|
|
78
|
+
result += " ".repeat(stop - i);
|
|
79
|
+
i = stop - 1;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
result += ch;
|
|
83
|
+
}
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
/** Returns the body of every top-level `\header { ... }` block in `source` — there may be more than one (e.g. book-level metadata plus a per-`\score` override). */
|
|
87
|
+
function allHeaderBodies(source) {
|
|
88
|
+
const bodies = [];
|
|
89
|
+
const headerRe = /\\header\s*\{/g;
|
|
90
|
+
let match;
|
|
91
|
+
// biome-ignore lint: reassigned in the while condition
|
|
92
|
+
while ((match = headerRe.exec(source))) {
|
|
93
|
+
const openBraceIndex = match.index + match[0].length - 1;
|
|
94
|
+
const closeBraceIndex = matchBalancedBraces(source, openBraceIndex);
|
|
95
|
+
if (closeBraceIndex === -1)
|
|
96
|
+
continue;
|
|
97
|
+
bodies.push(source.slice(openBraceIndex + 1, closeBraceIndex));
|
|
98
|
+
headerRe.lastIndex = closeBraceIndex + 1;
|
|
99
|
+
}
|
|
100
|
+
return bodies;
|
|
101
|
+
}
|
|
102
|
+
/** Consumes one Scheme datum starting at `source[i]` (which must be `#`): a boolean/number/symbol atom, or a balanced, quote-aware parenthesized list (e.g. `#4`, `#f`, `#'symbol`, `#'(0 . 3)`, `#(format #f "...")`). Returns the index just past it. */
|
|
103
|
+
function skipSchemeDatum(source, i) {
|
|
104
|
+
i++; // past '#'
|
|
105
|
+
if (source[i] === "'")
|
|
106
|
+
i++; // optional quote prefix
|
|
107
|
+
if (source[i] === "(") {
|
|
108
|
+
let depth = 0;
|
|
109
|
+
let inString = false;
|
|
110
|
+
do {
|
|
111
|
+
const ch = source[i];
|
|
112
|
+
if (inString) {
|
|
113
|
+
if (ch === "\\")
|
|
114
|
+
i++;
|
|
115
|
+
else if (ch === '"')
|
|
116
|
+
inString = false;
|
|
117
|
+
}
|
|
118
|
+
else if (ch === '"') {
|
|
119
|
+
inString = true;
|
|
120
|
+
}
|
|
121
|
+
else if (ch === "(") {
|
|
122
|
+
depth++;
|
|
123
|
+
}
|
|
124
|
+
else if (ch === ")") {
|
|
125
|
+
depth--;
|
|
126
|
+
}
|
|
127
|
+
i++;
|
|
128
|
+
} while (i < source.length && depth > 0);
|
|
129
|
+
return i;
|
|
130
|
+
}
|
|
131
|
+
if (source[i] === '"') {
|
|
132
|
+
const end = matchQuotedStringEnd(source, i);
|
|
133
|
+
return end === -1 ? source.length : end + 1;
|
|
134
|
+
}
|
|
135
|
+
while (i < source.length && !/[\s{}()"#\\]/.test(source[i]))
|
|
136
|
+
i++;
|
|
137
|
+
return i;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Extracts readable plain text from inside a `\markup { ... }` block: quoted-string
|
|
141
|
+
* contents and bare words are kept, `\command` tokens and `#...` Scheme literal
|
|
142
|
+
* arguments (font sizes, colors, alist overrides, etc.) are stripped, and nested
|
|
143
|
+
* `{ }` grouping is flattened — good enough for the formatting-wrapped text
|
|
144
|
+
* commonly seen in real `\header` fields (e.g. `\markup { \bold "Sonata" }`),
|
|
145
|
+
* not a full markup-language evaluator.
|
|
146
|
+
*/
|
|
147
|
+
export function extractMarkupText(markupInner) {
|
|
148
|
+
const tokens = [];
|
|
149
|
+
const n = markupInner.length;
|
|
150
|
+
let i = 0;
|
|
151
|
+
while (i < n) {
|
|
152
|
+
const ch = markupInner[i];
|
|
153
|
+
if (/\s/.test(ch)) {
|
|
154
|
+
i++;
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
if (ch === '"') {
|
|
158
|
+
const end = matchQuotedStringEnd(markupInner, i);
|
|
159
|
+
if (end === -1)
|
|
160
|
+
break;
|
|
161
|
+
tokens.push(unescapeQuoted(markupInner.slice(i + 1, end)));
|
|
162
|
+
i = end + 1;
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
if (ch === "{" || ch === "}") {
|
|
166
|
+
i++;
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
if (ch === "#") {
|
|
170
|
+
i = skipSchemeDatum(markupInner, i);
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
if (ch === "\\") {
|
|
174
|
+
let j = i + 1;
|
|
175
|
+
while (j < n && /[A-Za-z-]/.test(markupInner[j]))
|
|
176
|
+
j++;
|
|
177
|
+
i = j;
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
let j = i;
|
|
181
|
+
while (j < n && !/[\s{}"#\\]/.test(markupInner[j]))
|
|
182
|
+
j++;
|
|
183
|
+
tokens.push(markupInner.slice(i, j));
|
|
184
|
+
i = j;
|
|
185
|
+
}
|
|
186
|
+
return tokens.join(" ").replace(/\s+/g, " ").trim();
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Parses the value starting at `body[start]` (right after a field's `=`).
|
|
190
|
+
* Supports a plain quoted string, or a `\markup { ... }` expression (braced
|
|
191
|
+
* form only — an unbraced `\markup \command "text"` value has no reliable end
|
|
192
|
+
* delimiter without a real LilyPond grammar, so it's left unsupported).
|
|
193
|
+
* Returns `null` for unsupported/empty values (e.g. `##f`, `\markup` without
|
|
194
|
+
* a brace), same as the field simply being absent.
|
|
195
|
+
*/
|
|
196
|
+
function parseFieldValue(body, start) {
|
|
197
|
+
if (body[start] === '"') {
|
|
198
|
+
const end = matchQuotedStringEnd(body, start);
|
|
199
|
+
if (end === -1)
|
|
200
|
+
return null;
|
|
201
|
+
const value = unescapeQuoted(body.slice(start + 1, end)).trim();
|
|
202
|
+
return value ? { value, end: end + 1 } : null;
|
|
203
|
+
}
|
|
204
|
+
const MARKUP = "\\markup";
|
|
205
|
+
if (body.startsWith(MARKUP, start) &&
|
|
206
|
+
!/[A-Za-z-]/.test(body[start + MARKUP.length] ?? "")) {
|
|
207
|
+
let i = start + MARKUP.length;
|
|
208
|
+
while (/\s/.test(body[i]))
|
|
209
|
+
i++;
|
|
210
|
+
if (body[i] !== "{")
|
|
211
|
+
return null;
|
|
212
|
+
const end = matchBalancedBraces(body, i);
|
|
213
|
+
if (end === -1)
|
|
214
|
+
return null;
|
|
215
|
+
const value = extractMarkupText(body.slice(i + 1, end));
|
|
216
|
+
return value ? { value, end: end + 1 } : null;
|
|
217
|
+
}
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
/** Extracts every `key = "..."` or `key = \markup { ... }` assignment from one `\header` block's body. Repeated keys within the same block keep the first occurrence. */
|
|
221
|
+
function fieldsFromHeaderBody(body) {
|
|
37
222
|
const fields = {};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
223
|
+
const identifierRe = /(?<![\w-])([a-zA-Z][\w-]*)\s*=\s*/g;
|
|
224
|
+
let match;
|
|
225
|
+
// biome-ignore lint: reassigned in the while condition
|
|
226
|
+
while ((match = identifierRe.exec(body))) {
|
|
227
|
+
const key = match[1];
|
|
228
|
+
const valueStart = match.index + match[0].length;
|
|
229
|
+
const parsed = parseFieldValue(body, valueStart);
|
|
230
|
+
if (!parsed)
|
|
41
231
|
continue;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
232
|
+
if (!(key in fields))
|
|
233
|
+
fields[key] = parsed.value;
|
|
234
|
+
identifierRe.lastIndex = parsed.end;
|
|
45
235
|
}
|
|
46
236
|
return fields;
|
|
47
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* Extracts every string-valued header field found anywhere in `source`,
|
|
240
|
+
* across every top-level `\header` block (there can be more than one — e.g.
|
|
241
|
+
* book-level metadata plus a per-`\score` override). When the same field name
|
|
242
|
+
* appears in more than one block, the **last occurrence in the file wins** —
|
|
243
|
+
* approximating LilyPond's own inner-scope-overrides-outer-scope header chain
|
|
244
|
+
* for the common case of a book/top-level header followed by per-score ones.
|
|
245
|
+
*/
|
|
246
|
+
export function parseLyHeaderFields(source) {
|
|
247
|
+
const withoutComments = stripComments(source);
|
|
248
|
+
return Object.assign({}, ...allHeaderBodies(withoutComments).map(fieldsFromHeaderBody));
|
|
249
|
+
}
|
|
250
|
+
/** Extracts `title`/`composer` from the file's header block(s) (see `parseLyHeaderFields`); non-string values (e.g. an unbraced `\markup`, `##f`) are treated as absent. */
|
|
251
|
+
export function parseLyHeader(source) {
|
|
252
|
+
const { title, composer } = parseLyHeaderFields(source);
|
|
253
|
+
const fields = {};
|
|
254
|
+
if (title)
|
|
255
|
+
fields.title = title;
|
|
256
|
+
if (composer)
|
|
257
|
+
fields.composer = composer;
|
|
258
|
+
return fields;
|
|
259
|
+
}
|
|
48
260
|
//# sourceMappingURL=parseLyHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseLyHeader.js","sourceRoot":"","sources":["../../src/utils/parseLyHeader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"parseLyHeader.js","sourceRoot":"","sources":["../../src/utils/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IACjD,MAAM,eAAe,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,MAAM,CACnB,EAAE,EACF,GAAG,eAAe,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAC7D,CAAC;AACH,CAAC;AAED,4KAA4K;AAC5K,MAAM,UAAU,aAAa,CAAC,MAAc;IAC3C,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACxD,MAAM,MAAM,GAAmB,EAAE,CAAC;IAClC,IAAI,KAAK;QAAE,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;IAChC,IAAI,QAAQ;QAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACzC,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LilyPond's standard `\header` field names
|
|
3
|
+
*/
|
|
4
|
+
export declare const STANDARD_HEADER_FIELDS: readonly ["dedication", "title", "subtitle", "subsubtitle", "instrument", "poet", "composer", "meter", "arranger", "piece", "opus", "copyright", "tagline"];
|
|
5
|
+
export interface KnownLyHeaderFields {
|
|
6
|
+
dedication?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
subtitle?: string;
|
|
9
|
+
subsubtitle?: string;
|
|
10
|
+
instrument?: string;
|
|
11
|
+
poet?: string;
|
|
12
|
+
composer?: string;
|
|
13
|
+
meter?: string;
|
|
14
|
+
arranger?: string;
|
|
15
|
+
piece?: string;
|
|
16
|
+
opus?: string;
|
|
17
|
+
copyright?: string;
|
|
18
|
+
tagline?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Splits parsed header fields into LilyPond's standard named fields and everything else (e.g. `mutopiacomposer`, `maintainerEmail`). */
|
|
21
|
+
export declare function splitHeaderFields(fields: Record<string, string>): KnownLyHeaderFields & {
|
|
22
|
+
extra: Record<string, string>;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=splitHeaderFields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splitHeaderFields.d.ts","sourceRoot":"","sources":["../../src/utils/splitHeaderFields.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,sBAAsB,YAClC,YAAY,EACZ,OAAO,EACP,UAAU,EACV,aAAa,EACb,YAAY,EACZ,MAAM,EACN,UAAU,EACV,OAAO,EACP,UAAU,EACV,OAAO,EACP,MAAM,EACN,WAAW,EACX,SAAS,CACA,CAAC;AAEX,MAAM,WAAW,mBAAmB;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,yIAAyI;AACzI,wBAAgB,iBAAiB,CAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC5B,mBAAmB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAWzD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LilyPond's standard `\header` field names
|
|
3
|
+
*/
|
|
4
|
+
export const STANDARD_HEADER_FIELDS = [
|
|
5
|
+
"dedication",
|
|
6
|
+
"title",
|
|
7
|
+
"subtitle",
|
|
8
|
+
"subsubtitle",
|
|
9
|
+
"instrument",
|
|
10
|
+
"poet",
|
|
11
|
+
"composer",
|
|
12
|
+
"meter",
|
|
13
|
+
"arranger",
|
|
14
|
+
"piece",
|
|
15
|
+
"opus",
|
|
16
|
+
"copyright",
|
|
17
|
+
"tagline",
|
|
18
|
+
];
|
|
19
|
+
/** Splits parsed header fields into LilyPond's standard named fields and everything else (e.g. `mutopiacomposer`, `maintainerEmail`). */
|
|
20
|
+
export function splitHeaderFields(fields) {
|
|
21
|
+
const known = {};
|
|
22
|
+
const extra = {};
|
|
23
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
24
|
+
if (STANDARD_HEADER_FIELDS.includes(key)) {
|
|
25
|
+
known[key] = value;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
extra[key] = value;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return { ...known, extra };
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=splitHeaderFields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splitHeaderFields.js","sourceRoot":"","sources":["../../src/utils/splitHeaderFields.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC,YAAY;IACZ,OAAO;IACP,UAAU;IACV,aAAa;IACb,YAAY;IACZ,MAAM;IACN,UAAU;IACV,OAAO;IACP,UAAU;IACV,OAAO;IACP,MAAM;IACN,WAAW;IACX,SAAS;CACA,CAAC;AAkBX,yIAAyI;AACzI,MAAM,UAAU,iBAAiB,CAChC,MAA8B;IAE9B,MAAM,KAAK,GAA2B,EAAE,CAAC;IACzC,MAAM,KAAK,GAA2B,EAAE,CAAC;IACzC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACnD,IAAK,sBAA4C,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACjE,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACpB,CAAC;aAAM,CAAC;YACP,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACpB,CAAC;IACF,CAAC;IACD,OAAO,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,CAAC;AAC5B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro-lilypond",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "An Astro integration for rendering Lilypond markup to music notation.",
|
|
5
5
|
"homepage": "https://lilypond.ky.fyi",
|
|
6
6
|
"author": "Ky Decker",
|
|
@@ -17,7 +17,11 @@
|
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
18
|
"import": "./dist/index.js"
|
|
19
19
|
},
|
|
20
|
-
"./component": "./components/LilyPond.astro"
|
|
20
|
+
"./component": "./components/LilyPond.astro",
|
|
21
|
+
"./loader": {
|
|
22
|
+
"types": "./dist/loader.d.ts",
|
|
23
|
+
"import": "./dist/loader.js"
|
|
24
|
+
}
|
|
21
25
|
},
|
|
22
26
|
"files": [
|
|
23
27
|
"dist",
|
|
@@ -26,6 +30,7 @@
|
|
|
26
30
|
"keywords": [
|
|
27
31
|
"astro",
|
|
28
32
|
"astro-integration",
|
|
33
|
+
"astro-loader",
|
|
29
34
|
"engraving",
|
|
30
35
|
"image",
|
|
31
36
|
"images",
|