@bemedev/codebase 0.1.3 → 0.2.0

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 (108) hide show
  1. package/README.md +8 -8
  2. package/lib/_virtual/_rolldown/runtime.cjs +23 -0
  3. package/lib/analyse.cjs +48 -62
  4. package/lib/analyse.cjs.map +1 -1
  5. package/lib/analyse.d.ts +21 -3
  6. package/lib/analyse.js +45 -60
  7. package/lib/analyse.js.map +1 -1
  8. package/lib/analyse.utils.cjs +154 -205
  9. package/lib/analyse.utils.cjs.map +1 -1
  10. package/lib/analyse.utils.d.ts +1 -2
  11. package/lib/analyse.utils.js +153 -203
  12. package/lib/analyse.utils.js.map +1 -1
  13. package/lib/cli/cli.cjs +28 -27
  14. package/lib/cli/cli.cjs.map +1 -1
  15. package/lib/cli/cli.d.ts +0 -1
  16. package/lib/cli/cli.js +25 -24
  17. package/lib/cli/cli.js.map +1 -1
  18. package/lib/cli/constants.cjs +6 -5
  19. package/lib/cli/constants.cjs.map +1 -1
  20. package/lib/cli/constants.d.ts +0 -1
  21. package/lib/cli/constants.js +5 -3
  22. package/lib/cli/constants.js.map +1 -1
  23. package/lib/cli/index.cjs +6 -6
  24. package/lib/cli/index.cjs.map +1 -1
  25. package/lib/cli/index.d.ts +0 -1
  26. package/lib/cli/index.js +7 -4
  27. package/lib/cli/index.js.map +1 -1
  28. package/lib/constants.cjs +26 -28
  29. package/lib/constants.cjs.map +1 -1
  30. package/lib/constants.d.ts +0 -1
  31. package/lib/constants.js +24 -26
  32. package/lib/constants.js.map +1 -1
  33. package/lib/exports.cjs +51 -72
  34. package/lib/exports.cjs.map +1 -1
  35. package/lib/exports.d.ts +1 -2
  36. package/lib/exports.js +49 -70
  37. package/lib/exports.js.map +1 -1
  38. package/lib/functions/add.cjs +71 -84
  39. package/lib/functions/add.cjs.map +1 -1
  40. package/lib/functions/add.d.ts +1 -2
  41. package/lib/functions/add.js +68 -82
  42. package/lib/functions/add.js.map +1 -1
  43. package/lib/functions/generate.cjs +53 -56
  44. package/lib/functions/generate.cjs.map +1 -1
  45. package/lib/functions/generate.d.ts +1 -2
  46. package/lib/functions/generate.js +51 -54
  47. package/lib/functions/generate.js.map +1 -1
  48. package/lib/functions/index.cjs +11 -16
  49. package/lib/functions/index.d.ts +0 -1
  50. package/lib/functions/index.js +5 -5
  51. package/lib/functions/init.cjs +68 -97
  52. package/lib/functions/init.cjs.map +1 -1
  53. package/lib/functions/init.d.ts +1 -2
  54. package/lib/functions/init.js +66 -95
  55. package/lib/functions/init.js.map +1 -1
  56. package/lib/functions/remove.cjs +85 -103
  57. package/lib/functions/remove.cjs.map +1 -1
  58. package/lib/functions/remove.d.ts +1 -2
  59. package/lib/functions/remove.js +82 -101
  60. package/lib/functions/remove.js.map +1 -1
  61. package/lib/helpers.cjs +32 -38
  62. package/lib/helpers.cjs.map +1 -1
  63. package/lib/helpers.d.ts +3 -4
  64. package/lib/helpers.js +30 -36
  65. package/lib/helpers.js.map +1 -1
  66. package/lib/imports.cjs +88 -124
  67. package/lib/imports.cjs.map +1 -1
  68. package/lib/imports.d.ts +2 -3
  69. package/lib/imports.js +86 -122
  70. package/lib/imports.js.map +1 -1
  71. package/lib/index.cjs +22 -24
  72. package/lib/index.d.ts +4 -4
  73. package/lib/index.js +8 -6
  74. package/lib/schemas.cjs +53 -64
  75. package/lib/schemas.cjs.map +1 -1
  76. package/lib/schemas.d.ts +1 -2
  77. package/lib/schemas.js +43 -36
  78. package/lib/schemas.js.map +1 -1
  79. package/lib/types.d.ts +0 -1
  80. package/lib/utils.cjs +9 -10
  81. package/lib/utils.cjs.map +1 -1
  82. package/lib/utils.d.ts +0 -1
  83. package/lib/utils.js +8 -8
  84. package/lib/utils.js.map +1 -1
  85. package/package.json +56 -44
  86. package/CHANGE_LOG.md +0 -161
  87. package/lib/analyse.d.ts.map +0 -1
  88. package/lib/analyse.utils.d.ts.map +0 -1
  89. package/lib/cli/cli.d.ts.map +0 -1
  90. package/lib/cli/constants.d.ts.map +0 -1
  91. package/lib/cli/index.d.ts.map +0 -1
  92. package/lib/constants.d.ts.map +0 -1
  93. package/lib/exports.d.ts.map +0 -1
  94. package/lib/functions/add.d.ts.map +0 -1
  95. package/lib/functions/generate.d.ts.map +0 -1
  96. package/lib/functions/index.cjs.map +0 -1
  97. package/lib/functions/index.d.ts.map +0 -1
  98. package/lib/functions/index.js.map +0 -1
  99. package/lib/functions/init.d.ts.map +0 -1
  100. package/lib/functions/remove.d.ts.map +0 -1
  101. package/lib/helpers.d.ts.map +0 -1
  102. package/lib/imports.d.ts.map +0 -1
  103. package/lib/index.cjs.map +0 -1
  104. package/lib/index.d.ts.map +0 -1
  105. package/lib/index.js.map +0 -1
  106. package/lib/schemas.d.ts.map +0 -1
  107. package/lib/types.d.ts.map +0 -1
  108. package/lib/utils.d.ts.map +0 -1
@@ -1,2 +1 @@
1
1
  export declare const BIN = "codebase";
2
- //# sourceMappingURL=constants.d.ts.map
@@ -1,4 +1,6 @@
1
- const BIN = 'codebase';
2
-
1
+ //#region src/cli/constants.ts
2
+ const BIN = "codebase";
3
+ //#endregion
3
4
  export { BIN };
4
- //# sourceMappingURL=constants.js.map
5
+
6
+ //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../src/cli/constants.ts"],"sourcesContent":["export const BIN = 'codebase';\n"],"names":[],"mappings":"AAAO,MAAM,GAAG,GAAG;;;;"}
1
+ {"version":3,"file":"constants.js","names":[],"sources":["../../src/cli/constants.ts"],"sourcesContent":["export const BIN = 'codebase';\n"],"mappings":";AAAA,MAAa,MAAM"}
package/lib/cli/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
2
+ require("../_virtual/_rolldown/runtime.cjs");
3
+ const require_cli_cli = require("./cli.cjs");
4
+ //#region src/cli/index.ts
5
+ (0, require("cmd-ts").run)(require_cli_cli.cli, process.argv.slice(2));
6
+ //#endregion
3
7
 
