@lcap/nasl 4.5.0-beta.5 → 4.5.0-beta.7

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.
Files changed (83) hide show
  1. package/out/generator/genBundleFiles.d.ts.map +1 -1
  2. package/out/generator/genBundleFiles.js +8 -1
  3. package/out/generator/genBundleFiles.js.map +1 -1
  4. package/out/generator/permission.d.ts.map +1 -1
  5. package/out/generator/permission.js +124 -8
  6. package/out/generator/permission.js.map +1 -1
  7. package/out/generator/release-body/body.d.ts.map +1 -1
  8. package/out/generator/release-body/body.js +2 -8
  9. package/out/generator/release-body/body.js.map +1 -1
  10. package/out/generator/release-body/data.d.ts.map +1 -1
  11. package/out/generator/release-body/data.js +5 -9
  12. package/out/generator/release-body/data.js.map +1 -1
  13. package/out/generator/release-body/internal.d.ts +0 -1
  14. package/out/generator/release-body/internal.d.ts.map +1 -1
  15. package/out/generator/release-body/internal.js.map +1 -1
  16. package/out/generator/release-body/types.d.ts +0 -2
  17. package/out/generator/release-body/types.d.ts.map +1 -1
  18. package/out/generator/release-body/utils.d.ts +1 -6
  19. package/out/generator/release-body/utils.d.ts.map +1 -1
  20. package/out/generator/release-body/utils.js +1 -1
  21. package/out/generator/release-body/utils.js.map +1 -1
  22. package/out/natural/exports/doctor/doctorView.d.ts +2 -1
  23. package/out/natural/exports/doctor/doctorView.d.ts.map +1 -1
  24. package/out/natural/exports/doctor/doctorView.js +134 -25
  25. package/out/natural/exports/doctor/doctorView.js.map +1 -1
  26. package/out/natural/exports/doctor/types.d.ts +34 -0
  27. package/out/natural/exports/doctor/types.d.ts.map +1 -1
  28. package/out/natural/exports/doctor/viewGraph.js +2 -2
  29. package/out/natural/exports/doctor/viewGraph.js.map +1 -1
  30. package/out/natural/exports/transform2BatchActions/diff/nodes.d.ts +0 -8
  31. package/out/natural/exports/transform2BatchActions/diff/nodes.d.ts.map +1 -1
  32. package/out/natural/exports/transform2BatchActions/diff/nodes.js +8 -28
  33. package/out/natural/exports/transform2BatchActions/diff/nodes.js.map +1 -1
  34. package/out/natural/exports/transform2BatchActions/diff/roles.d.ts.map +1 -1
  35. package/out/natural/exports/transform2BatchActions/diff/roles.js +4 -1
  36. package/out/natural/exports/transform2BatchActions/diff/roles.js.map +1 -1
  37. package/out/natural/exports/transform2BatchActions/diff/strip-uuid.d.ts +3 -0
  38. package/out/natural/exports/transform2BatchActions/diff/strip-uuid.d.ts.map +1 -0
  39. package/out/natural/exports/transform2BatchActions/diff/strip-uuid.js +30 -0
  40. package/out/natural/exports/transform2BatchActions/diff/strip-uuid.js.map +1 -0
  41. package/out/natural/exports/transform2BatchActions/index.d.ts.map +1 -1
  42. package/out/natural/exports/transform2BatchActions/index.js +1 -1
  43. package/out/natural/exports/transform2BatchActions/index.js.map +1 -1
  44. package/out/natural/exports/transform2BatchActions/parse.d.ts +2 -1
  45. package/out/natural/exports/transform2BatchActions/parse.d.ts.map +1 -1
  46. package/out/natural/exports/transform2BatchActions/parse.js +39 -12
  47. package/out/natural/exports/transform2BatchActions/parse.js.map +1 -1
  48. package/out/natural/exports/transform2BatchActions/types.d.ts +6 -0
  49. package/out/natural/exports/transform2BatchActions/types.d.ts.map +1 -1
  50. package/out/natural/exports/transform2BatchActions/view-path-utils.d.ts +13 -0
  51. package/out/natural/exports/transform2BatchActions/view-path-utils.d.ts.map +1 -0
  52. package/out/natural/exports/transform2BatchActions/view-path-utils.js +32 -0
  53. package/out/natural/exports/transform2BatchActions/view-path-utils.js.map +1 -0
  54. package/out/natural/old/getContext/getUILib.d.ts.map +1 -1
  55. package/out/natural/old/getContext/getUILib.js +47 -22
  56. package/out/natural/old/getContext/getUILib.js.map +1 -1
  57. package/out/natural/old/getContext/naslStdlibMap.d.ts.map +1 -1
  58. package/out/natural/old/getContext/naslStdlibMap.js +29 -14
  59. package/out/natural/old/getContext/naslStdlibMap.js.map +1 -1
  60. package/out/natural/parser/parseNaturalTSXView.d.ts.map +1 -1
  61. package/out/natural/parser/parseNaturalTSXView.js +38 -1
  62. package/out/natural/parser/parseNaturalTSXView.js.map +1 -1
  63. package/out/natural/transforms/checker/checkViewElement.d.ts.map +1 -1
  64. package/out/natural/transforms/checker/checkViewElement.js +8 -0
  65. package/out/natural/transforms/checker/checkViewElement.js.map +1 -1
  66. package/out/natural/transforms/transform2LogicItem.js +2 -2
  67. package/out/natural/transforms/transform2LogicItem.js.map +1 -1
  68. package/out/server/naslServer.d.ts.map +1 -1
  69. package/out/server/naslServer.js +38 -29
  70. package/out/server/naslServer.js.map +1 -1
  71. package/out/server/naslStdlibMap.d.ts.map +1 -1
  72. package/out/server/naslStdlibMap.js +61 -31
  73. package/out/server/naslStdlibMap.js.map +1 -1
  74. package/out/server/naslUiComponentTs.d.ts.map +1 -1
  75. package/out/server/naslUiComponentTs.js +18 -9
  76. package/out/server/naslUiComponentTs.js.map +1 -1
  77. package/out/service/autofix/rules/rule-convert-incompatible-assignment-to-union.d.ts.map +1 -1
  78. package/out/service/autofix/rules/rule-convert-incompatible-assignment-to-union.js +3 -3
  79. package/out/service/autofix/rules/rule-convert-incompatible-assignment-to-union.js.map +1 -1
  80. package/out/service/storage/init.d.ts.map +1 -1
  81. package/out/service/storage/init.js +2 -0
  82. package/out/service/storage/init.js.map +1 -1
  83. package/package.json +16 -10
