export-table-pulgin-csharp 1.1.151 → 1.1.152

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,4 +28,6 @@ export declare const getDescripts: (v: Field) => string[];
28
28
  export declare const convTupleArrayType: (f: Field) => Field | undefined;
29
29
  export declare const convTupleArrayTypeDefine: (f: Field) => string;
30
30
  export declare function GetUsingJsonToolNamespace(): string;
31
+ export declare let isEnableMMP: boolean;
32
+ export declare let useMMPNamespace: string;
31
33
  //# sourceMappingURL=CSParseTool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CSParseTool.d.ts","sourceRoot":"","sources":["../src/CSParseTool.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,KAAK,EAA4D,SAAS,EAAwB,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEtK,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,GAAG,GAAG,CAWpE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,GAAG,GAAG,CA0CjE;AAED,MAAM,MAAM,UAAU,GAAG;IACxB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,KAAK,CAAC,EAAE,GAAG,CAAC;CACZ,CAAA;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,UAAU,EAAE,CAAA;CAAE,GAAG,SAAS,CAoDlH;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,UAAU,UAElD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,GAAG,MAAM,CAwE5E;AAED,eAAO,IAAI,qBAAqB,SAA0D,C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MAAO,KAAK,WAYhD,CAAA;AAED,wBAAgB,yBAAyB,WAQxC;AAED,eAAO,IAAI,WAAW,SAAwD,CAAA;AAC9E,eAAO,IAAI,eAAe,QAAgC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetUsingJsonToolNamespace = exports.convTupleArrayTypeDefine = exports.convTupleArrayType = exports.getDescripts = exports.getTitle = exports.genValue = exports.getFkFieldType = exports.getCustomFieldTypeAnnotation = exports.getFieldAnnotation = exports.isTypeArray = exports.getFieldType = exports.getFieldElementType = exports.convVarName = exports.convMemberName = exports.firstLetterLower = exports.firstLetterUpper = exports.isSkipExportDefaults0 = exports.ConvValue2Literal = exports.ToNewTupleStatement = exports.genTupleArrayValue = exports.ConvValue = exports.TryConvValue = void 0;
3
+ exports.useMMPNamespace = exports.isEnableMMP = exports.GetUsingJsonToolNamespace = exports.convTupleArrayTypeDefine = exports.convTupleArrayType = exports.getDescripts = exports.getTitle = exports.genValue = exports.getFkFieldType = exports.getCustomFieldTypeAnnotation = exports.getFieldAnnotation = exports.isTypeArray = exports.getFieldType = exports.getFieldElementType = exports.convVarName = exports.convMemberName = exports.firstLetterLower = exports.firstLetterUpper = exports.isSkipExportDefaults0 = exports.ConvValue2Literal = exports.ToNewTupleStatement = exports.genTupleArrayValue = exports.ConvValue = exports.TryConvValue = void 0;
4
4
  const export_table_lib_1 = require("export-table-lib");
