Procházet zdrojové kódy

渐变类调整;系统图引擎新增

haojianlong před 4 roky
rodič
revize
05d8cb6e59

+ 9 - 0
saga-web-big/.editorconfig

@@ -0,0 +1,9 @@
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 4
+end_of_line =lf
+insert_final_newline = true
+trim_trailing_whitespace = true

+ 36 - 0
saga-web-big/.eslintrc.js

@@ -0,0 +1,36 @@
+module.exports = {
+    root: true,
+    parser: "@typescript-eslint/parser",
+    extends: [
+        "plugin:@typescript-eslint/recommended",
+        // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
+        "prettier/@typescript-eslint",
+        // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
+        // 此行必须在最后
+        "plugin:prettier/recommended"
+    ],
+    env: {
+        es6: true,
+        node: true
+    },
+    parserOptions: {
+        // 支持最新 JavaScript
+        ecmaVersion: 2018,
+        sourceType: "module"
+    },
+    rules: {
+        // 注释
+        // 文件
+        "max-classes-per-file": ["error", 1],           // 一个文件中只能定义一个类
+        "max-lines-per-function": ["error", 200],       // 一个函数最多200行代码
+        "max-statements-per-line": ["error", {max: 1}], // 一行只允许有一条语句
+        // 缩进
+        "indent": ["error", 4],                         // 缩进控制4空格
+        "max-len": ["error", 120],                      // 每行字符不超过120
+        "no-mixed-spaces-and-tabs": "error",            // 禁止使用空格和tab混合缩进
+        // 语句
+        "curly": ["error", "multi-line"],               // if、else if、else、for、while强制使用大括号,但允许在单行中省略大括号。
+        "semi": ["error", "always"],                    // 不得省略语句结束的分号
+        "@typescript-eslint/explicit-member-accessibility": ["error", { accessibility: "no-public" }],       // public访问不需加访问修饰符
+    }
+};

+ 12 - 0
saga-web-big/.npmignore

@@ -0,0 +1,12 @@
+# 发布时排除
+__tests__/
+api/
+docs/
+src/
+.editorconfig
+.eslintrc.js
+*.iml
+coverage
+jest.config.js
+tsconfig.json
+typedoc.json

+ 0 - 0
saga-web-big/README.md


+ 12 - 0
saga-web-big/jest.config.js

@@ -0,0 +1,12 @@
+module.exports = {
+    preset: "ts-jest",
+    moduleFileExtensions: ["js", "ts"],
+    transform: {
+        "^.+\\.tsx?$": "ts-jest"
+    },
+    transformIgnorePatterns: ["/node_modules/"],
+    moduleNameMapper: {
+        "^@/(.*)$": "<rootDir>/src/$1"
+    },
+    collectCoverage: true
+};

+ 37 - 0
saga-web-big/package.json

@@ -0,0 +1,37 @@
+{
+    "name": "@saga-web/big",
+    "version": "1.0.1",
+    "description": "上格云Web基础库。",
+    "main": "lib/index.js",
+    "types": "lib/index.d.js",
+    "scripts": {
+        "build": "tsc",
+        "publish": "npm publish",
+        "lint": "eslint src/**/*.{js,ts,tsx}",
+        "test": "jest",
+        "typedoc": "typedoc --hideGenerator src"
+    },
+    "keywords": [
+        "sybotan",
+        "base"
+    ],
+    "author": "庞利祥 (sybotan@126.com)",
+    "license": "ISC",
+    "publishConfig": {
+        "registry": "http://dev.dp.sagacloud.cn:8082/repository/npm-hosted/"
+    },
+    "devDependencies": {
+        "@typescript-eslint/eslint-plugin": "^1.12.0",
+        "@typescript-eslint/parser": "^1.12.0",
+        "eslint": "^6.0.1",
+        "eslint-config-prettier": "^6.0.0",
+        "eslint-plugin-prettier": "^3.1.0",
+        "prettier": "^1.18.2",
+        "@types/jest": "^24.0.15",
+        "ts-jest": "^24.0.2",
+        "typescript": "^3.5.3"
+    },
+    "dependencies": {
+        "@saga-web/graphy": "2.1.52"
+    }
+}

+ 29 - 0
saga-web-big/src/index.ts

@@ -0,0 +1,29 @@
+import { SAnchorItem } from "./SAnchorItem";
+import { SCompassItem } from "./SCompassItem";
+import { SCurveRelation } from "./SCurveRelation";
+import { SEntityItem } from "./SEntityItem";
+import { SFloorItem } from "./SFloorItem";
+import { SImageItem } from "./SImageItem";
+import { SLayerItem } from "./SLayerItem";
+import { SLineRelation } from "./SLineRelation";
+import { SObjectItem } from "./SObjectItem";
+import { SRelation } from "./SRelation";
+import { STextItem } from "./STextItem";
+import { STooltipItem } from "./STooltipItem";
+import { SVerticalRelation } from "./SVerticalRelation";
+
+export {
+    SAnchorItem,
+    SCompassItem,
+    SCurveRelation,
+    SEntityItem,
+    SFloorItem,
+    SImageItem,
+    SLayerItem,
+    SLineRelation,
+    SObjectItem,
+    SRelation,
+    STextItem,
+    STooltipItem,
+    SVerticalRelation
+};

+ 16 - 0
saga-web-big/tsconfig.json

@@ -0,0 +1,16 @@
+{
+    "compilerOptions": {
+        "target": "es5",                            // 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'.
+        "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": ["./src"],
+    "exclude": ["node_modules"]
+}

+ 6 - 0
saga-web-big/typedoc.json

@@ -0,0 +1,6 @@
+{
+    "name": "上格云Web基础库",
+    "mode": "file",
+    "out": "doc",
+    "exclude": ["**/*+(index|.test).ts"]
+}