Explorar o código

Preliminary skeleton

Andrea Condoluci %!s(int64=9) %!d(string=hai) anos
pai
achega
60156ef2f5
Modificáronse 4 ficheiros con 196 adicións e 0 borrados
  1. 135 0
      Gruntfile.js
  2. 7 0
      README.md
  3. 20 0
      build.js
  4. 34 0
      package.json

+ 135 - 0
Gruntfile.js

@@ -0,0 +1,135 @@
+module.exports = function(grunt) {
+  var L = grunt.log.writeln;
+  var BANNER = '/**\n' +
+                ' * Open Sheet Music Display library <%= pkg.version %> built on <%= grunt.template.today("yyyy-mm-dd") %>.\n' +
+                ' * Copyright (c) 2016 PhonicScore\n' +
+                ' *\n' +
+                ' * https://github.com/opensheetmusicdisplay/opensheetmusicdisplay\n' +
+                ' */\n';
+  var BUILD_DIR = 'build';
+  var RELEASE_DIR = 'releases';
+  var TARGET_RAW = BUILD_DIR + '/osmd.js';
+  var TARGET_MIN = BUILD_DIR + '/osmd-min.js';
+
+  var SOURCES = [ "src/source.js",
+                  "src/*.js", "!src/header.js", "!src/container.js"];
+
+  grunt.initConfig({
+    pkg: grunt.file.readJSON('package.json'),
+    concat: {
+      options: {
+        banner: BANNER
+      },
+      build: {
+        src: SOURCES,
+        dest: TARGET_RAW
+      }
+    },
+    uglify: {
+      options: {
+        banner: BANNER,
+        sourceMap: true
+      },
+      build: {
+        src: SOURCES,
+        dest: TARGET_MIN
+      }
+    },
+    jshint: {
+      files: SOURCES,
+      options: {
+        eqnull: true,   // allow == and ~= for nulls
+        sub: true,      // don't enforce dot notation
+        trailing: true, // no more trailing spaces
+        globals: {
+          "Vex": false,
+          "Raphael": false
+         }
+      }
+    },
+    watch: {
+      scripts: {
+        files: ['src/*', 'Gruntfile.js'],
+        tasks: ['concat', 'jshint'],
+        options: {
+          interrupt: true
+        }
+      }
+    },
+    copy: {
+      release: {
+        files: [
+          {
+            expand: true,
+            dest: RELEASE_DIR,
+            cwd: BUILD_DIR,
+            src    : ['*.js', 'docs/**', '*.map']
+          }
+        ]
+      }
+    },
+    docco: {
+      src: SOURCES,
+      options: {
+        layout: 'linear',
+        output: 'build/docs'
+      }
+    },
+    gitcommit: {
+      releases: {
+        options: {
+          message: "Committing release binaries for new version: <%= pkg.version %>",
+          verbose: true
+        },
+        files: [
+          {
+            src: [RELEASE_DIR + "/*.js", RELEASE_DIR + "/*.map"],
+            expand: true
+          }
+        ]
+      }
+    },
+    bump: {
+      options: {
+        files: ['package.json', 'component.json'],
+        commitFiles: ['package.json', 'component.json'],
+        updateConfigs: ['pkg'],
+        createTag: false,
+        push: false
+      }
+    },
+    release: {
+      options: {
+        bump: false,
+        commit: false
+      }
+    },
+    clean: [BUILD_DIR, RELEASE_DIR],
+  });
+
+  // Load the plugin that provides the "uglify" task.
+  grunt.loadNpmTasks('grunt-contrib-concat');
+  grunt.loadNpmTasks('grunt-contrib-uglify');
+  grunt.loadNpmTasks('grunt-contrib-jshint');
+  grunt.loadNpmTasks('grunt-contrib-watch');
+  grunt.loadNpmTasks('grunt-contrib-qunit');
+  grunt.loadNpmTasks('grunt-contrib-copy');
+  grunt.loadNpmTasks('grunt-contrib-clean');
+  grunt.loadNpmTasks('grunt-docco');
+  grunt.loadNpmTasks('grunt-release');
+  grunt.loadNpmTasks('grunt-bump');
+  grunt.loadNpmTasks('grunt-git');
+
+  // Default task(s).
+  grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'docco']);
+
+  grunt.registerTask('test', 'Run qunit tests.', function() {
+    grunt.task.run('qunit');
+  });
+
+  // Release current build.
+  grunt.registerTask('stage', 'Stage current binaries to releases/.', function() {
+    grunt.task.run('default');
+    grunt.task.run('copy:release');
+  });
+};

+ 7 - 0
README.md

@@ -0,0 +1,7 @@
+<p align="center">
+  <img alt="OSMD logo" src="http://opensheetmusicdisplay.org/wp-content/uploads/2015/03/OSMD_3_icon.png" width="200"/>
+</p>
+
+# Open Sheet Music Display library
+
+Website: [opensheetmusicdisplay.org](http://opensheetmusicdisplay.org)

+ 20 - 0
build.js

@@ -0,0 +1,20 @@
+#!/usr/bin/env node
+
+var fs = require("fs");
+var path = require("path");
+var browserify = require("browserify");
+var args = require('minimist')(process.argv.slice(2));
+
+var b = browserify({ debug: args.debug || false });
+
+var path_to_vexflow = args.path || path.join(__dirname, "node_modules/vexflow/releases/");
+
+console.log("Path to vexflow: " + path_to_vexflow);
+
+if (args["include-vexflow"]) {
+	b.add(path.join(path_to_vexflow, 'vexflow-debug.js'));
+}
+
+b.add('./src/file1.js');
+
+b.bundle().pipe(fs.createWriteStream("osmd.js"));

+ 34 - 0
package.json

@@ -0,0 +1,34 @@
+{
+  "name": "opensheetmusicdisplay",
+  "version": "0.0.0",
+  "description": "Open Sheet Music Display library",
+  "main": "build.js",
+  "directories": {
+    "doc": "docs",
+    "test": "tests"
+  },
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/opensheetmusicdisplay/opensheetmusicdisplay"
+  },
+  "keywords": [
+    "sheets",
+    "music",
+    "vexflow",
+    "musicxml"
+  ],
+  "author": "PhonicScore",
+  "license": "MIT",
+  "bugs": {
+    "url": "https://github.com/opensheetmusicdisplay/opensheetmusicdisplay/issues"
+  },
+  "homepage": "http://opensheetmusicdisplay.org",
+  "dependencies": {
+    "browserify": "^8.1.1",
+    "minimist": "^1.1.0",
+    "vexflow": "^1.2.27"
+  }
+}