Jelajahi Sumber

full commonjs build for servers and cli tools

David Sehnal 4 tahun lalu
induk
melakukan
422f4567f1
7 mengubah file dengan 22 tambahan dan 22 penghapusan
  1. 1 1
      .eslintrc.json
  2. 1 1
      .gitignore
  3. 1 1
      .npmignore
  4. 2 2
      docs/model-server/readme.md
  5. 3 3
      docs/volume-server/README.md
  6. 12 12
      package.json
  7. 2 2
      tsconfig.commonjs.json

+ 1 - 1
.eslintrc.json

@@ -5,7 +5,7 @@
     },
     "parser": "@typescript-eslint/parser",
     "parserOptions": {
-        "project": ["tsconfig.json", "tsconfig.servers.json"],
+        "project": ["tsconfig.json", "tsconfig.commonjs.json"],
         "sourceType": "module"
     },
     "plugins": [

+ 1 - 1
.gitignore

@@ -5,7 +5,7 @@ node_modules/
 debug.log
 npm-debug.log
 tsconfig.tsbuildinfo
-tsconfig.servers.tsbuildinfo
+tsconfig.commonjs.tsbuildinfo
 
 *.sublime-workspace
 .idea

+ 1 - 1
.npmignore

@@ -1 +1 @@
-tsconfig.servers.buildinfo
+tsconfig.commonjs.buildinfo

+ 2 - 2
docs/model-server/readme.md

@@ -54,12 +54,12 @@ Sometimes nodejs might run into problems with memory. This is usually resolved b
 
 ## Preprocessor
 
-The preprocessor application allows to add custom data to CIF files and/or convert CIF to BinaryCIF. ``node lib/servers/servers/model/preprocess`` or ``model-server-preprocess`` binary from the NPM package.
+The preprocessor application allows to add custom data to CIF files and/or convert CIF to BinaryCIF. ``node lib/commonjs/servers/model/preprocess`` or ``model-server-preprocess`` binary from the NPM package.
 
 
 ## Local Mode
 
-The server can be run in local/file based mode using ``node lib/servers/servers/model/query`` (``model-server-query`` binary from the NPM package).
+The server can be run in local/file based mode using ``node lib/commonjs/servers/model/query`` (``model-server-query`` binary from the NPM package).
 
 Custom Properties
 =================

+ 3 - 3
docs/volume-server/README.md

@@ -28,7 +28,7 @@ npm run build-tsc
 and run the server by 
 
 ```
-node lib/servers/servers/volume/server
+node lib/commonjs/servers/volume/server
 ```
 
 ## From NPM
@@ -60,11 +60,11 @@ Sometimes nodejs might run into problems with memory. This is usually resolved b
 ## Preparing the Data
 
 For the server to work, CCP4/MAP (models 0, 1, 2 are supported) input data need to be converted into a custom block format. 
-To achieve this, use the ``pack`` application (``node lib/servers/servers/volume/pack`` or ``volume-server-pack`` binary from the NPM package).
+To achieve this, use the ``pack`` application (``node lib/commonjs/servers/volume/pack`` or ``volume-server-pack`` binary from the NPM package).
 
 ## Local Mode
 
-The program  ``lib/servers/servers/volume/pack`` (``volume-server-query`` in NPM package) can be used to query the data without running a http server.
+The program  ``lib/commonjs/servers/volume/pack`` (``volume-server-query`` in NPM package) can be used to query the data without running a http server.
 
 ## Navigating the Source Code
 

+ 12 - 12
package.json

@@ -16,7 +16,7 @@
     "test": "npm run lint && jest",
     "build": "npm run build-tsc && npm run build-extra && npm run build-webpack",
     "build-viewer": "npm run build-tsc && npm run build-extra && npm run build-webpack-viewer",
-    "build-tsc": "tsc --incremental && tsc --build tsconfig.servers.json --incremental",
+    "build-tsc": "concurrently \"tsc --incremental\" \"tsc --build tsconfig.commonjs.json --incremental\"",
     "build-extra": "cpx \"src/**/*.{scss,html,ico}\" lib/",
     "build-webpack": "webpack --mode production --config ./webpack.config.production.js",
     "build-webpack-viewer": "webpack --mode production --config ./webpack.config.viewer.js",
@@ -24,16 +24,16 @@
     "watch-viewer": "concurrently -c \"green,gray,gray\" --names \"tsc,ext,wpc\" --kill-others \"npm:watch-tsc\" \"npm:watch-extra\" \"npm:watch-webpack-viewer\"",
     "watch-viewer-debug": "concurrently -c \"green,gray,gray\" --names \"tsc,ext,wpc\" --kill-others \"npm:watch-tsc\" \"npm:watch-extra\" \"npm:watch-webpack-viewer-debug\"",
     "watch-tsc": "tsc --watch --incremental",
-    "watch-servers": "tsc --build tsconfig.servers.json --watch --incremental",
+    "watch-servers": "tsc --build tsconfig.commonjs.json --watch --incremental",
     "watch-extra": "cpx \"src/**/*.{scss,html,ico}\" lib/ --watch",
     "watch-webpack": "webpack -w --mode development --display minimal",
     "watch-webpack-viewer": "webpack -w --mode development --display errors-only --info-verbosity verbose --config ./webpack.config.viewer.js",
     "watch-webpack-viewer-debug": "webpack -w --mode development --display errors-only --info-verbosity verbose --config ./webpack.config.viewer.debug.js",
     "serve": "http-server -p 1338",
-    "model-server": "node lib/servers/servers/model/server.js",
-    "model-server-watch": "nodemon --watch lib lib/servers/servers/model/server.js",
-    "volume-server-test": "node lib/servers/servers/volume/server.js --idMap em 'test/${id}.mdb' --defaultPort 1336",
-    "plugin-state": "node lib/servers/servers/plugin-state/index.js",
+    "model-server": "node lib/commonjs/servers/model/server.js",
+    "model-server-watch": "nodemon --watch lib lib/commonjs/servers/model/server.js",
+    "volume-server-test": "node lib/commonjs/servers/volume/server.js --idMap em 'test/${id}.mdb' --defaultPort 1336",
+    "plugin-state": "node lib/commonjs/servers/plugin-state/index.js",
     "preversion": "npm run test",
     "version": "npm run build",
     "postversion": "git push && git push --tags"
@@ -45,12 +45,12 @@
   "bin": {
     "cif2bcif": "lib/cli/cif2bcif/index.js",
     "cifschema": "lib/cli/cifschema/index.js",
-    "model-server": "lib/servers/servers/model/server.js",
-    "model-server-query": "lib/servers/servers/model/query.js",
-    "model-server-preprocess": "lib/servers/servers/model/preprocess.js",
-    "volume-server": "lib/servers/servers/volume/server.js",
-    "volume-server-query": "lib/servers/servers/volume/query.js",
-    "volume-server-pack": "lib/servers/servers/volume/pack.js"
+    "model-server": "lib/commonjs/servers/model/server.js",
+    "model-server-query": "lib/commonjs/servers/model/query.js",
+    "model-server-preprocess": "lib/commonjs/servers/model/preprocess.js",
+    "volume-server": "lib/commonjs/servers/volume/server.js",
+    "volume-server-query": "lib/commonjs/servers/volume/query.js",
+    "volume-server-pack": "lib/commonjs/servers/volume/pack.js"
   },
   "nodemonConfig": {
     "ignoreRoot": [

+ 2 - 2
tsconfig.servers.json → tsconfig.commonjs.json

@@ -17,7 +17,7 @@
         "jsx": "react",
         "lib": [ "es6", "dom", "esnext.asynciterable", "es2016" ],
         "rootDir": "src",
-        "outDir": "lib"
+        "outDir": "lib/commonjs"
     },
-    "include": [ "src/servers/**/*", "src/perf-tests/*", "src/cli/**/*" ]
+    "include": [ "src/**/*" ]
 }