@r_masseater/song-format 0.2.2 → 0.2.4

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/dist/mapper.mjs CHANGED
@@ -3,7 +3,7 @@ import { runContentMapper } from "ts-content-mapper";
3
3
  // src/app/mapper.ts
4
4
  runContentMapper({
5
5
  diagnosticSource: "fumx",
6
- transform: ({ fileName, content }, { positionEncoding }) => runPromise(promise(() => import("./transform-MqcJm-I-.mjs")).pipe(flatMap(({ transform }) => promise(() => transform({
6
+ transform: ({ fileName, content }, { positionEncoding }) => runPromise(promise(() => import("./transform-CEJ9wvbl.mjs")).pipe(flatMap(({ transform }) => promise(() => transform({
7
7
  fileName,
8
8
  content,
9
9
  positionEncoding
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { a as sortedNotes, i as sortedByTick, n as writeFumx, r as NO_MIX, s as convertMain, t as roundTrip } from "./round-trip-CIXCochn.mjs";
3
- import { s as TICKS_PER_WHOLE } from "./fumx-module-BfH5pPUU.mjs";
2
+ import { a as sortedNotes, i as sortedByTick, n as writeFumx, r as NO_MIX, s as convertMain, t as roundTrip } from "./round-trip-DoHBIPds.mjs";
3
+ import { s as TICKS_PER_WHOLE } from "./fumx-module-BxN-liut.mjs";
4
4
  import { Array, Effect, Match, Option, Order, Predicate, Record, Schema, pipe } from "effect";
5
5
  import { parseMidi } from "midi-file";
6
6
  // src/features/convert-midi/model/channel.ts
@@ -0,0 +1,44 @@
1
+ import { Array, Cause, Console, Effect, Layer, Option, Predicate, Record, Runtime, String, pipe } from "effect";
2
+ import { runMain } from "@effect/platform-node/NodeRuntime";
3
+ import { layer } from "@effect/platform-node/NodeServices";
4
+ import { FetchHttpClient } from "effect/http";
5
+ import { Otlp, OtlpSerialization } from "effect/observability";
6
+ // ../node-main/src/features/run-main/model/report.ts
7
+ const TAG = "_tag";
8
+ const fieldsOf = (failure) => pipe(Option.liftPredicate(failure, Predicate.isObject), Option.map((object) => Record.toEntries({ ...object })), Option.getOrElse(() => []), Array.flatMap(([key, value]) => pipe(Option.liftPredicate(value, Predicate.isString), Option.filter(() => key !== TAG), Option.map((text) => `${key}: ${text}`), Option.toArray)), Array.join(", "));
9
+ const describedOf = (reason, name) => pipe(Option.liftPredicate(reason, Cause.isFailReason), Option.map((failed) => fieldsOf(failed.error)), Option.filter(String.isNonEmpty), Option.match({
10
+ onNone: () => name,
11
+ onSome: (fields) => `${name} (${fields})`
12
+ }));
13
+ const linesOf = (serviceName) => (reason) => pipe(Cause.prettyErrors(Cause.fromReasons([reason])), Array.map((error) => {
14
+ if (String.isEmpty(error.message)) return `${serviceName}: ${describedOf(reason, error.name)}`;
15
+ if (Cause.isDieReason(reason)) return `${serviceName}: ${error.name}: ${error.message}`;
16
+ return `${serviceName}: ${error.message}`;
17
+ }));
18
+ /** @internal */
19
+ const reportOf = (serviceName) => (cause) => {
20
+ if (Cause.hasInterruptsOnly(cause) || !cause.pipe(Cause.squash, Runtime.getErrorReported)) return [];
21
+ return pipe(cause.reasons, Array.filter((reason) => !Cause.isInterruptReason(reason)), Array.flatMap(linesOf(serviceName)));
22
+ };
23
+ // ../node-main/src/features/run-main/model/run-main.ts
24
+ const platform = Layer.mergeAll(layer, FetchHttpClient.layer);
25
+ const runWithTracingAnd = ({ serviceName, services }) => (program) => {
26
+ const tracing = Otlp.layerFromConfig({ resource: { serviceName } }).pipe(Layer.provide(OtlpSerialization.layerJson), Layer.provide(FetchHttpClient.layer));
27
+ const provided = Layer.provideMerge(services, platform);
28
+ const report = reportOf(serviceName);
29
+ runMain(Layer.mergeAll(tracing, provided).pipe(Layer.build, Effect.flatMap((context) => Effect.provideContext(program, context)), Effect.scoped, Effect.tapCause((cause) => Effect.forEach(report(cause), (line) => Console.error(line), {
30
+ concurrency: 1,
31
+ discard: true
32
+ }))), { disableErrorReporting: true });
33
+ };
34
+ const runWithTracing = (serviceName) => runWithTracingAnd({
35
+ serviceName,
36
+ services: Layer.empty
37
+ });
38
+ /** @internal */
39
+ const runMain$1 = runWithTracing;
40
+ // package.json
41
+ var version = "0.2.4";
42
+ export { runMain$1 as n, version as t };
43
+
44
+ //# sourceMappingURL=package-CF2AYNcn.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-CF2AYNcn.mjs","names":["Rec","Arr","Str","nodeServices","runMain"],"sources":["../../node-main/src/features/run-main/model/report.ts","../../node-main/src/features/run-main/model/run-main.ts","../package.json"],"sourcesContent":["import {\n Array as Arr,\n Cause,\n Option,\n Predicate,\n Record as Rec,\n Runtime,\n String as Str,\n pipe,\n} from \"effect\";\n\nconst TAG = \"_tag\";\n\nconst fieldsOf = (failure: unknown): string =>\n pipe(\n Option.liftPredicate(failure, Predicate.isObject),\n Option.map((object): readonly (readonly [string, unknown])[] => Rec.toEntries({ ...object })),\n Option.getOrElse((): readonly (readonly [string, unknown])[] => []),\n Arr.flatMap(([key, value]) =>\n pipe(\n Option.liftPredicate(value, Predicate.isString),\n Option.filter(() => key !== TAG),\n Option.map((text) => `${key}: ${text}`),\n Option.toArray,\n ),\n ),\n Arr.join(\", \"),\n );\n\nconst describedOf = <Failure>(reason: Cause.Reason<Failure>, name: string): string =>\n pipe(\n Option.liftPredicate(reason, Cause.isFailReason),\n Option.map((failed) => fieldsOf(failed.error)),\n Option.filter(Str.isNonEmpty),\n Option.match({ onNone: () => name, onSome: (fields) => `${name} (${fields})` }),\n );\n\nconst linesOf =\n (serviceName: string) =>\n <Failure>(reason: Cause.Reason<Failure>): readonly string[] =>\n pipe(\n Cause.prettyErrors(Cause.fromReasons([reason])),\n Arr.map((error) => {\n if (Str.isEmpty(error.message)) {\n return `${serviceName}: ${describedOf(reason, error.name)}`;\n }\n if (Cause.isDieReason(reason)) {\n return `${serviceName}: ${error.name}: ${error.message}`;\n }\n return `${serviceName}: ${error.message}`;\n }),\n );\n\n/** @internal */\nexport const reportOf =\n (serviceName: string) =>\n <Failure>(cause: Cause.Cause<Failure>): readonly string[] => {\n if (Cause.hasInterruptsOnly(cause) || !cause.pipe(Cause.squash, Runtime.getErrorReported)) {\n return [];\n }\n return pipe(\n cause.reasons,\n Arr.filter((reason) => !Cause.isInterruptReason(reason)),\n Arr.flatMap(linesOf(serviceName)),\n );\n };\n","import { runMain as nodeRuntimeRunMain } from \"@effect/platform-node/NodeRuntime\";\nimport { layer as nodeServices } from \"@effect/platform-node/NodeServices\";\nimport type { NodeServices } from \"@effect/platform-node/NodeServices\";\nimport { Console, Effect, Layer } from \"effect\";\nimport { FetchHttpClient } from \"effect/http\";\nimport type { HttpClient } from \"effect/http\";\nimport { Otlp, OtlpSerialization } from \"effect/observability\";\n\nimport { reportOf } from \"./report.ts\";\n\n/** @internal */\nexport type Platform = NodeServices | HttpClient.HttpClient;\n\n/** @internal */\nexport type Run<Provided> = <Success, Failure>(\n program: Effect.Effect<Success, Failure, Platform | Provided>,\n) => void;\n\nconst platform = Layer.mergeAll(nodeServices, FetchHttpClient.layer);\n\nconst runWithTracingAnd =\n <Provided, LayerFailure>({\n serviceName,\n services,\n }: Readonly<{\n serviceName: string;\n services: Layer.Layer<Provided, LayerFailure, Platform>;\n }>): Run<Provided> =>\n (program) => {\n const tracing = Otlp.layerFromConfig({ resource: { serviceName } }).pipe(\n Layer.provide(OtlpSerialization.layerJson),\n Layer.provide(FetchHttpClient.layer),\n );\n const provided = Layer.provideMerge(services, platform);\n const report = reportOf(serviceName);\n nodeRuntimeRunMain(\n Layer.mergeAll(tracing, provided).pipe(\n Layer.build,\n Effect.flatMap((context) => Effect.provideContext(program, context)),\n Effect.scoped,\n Effect.tapCause((cause) =>\n Effect.forEach(report(cause), (line) => Console.error(line), {\n concurrency: 1,\n discard: true,\n }),\n ),\n ),\n { disableErrorReporting: true },\n );\n };\n\nconst runWithTracing = (serviceName: string): Run<never> =>\n runWithTracingAnd({ serviceName, services: Layer.empty });\n\n/** @internal */\nexport const runMainWith = runWithTracingAnd;\n\n/** @internal */\nexport const runMain = runWithTracing;\n",""],"mappings":";;;;;;AAWA,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F;;AC/CF,MAAM,WAAW,MAAM,SAASE,OAAc,gBAAgB,KAAK;AAEnE,MAAM,qBACqB,EACvB,aACA,gBAKD,YAAY;CACX,MAAM,UAAU,KAAK,gBAAgB,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,KAClE,MAAM,QAAQ,kBAAkB,SAAS,GACzC,MAAM,QAAQ,gBAAgB,KAAK,CACrC;CACA,MAAM,WAAW,MAAM,aAAa,UAAU,QAAQ;CACtD,MAAM,SAAS,SAAS,WAAW;CACnC,QACE,MAAM,SAAS,SAAS,QAAQ,CAAC,CAAC,KAChC,MAAM,OACN,OAAO,SAAS,YAAY,OAAO,eAAe,SAAS,OAAO,CAAC,GACnE,OAAO,QACP,OAAO,UAAU,UACf,OAAO,QAAQ,OAAO,KAAK,IAAI,SAAS,QAAQ,MAAM,IAAI,GAAG;EAC3D,aAAa;EACb,SAAS;CACX,CAAC,CACH,CACF,GACA,EAAE,uBAAuB,KAAK,CAChC;AACF;AAEF,MAAM,kBAAkB,gBACtB,kBAAkB;CAAE;CAAa,UAAU,MAAM;AAAM,CAAC;;AAM1D,MAAaC,YAAU"}
@@ -1,6 +1,6 @@
1
- import { a as importedUriOf, i as compileSong, n as createFumxServices, o as isNamed, p as isSong } from "./fumx-module-BfH5pPUU.mjs";
2
- import { CstUtils, DocumentValidator, GrammarUtils, URI, isLeafCstNode } from "langium";
1
+ import { a as importedUriOf, i as compileSong, n as createFumxServices, o as isNamed, p as isSong } from "./fumx-module-BxN-liut.mjs";
3
2
  import { Array, Effect, Option, Predicate, pipe } from "effect";
3
+ import { CstUtils, DocumentValidator, GrammarUtils, URI, isLeafCstNode } from "langium";
4
4
  // src/features/read-song/model/comments.ts
5
5
  const KINDS = ["SL_COMMENT", "ML_COMMENT"];
6
6
  const FIRST$1 = 1;
@@ -125,4 +125,4 @@ const readSong = Effect.fnUntraced(function* read(files) {
125
125
  });
126
126
  export { readSong as t };
127
127
 
128
- //# sourceMappingURL=read-song-ypQjpC0y.mjs.map
128
+ //# sourceMappingURL=read-song-C7MGcv8n.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"read-song-ypQjpC0y.mjs","names":["FIRST","Arr","Arr","Arr"],"sources":["../src/features/read-song/model/comments.ts","../src/features/read-song/model/outline.ts","../src/features/read-song/model/read-song.ts"],"sourcesContent":["import { Array as Arr, Option, pipe } from \"effect\";\nimport { CstUtils, isLeafCstNode } from \"langium\";\nimport type { AstNode, CstNode, LeafCstNode } from \"langium\";\n\nimport type { From } from \"./problem.ts\";\n\nconst KINDS = [\"SL_COMMENT\", \"ML_COMMENT\"];\nconst FIRST = 1;\n\nexport interface SourceComment {\n readonly line: number;\n readonly column: number;\n readonly text: string;\n}\n\nconst leavesOf: From<CstNode, readonly LeafCstNode[]> = (cst) =>\n CstUtils.streamCst(cst)\n .filter((node) => isLeafCstNode(node))\n .toArray();\n\nconst isComment: From<LeafCstNode, boolean> = (leaf) =>\n leaf.hidden && Arr.contains(KINDS, leaf.tokenType.name);\n\nexport const commentsOf: From<AstNode, readonly SourceComment[]> = (root) =>\n pipe(\n Option.fromNullishOr(root.$cstNode),\n Option.map(leavesOf),\n Option.getOrElse((): readonly LeafCstNode[] => []),\n Arr.filter(isComment),\n Arr.map((leaf) => ({\n line: leaf.range.start.line + FIRST,\n column: leaf.range.start.character + FIRST,\n text: leaf.text,\n })),\n );\n","import { Array as Arr, Option, pipe } from \"effect\";\nimport { GrammarUtils } from \"langium\";\nimport type { AstNode, CstNode } from \"langium\";\n\nimport type { Song as SongNode } from \"#generated/langium/ast.ts\";\n\nimport { commentsOf } from \"./comments.ts\";\nimport type { SourceComment } from \"./comments.ts\";\nimport { isNamed } from \"./declarations.ts\";\nimport type { Named } from \"./declarations.ts\";\nimport type { From } from \"./problem.ts\";\nimport { importedUriOf } from \"./scope.ts\";\n\nexport interface Span {\n readonly start: number;\n readonly end: number;\n}\n\nexport interface NamedSpan {\n readonly type: Named[\"$type\"];\n readonly name: string;\n readonly span: Span;\n}\n\nexport interface ImportSpan {\n readonly path: string;\n readonly span: Span;\n}\n\nexport interface Outline {\n readonly title: Option.Option<Span>;\n readonly names: readonly NamedSpan[];\n readonly imports: readonly ImportSpan[];\n readonly files: readonly string[];\n readonly comments: readonly SourceComment[];\n}\n\nexport const emptyOutline: Outline = {\n title: Option.none(),\n names: [],\n imports: [],\n files: [],\n comments: [],\n};\n\nconst spanOf: From<CstNode, Span> = (node) => ({ start: node.offset, end: node.end });\n\nconst propertySpanOf: From<AstNode, From<string, Option.Option<Span>>> = (node) => (property) =>\n pipe(\n Option.fromNullishOr(GrammarUtils.findNodeForProperty(node.$cstNode, property)),\n Option.map(spanOf),\n );\n\nconst namesOf: From<SongNode, readonly NamedSpan[]> = (song) =>\n pipe(\n song.declarations,\n Arr.filter(isNamed),\n Arr.flatMap((declaration) =>\n pipe(\n propertySpanOf(declaration)(\"name\"),\n Option.map((span) => ({ type: declaration.$type, name: declaration.name, span })),\n Option.toArray,\n ),\n ),\n );\n\nconst importsOf: From<SongNode, readonly ImportSpan[]> = (song) =>\n pipe(\n song.imports,\n Arr.flatMap((node) =>\n pipe(\n propertySpanOf(node)(\"path\"),\n Option.map((span) => ({ path: importedUriOf(node).fsPath, span })),\n Option.toArray,\n ),\n ),\n );\n\nexport const outlineOf: From<readonly string[], From<SongNode, Outline>> = (files) => (song) => ({\n title: propertySpanOf(song)(\"title\"),\n names: namesOf(song),\n imports: importsOf(song),\n files,\n comments: commentsOf(song),\n});\n","import { Array as Arr, Effect, Option, Predicate, pipe } from \"effect\";\nimport { DocumentValidator, URI } from \"langium\";\nimport type { LangiumDocument } from \"langium\";\nimport type { Diagnostic } from \"vscode-languageserver\";\n\nimport type { Song } from \"#/entities/song/index.ts\";\nimport { isSong } from \"#generated/langium/ast.ts\";\nimport type { Song as SongNode } from \"#generated/langium/ast.ts\";\n\nimport { compileSong } from \"./compile.ts\";\nimport { createFumxServices } from \"./fumx-module.ts\";\nimport type { FumxServices } from \"./fumx-module.ts\";\nimport { emptyOutline, outlineOf } from \"./outline.ts\";\nimport type { Outline } from \"./outline.ts\";\nimport type { From } from \"./problem.ts\";\nimport { importedUriOf } from \"./scope.ts\";\n\nconst FIRST = 1;\nconst ERROR = 1;\n\nconst VALIDATION = {\n stopAfterLexingErrors: true,\n stopAfterParsingErrors: true,\n};\n\nexport interface SourceIssue {\n readonly path: string;\n readonly line: number;\n readonly column: number;\n readonly start: number;\n readonly end: number;\n readonly message: string;\n}\n\nexport type SongSource =\n | {\n readonly status: \"invalid\";\n readonly issues: readonly SourceIssue[];\n readonly outline: Outline;\n }\n | { readonly status: \"valid\"; readonly song: Song; readonly outline: Outline };\n\nexport interface SongFiles<Failure> {\n readonly path: string;\n readonly read: (path: string) => Effect.Effect<string, Failure>;\n}\n\nconst messageOf: From<Diagnostic[\"message\"], string> = (message) => {\n if (Predicate.isString(message)) {\n return message;\n }\n return message.value;\n};\n\ntype Reader = From<string, Effect.Effect<Option.Option<string>>>;\n\nconst loader: From<FumxServices, From<Reader, From<URI, Effect.Effect<void>>>> =\n (services) => (read) => {\n const { LangiumDocuments, LangiumDocumentFactory } = services.shared.workspace;\n const load: From<URI, Effect.Effect<void>> = (uri) =>\n Effect.gen(function* loadDocument() {\n if (LangiumDocuments.hasDocument(uri)) {\n return;\n }\n const text = yield* read(uri.fsPath);\n if (Option.isNone(text)) {\n return;\n }\n const document = LangiumDocumentFactory.fromString<SongNode>(text.value, uri);\n LangiumDocuments.addDocument(document);\n yield* Effect.forEach(\n document.parseResult.value.imports,\n (node) => load(importedUriOf(node)),\n { concurrency: 1, discard: true },\n );\n });\n return load;\n };\n\nconst isParsingError = (diagnostic: Diagnostic): boolean =>\n Predicate.hasProperty(diagnostic.data, \"code\") &&\n diagnostic.data.code === DocumentValidator.ParsingError;\n\nconst sameSyntaxError = (one: Diagnostic, other: Diagnostic): boolean =>\n isParsingError(one) &&\n isParsingError(other) &&\n one.range.start.line === other.range.start.line &&\n one.range.start.character === other.range.start.character;\n\nconst issuesOf: From<LangiumDocument, readonly SourceIssue[]> = (document) =>\n pipe(\n document.diagnostics ?? [],\n Arr.filter((diagnostic) => diagnostic.severity === ERROR),\n Arr.dedupeWith(sameSyntaxError),\n Arr.map((diagnostic) => ({\n path: document.uri.fsPath,\n line: diagnostic.range.start.line + FIRST,\n column: diagnostic.range.start.character + FIRST,\n start: document.textDocument.offsetAt(diagnostic.range.start),\n end: document.textDocument.offsetAt(diagnostic.range.end),\n message: messageOf(diagnostic.message),\n })),\n );\n\nconst builtOf: From<FumxServices, From<URI, Effect.Effect<SongSource>>> = (services) => (entry) =>\n Effect.gen(function* build() {\n const { workspace } = services.shared;\n const documents = workspace.LangiumDocuments.all.toArray();\n yield* Effect.promise(() =>\n workspace.DocumentBuilder.build(documents, { validation: VALIDATION }),\n );\n const files = pipe(\n documents,\n Arr.map((document) => document.uri.fsPath),\n );\n const root = pipe(\n Option.fromNullishOr(workspace.LangiumDocuments.getDocument(entry)),\n Option.map((document) => document.parseResult.value),\n Option.filter(isSong),\n );\n const outline = pipe(\n root,\n Option.map(outlineOf(files)),\n Option.getOrElse(() => ({ ...emptyOutline, files })),\n );\n const issues = pipe(documents, Arr.flatMap(issuesOf));\n if (Arr.isReadonlyArrayNonEmpty(issues)) {\n return { status: \"invalid\", issues, outline };\n }\n return Option.match(root, {\n onNone: (): SongSource => ({ status: \"invalid\", issues: [], outline }),\n onSome: (song): SongSource => ({ status: \"valid\", song: compileSong(song).value, outline }),\n });\n });\n\nexport const readSong = Effect.fnUntraced(function* read<Failure>(\n files: SongFiles<Failure>,\n): Effect.fn.Return<SongSource> {\n const services = createFumxServices();\n const entry = URI.file(files.path);\n yield* loader(services)((path) => Effect.option(files.read(path)))(entry);\n if (!services.shared.workspace.LangiumDocuments.hasDocument(entry)) {\n return {\n status: \"invalid\",\n issues: [\n {\n path: files.path,\n line: FIRST,\n column: FIRST,\n start: 0,\n end: 0,\n message: \"ファイルを読めません\",\n },\n ],\n outline: emptyOutline,\n };\n }\n return yield* builtOf(services)(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M,QAAQ,IAAI,KAAK,MAAM,IAAI;CACjC,OAAO,OAAO,QAAQ,CAAC,EAAE,SAAS,OAAO,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK;CACxE,IAAI,CAAC,SAAS,OAAO,UAAU,iBAAiB,YAAY,KAAK,GAC/D,OAAO;EACL,QAAQ;EACR,QAAQ,CACN;GACE,MAAM,MAAM;GACZ,MAAM;GACN,QAAQ;GACR,OAAO;GACP,KAAK;GACL,SAAS;EACX,CACF;EACA,SAAS;CACX;CAEF,OAAO,OAAO,QAAQ,QAAQ,CAAC,CAAC,KAAK;AACvC,CAAC"}
1
+ {"version":3,"file":"read-song-C7MGcv8n.mjs","names":["FIRST","Arr","Arr","Arr"],"sources":["../src/features/read-song/model/comments.ts","../src/features/read-song/model/outline.ts","../src/features/read-song/model/read-song.ts"],"sourcesContent":["import { Array as Arr, Option, pipe } from \"effect\";\nimport { CstUtils, isLeafCstNode } from \"langium\";\nimport type { AstNode, CstNode, LeafCstNode } from \"langium\";\n\nimport type { From } from \"./problem.ts\";\n\nconst KINDS = [\"SL_COMMENT\", \"ML_COMMENT\"];\nconst FIRST = 1;\n\nexport interface SourceComment {\n readonly line: number;\n readonly column: number;\n readonly text: string;\n}\n\nconst leavesOf: From<CstNode, readonly LeafCstNode[]> = (cst) =>\n CstUtils.streamCst(cst)\n .filter((node) => isLeafCstNode(node))\n .toArray();\n\nconst isComment: From<LeafCstNode, boolean> = (leaf) =>\n leaf.hidden && Arr.contains(KINDS, leaf.tokenType.name);\n\nexport const commentsOf: From<AstNode, readonly SourceComment[]> = (root) =>\n pipe(\n Option.fromNullishOr(root.$cstNode),\n Option.map(leavesOf),\n Option.getOrElse((): readonly LeafCstNode[] => []),\n Arr.filter(isComment),\n Arr.map((leaf) => ({\n line: leaf.range.start.line + FIRST,\n column: leaf.range.start.character + FIRST,\n text: leaf.text,\n })),\n );\n","import { Array as Arr, Option, pipe } from \"effect\";\nimport { GrammarUtils } from \"langium\";\nimport type { AstNode, CstNode } from \"langium\";\n\nimport type { Song as SongNode } from \"#generated/langium/ast.ts\";\n\nimport { commentsOf } from \"./comments.ts\";\nimport type { SourceComment } from \"./comments.ts\";\nimport { isNamed } from \"./declarations.ts\";\nimport type { Named } from \"./declarations.ts\";\nimport type { From } from \"./problem.ts\";\nimport { importedUriOf } from \"./scope.ts\";\n\nexport interface Span {\n readonly start: number;\n readonly end: number;\n}\n\nexport interface NamedSpan {\n readonly type: Named[\"$type\"];\n readonly name: string;\n readonly span: Span;\n}\n\nexport interface ImportSpan {\n readonly path: string;\n readonly span: Span;\n}\n\nexport interface Outline {\n readonly title: Option.Option<Span>;\n readonly names: readonly NamedSpan[];\n readonly imports: readonly ImportSpan[];\n readonly files: readonly string[];\n readonly comments: readonly SourceComment[];\n}\n\nexport const emptyOutline: Outline = {\n title: Option.none(),\n names: [],\n imports: [],\n files: [],\n comments: [],\n};\n\nconst spanOf: From<CstNode, Span> = (node) => ({ start: node.offset, end: node.end });\n\nconst propertySpanOf: From<AstNode, From<string, Option.Option<Span>>> = (node) => (property) =>\n pipe(\n Option.fromNullishOr(GrammarUtils.findNodeForProperty(node.$cstNode, property)),\n Option.map(spanOf),\n );\n\nconst namesOf: From<SongNode, readonly NamedSpan[]> = (song) =>\n pipe(\n song.declarations,\n Arr.filter(isNamed),\n Arr.flatMap((declaration) =>\n pipe(\n propertySpanOf(declaration)(\"name\"),\n Option.map((span) => ({ type: declaration.$type, name: declaration.name, span })),\n Option.toArray,\n ),\n ),\n );\n\nconst importsOf: From<SongNode, readonly ImportSpan[]> = (song) =>\n pipe(\n song.imports,\n Arr.flatMap((node) =>\n pipe(\n propertySpanOf(node)(\"path\"),\n Option.map((span) => ({ path: importedUriOf(node).fsPath, span })),\n Option.toArray,\n ),\n ),\n );\n\nexport const outlineOf: From<readonly string[], From<SongNode, Outline>> = (files) => (song) => ({\n title: propertySpanOf(song)(\"title\"),\n names: namesOf(song),\n imports: importsOf(song),\n files,\n comments: commentsOf(song),\n});\n","import { Array as Arr, Effect, Option, Predicate, pipe } from \"effect\";\nimport { DocumentValidator, URI } from \"langium\";\nimport type { LangiumDocument } from \"langium\";\nimport type { Diagnostic } from \"vscode-languageserver\";\n\nimport type { Song } from \"#/entities/song/index.ts\";\nimport { isSong } from \"#generated/langium/ast.ts\";\nimport type { Song as SongNode } from \"#generated/langium/ast.ts\";\n\nimport { compileSong } from \"./compile.ts\";\nimport { createFumxServices } from \"./fumx-module.ts\";\nimport type { FumxServices } from \"./fumx-module.ts\";\nimport { emptyOutline, outlineOf } from \"./outline.ts\";\nimport type { Outline } from \"./outline.ts\";\nimport type { From } from \"./problem.ts\";\nimport { importedUriOf } from \"./scope.ts\";\n\nconst FIRST = 1;\nconst ERROR = 1;\n\nconst VALIDATION = {\n stopAfterLexingErrors: true,\n stopAfterParsingErrors: true,\n};\n\nexport interface SourceIssue {\n readonly path: string;\n readonly line: number;\n readonly column: number;\n readonly start: number;\n readonly end: number;\n readonly message: string;\n}\n\nexport type SongSource =\n | {\n readonly status: \"invalid\";\n readonly issues: readonly SourceIssue[];\n readonly outline: Outline;\n }\n | { readonly status: \"valid\"; readonly song: Song; readonly outline: Outline };\n\nexport interface SongFiles<Failure> {\n readonly path: string;\n readonly read: (path: string) => Effect.Effect<string, Failure>;\n}\n\nconst messageOf: From<Diagnostic[\"message\"], string> = (message) => {\n if (Predicate.isString(message)) {\n return message;\n }\n return message.value;\n};\n\ntype Reader = From<string, Effect.Effect<Option.Option<string>>>;\n\nconst loader: From<FumxServices, From<Reader, From<URI, Effect.Effect<void>>>> =\n (services) => (read) => {\n const { LangiumDocuments, LangiumDocumentFactory } = services.shared.workspace;\n const load: From<URI, Effect.Effect<void>> = (uri) =>\n Effect.gen(function* loadDocument() {\n if (LangiumDocuments.hasDocument(uri)) {\n return;\n }\n const text = yield* read(uri.fsPath);\n if (Option.isNone(text)) {\n return;\n }\n const document = LangiumDocumentFactory.fromString<SongNode>(text.value, uri);\n LangiumDocuments.addDocument(document);\n yield* Effect.forEach(\n document.parseResult.value.imports,\n (node) => load(importedUriOf(node)),\n { concurrency: 1, discard: true },\n );\n });\n return load;\n };\n\nconst isParsingError = (diagnostic: Diagnostic): boolean =>\n Predicate.hasProperty(diagnostic.data, \"code\") &&\n diagnostic.data.code === DocumentValidator.ParsingError;\n\nconst sameSyntaxError = (one: Diagnostic, other: Diagnostic): boolean =>\n isParsingError(one) &&\n isParsingError(other) &&\n one.range.start.line === other.range.start.line &&\n one.range.start.character === other.range.start.character;\n\nconst issuesOf: From<LangiumDocument, readonly SourceIssue[]> = (document) =>\n pipe(\n document.diagnostics ?? [],\n Arr.filter((diagnostic) => diagnostic.severity === ERROR),\n Arr.dedupeWith(sameSyntaxError),\n Arr.map((diagnostic) => ({\n path: document.uri.fsPath,\n line: diagnostic.range.start.line + FIRST,\n column: diagnostic.range.start.character + FIRST,\n start: document.textDocument.offsetAt(diagnostic.range.start),\n end: document.textDocument.offsetAt(diagnostic.range.end),\n message: messageOf(diagnostic.message),\n })),\n );\n\nconst builtOf: From<FumxServices, From<URI, Effect.Effect<SongSource>>> = (services) => (entry) =>\n Effect.gen(function* build() {\n const { workspace } = services.shared;\n const documents = workspace.LangiumDocuments.all.toArray();\n yield* Effect.promise(() =>\n workspace.DocumentBuilder.build(documents, { validation: VALIDATION }),\n );\n const files = pipe(\n documents,\n Arr.map((document) => document.uri.fsPath),\n );\n const root = pipe(\n Option.fromNullishOr(workspace.LangiumDocuments.getDocument(entry)),\n Option.map((document) => document.parseResult.value),\n Option.filter(isSong),\n );\n const outline = pipe(\n root,\n Option.map(outlineOf(files)),\n Option.getOrElse(() => ({ ...emptyOutline, files })),\n );\n const issues = pipe(documents, Arr.flatMap(issuesOf));\n if (Arr.isReadonlyArrayNonEmpty(issues)) {\n return { status: \"invalid\", issues, outline };\n }\n return Option.match(root, {\n onNone: (): SongSource => ({ status: \"invalid\", issues: [], outline }),\n onSome: (song): SongSource => ({ status: \"valid\", song: compileSong(song).value, outline }),\n });\n });\n\nexport const readSong = Effect.fnUntraced(function* read<Failure>(\n files: SongFiles<Failure>,\n): Effect.fn.Return<SongSource> {\n const services = createFumxServices();\n const entry = URI.file(files.path);\n yield* loader(services)((path) => Effect.option(files.read(path)))(entry);\n if (!services.shared.workspace.LangiumDocuments.hasDocument(entry)) {\n return {\n status: \"invalid\",\n issues: [\n {\n path: files.path,\n line: FIRST,\n column: FIRST,\n start: 0,\n end: 0,\n message: \"ファイルを読めません\",\n },\n ],\n outline: emptyOutline,\n };\n }\n return yield* builtOf(services)(entry);\n});\n"],"mappings":";;;;AAMA,MAAM,QAAQ,CAAC,cAAc,YAAY;AACzC,MAAMA,UAAQ;AAQd,MAAM,YAAmD,QACvD,SAAS,UAAU,GAAG,CAAC,CACpB,QAAQ,SAAS,cAAc,IAAI,CAAC,CAAC,CACrC,QAAQ;AAEb,MAAM,aAAyC,SAC7C,KAAK,UAAUC,MAAI,SAAS,OAAO,KAAK,UAAU,IAAI;AAExD,MAAa,cAAuD,SAClE,KACE,OAAO,cAAc,KAAK,QAAQ,GAClC,OAAO,IAAI,QAAQ,GACnB,OAAO,gBAAwC,CAAC,CAAC,GACjDA,MAAI,OAAO,SAAS,GACpBA,MAAI,KAAK,UAAU;CACjB,MAAM,KAAK,MAAM,MAAM,OAAOD;CAC9B,QAAQ,KAAK,MAAM,MAAM,YAAYA;CACrC,MAAM,KAAK;AACb,EAAE,CACJ;;ACGF,MAAa,eAAwB;CACnC,OAAO,OAAO,KAAK;CACnB,OAAO,CAAC;CACR,SAAS,CAAC;CACV,OAAO,CAAC;CACR,UAAU,CAAC;AACb;AAEA,MAAM,UAA+B,UAAU;CAAE,OAAO,KAAK;CAAQ,KAAK,KAAK;AAAI;AAEnF,MAAM,kBAAoE,UAAU,aAClF,KACE,OAAO,cAAc,aAAa,oBAAoB,KAAK,UAAU,QAAQ,CAAC,GAC9E,OAAO,IAAI,MAAM,CACnB;AAEF,MAAM,WAAiD,SACrD,KACE,KAAK,cACLE,MAAI,OAAO,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AM,GACpC,OAAO;EAAE,QAAQ;EAAW;EAAQ;CAAQ;CAE9C,OAAO,OAAO,MAAM,MAAM;EACxB,eAA2B;GAAE,QAAQ;GAAW,QAAQ,CAAC;GAAG;EAAQ;EACpE,SAAS,UAAsB;GAAE,QAAQ;GAAS,MAAM,YAAY,IAAI,CAAC,CAAC;GAAO;EAAQ;CAC3F,CAAC;AACH,CAAC;AAEH,MAAa,WAAW,OAAO,WAAW,UAAU,KAClD,OAC8B;CAC9B,MAAM,WAAW,mBAAmB;CACpC,MAAM,QAAQ,IAAI,KAAK,MAAM,IAAI;CACjC,OAAO,OAAO,QAAQ,CAAC,EAAE,SAAS,OAAO,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK;CACxE,IAAI,CAAC,SAAS,OAAO,UAAU,iBAAiB,YAAY,KAAK,GAC/D,OAAO;EACL,QAAQ;EACR,QAAQ,CACN;GACE,MAAM,MAAM;GACZ,MAAM;GACN,QAAQ;GACR,OAAO;GACP,KAAK;GACL,SAAS;EACX,CACF;EACA,SAAS;CACX;CAEF,OAAO,OAAO,QAAQ,QAAQ,CAAC,CAAC,KAAK;AACvC,CAAC"}
@@ -1,10 +1,10 @@
1
- import { c as fractionOf, d as FumxGrammar, f as FumxTerminals, s as TICKS_PER_WHOLE } from "./fumx-module-BfH5pPUU.mjs";
2
- import { t as readSong } from "./read-song-ypQjpC0y.mjs";
3
- import { n as runMain, t as version } from "./package-BhGdZERV.mjs";
4
- import { AstUtils, GrammarAST } from "langium";
1
+ import { n as runMain, t as version } from "./package-CF2AYNcn.mjs";
2
+ import { c as fractionOf, d as FumxGrammar, f as FumxTerminals, s as TICKS_PER_WHOLE } from "./fumx-module-BxN-liut.mjs";
3
+ import { t as readSong } from "./read-song-C7MGcv8n.mjs";
5
4
  import { Array, Console, Effect, FileSystem, Option, Order, Path, Record, Schema, String as String$1, pipe } from "effect";
6
- import { Midi } from "tonal";
7
5
  import { Argument, Command, Flag } from "effect/cli";
6
+ import { AstUtils, GrammarAST } from "langium";
7
+ import { Midi } from "tonal";
8
8
  // src/app/convert-command.ts
9
9
  const INDENT$1 = 2;
10
10
  const taggedError$1 = Schema.TaggedError;
@@ -943,4 +943,4 @@ const roundTrip = Effect.fn("roundTrip")(function* check(path, fumx) {
943
943
  });
944
944
  export { sortedNotes as a, sortedByTick as i, writeFumx as n, microsecondsOf as o, NO_MIX as r, convertMain as s, roundTrip as t };
945
945
 
946
- //# sourceMappingURL=round-trip-CIXCochn.mjs.map
946
+ //# sourceMappingURL=round-trip-DoHBIPds.mjs.map