songproorg / songpro-javascript Goto Github PK
View Code? Open in Web Editor NEWA Javascript package to convert SongPro songs to a Javascript object used to generate various output formats.
Home Page: https://songpro.org
License: MIT License
A Javascript package to convert SongPro songs to a Javascript object used to generate various output formats.
Home Page: https://songpro.org
License: MIT License
Hi, when installing this package from npm, it appears that only the license, readme, and package.json files are included in the node_modules folder. I checked out the project and attempted to build it, but got the following error about the babel version
ERROR in ./src/SongPro.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel. (While processing preset: "/home/chris/songpro-js/node_modules/@babel/preset-env/lib/index.js")
at throwVersionError (/home/chris/songpro-js/node_modules/@babel/helper-plugin-utils/lib/index.js:65:11)
at Object.assertVersion (/home/chris/songpro-js/node_modules/@babel/helper-plugin-utils/lib/index.js:13:11)
at /home/chris/songpro-js/node_modules/@babel/preset-env/lib/index.js:188:7
at /home/chris/songpro-js/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
at /home/chris/songpro-js/node_modules/babel-core/lib/transformation/file/options/option-manager.js:317:46
at Array.map (<anonymous>)
at OptionManager.resolvePresets (/home/chris/songpro-js/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
at OptionManager.mergePresets (/home/chris/songpro-js/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
at OptionManager.mergeOptions (/home/chris/songpro-js/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
at OptionManager.init (/home/chris/songpro-js/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
at File.initOptions (/home/chris/songpro-js/node_modules/babel-core/lib/transformation/file/index.js:212:65)
at new File (/home/chris/songpro-js/node_modules/babel-core/lib/transformation/file/index.js:135:24)
at Pipeline.transform (/home/chris/songpro-js/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
at transpile (/home/chris/songpro-js/node_modules/babel-loader/lib/index.js:50:20)
at Object.module.exports (/home/chris/songpro-js/node_modules/babel-loader/lib/index.js:173:20)
is it possible the latest build is broken?
All other implementations of SongPro put the core attributes like title
and author
on the song
object, but the Javascript library currently puts them under an attrs
object. Additionally the README shows the non-attrs approach.
My preference is for the Javascript library to be consistent with all other libraries.
Expected:
let song = SongPro.parse(contents);
console.log(song.title);
console.log(song.artist);
Actual:
let song = SongPro.parse(contents);
console.log(song.attrs.title);
console.log(song.attrs.artist);
I believe this package might be built in an odd way that does not allow for a standard way of importing it into a project.
I have tried a lot of different things, but in the end nothing works. See my efforts here on the StackOverflow question which I won't repeat in this issue: https://stackoverflow.com/questions/76285992/including-js-package-import-in-a-typescript-project
To summarize though, I have a TypeScript project and none of the following imports do anything
import * as songpro from 'songpro'
const songpro = require('songpro');
const songpro = require('SongPro');
For all of them the songpro
object is totally empty when I log it to the console, it has no methods or properties on it.
I'd love to get any advice from you if I am doing something wrong, but if not it would be fantastic if this project used a standard module system to allow for easy importing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.