4
- var cmdTs = require('cmd-ts');
5
- var cli_cli = require('./cli.cjs');
6
-
7
- cmdTs.run(cli_cli.cli, process.argv.slice(2));
8
- //# sourceMappingURL=index.cjs.map
8
+ //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { run } from 'cmd-ts';\nimport { cli } from './cli';\n\nrun(cli, process.argv.slice(2));\n"],"names":["run","cli"],"mappings":";;;;;;AAKAA,SAAG,CAACC,WAAG,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;;"}
1
+ {"version":3,"file":"index.cjs","names":["cli"],"sources":["../../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { run } from 'cmd-ts';\nimport { cli } from './cli';\n\nrun(cli, process.argv.slice(2));\n"],"mappings":";;;;2BAKIA,gBAAAA,KAAK,QAAQ,KAAK,MAAM,EAAE,CAAC"}
@@ -1,3 +1,2 @@
1
1
  #!/usr/bin/env node
2
2
  export {};
3
- //# sourceMappingURL=index.d.ts.map
package/lib/cli/index.js CHANGED
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { run } from 'cmd-ts';
3
- import { cli } from './cli.js';
4
-
2
+ import { cli } from "./cli.js";
3
+ import { run } from "cmd-ts";
4
+ //#region src/cli/index.ts
5
5
  run(cli, process.argv.slice(2));
6
- //# sourceMappingURL=index.js.map
6
+ //#endregion
7
+ export {};
8
+
9
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { run } from 'cmd-ts';\nimport { cli } from './cli';\n\nrun(cli, process.argv.slice(2));\n"],"names":[],"mappings":";;;;AAKA,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { run } from 'cmd-ts';\nimport { cli } from './cli';\n\nrun(cli, process.argv.slice(2));\n"],"mappings":";;;;AAKA,IAAI,KAAK,QAAQ,KAAK,MAAM,EAAE,CAAC"}
package/lib/constants.cjs CHANGED
@@ -1,34 +1,31 @@
1
- 'use strict';
2
-
3
- var path = require('path');
4
-
5
- const SRC_DIR = path.join(process.cwd(), 'src');
6
- const CODEBASE_FILE = path.join(process.cwd(), '.codebase.json');
7
- const _REPLACER = '-|||-';
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ require("./_virtual/_rolldown/runtime.cjs");
3
+ let path = require("path");
4
+ //#region src/constants.ts
5
+ const SRC_DIR = (0, path.join)(process.cwd(), "src");
6
+ const CODEBASE_FILE = (0, path.join)(process.cwd(), ".codebase.json");
7
+ const _REPLACER = "-|||-";
8
8
  const REPLACERS = {
9
- code: [
10
- ['\\`', `${_REPLACER}w`],
11
- ['`', '\\`'],
12
- ['${', `$${_REPLACER}{`],
13
- ['\\s', `${_REPLACER}s`],
14
- ['\\w', `${_REPLACER}w`],
15
- ],
16
- init: [
17
- [new RegExp('\\`', 'g'), '`'],
18
- [_REPLACER, ''],
19
- ],
9
+ code: [
10
+ ["\\`", `${_REPLACER}w`],
11
+ ["`", "\\`"],
12
+ ["${", `$${_REPLACER}{`],
13
+ ["\\s", `${_REPLACER}s`],
14
+ ["\\w", `${_REPLACER}w`]
15
+ ],
16
+ init: [[/* @__PURE__ */ new RegExp("\\`", "g"), "`"], [_REPLACER, ""]]
20
17
  };
21
- const PATH_KEY = '#bemedev/*';
22
- const JSON_FILE_NAME = '.bemedev.json';
23
- const PATH_PROPERTY = 'path';
24
- const FILES_PROPERTY = 'files';
18
+ const PATH_KEY = "#bemedev/*";
19
+ const JSON_FILE_NAME = ".bemedev.json";
20
+ const PATH_PROPERTY = "path";
21
+ const FILES_PROPERTY = "files";
25
22
  const PROPERTIES = {
26
- PATH: 'path',
27
- FILES: 'files',
28
- CODEBASE_ANALYSIS: 'CODEBASE_ANALYSIS',
29
- STATS: 'STATS',
23
+ PATH: "path",
24
+ FILES: "files",
25
+ CODEBASE_ANALYSIS: "CODEBASE_ANALYSIS",
26
+ STATS: "STATS"
30
27
  };
31
-
28
+ //#endregion
32
29
  exports.CODEBASE_FILE = CODEBASE_FILE;
33
30
  exports.FILES_PROPERTY = FILES_PROPERTY;
34
31
  exports.JSON_FILE_NAME = JSON_FILE_NAME;
@@ -37,4 +34,5 @@ exports.PATH_PROPERTY = PATH_PROPERTY;
37
34
  exports.PROPERTIES = PROPERTIES;
38
35
  exports.REPLACERS = REPLACERS;
39
36
  exports.SRC_DIR = SRC_DIR;
