music-jsx-compiler 0.1.0 → 0.1.2

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.
@@ -10,6 +10,14 @@ export declare function Loop(props: {
10
10
  times: number;
11
11
  children?: LoopNode["children"] | LoopNode["children"][number];
12
12
  }): LoopNode;
13
+ export declare function Chorus(props: {
14
+ name?: string;
15
+ children?: SectionNode["children"] | SectionNode["children"][number];
16
+ }): SectionNode;
17
+ export declare function Verse(props: {
18
+ name?: string;
19
+ children?: SectionNode["children"] | SectionNode["children"][number];
20
+ }): SectionNode;
13
21
  export declare function Bridge(props: {
14
22
  name?: string;
15
23
  children?: SectionNode["children"] | SectionNode["children"][number];
@@ -16,6 +16,20 @@ export function Loop(props) {
16
16
  children: collectChildren(props.children),
17
17
  };
18
18
  }
19
+ export function Chorus(props) {
20
+ return {
21
+ type: "section",
22
+ name: props.name ?? "Chorus",
23
+ children: collectChildren(props.children),
24
+ };
25
+ }
26
+ export function Verse(props) {
27
+ return {
28
+ type: "section",
29
+ name: props.name ?? "Verse",
30
+ children: collectChildren(props.children),
31
+ };
32
+ }
19
33
  export function Bridge(props) {
20
34
  return {
21
35
  type: "section",
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export type * from "./types.js";
2
2
  export { jsx, jsxs, Fragment } from "./jsx-runtime.js";
3
- export { Song, Loop, Bridge, Section, ChordBar, Comment, Words } from "./components.js";
3
+ export { Song, Loop, Bridge, Chorus, Verse, Section, ChordBar, Comment, Words } from "./components.js";
4
4
  export { compileToMusicXml } from "./compile.js";
5
5
  export { parseChord } from "./chord-parser.js";
6
6
  export { flattenSong } from "./flatten.js";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { jsx, jsxs, Fragment } from "./jsx-runtime.js";
2
- export { Song, Loop, Bridge, Section, ChordBar, Comment, Words } from "./components.js";
2
+ export { Song, Loop, Bridge, Chorus, Verse, Section, ChordBar, Comment, Words } from "./components.js";
3
3
  export { compileToMusicXml } from "./compile.js";
4
4
  export { parseChord } from "./chord-parser.js";
5
5
  export { flattenSong } from "./flatten.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "music-jsx-compiler",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "JSX-like component framework for building MusicXML",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  "scripts": {
30
30
  "build": "tsc",
31
31
  "prepack": "npm run build",
32
- "example": "tsx --tsconfig tsconfig.examples.json examples/example.tsx",
32
+ "compile": "tsx --tsconfig tsconfig.input.json input/toCompile.tsx",
33
33
  "check": "tsc --noEmit && tsx src/self-check.ts && npm run example"
34
34
  },
35
35
  "keywords": [