Explorar el Código

创建项目。

sybotan hace 4 años
commit
4f17253bb3
Se han modificado 4 ficheros con 112 adiciones y 0 borrados
  1. 6 0
      .gitignore
  2. 36 0
      package.json
  3. 52 0
      publish.js
  4. 18 0
      tsconfig.json

+ 6 - 0
.gitignore

@@ -0,0 +1,6 @@
+/.idea
+*.iml
+dist
+build
+node_modules
+package-lock.json

+ 36 - 0
package.json

@@ -0,0 +1,36 @@
+{
+  "remote": {
+    "host": "47.94.89.44",
+    "path": "/opt/tomcat9/webapps/doc",
+    "user": "user1",
+    "password": "@)!^sagacloud",
+    "local": "docs/.vuepress/dist"
+  },
+  "scripts": {
+    "dev": "vuepress dev docs",
+    "build": "vuepress build docs",
+    "publish": "node publish.js"
+  },
+  "dependencies": {
+    "@saga-web/base": "2.1.24",
+    "@saga-web/big": "1.0.86",
+    "@saga-web/draw": "2.1.104",
+    "@saga-web/graph": "2.1.114",
+    "@saga-web/feng-map": "1.0.25",
+    "axios": "^0.18.1",
+    "element-ui": "^2.12.0",
+    "vue": "^2.6.10",
+    "vue-property-decorator": "^8.4.2"
+  },
+  "devDependencies": {
+    "@vuepress/plugin-back-to-top": "^1.2.0",
+    "vuepress-plugin-mathjax": "^1.2.8",
+    "node-ssh": "^6.0.0",
+    "ts-loader": "^7.0.4",
+    "typescript": "^3.9.2",
+    "vuepress": "^1.2.0",
+    "polybooljs": "^1.2.0",
+    "vuepress-plugin-typescript": "^0.2.0",
+    "vuepress-types": "^0.9.2"
+  }
+}

+ 52 - 0
publish.js

@@ -0,0 +1,52 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+const Client = require("node-ssh");
+const ssh = new Client();
+
+ssh.connect({
+    host: process.env.npm_package_remote_host,
+    port: "22",
+    username: process.env.npm_package_remote_user,
+    password: process.env.npm_package_remote_password
+}).then(() => {
+    const failedList = [];
+    ssh.putDirectory(
+        process.env.npm_package_remote_local,
+        process.env.npm_package_remote_path,
+        {
+            recursive: true,
+            concurrency: 1,
+            tick: function(localPath, remotePath, error) {
+                if (error) {
+                    failedList.push(localPath);
+                }
+            }
+        }
+    ).then(status => {
+        if (failedList.length > 0) {
+            console.log("发布失败");
+            console.log("failed transfers", failedList.join(", "));
+        } else {
+            console.log(status ? "发布成功" : "发布失败");
+        }
+        ssh.dispose();
+    });
+});

+ 18 - 0
tsconfig.json

@@ -0,0 +1,18 @@
+{
+    "compilerOptions": {
+        "types": ["vuepress-types"],
+        "target": "es6",                            // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'.
+        "module": "commonjs",                       // Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'.
+        "rootDir": "./docs",
+//        "outDir": "./lib",                          // 编译后生成的文件目录
+        "strict": true,                             // 开启严格的类型检测
+        "declaration": true,                        // 生成 `.d.ts` 文件
+        "experimentalDecorators": true,             // 开启装饰器
+        "removeComments": true,                     // 去除注释
+        "noImplicitAny": true,                      // 在表达式和声明上有隐含的 any类型时报错。
+        "esModuleInterop": true,                    // 支持别名导入
+        "moduleResolution": "node"                  // 此处设置为node,才能解析import xx from 'xx'
+    },
+    "include": ["docs/.vuepress/**/*.ts", "docs/.vuepress/**/*.vue"],
+    "exclude": ["node_modules"]
+}