40
- //# sourceMappingURL=constants.cjs.map
37
+
38
+ //# sourceMappingURL=constants.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.cjs","sources":["../src/constants.ts"],"sourcesContent":["import { join } from 'node:path';\n\nexport const SRC_DIR = join(process.cwd(), 'src');\nexport const CODEBASE_FILE = join(process.cwd(), '.codebase.json');\n\nconst _REPLACER = '-|||-';\n\nexport const REPLACERS = {\n code: [\n ['\\\\`', `${_REPLACER}w`],\n ['`', '\\\\`'],\n ['${', `$${_REPLACER}{`],\n ['\\\\s', `${_REPLACER}s`],\n ['\\\\w', `${_REPLACER}w`],\n ],\n init: [\n [new RegExp('\\\\`', 'g'), '`'],\n [_REPLACER, ''],\n ],\n} as const;\n\nexport const PATH_KEY = '#bemedev/*';\nexport const JSON_FILE_NAME = '.bemedev.json';\n\nexport const PATH_PROPERTY = 'path';\nexport const FILES_PROPERTY = 'files';\n\nexport const PROPERTIES = {\n PATH: 'path',\n FILES: 'files',\n CODEBASE_ANALYSIS: 'CODEBASE_ANALYSIS',\n STATS: 'STATS',\n} as const;\n"],"names":["join"],"mappings":";;;;AAEO,MAAM,OAAO,GAAGA,SAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK;AACzC,MAAM,aAAa,GAAGA,SAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB;AAEjE,MAAM,SAAS,GAAG,OAAO;AAElB,MAAM,SAAS,GAAG;AACvB,IAAA,IAAI,EAAE;AACJ,QAAA,CAAC,KAAK,EAAE,CAAA,EAAG,SAAS,GAAG,CAAC;QACxB,CAAC,GAAG,EAAE,KAAK,CAAC;AACZ,QAAA,CAAC,IAAI,EAAE,CAAA,CAAA,EAAI,SAAS,GAAG,CAAC;AACxB,QAAA,CAAC,KAAK,EAAE,CAAA,EAAG,SAAS,GAAG,CAAC;AACxB,QAAA,CAAC,KAAK,EAAE,CAAA,EAAG,SAAS,GAAG,CAAC;AACzB,KAAA;AACD,IAAA,IAAI,EAAE;QACJ,CAAC,IAAI,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC;QAC7B,CAAC,SAAS,EAAE,EAAE,CAAC;AAChB,KAAA;;AAGI,MAAM,QAAQ,GAAG;AACjB,MAAM,cAAc,GAAG;AAEvB,MAAM,aAAa,GAAG;AACtB,MAAM,cAAc,GAAG;AAEvB,MAAM,UAAU,GAAG;AACxB,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,iBAAiB,EAAE,mBAAmB;AACtC,IAAA,KAAK,EAAE,OAAO;;;;;;;;;;;;"}
1
+ {"version":3,"file":"constants.cjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["import { join } from 'node:path';\n\nexport const SRC_DIR = join(process.cwd(), 'src');\nexport const CODEBASE_FILE = join(process.cwd(), '.codebase.json');\n\nconst _REPLACER = '-|||-';\n\nexport const REPLACERS = {\n code: [\n ['\\\\`', `${_REPLACER}w`],\n ['`', '\\\\`'],\n ['${', `$${_REPLACER}{`],\n ['\\\\s', `${_REPLACER}s`],\n ['\\\\w', `${_REPLACER}w`],\n ],\n init: [\n [new RegExp('\\\\`', 'g'), '`'],\n [_REPLACER, ''],\n ],\n} as const;\n\nexport const PATH_KEY = '#bemedev/*';\nexport const JSON_FILE_NAME = '.bemedev.json';\n\nexport const PATH_PROPERTY = 'path';\nexport const FILES_PROPERTY = 'files';\n\nexport const PROPERTIES = {\n PATH: 'path',\n FILES: 'files',\n CODEBASE_ANALYSIS: 'CODEBASE_ANALYSIS',\n STATS: 'STATS',\n} as const;\n"],"mappings":";;;;AAEA,MAAa,WAAA,GAAA,KAAA,MAAe,QAAQ,KAAK,EAAE,MAAM;AACjD,MAAa,iBAAA,GAAA,KAAA,MAAqB,QAAQ,KAAK,EAAE,iBAAiB;AAElE,MAAM,YAAY;AAElB,MAAa,YAAY;CACvB,MAAM;EACJ,CAAC,OAAO,GAAG,UAAU,GAAG;EACxB,CAAC,KAAK,MAAM;EACZ,CAAC,MAAM,IAAI,UAAU,GAAG;EACxB,CAAC,OAAO,GAAG,UAAU,GAAG;EACxB,CAAC,OAAO,GAAG,UAAU,GAAG;EACzB;CACD,MAAM,CACJ,iBAAC,IAAI,OAAO,OAAO,IAAI,EAAE,IAAI,EAC7B,CAAC,WAAW,GAAG,CAChB;CACF;AAED,MAAa,WAAW;AACxB,MAAa,iBAAiB;AAE9B,MAAa,gBAAgB;AAC7B,MAAa,iBAAiB;AAE9B,MAAa,aAAa;CACxB,MAAM;CACN,OAAO;CACP,mBAAmB;CACnB,OAAO;CACR"}
@@ -14,4 +14,3 @@ export declare const PROPERTIES: {
14
14
  readonly CODEBASE_ANALYSIS: "CODEBASE_ANALYSIS";
15
15
  readonly STATS: "STATS";
16
16
  };
17
- //# sourceMappingURL=constants.d.ts.map
package/lib/constants.js CHANGED
@@ -1,31 +1,29 @@
1
- import { join } from 'path';
2
-
3
- const SRC_DIR = join(process.cwd(), 'src');
4
- const CODEBASE_FILE = join(process.cwd(), '.codebase.json');
5
- const _REPLACER = '-|||-';
1
+ import { join } from "path";
2
+ //#region src/constants.ts
3
+ const SRC_DIR = join(process.cwd(), "src");
4
+ const CODEBASE_FILE = join(process.cwd(), ".codebase.json");
5
+ const _REPLACER = "-|||-";
6
6
  const REPLACERS = {
7
- code: [
8
- ['\\`', `${_REPLACER}w`],
9
- ['`', '\\`'],
10
- ['${', `$${_REPLACER}{`],
11
- ['\\s', `${_REPLACER}s`],
12
- ['\\w', `${_REPLACER}w`],
13
- ],
14
- init: [
15
- [new RegExp('\\`', 'g'), '`'],
16
- [_REPLACER, ''],
17
- ],
7
+ code: [
8
+ ["\\`", `${_REPLACER}w`],
9
+ ["`", "\\`"],
10
+ ["${", `$${_REPLACER}{`],
11
+ ["\\s", `${_REPLACER}s`],
12
+ ["\\w", `${_REPLACER}w`]
13
+ ],
14
+ init: [[/* @__PURE__ */ new RegExp("\\`", "g"), "`"], [_REPLACER, ""]]
18
15
  };
19
- const PATH_KEY = '#bemedev/*';
20
- const JSON_FILE_NAME = '.bemedev.json';
21
- const PATH_PROPERTY = 'path';
22
- const FILES_PROPERTY = 'files';
16
+ const PATH_KEY = "#bemedev/*";
17
+ const JSON_FILE_NAME = ".bemedev.json";
18
+ const PATH_PROPERTY = "path";
19
+ const FILES_PROPERTY = "files";
23
20
  const PROPERTIES = {
24
- PATH: 'path',
25
- FILES: 'files',
26
- CODEBASE_ANALYSIS: 'CODEBASE_ANALYSIS',
27
- STATS: 'STATS',
21
+ PATH: "path",
22
+ FILES: "files",
23
+ CODEBASE_ANALYSIS: "CODEBASE_ANALYSIS",
24
+ STATS: "STATS"
28
25
  };
29
-
26
+ //#endregion
30
27
  export { CODEBASE_FILE, FILES_PROPERTY, JSON_FILE_NAME, PATH_KEY, PATH_PROPERTY, PROPERTIES, REPLACERS, SRC_DIR };
31
- //# sourceMappingURL=constants.js.map
28
+
29
+ //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["import { join } from 'node:path';\n\nexport const SRC_DIR = join(process.cwd(), 'src');\nexport const CODEBASE_FILE = join(process.cwd(), '.codebase.json');\n\nconst _REPLACER = '-|||-';\n\nexport const REPLACERS = {\n code: [\n ['\\\\`', `${_REPLACER}w`],\n ['`', '\\\\`'],\n ['${', `$${_REPLACER}{`],\n ['\\\\s', `${_REPLACER}s`],\n ['\\\\w', `${_REPLACER}w`],\n ],\n init: [\n [new RegExp('\\\\`', 'g'), '`'],\n [_REPLACER, ''],\n ],\n} as const;\n\nexport const PATH_KEY = '#bemedev/*';\nexport const JSON_FILE_NAME = '.bemedev.json';\n\nexport const PATH_PROPERTY = 'path';\nexport const FILES_PROPERTY = 'files';\n\nexport const PROPERTIES = {\n PATH: 'path',\n FILES: 'files',\n CODEBASE_ANALYSIS: 'CODEBASE_ANALYSIS',\n STATS: 'STATS',\n} as const;\n"],"names":[],"mappings":";;AAEO,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK;AACzC,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB;AAEjE,MAAM,SAAS,GAAG,OAAO;AAElB,MAAM,SAAS,GAAG;AACvB,IAAA,IAAI,EAAE;AACJ,QAAA,CAAC,KAAK,EAAE,CAAA,EAAG,SAAS,GAAG,CAAC;QACxB,CAAC,GAAG,EAAE,KAAK,CAAC;AACZ,QAAA,CAAC,IAAI,EAAE,CAAA,CAAA,EAAI,SAAS,GAAG,CAAC;AACxB,QAAA,CAAC,KAAK,EAAE,CAAA,EAAG,SAAS,GAAG,CAAC;AACxB,QAAA,CAAC,KAAK,EAAE,CAAA,EAAG,SAAS,GAAG,CAAC;AACzB,KAAA;AACD,IAAA,IAAI,EAAE;QACJ,CAAC,IAAI,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC;QAC7B,CAAC,SAAS,EAAE,EAAE,CAAC;AAChB,KAAA;;AAGI,MAAM,QAAQ,GAAG;AACjB,MAAM,cAAc,GAAG;AAEvB,MAAM,aAAa,GAAG;AACtB,MAAM,cAAc,GAAG;AAEvB,MAAM,UAAU,GAAG;AACxB,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,iBAAiB,EAAE,mBAAmB;AACtC,IAAA,KAAK,EAAE,OAAO;;;;;"}
1
+ {"version":3,"file":"constants.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["import { join } from 'node:path';\n\nexport const SRC_DIR = join(process.cwd(), 'src');\nexport const CODEBASE_FILE = join(process.cwd(), '.codebase.json');\n\nconst _REPLACER = '-|||-';\n\nexport const REPLACERS = {\n code: [\n ['\\\\`', `${_REPLACER}w`],\n ['`', '\\\\`'],\n ['${', `$${_REPLACER}{`],\n ['\\\\s', `${_REPLACER}s`],\n ['\\\\w', `${_REPLACER}w`],\n ],\n init: [\n [new RegExp('\\\\`', 'g'), '`'],\n [_REPLACER, ''],\n ],\n} as const;\n\nexport const PATH_KEY = '#bemedev/*';\nexport const JSON_FILE_NAME = '.bemedev.json';\n\nexport const PATH_PROPERTY = 'path';\nexport const FILES_PROPERTY = 'files';\n\nexport const PROPERTIES = {\n PATH: 'path',\n FILES: 'files',\n CODEBASE_ANALYSIS: 'CODEBASE_ANALYSIS',\n STATS: 'STATS',\n} as const;\n"],"mappings":";;AAEA,MAAa,UAAU,KAAK,QAAQ,KAAK,EAAE,MAAM;AACjD,MAAa,gBAAgB,KAAK,QAAQ,KAAK,EAAE,iBAAiB;AAElE,MAAM,YAAY;AAElB,MAAa,YAAY;CACvB,MAAM;EACJ,CAAC,OAAO,GAAG,UAAU,GAAG;EACxB,CAAC,KAAK,MAAM;EACZ,CAAC,MAAM,IAAI,UAAU,GAAG;EACxB,CAAC,OAAO,GAAG,UAAU,GAAG;EACxB,CAAC,OAAO,GAAG,UAAU,GAAG;EACzB;CACD,MAAM,CACJ,iBAAC,IAAI,OAAO,OAAO,IAAI,EAAE,IAAI,EAC7B,CAAC,WAAW,GAAG,CAChB;CACF;AAED,MAAa,WAAW;AACxB,MAAa,iBAAiB;AAE9B,MAAa,gBAAgB;AAC7B,MAAa,iBAAiB;AAE9B,MAAa,aAAa;CACxB,MAAM;CACN,OAAO;CACP,mBAAmB;CACnB,OAAO;CACR"}
package/lib/exports.cjs CHANGED
@@ -1,75 +1,54 @@
1
- 'use strict';
2
-
3
- var tsMorph = require('ts-morph');
4
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ require("./_virtual/_rolldown/runtime.cjs");
3
+ let ts_morph = require("ts-morph");
4
+ //#region src/exports.ts
5
5
  const analyzeExports = (sourceFile) => {
6
- const exports$1 = [];
7
- // Export declarations (export ...)
8
- sourceFile.getExportDeclarations().forEach(exportDecl => {
9
- const moduleSpecifier = exportDecl.getModuleSpecifierValue();
10
- const exportText = exportDecl.getText();
11
- // Named exports
12
- const namedExports = exportDecl.getNamedExports();
13
- namedExports.forEach(namedExport => {
14
- exports$1.push({
15
- name: namedExport.getName(),
16
- kind: 'named',
17
- text: exportText,
18
- moduleSpecifier,
19
- });
20
- });
21
- // Namespace export (export * from '...')
22
- if (exportDecl.isNamespaceExport()) {
23
- exports$1.push({
24
- name: '*',
25
- kind: 'namespace',
26
- text: exportText,
27
- moduleSpecifier,
28
- });
29
- }
30
- });
31
- // Export assignments (export = ...)
32
- sourceFile.getExportAssignments().forEach(exportAssignment => {
33
- if (exportAssignment.isExportEquals()) {
34
- exports$1.push({
35
- name: 'default',
36
- kind: 'default',
37
- text: exportAssignment.getText(),
38
- });
39
- }
40
- });
41
- // Exported declarations (export function, export class, etc.)
42
- sourceFile.getExportedDeclarations().forEach((declarations, name) => {
43
- declarations.forEach(decl => {
44
- let declarationKind;
45
- if (decl.getKind() === tsMorph.SyntaxKind.FunctionDeclaration) {
46
- declarationKind = 'function';
47
- }
48
- else if (decl.getKind() === tsMorph.SyntaxKind.ClassDeclaration) {
49
- declarationKind = 'class';
50
- }
51
- else if (decl.getKind() === tsMorph.SyntaxKind.InterfaceDeclaration) {
52
- declarationKind = 'interface';
53
- }
54
- else if (decl.getKind() === tsMorph.SyntaxKind.TypeAliasDeclaration) {
55
- declarationKind = 'type';
56
- }
57
- else if (decl.getKind() === tsMorph.SyntaxKind.VariableDeclaration) {
58
- declarationKind = 'variable';
59
- }
60
- else if (decl.getKind() === tsMorph.SyntaxKind.EnumDeclaration) {
61
- declarationKind = 'enum';
62
- }
63
- exports$1.push({
64
- name,
65
- kind: name === 'default' ? 'default' : 'named',
66
- text: decl.getText(),
67
- declarationKind,
68
- });
69
- });
70
- });
71
- return exports$1;
6
+ const exports = [];
7
+ sourceFile.getExportDeclarations().forEach((exportDecl) => {
8
+ const moduleSpecifier = exportDecl.getModuleSpecifierValue();
9
+ const exportText = exportDecl.getText();
10
+ exportDecl.getNamedExports().forEach((namedExport) => {
11
+ exports.push({
12
+ name: namedExport.getName(),
13
+ kind: "named",
14
+ text: exportText,
15
+ moduleSpecifier
16
+ });
17
+ });
18
+ if (exportDecl.isNamespaceExport()) exports.push({
19
+ name: "*",
20
+ kind: "namespace",
21
+ text: exportText,
22
+ moduleSpecifier
23
+ });
24
+ });
25
+ sourceFile.getExportAssignments().forEach((exportAssignment) => {
26
+ if (exportAssignment.isExportEquals()) exports.push({
27
+ name: "default",
28
+ kind: "default",
29
+ text: exportAssignment.getText()
30
+ });
31
+ });
32
+ sourceFile.getExportedDeclarations().forEach((declarations, name) => {
33
+ declarations.forEach((decl) => {
34
+ let declarationKind;
35
+ if (decl.getKind() === ts_morph.SyntaxKind.FunctionDeclaration) declarationKind = "function";
36
+ else if (decl.getKind() === ts_morph.SyntaxKind.ClassDeclaration) declarationKind = "class";
37
+ else if (decl.getKind() === ts_morph.SyntaxKind.InterfaceDeclaration) declarationKind = "interface";
38
+ else if (decl.getKind() === ts_morph.SyntaxKind.TypeAliasDeclaration) declarationKind = "type";
39
+ else if (decl.getKind() === ts_morph.SyntaxKind.VariableDeclaration) declarationKind = "variable";
40
+ else if (decl.getKind() === ts_morph.SyntaxKind.EnumDeclaration) declarationKind = "enum";
41
+ exports.push({
42
+ name,
43
+ kind: name === "default" ? "default" : "named",
44
+ text: decl.getText(),
45
+ declarationKind
46
+ });
47
+ });
48
+ });
49
+ return exports;
72
50
  };
73
-
51
+ //#endregion
74
52
  exports.analyzeExports = analyzeExports;
75
- //# sourceMappingURL=exports.cjs.map
53
+
54
+ //# sourceMappingURL=exports.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"exports.cjs","sources":["../src/exports.ts"],"sourcesContent":["import { SourceFile, SyntaxKind } from 'ts-morph';\nimport type { ExportInfo } from './schemas';\n\nexport const analyzeExports = (sourceFile: SourceFile) => {\n const exports: ExportInfo[] = [];\n\n // Export declarations (export ...)\n sourceFile.getExportDeclarations().forEach(exportDecl => {\n const moduleSpecifier = exportDecl.getModuleSpecifierValue();\n const exportText = exportDecl.getText();\n\n // Named exports\n const namedExports = exportDecl.getNamedExports();\n namedExports.forEach(namedExport => {\n exports.push({\n name: namedExport.getName(),\n kind: 'named',\n text: exportText,\n moduleSpecifier,\n });\n });\n\n // Namespace export (export * from '...')\n if (exportDecl.isNamespaceExport()) {\n exports.push({\n name: '*',\n kind: 'namespace',\n text: exportText,\n moduleSpecifier,\n });\n }\n });\n\n // Export assignments (export = ...)\n sourceFile.getExportAssignments().forEach(exportAssignment => {\n if (exportAssignment.isExportEquals()) {\n exports.push({\n name: 'default',\n kind: 'default',\n text: exportAssignment.getText(),\n });\n }\n });\n\n // Exported declarations (export function, export class, etc.)\n sourceFile.getExportedDeclarations().forEach((declarations, name) => {\n declarations.forEach(decl => {\n let declarationKind: ExportInfo['declarationKind'];\n\n if (decl.getKind() === SyntaxKind.FunctionDeclaration) {\n declarationKind = 'function';\n } else if (decl.getKind() === SyntaxKind.ClassDeclaration) {\n declarationKind = 'class';\n } else if (decl.getKind() === SyntaxKind.InterfaceDeclaration) {\n declarationKind = 'interface';\n } else if (decl.getKind() === SyntaxKind.TypeAliasDeclaration) {\n declarationKind = 'type';\n } else if (decl.getKind() === SyntaxKind.VariableDeclaration) {\n declarationKind = 'variable';\n } else if (decl.getKind() === SyntaxKind.EnumDeclaration) {\n declarationKind = 'enum';\n }\n\n exports.push({\n name,\n kind: name === 'default' ? 'default' : 'named',\n text: decl.getText(),\n declarationKind,\n });\n });\n });\n\n return exports;\n};\n"],"names":["exports","SyntaxKind"],"mappings":";;;;AAGO,MAAM,cAAc,GAAG,CAAC,UAAsB,KAAI;IACvD,MAAMA,SAAO,GAAiB,EAAE;;IAGhC,UAAU,CAAC,qBAAqB,EAAE,CAAC,OAAO,CAAC,UAAU,IAAG;AACtD,QAAA,MAAM,eAAe,GAAG,UAAU,CAAC,uBAAuB,EAAE;AAC5D,QAAA,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,EAAE;;AAGvC,QAAA,MAAM,YAAY,GAAG,UAAU,CAAC,eAAe,EAAE;AACjD,QAAA,YAAY,CAAC,OAAO,CAAC,WAAW,IAAG;YACjCA,SAAO,CAAC,IAAI,CAAC;AACX,gBAAA,IAAI,EAAE,WAAW,CAAC,OAAO,EAAE;AAC3B,gBAAA,IAAI,EAAE,OAAO;AACb,gBAAA,IAAI,EAAE,UAAU;gBAChB,eAAe;AAChB,aAAA,CAAC;AACJ,QAAA,CAAC,CAAC;;AAGF,QAAA,IAAI,UAAU,CAAC,iBAAiB,EAAE,EAAE;YAClCA,SAAO,CAAC,IAAI,CAAC;AACX,gBAAA,IAAI,EAAE,GAAG;AACT,gBAAA,IAAI,EAAE,WAAW;AACjB,gBAAA,IAAI,EAAE,UAAU;gBAChB,eAAe;AAChB,aAAA,CAAC;QACJ;AACF,IAAA,CAAC,CAAC;;IAGF,UAAU,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC,gBAAgB,IAAG;AAC3D,QAAA,IAAI,gBAAgB,CAAC,cAAc,EAAE,EAAE;YACrCA,SAAO,CAAC,IAAI,CAAC;AACX,gBAAA,IAAI,EAAE,SAAS;AACf,gBAAA,IAAI,EAAE,SAAS;AACf,gBAAA,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE;AACjC,aAAA,CAAC;QACJ;AACF,IAAA,CAAC,CAAC;;IAGF,UAAU,CAAC,uBAAuB,EAAE,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,IAAI,KAAI;AAClE,QAAA,YAAY,CAAC,OAAO,CAAC,IAAI,IAAG;AAC1B,YAAA,IAAI,eAA8C;YAElD,IAAI,IAAI,CAAC,OAAO,EAAE,KAAKC,kBAAU,CAAC,mBAAmB,EAAE;gBACrD,eAAe,GAAG,UAAU;YAC9B;iBAAO,IAAI,IAAI,CAAC,OAAO,EAAE,KAAKA,kBAAU,CAAC,gBAAgB,EAAE;gBACzD,eAAe,GAAG,OAAO;YAC3B;iBAAO,IAAI,IAAI,CAAC,OAAO,EAAE,KAAKA,kBAAU,CAAC,oBAAoB,EAAE;gBAC7D,eAAe,GAAG,WAAW;YAC/B;iBAAO,IAAI,IAAI,CAAC,OAAO,EAAE,KAAKA,kBAAU,CAAC,oBAAoB,EAAE;gBAC7D,eAAe,GAAG,MAAM;YAC1B;iBAAO,IAAI,IAAI,CAAC,OAAO,EAAE,KAAKA,kBAAU,CAAC,mBAAmB,EAAE;gBAC5D,eAAe,GAAG,UAAU;YAC9B;iBAAO,IAAI,IAAI,CAAC,OAAO,EAAE,KAAKA,kBAAU,CAAC,eAAe,EAAE;gBACxD,eAAe,GAAG,MAAM;YAC1B;YAEAD,SAAO,CAAC,IAAI,CAAC;gBACX,IAAI;gBACJ,IAAI,EAAE,IAAI,KAAK,SAAS,GAAG,SAAS,GAAG,OAAO;AAC9C,gBAAA,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE;gBACpB,eAAe;AAChB,aAAA,CAAC;AACJ,QAAA,CAAC,CAAC;AACJ,IAAA,CAAC,CAAC;AAEF,IAAA,OAAOA,SAAO;AAChB;;;;"}
1
+ {"version":3,"file":"exports.cjs","names":["SyntaxKind"],"sources":["../src/exports.ts"],"sourcesContent":["import { SourceFile, SyntaxKind } from 'ts-morph';\nimport type { ExportInfo } from './schemas';\n\nexport const analyzeExports = (sourceFile: SourceFile) => {\n const exports: ExportInfo[] = [];\n\n // Export declarations (export ...)\n sourceFile.getExportDeclarations().forEach(exportDecl => {\n const moduleSpecifier = exportDecl.getModuleSpecifierValue();\n const exportText = exportDecl.getText();\n\n // Named exports\n const namedExports = exportDecl.getNamedExports();\n namedExports.forEach(namedExport => {\n exports.push({\n name: namedExport.getName(),\n kind: 'named',\n text: exportText,\n moduleSpecifier,\n });\n });\n\n // Namespace export (export * from '...')\n if (exportDecl.isNamespaceExport()) {\n exports.push({\n name: '*',\n kind: 'namespace',\n text: exportText,\n moduleSpecifier,\n });\n }\n });\n\n // Export assignments (export = ...)\n sourceFile.getExportAssignments().forEach(exportAssignment => {\n if (exportAssignment.isExportEquals()) {\n exports.push({\n name: 'default',\n kind: 'default',\n text: exportAssignment.getText(),\n });\n }\n });\n\n // Exported declarations (export function, export class, etc.)\n sourceFile.getExportedDeclarations().forEach((declarations, name) => {\n declarations.forEach(decl => {\n let declarationKind: ExportInfo['declarationKind'];\n\n if (decl.getKind() === SyntaxKind.FunctionDeclaration) {\n declarationKind = 'function';\n } else if (decl.getKind() === SyntaxKind.ClassDeclaration) {\n declarationKind = 'class';\n } else if (decl.getKind() === SyntaxKind.InterfaceDeclaration) {\n declarationKind = 'interface';\n } else if (decl.getKind() === SyntaxKind.TypeAliasDeclaration) {\n declarationKind = 'type';\n } else if (decl.getKind() === SyntaxKind.VariableDeclaration) {\n declarationKind = 'variable';\n } else if (decl.getKind() === SyntaxKind.EnumDeclaration) {\n declarationKind = 'enum';\n }\n\n exports.push({\n name,\n kind: name === 'default' ? 'default' : 'named',\n text: decl.getText(),\n declarationKind,\n });\n });\n });\n\n return exports;\n};\n"],"mappings":";;;;AAGA,MAAa,kBAAkB,eAA2B;CACxD,MAAM,UAAwB,EAAE;AAGhC,YAAW,uBAAuB,CAAC,SAAQ,eAAc;EACvD,MAAM,kBAAkB,WAAW,yBAAyB;EAC5D,MAAM,aAAa,WAAW,SAAS;AAGlB,aAAW,iBAAiB,CACpC,SAAQ,gBAAe;AAClC,WAAQ,KAAK;IACX,MAAM,YAAY,SAAS;IAC3B,MAAM;IACN,MAAM;IACN;IACD,CAAC;IACF;AAGF,MAAI,WAAW,mBAAmB,CAChC,SAAQ,KAAK;GACX,MAAM;GACN,MAAM;GACN,MAAM;GACN;GACD,CAAC;GAEJ;AAGF,YAAW,sBAAsB,CAAC,SAAQ,qBAAoB;AAC5D,MAAI,iBAAiB,gBAAgB,CACnC,SAAQ,KAAK;GACX,MAAM;GACN,MAAM;GACN,MAAM,iBAAiB,SAAS;GACjC,CAAC;GAEJ;AAGF,YAAW,yBAAyB,CAAC,SAAS,cAAc,SAAS;AACnE,eAAa,SAAQ,SAAQ;GAC3B,IAAI;AAEJ,OAAI,KAAK,SAAS,KAAKA,SAAAA,WAAW,oBAChC,mBAAkB;YACT,KAAK,SAAS,KAAKA,SAAAA,WAAW,iBACvC,mBAAkB;YACT,KAAK,SAAS,KAAKA,SAAAA,WAAW,qBACvC,mBAAkB;YACT,KAAK,SAAS,KAAKA,SAAAA,WAAW,qBACvC,mBAAkB;YACT,KAAK,SAAS,KAAKA,SAAAA,WAAW,oBACvC,mBAAkB;YACT,KAAK,SAAS,KAAKA,SAAAA,WAAW,gBACvC,mBAAkB;AAGpB,WAAQ,KAAK;IACX;IACA,MAAM,SAAS,YAAY,YAAY;IACvC,MAAM,KAAK,SAAS;IACpB;IACD,CAAC;IACF;GACF;AAEF,QAAO"}
package/lib/exports.d.ts CHANGED
@@ -4,6 +4,5 @@ export declare const analyzeExports: (sourceFile: SourceFile) => {
4
4
  kind: "default" | "named" | "namespace";
5
5
  text?: string | undefined;
6
6
  moduleSpecifier?: string | undefined;
7
- declarationKind?: "function" | "type" | "class" | "interface" | "variable" | "const" | "let" | "enum" | undefined;
7
+ declarationKind?: "function" | "class" | "variable" | "interface" | "type" | "enum" | "const" | "let" | undefined;
8
8
  }[];
9
- //# sourceMappingURL=exports.d.ts.map
package/lib/exports.js CHANGED
@@ -1,73 +1,52 @@
1
- import { SyntaxKind } from 'ts-morph';
2
-
1
+ import { SyntaxKind } from "ts-morph";
2
+ //#region src/exports.ts
3
3
  const analyzeExports = (sourceFile) => {
4
- const exports$1 = [];
5
- // Export declarations (export ...)
6
- sourceFile.getExportDeclarations().forEach(exportDecl => {
7
- const moduleSpecifier = exportDecl.getModuleSpecifierValue();
8
- const exportText = exportDecl.getText();
9
- // Named exports
10
- const namedExports = exportDecl.getNamedExports();
11
- namedExports.forEach(namedExport => {
12
- exports$1.push({
13
- name: namedExport.getName(),
14
- kind: 'named',
15
- text: exportText,
16
- moduleSpecifier,
17
- });
18
- });
19
- // Namespace export (export * from '...')
20
- if (exportDecl.isNamespaceExport()) {
21
- exports$1.push({
22
- name: '*',
23
- kind: 'namespace',
24
- text: exportText,
25
- moduleSpecifier,
26
- });
27
- }
28
- });
29
- // Export assignments (export = ...)
30
- sourceFile.getExportAssignments().forEach(exportAssignment => {
31
- if (exportAssignment.isExportEquals()) {
32
- exports$1.push({
33
- name: 'default',
34
- kind: 'default',
35
- text: exportAssignment.getText(),
36
- });
37
- }
38
- });
39
- // Exported declarations (export function, export class, etc.)
40
- sourceFile.getExportedDeclarations().forEach((declarations, name) => {
41
- declarations.forEach(decl => {
42
- let declarationKind;
43
- if (decl.getKind() === SyntaxKind.FunctionDeclaration) {
44
- declarationKind = 'function';
45
- }
46
- else if (decl.getKind() === SyntaxKind.ClassDeclaration) {
47
- declarationKind = 'class';
48
- }
49
- else if (decl.getKind() === SyntaxKind.InterfaceDeclaration) {
50
- declarationKind = 'interface';
51
- }
52
- else if (decl.getKind() === SyntaxKind.TypeAliasDeclaration) {
53
- declarationKind = 'type';
54
- }
55
- else if (decl.getKind() === SyntaxKind.VariableDeclaration) {
56
- declarationKind = 'variable';
57
- }
58
- else if (decl.getKind() === SyntaxKind.EnumDeclaration) {
59
- declarationKind = 'enum';
60
- }
61
- exports$1.push({
62
- name,
63
- kind: name === 'default' ? 'default' : 'named',
64
- text: decl.getText(),
65
- declarationKind,
66
- });
67
- });
68
- });
69
- return exports$1;
4
+ const exports = [];
5
+ sourceFile.getExportDeclarations().forEach((exportDecl) => {
6
+ const moduleSpecifier = exportDecl.getModuleSpecifierValue();
7
+ const exportText = exportDecl.getText();
8
+ exportDecl.getNamedExports().forEach((namedExport) => {
9
+ exports.push({
10
+ name: namedExport.getName(),
11
+ kind: "named",
12
+ text: exportText,
13
+ moduleSpecifier
14
+ });
15
+ });
16
+ if (exportDecl.isNamespaceExport()) exports.push({
17
+ name: "*",
18
+ kind: "namespace",
19
+ text: exportText,
20
+ moduleSpecifier
21
+ });
22
+ });
23
+ sourceFile.getExportAssignments().forEach((exportAssignment) => {
24
+ if (exportAssignment.isExportEquals()) exports.push({
25
+ name: "default",
26
+ kind: "default",
27
+ text: exportAssignment.getText()
28
+ });
29
+ });
30
+ sourceFile.getExportedDeclarations().forEach((declarations, name) => {
31
+ declarations.forEach((decl) => {
32
+ let declarationKind;
33
+ if (decl.getKind() === SyntaxKind.FunctionDeclaration) declarationKind = "function";
34
+ else if (decl.getKind() === SyntaxKind.ClassDeclaration) declarationKind = "class";
35
+ else if (decl.getKind() === SyntaxKind.InterfaceDeclaration) declarationKind = "interface";
36
+ else if (decl.getKind() === SyntaxKind.TypeAliasDeclaration) declarationKind = "type";
37
+ else if (decl.getKind() === SyntaxKind.VariableDeclaration) declarationKind = "variable";
38
+ else if (decl.getKind() === SyntaxKind.EnumDeclaration) declarationKind = "enum";
39
+ exports.push({
40
+ name,
41
+ kind: name === "default" ? "default" : "named",
42
+ text: decl.getText(),
43
+ declarationKind
44
+ });
45
+ });
46
+ });
47
+ return exports;
70
48
  };
71
-
49
+ //#endregion
72
50
  export { analyzeExports };
73
- //# sourceMappingURL=exports.js.map
51
+
52
+ //# sourceMappingURL=exports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"exports.js","sources":["../src/exports.ts"],"sourcesContent":["import { SourceFile, SyntaxKind } from 'ts-morph';\nimport type { ExportInfo } from './schemas';\n\nexport const analyzeExports = (sourceFile: SourceFile) => {\n const exports: ExportInfo[] = [];\n\n // Export declarations (export ...)\n sourceFile.getExportDeclarations().forEach(exportDecl => {\n const moduleSpecifier = exportDecl.getModuleSpecifierValue();\n const exportText = exportDecl.getText();\n\n // Named exports\n const namedExports = exportDecl.getNamedExports();\n namedExports.forEach(namedExport => {\n exports.push({\n name: namedExport.getName(),\n kind: 'named',\n text: exportText,\n moduleSpecifier,\n });\n });\n\n // Namespace export (export * from '...')\n if (exportDecl.isNamespaceExport()) {\n exports.push({\n name: '*',\n kind: 'namespace',\n text: exportText,\n moduleSpecifier,\n });\n }\n });\n\n // Export assignments (export = ...)\n sourceFile.getExportAssignments().forEach(exportAssignment => {\n if (exportAssignment.isExportEquals()) {\n exports.push({\n name: 'default',\n kind: 'default',\n text: exportAssignment.getText(),\n });\n }\n });\n\n // Exported declarations (export function, export class, etc.)\n sourceFile.getExportedDeclarations().forEach((declarations, name) => {\n declarations.forEach(decl => {\n let declarationKind: ExportInfo['declarationKind'];\n\n if (decl.getKind() === SyntaxKind.FunctionDeclaration) {\n declarationKind = 'function';\n } else if (decl.getKind() === SyntaxKind.ClassDeclaration) {\n declarationKind = 'class';\n } else if (decl.getKind() === SyntaxKind.InterfaceDeclaration) {\n declarationKind = 'interface';\n } else if (decl.getKind() === SyntaxKind.TypeAliasDeclaration) {\n declarationKind = 'type';\n } else if (decl.getKind() === SyntaxKind.VariableDeclaration) {\n declarationKind = 'variable';\n } else if (decl.getKind() === SyntaxKind.EnumDeclaration) {\n declarationKind = 'enum';\n }\n\n exports.push({\n name,\n kind: name === 'default' ? 'default' : 'named',\n text: decl.getText(),\n declarationKind,\n });\n });\n });\n\n return exports;\n};\n"],"names":["exports"],"mappings":";;AAGO,MAAM,cAAc,GAAG,CAAC,UAAsB,KAAI;IACvD,MAAMA,SAAO,GAAiB,EAAE;;IAGhC,UAAU,CAAC,qBAAqB,EAAE,CAAC,OAAO,CAAC,UAAU,IAAG;AACtD,QAAA,MAAM,eAAe,GAAG,UAAU,CAAC,uBAAuB,EAAE;AAC5D,QAAA,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,EAAE;;AAGvC,QAAA,MAAM,YAAY,GAAG,UAAU,CAAC,eAAe,EAAE;AACjD,QAAA,YAAY,CAAC,OAAO,CAAC,WAAW,IAAG;YACjCA,SAAO,CAAC,IAAI,CAAC;AACX,gBAAA,IAAI,EAAE,WAAW,CAAC,OAAO,EAAE;AAC3B,gBAAA,IAAI,EAAE,OAAO;AACb,gBAAA,IAAI,EAAE,UAAU;gBAChB,eAAe;AAChB,aAAA,CAAC;AACJ,QAAA,CAAC,CAAC;;AAGF,QAAA,IAAI,UAAU,CAAC,iBAAiB,EAAE,EAAE;YAClCA,SAAO,CAAC,IAAI,CAAC;AACX,gBAAA,IAAI,EAAE,GAAG;AACT,gBAAA,IAAI,EAAE,WAAW;AACjB,gBAAA,IAAI,EAAE,UAAU;gBAChB,eAAe;AAChB,aAAA,CAAC;QACJ;AACF,IAAA,CAAC,CAAC;;IAGF,UAAU,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC,gBAAgB,IAAG;AAC3D,QAAA,IAAI,gBAAgB,CAAC,cAAc,EAAE,EAAE;YACrCA,SAAO,CAAC,IAAI,CAAC;AACX,gBAAA,IAAI,EAAE,SAAS;AACf,gBAAA,IAAI,EAAE,SAAS;AACf,gBAAA,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE;AACjC,aAAA,CAAC;QACJ;AACF,IAAA,CAAC,CAAC;;IAGF,UAAU,CAAC,uBAAuB,EAAE,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,IAAI,KAAI;AAClE,QAAA,YAAY,CAAC,OAAO,CAAC,IAAI,IAAG;AAC1B,YAAA,IAAI,eAA8C;YAElD,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,UAAU,CAAC,mBAAmB,EAAE;gBACrD,eAAe,GAAG,UAAU;YAC9B;iBAAO,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,UAAU,CAAC,gBAAgB,EAAE;gBACzD,eAAe,GAAG,OAAO;YAC3B;iBAAO,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,UAAU,CAAC,oBAAoB,EAAE;gBAC7D,eAAe,GAAG,WAAW;YAC/B;iBAAO,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,UAAU,CAAC,oBAAoB,EAAE;gBAC7D,eAAe,GAAG,MAAM;YAC1B;iBAAO,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,UAAU,CAAC,mBAAmB,EAAE;gBAC5D,eAAe,GAAG,UAAU;YAC9B;iBAAO,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,UAAU,CAAC,eAAe,EAAE;gBACxD,eAAe,GAAG,MAAM;YAC1B;YAEAA,SAAO,CAAC,IAAI,CAAC;gBACX,IAAI;gBACJ,IAAI,EAAE,IAAI,KAAK,SAAS,GAAG,SAAS,GAAG,OAAO;AAC9C,gBAAA,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE;gBACpB,eAAe;AAChB,aAAA,CAAC;AACJ,QAAA,CAAC,CAAC;AACJ,IAAA,CAAC,CAAC;AAEF,IAAA,OAAOA,SAAO;AAChB;;;;"}
1
+ {"version":3,"file":"exports.js","names":[],"sources":["../src/exports.ts"],"sourcesContent":["import { SourceFile, SyntaxKind } from 'ts-morph';\nimport type { ExportInfo } from './schemas';\n\nexport const analyzeExports = (sourceFile: SourceFile) => {\n const exports: ExportInfo[] = [];\n\n // Export declarations (export ...)\n sourceFile.getExportDeclarations().forEach(exportDecl => {\n const moduleSpecifier = exportDecl.getModuleSpecifierValue();\n const exportText = exportDecl.getText();\n\n // Named exports\n const namedExports = exportDecl.getNamedExports();\n namedExports.forEach(namedExport => {\n exports.push({\n name: namedExport.getName(),\n kind: 'named',\n text: exportText,\n moduleSpecifier,\n });\n });\n\n // Namespace export (export * from '...')\n if (exportDecl.isNamespaceExport()) {\n exports.push({\n name: '*',\n kind: 'namespace',\n text: exportText,\n moduleSpecifier,\n });\n }\n });\n\n // Export assignments (export = ...)\n sourceFile.getExportAssignments().forEach(exportAssignment => {\n if (exportAssignment.isExportEquals()) {\n exports.push({\n name: 'default',\n kind: 'default',\n text: exportAssignment.getText(),\n });\n }\n });\n\n // Exported declarations (export function, export class, etc.)\n sourceFile.getExportedDeclarations().forEach((declarations, name) => {\n declarations.forEach(decl => {\n let declarationKind: ExportInfo['declarationKind'];\n\n if (decl.getKind() === SyntaxKind.FunctionDeclaration) {\n declarationKind = 'function';\n } else if (decl.getKind() === SyntaxKind.ClassDeclaration) {\n declarationKind = 'class';\n } else if (decl.getKind() === SyntaxKind.InterfaceDeclaration) {\n declarationKind = 'interface';\n } else if (decl.getKind() === SyntaxKind.TypeAliasDeclaration) {\n declarationKind = 'type';\n } else if (decl.getKind() === SyntaxKind.VariableDeclaration) {\n declarationKind = 'variable';\n } else if (decl.getKind() === SyntaxKind.EnumDeclaration) {\n declarationKind = 'enum';\n }\n\n exports.push({\n name,\n kind: name === 'default' ? 'default' : 'named',\n text: decl.getText(),\n declarationKind,\n });\n });\n });\n\n return exports;\n};\n"],"mappings":";;AAGA,MAAa,kBAAkB,eAA2B;CACxD,MAAM,UAAwB,EAAE;AAGhC,YAAW,uBAAuB,CAAC,SAAQ,eAAc;EACvD,MAAM,kBAAkB,WAAW,yBAAyB;EAC5D,MAAM,aAAa,WAAW,SAAS;AAGlB,aAAW,iBAAiB,CACpC,SAAQ,gBAAe;AAClC,WAAQ,KAAK;IACX,MAAM,YAAY,SAAS;IAC3B,MAAM;IACN,MAAM;IACN;IACD,CAAC;IACF;AAGF,MAAI,WAAW,mBAAmB,CAChC,SAAQ,KAAK;GACX,MAAM;GACN,MAAM;GACN,MAAM;GACN;GACD,CAAC;GAEJ;AAGF,YAAW,sBAAsB,CAAC,SAAQ,qBAAoB;AAC5D,MAAI,iBAAiB,gBAAgB,CACnC,SAAQ,KAAK;GACX,MAAM;GACN,MAAM;GACN,MAAM,iBAAiB,SAAS;GACjC,CAAC;GAEJ;AAGF,YAAW,yBAAyB,CAAC,SAAS,cAAc,SAAS;AACnE,eAAa,SAAQ,SAAQ;GAC3B,IAAI;AAEJ,OAAI,KAAK,SAAS,KAAK,WAAW,oBAChC,mBAAkB;YACT,KAAK,SAAS,KAAK,WAAW,iBACvC,mBAAkB;YACT,KAAK,SAAS,KAAK,WAAW,qBACvC,mBAAkB;YACT,KAAK,SAAS,KAAK,WAAW,qBACvC,mBAAkB;YACT,KAAK,SAAS,KAAK,WAAW,oBACvC,mBAAkB;YACT,KAAK,SAAS,KAAK,WAAW,gBACvC,mBAAkB;AAGpB,WAAQ,KAAK;IACX;IACA,MAAM,SAAS,YAAY,YAAY;IACvC,MAAM,KAAK,SAAS;IACpB;IACD,CAAC;IACF;GACF;AAEF,QAAO"}