Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"undef": true,
"unused": true,

"node": true
"node": true,
"esversion": 6
}
20 changes: 11 additions & 9 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module.exports = function( grunt ) {
"use strict";

const version = grunt.file.read("./api_version").trimEnd();

var srcHintOptionsBrowser = grunt.file.readJSON("src/.jshintrc"),
srcHintOptionsNode = grunt.file.readJSON("src/.jshintrc"),
proxySnippet = require("grunt-connect-proxy/lib/utils").proxyRequest,
Expand Down Expand Up @@ -61,20 +63,20 @@ module.exports = function( grunt ) {
},
preprocess: {
"data-api-browser": {
dest: "mt-static/data-api/v7/js/mt-data-api.js",
src: "src/data-api/v7/mt-data-api.js"
dest: "mt-static/data-api/" + version + "/js/mt-data-api.js",
src: "src/data-api/" + version + "/mt-data-api.js"
},
"data-api-node": {
dest: "node-lib/data-api/v7/node-mt-data-api.js",
src: "src/data-api/v7/node-mt-data-api.js"
dest: "node-lib/data-api/" + version + "/node-mt-data-api.js",
src: "src/data-api/" + version + "/node-mt-data-api.js"
},
"node-bootstrap": {
dest: "node-lib/bootstrap.js",
src: "src/node/bootstrap.js"
},
"data-api-coverage-endpoints": {
dest: ".src/data-api/coverage/endpoints.js",
src: "src/data-api/v7/endpoints.js"
src: "src/data-api/" + version + "/endpoints.js"
}
},
watch: {
Expand All @@ -96,13 +98,13 @@ module.exports = function( grunt ) {
uglify: {
"data-api-browser": {
files: {
"mt-static/data-api/v7/js/mt-data-api.min.js": [
"mt-static/data-api/v7/js/mt-data-api.js"
["mt-static/data-api/" + version + "/js/mt-data-api.min.js"]: [
"mt-static/data-api/" + version + "/js/mt-data-api.js"
]
},
options: {
banner: "/* Copyright (c) Six Apart Ltd.\n * This file is generated by Movable Type DataAPI SDK for JavaScript.\n * Consult the source files for their respective licenses and copyrights.\n * <%= pkg.homepage %>\n */\n",
sourceMap: "mt-static/data-api/v7/js/mt-data-api.min.map",
sourceMap: "mt-static/data-api/" + version + "/js/mt-data-api.min.map",
sourceMapPrefix: 4,
sourceMappingURL: "mt-data-api.min.map",
report: "min",
Expand Down Expand Up @@ -183,7 +185,7 @@ module.exports = function( grunt ) {
},
jasmine: {
"data-api": {
src: ["mt-static/data-api/v7/js/mt-data-api.js"],
src: ["mt-static/data-api/" + version + "/js/mt-data-api.js"],
options: {
specs: "spec/data-api/**/*.js",
host: "http://localhost:<%= connect.jasmine.options.port %>/",
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ all:
make build

clean:
-rm -rf node-lib mt-static
-rm -rf node_modules bower_components
-find . -name '.DS_Store' | xargs --no-run-if-empty rm

Expand All @@ -20,7 +19,7 @@ build:
test:
-grunt test

JSON_VERSION := v7
JSON_VERSION := $(shell cat api_version)
JSON_BASE_URL := http://localhost/cgi-bin/mt/mt-data-api.cgi

json:
Expand Down
1 change: 1 addition & 0 deletions api_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v7
241 changes: 233 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"grunt-contrib-clean": "~0.4.0",
"grunt-contrib-connect": "~5.0.1",
"grunt-contrib-jasmine": "^4.0.0",
"grunt-contrib-jshint": "~0.6.0",
"grunt-contrib-jshint": "^3.2.0",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-watch": "~0.2.0",
"grunt-jasmine-node": "~0.1.0",
Expand Down
Loading