Jelajahi Sumber

Explicit package versions

Lutz Roeder 7 tahun lalu
induk
melakukan
33ee01b5dc
3 mengubah file dengan 36 tambahan dan 22 penghapusan
  1. 13 2
      Makefile
  2. 16 17
      package.json
  3. 7 3
      tools/tflite

+ 13 - 2
Makefile

@@ -1,7 +1,9 @@
 
-build: build_python build_electron
+.PHONY: test
 
-publish: clean publish_github_electron publish_pip publish_github_pages publish_cask
+build: clean lint build_python build_electron
+
+publish: clean lint publish_github_electron publish_pip publish_github_pages publish_cask
 
 install:
 	rm -rf ./node_modules
@@ -10,6 +12,11 @@ install:
 clean:
 	rm -rf ./build
 
+reset:
+	rm -rf ./build
+	rm -rf ./node_modules
+	rm -rf ./third_party
+
 build_python:
 	@[ -d node_modules ] || npm install
 	rm -rf ./build/python
@@ -24,6 +31,10 @@ lint:
 	@[ -d node_modules ] || npm install
 	npx eslint src/*.js test/*.js
 
+test:
+	@[ -d node_modules ] || npm install
+	node ./test/test.js
+
 start:
 	@[ -d node_modules ] || npm install
 	npx electron .

+ 16 - 17
package.json

@@ -14,28 +14,27 @@
         "pull": "git pull --prune",
         "start": "[ -d node_modules ] || npm install && npx electron .",
         "server": "[ -d node_modules ] || npm install && rm -rf build/python && python setup.py --quiet build && PYTHONPATH=build/python/lib python -c 'import netron; netron.main()' $@",
-        "clean": "rm -rf ./build ./node_modules ./third_party",
+        "reset": "rm -rf ./build ./node_modules ./third_party",
         "update": "[ -d node_modules ] || npm install && ./tools/update",
         "test": "[ -d node_modules ] || npm install && node ./test/test.js"
     },
     "dependencies": {
-        "d3": "latest",
-        "dagre": "latest",
-        "electron-updater": "^4.0.0",
-        "flatbuffers": "latest",
-        "handlebars": "latest",
-        "long": "latest",
-        "marked": "latest",
-        "npm-font-open-sans": "latest",
-        "pako": "latest",
-        "protobufjs": "lutzroeder/protobuf.js#pbtxt",
-        "universal-analytics": "latest"
+        "d3": "^5.9.1",
+        "dagre": "^0.8.4",
+        "electron-updater": "^4.0.6",
+        "flatbuffers": "^1.10.2",
+        "handlebars": "^4.1.0",
+        "long": "^4.0.0",
+        "marked": "^0.6.0",
+        "npm-font-open-sans": "^1.1.0",
+        "pako": "^1.0.8",
+        "protobufjs": "github:lutzroeder/protobuf.js#pbtxt",
+        "universal-analytics": "^0.4.20"
     },
     "devDependencies": {
-        "electron": "latest",
-        "electron-builder": "latest",
-        "eslint": "latest",
-        "jshint": "latest",
-        "xmldom": "latest"
+        "electron": "^4.0.5",
+        "electron-builder": "^20.38.5",
+        "eslint": "^5.14.0",
+        "xmldom": "^0.1.27"
     }
 }

+ 7 - 3
tools/tflite

@@ -70,14 +70,18 @@ schema() {
     bold "tflite schema"
     sed 's/namespace tflite;/namespace tflite_schema;/g' <${third_party}/tensorflow/tensorflow/lite/schema/schema.fbs >${tools}/tflite.schema.fbs
     ${third_party}/flatbuffers/flatc --no-js-exports --js ${tools}/tflite.schema.fbs
-    mv ./tflite.schema_generated.js ${src}/tflite-schema.js
     rm ${tools}/tflite.schema.fbs
-cat <<EOT >> ${src}/tflite-schema.js
+    rm ${src}/tflite-schema.js
+    cat <<EOT >> ${src}/tflite-schema.js
+/* eslint 'indent': [ 'error', 2 ] */
+EOT
+    cat ./tflite.schema_generated.js >> ${src}/tflite-schema.js
+    cat <<EOT >> ${src}/tflite-schema.js
 if (typeof module !== 'undefined' && typeof module.exports === 'object') {
   module.exports = tflite_schema;
 }
 EOT
-    echo "/* eslint 'indent': [ 'error', 2 ] */" | cat - ${src}/tflite-schema.js > ${src}/tflite-schema_2.js && mv ${src}/tflite-schema_2.js ${src}/tflite-schema.js
+    rm ./tflite.schema_generated.js
 }
 
 visualize() {