Skip to content

Commit 978f173

Browse files
authored
Merge pull request #29 from movabletype/fix/easy-to-upgrade
Fix to upgrade easily. MTC-30497
2 parents b044d3b + 0bb00d2 commit 978f173

File tree

6 files changed

+249
-21
lines changed

6 files changed

+249
-21
lines changed

.jshintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
"undef": true,
1414
"unused": true,
1515

16-
"node": true
16+
"node": true,
17+
"esversion": 6
1718
}

Gruntfile.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module.exports = function( grunt ) {
22
"use strict";
33

4+
const version = grunt.file.read("./api_version").trimEnd();
5+
46
var srcHintOptionsBrowser = grunt.file.readJSON("src/.jshintrc"),
57
srcHintOptionsNode = grunt.file.readJSON("src/.jshintrc"),
68
proxySnippet = require("grunt-connect-proxy/lib/utils").proxyRequest,
@@ -61,20 +63,20 @@ module.exports = function( grunt ) {
6163
},
6264
preprocess: {
6365
"data-api-browser": {
64-
dest: "mt-static/data-api/v7/js/mt-data-api.js",
65-
src: "src/data-api/v7/mt-data-api.js"
66+
dest: "mt-static/data-api/" + version + "/js/mt-data-api.js",
67+
src: "src/data-api/" + version + "/mt-data-api.js"
6668
},
6769
"data-api-node": {
68-
dest: "node-lib/data-api/v7/node-mt-data-api.js",
69-
src: "src/data-api/v7/node-mt-data-api.js"
70+
dest: "node-lib/data-api/" + version + "/node-mt-data-api.js",
71+
src: "src/data-api/" + version + "/node-mt-data-api.js"
7072
},
7173
"node-bootstrap": {
7274
dest: "node-lib/bootstrap.js",
7375
src: "src/node/bootstrap.js"
7476
},
7577
"data-api-coverage-endpoints": {
7678
dest: ".src/data-api/coverage/endpoints.js",
77-
src: "src/data-api/v7/endpoints.js"
79+
src: "src/data-api/" + version + "/endpoints.js"
7880
}
7981
},
8082
watch: {
@@ -96,13 +98,13 @@ module.exports = function( grunt ) {
9698
uglify: {
9799
"data-api-browser": {
98100
files: {
99-
"mt-static/data-api/v7/js/mt-data-api.min.js": [
100-
"mt-static/data-api/v7/js/mt-data-api.js"
101+
["mt-static/data-api/" + version + "/js/mt-data-api.min.js"]: [
102+
"mt-static/data-api/" + version + "/js/mt-data-api.js"
101103
]
102104
},
103105
options: {
104106
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",
105-
sourceMap: "mt-static/data-api/v7/js/mt-data-api.min.map",
107+
sourceMap: "mt-static/data-api/" + version + "/js/mt-data-api.min.map",
106108
sourceMapPrefix: 4,
107109
sourceMappingURL: "mt-data-api.min.map",
108110
report: "min",
@@ -183,7 +185,7 @@ module.exports = function( grunt ) {
183185
},
184186
jasmine: {
185187
"data-api": {
186-
src: ["mt-static/data-api/v7/js/mt-data-api.js"],
188+
src: ["mt-static/data-api/" + version + "/js/mt-data-api.js"],
187189
options: {
188190
specs: "spec/data-api/**/*.js",
189191
host: "http://localhost:<%= connect.jasmine.options.port %>/",

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ all:
33
make build
44

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

@@ -20,7 +19,7 @@ build:
2019
test:
2120
-grunt test
2221

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

2625
json:

api_version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v7

package-lock.json

Lines changed: 233 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"grunt-contrib-clean": "~0.4.0",
1818
"grunt-contrib-connect": "~5.0.1",
1919
"grunt-contrib-jasmine": "^4.0.0",
20-
"grunt-contrib-jshint": "~0.6.0",
20+
"grunt-contrib-jshint": "^3.2.0",
2121
"grunt-contrib-uglify": "~0.2.2",
2222
"grunt-contrib-watch": "~0.2.0",
2323
"grunt-jasmine-node": "~0.1.0",

0 commit comments

Comments
 (0)