5
5
  function TryConvValue(value, t, f) {
6
6
  try {
@@ -479,3 +479,5 @@ function GetUsingJsonToolNamespace() {
479
479
  return useJsonToolNamesapce;
480
480
  }
481
481
  exports.GetUsingJsonToolNamespace = GetUsingJsonToolNamespace;
482
+ exports.isEnableMMP = process.argv.findIndex(v => v == "--EnableMMPB") >= 0;
483
+ exports.useMMPNamespace = "using LoadTableMMP.Runtime;";
@@ -1 +1 @@
1
- {"version":3,"file":"ExportCSPlugin.d.ts","sourceRoot":"","sources":["../src/ExportCSPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,iBAAiB,EAA+B,UAAU,EAAsE,MAAM,kBAAkB,CAAA;AAItK,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAqOpE;AAED,qBAAa,YAAa,SAAQ,UAAU;IAC3C,IAAI,SAAW;IACf,IAAI,EAAE,MAAM,EAAE,CAAS;IAEvB,WAAW,CAAC,KAAK,EAAE,iBAAiB;CAOpC"}
1
+ {"version":3,"file":"ExportCSPlugin.d.ts","sourceRoot":"","sources":["../src/ExportCSPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,iBAAiB,EAA+B,UAAU,EAAsE,MAAM,kBAAkB,CAAA;AAItK,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CA0OpE;AAED,qBAAa,YAAa,SAAQ,UAAU;IAC3C,IAAI,SAAW;IACf,IAAI,EAAE,MAAM,EAAE,CAAS;IAEvB,WAAW,CAAC,KAAK,EAAE,iBAAiB;CAOpC"}
@@ -28,7 +28,7 @@ const export_table_lib_1 = require("export-table-lib");
28
28
  const CSParseTool_1 = require("./CSParseTool");
29
29
  const fs = __importStar(require("fs-extra"));
30
30
  function export_stuff(paras) {
31
- let { datas, fields, inject, name, objects, packagename, tables, xxtea, exportNamespace, moreOptions, } = paras;
31
+ let { datas, fields, inject, name, objects, packagename, tables, xxtea, exportNamespace, moreOptions, allTags, } = paras;
32
32
  let isSkipExportDefaults = !!(moreOptions?.SkipDefaults ?? false);
33
33
  if (CSParseTool_1.isSkipExportDefaults0) {
34
34
  isSkipExportDefaults = true;
@@ -45,10 +45,13 @@ function export_stuff(paras) {
45
45
  customFields.push(f3);
46
46
  }
47
47
  }
48
+ let isMMPEnabled = allTags.indexOf('csharp:mmp') != -1;
49
+ let mmpNamespace = isMMPEnabled ? CSParseTool_1.useMMPNamespace : "";
48
50
  let temp = `
49
51
  using System.Collections.Generic;
50
52
  using System.Linq;
51
53
  using System.Runtime.InteropServices;
54
+ ${mmpNamespace}
52
55
 
53
56
  namespace ${exportNamespace}{
54
57
  [System.Serializable]
@@ -1 +1 @@
1
- {"version":3,"file":"ExportUnityCSJsonPlugin.d.ts","sourceRoot":"","sources":["../src/ExportUnityCSJsonPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,iBAAiB,EAA+B,UAAU,EAAE,iBAAiB,EAAqC,MAAM,kBAAkB,CAAA;AAQxJ,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CA2DnE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CA0GzE;AAED,qBAAa,iBAAkB,SAAQ,UAAU;IAChD,IAAI,SAAU;IACd,IAAI,EAAE,MAAM,EAAE,CAAY;IAE1B,WAAW,CAAC,KAAK,EAAE,iBAAiB;IAmBpC,WAAW,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI;CA4C3C"}
1
+ {"version":3,"file":"ExportUnityCSJsonPlugin.d.ts","sourceRoot":"","sources":["../src/ExportUnityCSJsonPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,iBAAiB,EAA+B,UAAU,EAAE,iBAAiB,EAAqC,MAAM,kBAAkB,CAAA;AAOxJ,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CA2DnE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAwGzE;AAED,qBAAa,iBAAkB,SAAQ,UAAU;IAChD,IAAI,SAAU;IACd,IAAI,EAAE,MAAM,EAAE,CAAY;IAE1B,WAAW,CAAC,KAAK,EAAE,iBAAiB;IAmBpC,WAAW,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI;CA4C3C"}
@@ -28,7 +28,6 @@ const export_table_lib_1 = require("export-table-lib");
28
28
  const fs = __importStar(require("fs-extra"));
29
29
  const CSParseTool_1 = require("./CSParseTool");
30
30
  var isSkipIndexLoader0 = process.argv.findIndex(v => v == "--SkipIndexLoader") >= 0;
31
- var isEnableMMPB = process.argv.findIndex(v => v == "--EnableMMPB") >= 0;
32
31
  let firstLetterUpper = export_table_lib_1.makeFirstLetterUpper;
33
32
  function exportUJson(paras) {
34
33
  let { datas, fields, name, objects, table, } = paras;
@@ -86,7 +85,6 @@ function exportUJsonLoader(paras) {
86
85
  let useJsonToolNamesapce = (0, CSParseTool_1.GetUsingJsonToolNamespace)();
87
86
  let RowClass = firstLetterUpper(name);
88
87
  var fullName = `${table.workbookName}-${name}`;
89
- var mmpMark = isEnableMMPB ? "[MemoryPack.MemoryPackable]" : "";
90
88
  // !!!必须开头没有空格
91
89
  let temp = `
92
90
  using System.Collections.Generic;
@@ -96,7 +94,6 @@ ${useJsonToolNamesapce}
96
94
 
97
95
  namespace ${exportNamespace}
98
96
  {
99
- ${mmpMark}
100
97
  public partial class ${RowClass}
101
98
  {
102
99
  #if UNITY_EDITOR && ENABLE_CONFIG_LOG
@@ -33,13 +33,13 @@ function exportMMP(paras) {
33
33
  let { datas, fields, name, objects, table, exportNamespace, } = paras;
34
34
  let RowClass = firstLetterUpper(name);
35
35
  var fullName = `${table.workbookName}-${name}`;
36
- var mmpMark = isEnableMMPB ? "[MemoryPack.MemoryPackable]" : "[System.Runtime.InteropServices.StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Ansi)]";
36
+ var mmpMark = "[System.Runtime.InteropServices.StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Ansi)]";
37
37
  // TODO: 支持FK类型
38
38
  let temp = `
39
39
  using System;
40
40
  using System.Collections.Generic;
41
41
  using System.Runtime.InteropServices;
42
- using LoadTableMMP.Runtime;
42
+ ${CSParseTool_1.useMMPNamespace}
43
43
 
44
44
  namespace ${exportNamespace}
45
45
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "export-table-pulgin-csharp",
3
- "version": "1.1.151",
3
+ "version": "1.1.152",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {},
@@ -13,7 +13,7 @@
13
13
  "dependencies": {
14
14
  "@types/commander": "2.12.2",
15
15
  "@types/node": "^17.0.18",
16
- "export-table-lib": "^1.0.64",
16
+ "export-table-lib": "^1.0.65",
17
17
  "fs": "^0.0.1-security",
18
18
  "fs-extra": "^10.0.0",
19
19
  "fse": "^4.0.1"
@@ -403,4 +403,7 @@ export function GetUsingJsonToolNamespace() {
403
403
  }
404
404
  let useJsonToolNamesapce = jsonToolNamespace != null ? `using ${jsonToolNamespace};` : ``
405
405
  return useJsonToolNamesapce
406
- }
406
+ }
407
+
408
+ export let isEnableMMP = process.argv.findIndex(v => v == "--EnableMMPB") >= 0
409
+ export let useMMPNamespace = "using LoadTableMMP.Runtime;"
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { cmm, HandleSheetParams, Field, foreach, IPlugin, st, PluginBase, HandleBatchParams, iff, FieldType, makeFirstLetterLower, DataTable } from "export-table-lib"
3
- import { convMemberName, convTupleArrayType, convTupleArrayTypeDefine, convVarName, firstLetterUpper, genValue, getCustomFieldTypeAnnotation, getDescripts, getFieldAnnotation, getFieldType, getFkFieldType, getTitle, isSkipExportDefaults0 } from "./CSParseTool"
3
+ import { convMemberName, convTupleArrayType, convTupleArrayTypeDefine, convVarName, firstLetterUpper, genValue, getCustomFieldTypeAnnotation, getDescripts, getFieldAnnotation, getFieldType, getFkFieldType, getTitle, isSkipExportDefaults0, useMMPNamespace } from "./CSParseTool"
4
4
  import * as fs from "fs-extra"
5
5
 
6
6
  export function export_stuff(paras: HandleSheetParams): string | null {
@@ -15,6 +15,7 @@ export function export_stuff(paras: HandleSheetParams): string | null {
15
15
  xxtea,
16
16
  exportNamespace,
17
17
  moreOptions,
18
+ allTags,
18
19
  } = paras;
19
20
 
20
21
  let isSkipExportDefaults = !!(moreOptions?.SkipDefaults ?? false)
@@ -36,10 +37,14 @@ export function export_stuff(paras: HandleSheetParams): string | null {
36
37
  }
37
38
  }
38
39
 
40
+ let isMMPEnabled = allTags.indexOf('csharp:mmp') != -1
41
+ let mmpNamespace = isMMPEnabled ? useMMPNamespace : ""
42
+
39
43
  let temp = `
40
44
  using System.Collections.Generic;
41
45
  using System.Linq;
42
46
  using System.Runtime.InteropServices;
47
+ ${mmpNamespace}
43
48
 
44
49
  namespace ${exportNamespace}{
45
50
  [System.Serializable]
@@ -4,7 +4,6 @@ import * as fs from "fs-extra"
4
4
  import { GetUsingJsonToolNamespace, TryConvValue, convMemberName, genTupleArrayValue } from "./CSParseTool";
5
5
 
6
6
  var isSkipIndexLoader0 = process.argv.findIndex(v => v == "--SkipIndexLoader") >= 0
7
- var isEnableMMPB = process.argv.findIndex(v => v == "--EnableMMPB") >= 0
8
7
 
9
8
  let firstLetterUpper = makeFirstLetterUpper;
10
9
  export function exportUJson(paras: HandleSheetParams): string | null {
@@ -82,7 +81,6 @@ export function exportUJsonLoader(paras: HandleSheetParams): string | null {
82
81
 
83
82
  let RowClass = firstLetterUpper(name)
84
83
  var fullName = `${table.workbookName}-${name}`
85
- var mmpMark = isEnableMMPB ? "[MemoryPack.MemoryPackable]" : "";
86
84
  // !!!必须开头没有空格
87
85
  let temp = `
88
86
  using System.Collections.Generic;
@@ -92,7 +90,6 @@ ${useJsonToolNamesapce}
92
90
 
93
91
  namespace ${exportNamespace}
94
92
  {
95
- ${mmpMark}
96
93
  public partial class ${RowClass}
97
94
  {
98
95
  #if UNITY_EDITOR && ENABLE_CONFIG_LOG
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { cmm, HandleSheetParams, Field, foreach, IPlugin, st, PluginBase, HandleBatchParams, OutFilePath, makeFirstLetterUpper, iff } from "export-table-lib"
3
3
  import * as fs from "fs-extra"
4
- import { convMemberName, convVarName, getFieldElementType, getFieldType, isTypeArray } from "./CSParseTool";
4
+ import { convMemberName, convVarName, getFieldElementType, getFieldType, isTypeArray, useMMPNamespace } from "./CSParseTool";
5
5
 
6
6
  var isEnableMMPB = process.argv.findIndex(v => v == "--EnableMMPB") >= 0
7
7
 
@@ -19,13 +19,13 @@ export function exportMMP(paras: HandleSheetParams): string | null {
19
19
 
20
20
  let RowClass = firstLetterUpper(name)
21
21
  var fullName = `${table.workbookName}-${name}`
22
- var mmpMark = isEnableMMPB ? "[MemoryPack.MemoryPackable]" : "[System.Runtime.InteropServices.StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Ansi)]";
22
+ var mmpMark = "[System.Runtime.InteropServices.StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Ansi)]";
23
23
  // TODO: 支持FK类型
24
24
  let temp = `
25
25
  using System;
26
26
  using System.Collections.Generic;
27
27
  using System.Runtime.InteropServices;
28
- using LoadTableMMP.Runtime;
28
+ ${useMMPNamespace}
29
29
 
30
30
  namespace ${exportNamespace}
31
31
  {