@@ -37,7 +37,7 @@ const config_1 = require("../config");
37
37
  const Messager_1 = __importDefault(require("../common/Messager"));
38
38
  const oql_cache_1 = require("./OQL/oql-cache");
39
39
  const initial_1 = require("../service/initial");
40
- const set_1 = require("mnemonist/set");
40
+ const mnemonist_1 = require("mnemonist");
41
41
  const sqlFunctions_json_1 = __importDefault(require("./OQL/sqlFunctions.json"));
42
42
  const sqlCategory_json_1 = __importDefault(require("./OQL/sqlCategory.json"));
43
43
  /// #if process.env.BUILD_TARGET === 'node'
@@ -643,34 +643,43 @@ class NaslServer {
643
643
  }
644
644
  // 根据特性开关控制是否创建TypeScript Worker
645
645
  if (this.flags.tssEnabled) {
646
- /// #if process.env.BUILD_TARGET === 'node'
647
- if (globalThis.process)
648
- // For TS build
649
- // this.worker = new Worker(require.resolve('@lcap/nasl-typescript-worker/src/index.js'));
650
- this.worker = new worker_threads_1.Worker(require.resolve('../../ts-worker/src/index.js'));
646
+ /// #if process.env.BUILD_TYPE === 'bundler'
647
+ if (process.env.BUILD_TYPE === 'bundler') {
648
+ this.worker = new worker_threads_1.Worker(path.join(__dirname, './ts-worker/bundle.electron.js'));
649
+ }
651
650
  /// #endif
652
- /// #if process.env.BUILD_TARGET !== 'node'
653
- if (globalThis.window) {
654
- // const source = require('!!raw-loader!@lcap/nasl-typescript-worker/dist/index.js').default;
655
- this.worker = await (async () => {
656
- if (process.env.NODE_ENV === 'development') {
657
- const source = require('!!raw-loader!../../ts-worker/bundle.js').default;
658
- const url = URL.createObjectURL(new Blob([source]));
659
- const worker = new window.Worker(url);
660
- URL.revokeObjectURL(url);
661
- return worker;
662
- }
663
- const instance = globalThis.window;
664
- const baseIdePath = instance?.baseIdePath;
665
- const hash = process.env.COMMIT_HASH || '';
666
- const filename = instance?.electron?.createWorker
667
- ? 'tsserver.electron.js'
668
- : 'tsserver.js';
669
- // @ts-ignore
670
- const link = `${baseIdePath}/js/${filename}?${hash}`;
671
- const options = { name: 'typescript-server' };
672
- return createWorker(link, options);
673
- })();
651
+ /// #if process.env.BUILD_TYPE !== 'bundler'
652
+ if (process.env.BUILD_TYPE !== 'bundler') {
653
+ /// #if process.env.BUILD_TARGET === 'node'
654
+ if (globalThis.process)
655
+ // For TS build
656
+ // this.worker = new Worker(require.resolve('@lcap/nasl-typescript-worker/src/index.js'));
657
+ this.worker = new worker_threads_1.Worker(require.resolve('../../ts-worker/src/index.js'));
658
+ /// #endif
659
+ /// #if process.env.BUILD_TARGET !== 'node'
660
+ if (globalThis.window) {
661
+ // const source = require('!!raw-loader!@lcap/nasl-typescript-worker/dist/index.js').default;
662
+ this.worker = await (async () => {
663
+ if (process.env.NODE_ENV === 'development') {
664
+ const source = require('!!raw-loader!../../ts-worker/bundle.js').default;
665
+ const url = URL.createObjectURL(new Blob([source]));
666
+ const worker = new window.Worker(url);
667
+ URL.revokeObjectURL(url);
668
+ return worker;
669
+ }
670
+ const instance = globalThis.window;
671
+ const baseIdePath = instance?.baseIdePath;
672
+ const hash = process.env.COMMIT_HASH || '';
673
+ const filename = instance?.electron?.createWorker
674
+ ? 'tsserver.electron.js'
675
+ : 'tsserver.js';
676
+ // @ts-ignore
677
+ const link = `${baseIdePath}/js/${filename}?${hash}`;
678
+ const options = { name: 'typescript-server' };
679
+ return createWorker(link, options);
680
+ })();
681
+ }
682
+ /// #endif
674
683
  }
675
684
  /// #endif
676
685
  }
@@ -3857,7 +3866,7 @@ class NaslServer {
3857
3866
  const diagRecs = await (0, nasl_language_server_core_1.checkUpdateRefsDiag)({
3858
3867
  env: this.semEnv,
3859
3868
  diagMgr: this.diagnosticManager,
3860
- chkFiles: (0, set_1.union)(this.typerCheckFiles, oqlCheckFiles, originLogicCheckFiles, exportInterfacesCheckFiles),
3869
+ chkFiles: mnemonist_1.set.union(this.typerCheckFiles, oqlCheckFiles, originLogicCheckFiles, exportInterfacesCheckFiles),
3861
3870
  removeNodes: this.typerRemoveNodes,
3862
3871
  createNodes: this.typerCreateNodes,
3863
3872
  tsDiagnostics,