@bemedev/codebase 0.0.1
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.
- package/LICENSE +21 -0
- package/README.md +39 -0
- package/lib/analyse.cjs +68 -0
- package/lib/analyse.cjs.map +1 -0
- package/lib/analyse.d.ts +10 -0
- package/lib/analyse.d.ts.map +1 -0
- package/lib/analyse.js +66 -0
- package/lib/analyse.js.map +1 -0
- package/lib/analyse.utils.cjs +240 -0
- package/lib/analyse.utils.cjs.map +1 -0
- package/lib/analyse.utils.d.ts +30 -0
- package/lib/analyse.utils.d.ts.map +1 -0
- package/lib/analyse.utils.js +232 -0
- package/lib/analyse.utils.js.map +1 -0
- package/lib/cli/cli.cjs +27 -0
- package/lib/cli/cli.cjs.map +1 -0
- package/lib/cli/cli.d.ts +12 -0
- package/lib/cli/cli.d.ts.map +1 -0
- package/lib/cli/cli.js +25 -0
- package/lib/cli/cli.js.map +1 -0
- package/lib/cli/constants.cjs +6 -0
- package/lib/cli/constants.cjs.map +1 -0
- package/lib/cli/constants.d.ts +2 -0
- package/lib/cli/constants.d.ts.map +1 -0
- package/lib/cli/constants.js +4 -0
- package/lib/cli/constants.js.map +1 -0
- package/lib/cli/index.cjs +8 -0
- package/lib/cli/index.cjs.map +1 -0
- package/lib/cli/index.d.ts +3 -0
- package/lib/cli/index.d.ts.map +1 -0
- package/lib/cli/index.js +6 -0
- package/lib/cli/index.js.map +1 -0
- package/lib/constants.cjs +40 -0
- package/lib/constants.cjs.map +1 -0
- package/lib/constants.d.ts +17 -0
- package/lib/constants.d.ts.map +1 -0
- package/lib/constants.js +31 -0
- package/lib/constants.js.map +1 -0
- package/lib/exports.cjs +75 -0
- package/lib/exports.cjs.map +1 -0
- package/lib/exports.d.ts +4 -0
- package/lib/exports.d.ts.map +1 -0
- package/lib/exports.js +73 -0
- package/lib/exports.js.map +1 -0
- package/lib/functions/add.cjs +85 -0
- package/lib/functions/add.cjs.map +1 -0
- package/lib/functions/add.d.ts +3 -0
- package/lib/functions/add.d.ts.map +1 -0
- package/lib/functions/add.js +83 -0
- package/lib/functions/add.js.map +1 -0
- package/lib/functions/generate.cjs +61 -0
- package/lib/functions/generate.cjs.map +1 -0
- package/lib/functions/generate.d.ts +25 -0
- package/lib/functions/generate.d.ts.map +1 -0
- package/lib/functions/generate.js +58 -0
- package/lib/functions/generate.js.map +1 -0
- package/lib/functions/index.cjs +16 -0
- package/lib/functions/index.cjs.map +1 -0
- package/lib/functions/index.d.ts +5 -0
- package/lib/functions/index.d.ts.map +1 -0
- package/lib/functions/index.js +5 -0
- package/lib/functions/index.js.map +1 -0
- package/lib/functions/init.cjs +104 -0
- package/lib/functions/init.cjs.map +1 -0
- package/lib/functions/init.d.ts +12 -0
- package/lib/functions/init.d.ts.map +1 -0
- package/lib/functions/init.js +101 -0
- package/lib/functions/init.js.map +1 -0
- package/lib/functions/remove.cjs +108 -0
- package/lib/functions/remove.cjs.map +1 -0
- package/lib/functions/remove.d.ts +3 -0
- package/lib/functions/remove.d.ts.map +1 -0
- package/lib/functions/remove.js +106 -0
- package/lib/functions/remove.js.map +1 -0
- package/lib/helpers.cjs +47 -0
- package/lib/helpers.cjs.map +1 -0
- package/lib/helpers.d.ts +11 -0
- package/lib/helpers.d.ts.map +1 -0
- package/lib/helpers.js +42 -0
- package/lib/helpers.js.map +1 -0
- package/lib/imports.cjs +128 -0
- package/lib/imports.cjs.map +1 -0
- package/lib/imports.d.ts +8 -0
- package/lib/imports.d.ts.map +1 -0
- package/lib/imports.js +125 -0
- package/lib/imports.js.map +1 -0
- package/lib/index.cjs +16 -0
- package/lib/index.cjs.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -0
- package/lib/schemas.cjs +80 -0
- package/lib/schemas.cjs.map +1 -0
- package/lib/schemas.d.ts +90 -0
- package/lib/schemas.d.ts.map +1 -0
- package/lib/schemas.js +53 -0
- package/lib/schemas.js.map +1 -0
- package/lib/types.d.ts +43 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/utils.cjs +14 -0
- package/lib/utils.cjs.map +1 -0
- package/lib/utils.d.ts +6 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +12 -0
- package/lib/utils.js.map +1 -0
- package/package.json +125 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 chlbri
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Beatifull lib
|
|
2
|
+
|
|
3
|
+
A beautifull description
|
|
4
|
+
|
|
5
|
+
<br/>
|
|
6
|
+
|
|
7
|
+
## Licence
|
|
8
|
+
|
|
9
|
+
MIT
|
|
10
|
+
|
|
11
|
+
## CHANGE_LOG
|
|
12
|
+
|
|
13
|
+
<details>
|
|
14
|
+
|
|
15
|
+
<summary>
|
|
16
|
+
...
|
|
17
|
+
</summary>
|
|
18
|
+
|
|
19
|
+
### Version [0.0.1] --> _date & hour_
|
|
20
|
+
|
|
21
|
+
- ✨ Première version de la bibliothèque
|
|
22
|
+
|
|
23
|
+
</details>
|
|
24
|
+
|
|
25
|
+
<br/>
|
|
26
|
+
|
|
27
|
+
## Auteur
|
|
28
|
+
|
|
29
|
+
chlbri (bri_lvi@icloud.com)
|
|
30
|
+
|
|
31
|
+
[My github](https://github.com/chlbri?tab=repositories)
|
|
32
|
+
|
|
33
|
+
[<svg width="98" height="96" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#24292f"/></svg>](https://github.com/chlbri?tab=repositories)
|
|
34
|
+
|
|
35
|
+
<br/>
|
|
36
|
+
|
|
37
|
+
## Liens
|
|
38
|
+
|
|
39
|
+
- [Documentation](https://github.com/chlbri/new-package)
|
package/lib/analyse.cjs
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var path = require('path');
|
|
4
|
+
var tsMorph = require('ts-morph');
|
|
5
|
+
var analyse_utils = require('./analyse.utils.cjs');
|
|
6
|
+
var constants = require('./constants.cjs');
|
|
7
|
+
var exports$1 = require('./exports.cjs');
|
|
8
|
+
var helpers = require('./helpers.cjs');
|
|
9
|
+
var imports = require('./imports.cjs');
|
|
10
|
+
var utils = require('./utils.cjs');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Analyse tous les fichiers TypeScript dans src/ (sauf src/scripts/)
|
|
14
|
+
*/
|
|
15
|
+
const analyze = ({ src = constants.SRC_DIR, excludes: _excludes, } = {}) => {
|
|
16
|
+
console.log('🔍 Analyse du codebase en cours...');
|
|
17
|
+
const excludes = helpers.toArray(_excludes);
|
|
18
|
+
// Initialiser le projet ts-morph
|
|
19
|
+
const project = new tsMorph.Project({
|
|
20
|
+
tsConfigFilePath: path.join(process.cwd(), 'tsconfig.json'),
|
|
21
|
+
});
|
|
22
|
+
// Ajouter tous les fichiers TypeScript du dossier src
|
|
23
|
+
const sourceFiles = project.addSourceFilesAtPaths([
|
|
24
|
+
'src/**/*.ts',
|
|
25
|
+
'!src/scripts/**/*', // Exclure le dossier scripts
|
|
26
|
+
'!src/**/*.test.ts', // Exclure les fichiers de test
|
|
27
|
+
'!src/**/*.spec.ts', // Exclure les fichiers de spec
|
|
28
|
+
].concat(excludes.map(exclude => `!${exclude}`)));
|
|
29
|
+
const analysis = {};
|
|
30
|
+
let processedCount = 0;
|
|
31
|
+
for (const sourceFile of sourceFiles) {
|
|
32
|
+
const filePath = sourceFile.getFilePath();
|
|
33
|
+
const relativePath = path.relative(src, filePath);
|
|
34
|
+
// Générer le texte modifié avec JSDoc pour les exports
|
|
35
|
+
const _text = analyse_utils.addJSDocToSourceText(sourceFile);
|
|
36
|
+
// #region Analyser les imports et exports
|
|
37
|
+
const imports$1 = imports.analyzeImports(sourceFile);
|
|
38
|
+
const exports = exports$1.analyzeExports(sourceFile);
|
|
39
|
+
// #endregion
|
|
40
|
+
// Construire les imports à partir de fileAnalysis.imports
|
|
41
|
+
const importsStrings = imports.buildImportStrings(imports$1);
|
|
42
|
+
// Combiner imports et contenu
|
|
43
|
+
const importsSection = importsStrings.length > 0 ? importsStrings.join('\n') : '';
|
|
44
|
+
const text = importsSection === ''
|
|
45
|
+
? _text
|
|
46
|
+
: `${importsSection}
|
|
47
|
+
|
|
48
|
+
${_text}
|
|
49
|
+
`;
|
|
50
|
+
analysis[utils.pathToDotNotation(relativePath)] = {
|
|
51
|
+
relativePath,
|
|
52
|
+
imports: imports$1,
|
|
53
|
+
exports,
|
|
54
|
+
text,
|
|
55
|
+
};
|
|
56
|
+
processedCount++;
|
|
57
|
+
// #region Afficher l'avancement de l'analyse par palliers de 50
|
|
58
|
+
if (processedCount % 50 === 0) {
|
|
59
|
+
console.log(`📊 Analysé ${processedCount}/${sourceFiles.length} fichiers...`);
|
|
60
|
+
}
|
|
61
|
+
// #endregion
|
|
62
|
+
}
|
|
63
|
+
console.log(`✅ Analyse terminée: ${processedCount} fichiers analysés`);
|
|
64
|
+
return analysis;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
exports.analyze = analyze;
|
|
68
|
+
//# sourceMappingURL=analyse.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyse.cjs","sources":["../src/analyse.ts"],"sourcesContent":["import { join, relative } from 'path';\nimport { Project } from 'ts-morph';\nimport { addJSDocToSourceText } from './analyse.utils';\nimport { SRC_DIR } from './constants';\nimport { analyzeExports } from './exports';\nimport { toArray } from './helpers';\nimport { analyzeImports, buildImportStrings } from './imports';\nimport type { CodebaseAnalysis } from './types';\nimport { pathToDotNotation } from './utils';\n\nexport type AnalyzeOptions = {\n src?: string;\n excludes?: string | string[];\n};\n\n/**\n * Analyse tous les fichiers TypeScript dans src/ (sauf src/scripts/)\n */\nexport const analyze = ({\n src = SRC_DIR,\n excludes: _excludes,\n}: AnalyzeOptions = {}): CodebaseAnalysis => {\n console.log('🔍 Analyse du codebase en cours...');\n const excludes = toArray(_excludes);\n\n // Initialiser le projet ts-morph\n const project = new Project({\n tsConfigFilePath: join(process.cwd(), 'tsconfig.json'),\n });\n\n // Ajouter tous les fichiers TypeScript du dossier src\n const sourceFiles = project.addSourceFilesAtPaths(\n [\n 'src/**/*.ts',\n '!src/scripts/**/*', // Exclure le dossier scripts\n '!src/**/*.test.ts', // Exclure les fichiers de test\n '!src/**/*.spec.ts', // Exclure les fichiers de spec\n ].concat(excludes.map(exclude => `!${exclude}`)),\n );\n\n const analysis: CodebaseAnalysis = {};\n let processedCount = 0;\n\n for (const sourceFile of sourceFiles) {\n const filePath = sourceFile.getFilePath();\n const relativePath = relative(src, filePath);\n\n // Générer le texte modifié avec JSDoc pour les exports\n\n const _text = addJSDocToSourceText(sourceFile);\n\n // #region Analyser les imports et exports\n const imports = analyzeImports(sourceFile);\n const exports = analyzeExports(sourceFile);\n // #endregion\n\n // Construire les imports à partir de fileAnalysis.imports\n const importsStrings = buildImportStrings(imports);\n\n // Combiner imports et contenu\n const importsSection =\n importsStrings.length > 0 ? importsStrings.join('\\n') : '';\n\n const text =\n importsSection === ''\n ? _text\n : `${importsSection}\n\n${_text}\n `;\n\n analysis[pathToDotNotation(relativePath)] = {\n relativePath,\n imports,\n exports,\n text,\n };\n\n processedCount++;\n\n // #region Afficher l'avancement de l'analyse par palliers de 50\n if (processedCount % 50 === 0) {\n console.log(\n `📊 Analysé ${processedCount}/${sourceFiles.length} fichiers...`,\n );\n }\n // #endregion\n }\n\n console.log(`✅ Analyse terminée: ${processedCount} fichiers analysés`);\n return analysis;\n};\n"],"names":["SRC_DIR","toArray","Project","join","relative","addJSDocToSourceText","imports","analyzeImports","analyzeExports","buildImportStrings","pathToDotNotation"],"mappings":";;;;;;;;;;;AAeA;;AAEG;AACI,MAAM,OAAO,GAAG,CAAC,EACtB,GAAG,GAAGA,iBAAO,EACb,QAAQ,EAAE,SAAS,GAAA,GACD,EAAE,KAAsB;AAC1C,IAAA,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC;AACjD,IAAA,MAAM,QAAQ,GAAGC,eAAO,CAAC,SAAS,CAAC;;AAGnC,IAAA,MAAM,OAAO,GAAG,IAAIC,eAAO,CAAC;QAC1B,gBAAgB,EAAEC,SAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,eAAe,CAAC;AACvD,KAAA,CAAC;;AAGF,IAAA,MAAM,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAC/C;QACE,aAAa;AACb,QAAA,mBAAmB;AACnB,QAAA,mBAAmB;AACnB,QAAA,mBAAmB;AACpB,KAAA,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,IAAI,IAAI,OAAO,CAAA,CAAE,CAAC,CAAC,CACjD;IAED,MAAM,QAAQ,GAAqB,EAAE;IACrC,IAAI,cAAc,GAAG,CAAC;AAEtB,IAAA,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;AACpC,QAAA,MAAM,QAAQ,GAAG,UAAU,CAAC,WAAW,EAAE;QACzC,MAAM,YAAY,GAAGC,aAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;;AAI5C,QAAA,MAAM,KAAK,GAAGC,kCAAoB,CAAC,UAAU,CAAC;;AAG9C,QAAA,MAAMC,SAAO,GAAGC,sBAAc,CAAC,UAAU,CAAC;AAC1C,QAAA,MAAM,OAAO,GAAGC,wBAAc,CAAC,UAAU,CAAC;;;AAI1C,QAAA,MAAM,cAAc,GAAGC,0BAAkB,CAACH,SAAO,CAAC;;QAGlD,MAAM,cAAc,GAClB,cAAc,CAAC,MAAM,GAAG,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;AAE5D,QAAA,MAAM,IAAI,GACR,cAAc,KAAK;AACjB,cAAE;cACA,GAAG,cAAc;;EAEzB,KAAK;KACF;AAED,QAAA,QAAQ,CAACI,uBAAiB,CAAC,YAAY,CAAC,CAAC,GAAG;YAC1C,YAAY;qBACZJ,SAAO;YACP,OAAO;YACP,IAAI;SACL;AAED,QAAA,cAAc,EAAE;;AAGhB,QAAA,IAAI,cAAc,GAAG,EAAE,KAAK,CAAC,EAAE;YAC7B,OAAO,CAAC,GAAG,CACT,CAAA,WAAA,EAAc,cAAc,CAAA,CAAA,EAAI,WAAW,CAAC,MAAM,CAAA,YAAA,CAAc,CACjE;QACH;;IAEF;AAEA,IAAA,OAAO,CAAC,GAAG,CAAC,uBAAuB,cAAc,CAAA,kBAAA,CAAoB,CAAC;AACtE,IAAA,OAAO,QAAQ;AACjB;;;;"}
|
package/lib/analyse.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CodebaseAnalysis } from './types';
|
|
2
|
+
export type AnalyzeOptions = {
|
|
3
|
+
src?: string;
|
|
4
|
+
excludes?: string | string[];
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Analyse tous les fichiers TypeScript dans src/ (sauf src/scripts/)
|
|
8
|
+
*/
|
|
9
|
+
export declare const analyze: ({ src, excludes: _excludes, }?: AnalyzeOptions) => CodebaseAnalysis;
|
|
10
|
+
//# sourceMappingURL=analyse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyse.d.ts","sourceRoot":"","sources":["../src/analyse.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,gCAGrB,cAAmB,KAAG,gBAsExB,CAAC"}
|
package/lib/analyse.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { join, relative } from 'path';
|
|
2
|
+
import { Project } from 'ts-morph';
|
|
3
|
+
import { addJSDocToSourceText } from './analyse.utils.js';
|
|
4
|
+
import { SRC_DIR } from './constants.js';
|
|
5
|
+
import { analyzeExports } from './exports.js';
|
|
6
|
+
import { toArray } from './helpers.js';
|
|
7
|
+
import { analyzeImports, buildImportStrings } from './imports.js';
|
|
8
|
+
import { pathToDotNotation } from './utils.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Analyse tous les fichiers TypeScript dans src/ (sauf src/scripts/)
|
|
12
|
+
*/
|
|
13
|
+
const analyze = ({ src = SRC_DIR, excludes: _excludes, } = {}) => {
|
|
14
|
+
console.log('🔍 Analyse du codebase en cours...');
|
|
15
|
+
const excludes = toArray(_excludes);
|
|
16
|
+
// Initialiser le projet ts-morph
|
|
17
|
+
const project = new Project({
|
|
18
|
+
tsConfigFilePath: join(process.cwd(), 'tsconfig.json'),
|
|
19
|
+
});
|
|
20
|
+
// Ajouter tous les fichiers TypeScript du dossier src
|
|
21
|
+
const sourceFiles = project.addSourceFilesAtPaths([
|
|
22
|
+
'src/**/*.ts',
|
|
23
|
+
'!src/scripts/**/*', // Exclure le dossier scripts
|
|
24
|
+
'!src/**/*.test.ts', // Exclure les fichiers de test
|
|
25
|
+
'!src/**/*.spec.ts', // Exclure les fichiers de spec
|
|
26
|
+
].concat(excludes.map(exclude => `!${exclude}`)));
|
|
27
|
+
const analysis = {};
|
|
28
|
+
let processedCount = 0;
|
|
29
|
+
for (const sourceFile of sourceFiles) {
|
|
30
|
+
const filePath = sourceFile.getFilePath();
|
|
31
|
+
const relativePath = relative(src, filePath);
|
|
32
|
+
// Générer le texte modifié avec JSDoc pour les exports
|
|
33
|
+
const _text = addJSDocToSourceText(sourceFile);
|
|
34
|
+
// #region Analyser les imports et exports
|
|
35
|
+
const imports = analyzeImports(sourceFile);
|
|
36
|
+
const exports = analyzeExports(sourceFile);
|
|
37
|
+
// #endregion
|
|
38
|
+
// Construire les imports à partir de fileAnalysis.imports
|
|
39
|
+
const importsStrings = buildImportStrings(imports);
|
|
40
|
+
// Combiner imports et contenu
|
|
41
|
+
const importsSection = importsStrings.length > 0 ? importsStrings.join('\n') : '';
|
|
42
|
+
const text = importsSection === ''
|
|
43
|
+
? _text
|
|
44
|
+
: `${importsSection}
|
|
45
|
+
|
|
46
|
+
${_text}
|
|
47
|
+
`;
|
|
48
|
+
analysis[pathToDotNotation(relativePath)] = {
|
|
49
|
+
relativePath,
|
|
50
|
+
imports,
|
|
51
|
+
exports,
|
|
52
|
+
text,
|
|
53
|
+
};
|
|
54
|
+
processedCount++;
|
|
55
|
+
// #region Afficher l'avancement de l'analyse par palliers de 50
|
|
56
|
+
if (processedCount % 50 === 0) {
|
|
57
|
+
console.log(`📊 Analysé ${processedCount}/${sourceFiles.length} fichiers...`);
|
|
58
|
+
}
|
|
59
|
+
// #endregion
|
|
60
|
+
}
|
|
61
|
+
console.log(`✅ Analyse terminée: ${processedCount} fichiers analysés`);
|
|
62
|
+
return analysis;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export { analyze };
|
|
66
|
+
//# sourceMappingURL=analyse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyse.js","sources":["../src/analyse.ts"],"sourcesContent":["import { join, relative } from 'path';\nimport { Project } from 'ts-morph';\nimport { addJSDocToSourceText } from './analyse.utils';\nimport { SRC_DIR } from './constants';\nimport { analyzeExports } from './exports';\nimport { toArray } from './helpers';\nimport { analyzeImports, buildImportStrings } from './imports';\nimport type { CodebaseAnalysis } from './types';\nimport { pathToDotNotation } from './utils';\n\nexport type AnalyzeOptions = {\n src?: string;\n excludes?: string | string[];\n};\n\n/**\n * Analyse tous les fichiers TypeScript dans src/ (sauf src/scripts/)\n */\nexport const analyze = ({\n src = SRC_DIR,\n excludes: _excludes,\n}: AnalyzeOptions = {}): CodebaseAnalysis => {\n console.log('🔍 Analyse du codebase en cours...');\n const excludes = toArray(_excludes);\n\n // Initialiser le projet ts-morph\n const project = new Project({\n tsConfigFilePath: join(process.cwd(), 'tsconfig.json'),\n });\n\n // Ajouter tous les fichiers TypeScript du dossier src\n const sourceFiles = project.addSourceFilesAtPaths(\n [\n 'src/**/*.ts',\n '!src/scripts/**/*', // Exclure le dossier scripts\n '!src/**/*.test.ts', // Exclure les fichiers de test\n '!src/**/*.spec.ts', // Exclure les fichiers de spec\n ].concat(excludes.map(exclude => `!${exclude}`)),\n );\n\n const analysis: CodebaseAnalysis = {};\n let processedCount = 0;\n\n for (const sourceFile of sourceFiles) {\n const filePath = sourceFile.getFilePath();\n const relativePath = relative(src, filePath);\n\n // Générer le texte modifié avec JSDoc pour les exports\n\n const _text = addJSDocToSourceText(sourceFile);\n\n // #region Analyser les imports et exports\n const imports = analyzeImports(sourceFile);\n const exports = analyzeExports(sourceFile);\n // #endregion\n\n // Construire les imports à partir de fileAnalysis.imports\n const importsStrings = buildImportStrings(imports);\n\n // Combiner imports et contenu\n const importsSection =\n importsStrings.length > 0 ? importsStrings.join('\\n') : '';\n\n const text =\n importsSection === ''\n ? _text\n : `${importsSection}\n\n${_text}\n `;\n\n analysis[pathToDotNotation(relativePath)] = {\n relativePath,\n imports,\n exports,\n text,\n };\n\n processedCount++;\n\n // #region Afficher l'avancement de l'analyse par palliers de 50\n if (processedCount % 50 === 0) {\n console.log(\n `📊 Analysé ${processedCount}/${sourceFiles.length} fichiers...`,\n );\n }\n // #endregion\n }\n\n console.log(`✅ Analyse terminée: ${processedCount} fichiers analysés`);\n return analysis;\n};\n"],"names":[],"mappings":";;;;;;;;;AAeA;;AAEG;AACI,MAAM,OAAO,GAAG,CAAC,EACtB,GAAG,GAAG,OAAO,EACb,QAAQ,EAAE,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CAAC,GAAG;YAC1C,YAAY;YACZ,OAAO;YACP,OAAO;YACP,IAAI;SACL;AAED,QAAA,cAAc,EAAE;;AAGhB,QAAA,IAAI,cAAc,GAAG,EAAE,KAAK,CAAC,EAAE;YAC7B,OAAO,CAAC,GAAG,CACT,CAAA,WAAA,EAAc,cAAc,CAAA,CAAA,EAAI,WAAW,CAAC,MAAM,CAAA,YAAA,CAAc,CACjE;QACH;;IAEF;AAEA,IAAA,OAAO,CAAC,GAAG,CAAC,uBAAuB,cAAc,CAAA,kBAAA,CAAoB,CAAC;AACtE,IAAA,OAAO,QAAQ;AACjB;;;;"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Génère un JSDoc pour une expression exportée générée automatiquement
|
|
5
|
+
*/
|
|
6
|
+
const generateJSDoc = (exportName, declarationKind) => {
|
|
7
|
+
const kindText = declarationKind ? ` ${declarationKind}` : '';
|
|
8
|
+
return `/**
|
|
9
|
+
* ${exportName}${kindText} - Auto-generated expression
|
|
10
|
+
*
|
|
11
|
+
* ⚠️ WARNING: This expression is auto-generated and should not be modified.
|
|
12
|
+
* Any manual changes will be overwritten during the next generation.
|
|
13
|
+
*
|
|
14
|
+
* @generated
|
|
15
|
+
* @readonly
|
|
16
|
+
* @author chlbri (bri_lvi@icloud.com)
|
|
17
|
+
*/`;
|
|
18
|
+
};
|
|
19
|
+
const extractExportDetails = (trimmedLine) => {
|
|
20
|
+
let exportName = 'export';
|
|
21
|
+
let declarationKind;
|
|
22
|
+
if (trimmedLine.includes('export default ')) {
|
|
23
|
+
exportName = 'default';
|
|
24
|
+
if (trimmedLine.includes('function'))
|
|
25
|
+
declarationKind = 'function';
|
|
26
|
+
else if (trimmedLine.includes('class'))
|
|
27
|
+
declarationKind = 'class';
|
|
28
|
+
else
|
|
29
|
+
declarationKind = 'value';
|
|
30
|
+
}
|
|
31
|
+
else if (trimmedLine.includes('export const ')) {
|
|
32
|
+
const match = trimmedLine.match(/export const (\w+)/);
|
|
33
|
+
exportName = match ? match[1] : 'const';
|
|
34
|
+
declarationKind = 'variable';
|
|
35
|
+
}
|
|
36
|
+
else if (trimmedLine.includes('export let ')) {
|
|
37
|
+
const match = trimmedLine.match(/export let (\w+)/);
|
|
38
|
+
exportName = match ? match[1] : 'let';
|
|
39
|
+
declarationKind = 'variable';
|
|
40
|
+
}
|
|
41
|
+
else if (trimmedLine.includes('export var ')) {
|
|
42
|
+
const match = trimmedLine.match(/export var (\w+)/);
|
|
43
|
+
exportName = match ? match[1] : 'var';
|
|
44
|
+
declarationKind = 'variable';
|
|
45
|
+
}
|
|
46
|
+
else if (trimmedLine.includes('export function ')) {
|
|
47
|
+
const match = trimmedLine.match(/export function (\w+)/);
|
|
48
|
+
exportName = match ? match[1] : 'function';
|
|
49
|
+
declarationKind = 'function';
|
|
50
|
+
}
|
|
51
|
+
else if (trimmedLine.includes('export class ')) {
|
|
52
|
+
const match = trimmedLine.match(/export class (\w+)/);
|
|
53
|
+
exportName = match ? match[1] : 'class';
|
|
54
|
+
declarationKind = 'class';
|
|
55
|
+
}
|
|
56
|
+
else if (trimmedLine.includes('export interface ')) {
|
|
57
|
+
const match = trimmedLine.match(/export interface (\w+)/);
|
|
58
|
+
exportName = match ? match[1] : 'interface';
|
|
59
|
+
declarationKind = 'interface';
|
|
60
|
+
}
|
|
61
|
+
else if (trimmedLine.includes('export type ')) {
|
|
62
|
+
const match = trimmedLine.match(/export type (\w+)/);
|
|
63
|
+
exportName = match ? match[1] : 'type';
|
|
64
|
+
declarationKind = 'type';
|
|
65
|
+
}
|
|
66
|
+
else if (trimmedLine.includes('export enum ')) {
|
|
67
|
+
const match = trimmedLine.match(/export enum (\w+)/);
|
|
68
|
+
exportName = match ? match[1] : 'enum';
|
|
69
|
+
declarationKind = 'enum';
|
|
70
|
+
}
|
|
71
|
+
return { exportName, declarationKind };
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Vérifie si une ligne d'export contient une déclaration et non pas un simple re-export
|
|
75
|
+
*/
|
|
76
|
+
const hasDeclaration = (exportLine) => {
|
|
77
|
+
const trimmed = exportLine.trim();
|
|
78
|
+
const falsy = trimmed.startsWith('export {') || // export { something }
|
|
79
|
+
trimmed.startsWith('export *') || // export * from
|
|
80
|
+
trimmed.includes('} from ') || // export { a, b } from
|
|
81
|
+
trimmed.match(/^export\s+\{[^}]*\}\s*;?\s*$/) || // export { a, b };
|
|
82
|
+
trimmed.match(/^export\s+default\s+[a-zA-Z_$][a-zA-Z0-9_$]*\s*;?\s*$/); // export default identifier;
|
|
83
|
+
// Re-exports et exports simples à exclure
|
|
84
|
+
if (falsy)
|
|
85
|
+
return false;
|
|
86
|
+
// Déclarations à inclure (avec mots-clés de déclaration)
|
|
87
|
+
const keywords = [
|
|
88
|
+
'export const ',
|
|
89
|
+
'export let ',
|
|
90
|
+
'export var ',
|
|
91
|
+
'export function ',
|
|
92
|
+
'export class ',
|
|
93
|
+
'export interface ',
|
|
94
|
+
'export type ',
|
|
95
|
+
'export enum ',
|
|
96
|
+
'export namespace ',
|
|
97
|
+
'export default function ',
|
|
98
|
+
'export default class ',
|
|
99
|
+
'export default interface ',
|
|
100
|
+
'export default enum ',
|
|
101
|
+
'export default const ',
|
|
102
|
+
'export default let ',
|
|
103
|
+
'export default var ',
|
|
104
|
+
];
|
|
105
|
+
return keywords.some(kw => trimmed.includes(kw));
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Extrait le nom d'une déclaration (const, function, etc.)
|
|
109
|
+
*/
|
|
110
|
+
const extractDeclarationName = (line) => {
|
|
111
|
+
const trimmed = line.trim();
|
|
112
|
+
if (trimmed.startsWith('const ')) {
|
|
113
|
+
const match = trimmed.match(/const\s+(\w+)/);
|
|
114
|
+
return match ? match[1] : null;
|
|
115
|
+
}
|
|
116
|
+
if (trimmed.startsWith('function ')) {
|
|
117
|
+
const match = trimmed.match(/function\s+(\w+)/);
|
|
118
|
+
return match ? match[1] : null;
|
|
119
|
+
}
|
|
120
|
+
if (trimmed.startsWith('class ')) {
|
|
121
|
+
const match = trimmed.match(/class\s+(\w+)/);
|
|
122
|
+
return match ? match[1] : null;
|
|
123
|
+
}
|
|
124
|
+
if (trimmed.startsWith('interface ')) {
|
|
125
|
+
const match = trimmed.match(/interface\s+(\w+)/);
|
|
126
|
+
return match ? match[1] : null;
|
|
127
|
+
}
|
|
128
|
+
if (trimmed.startsWith('type ')) {
|
|
129
|
+
const match = trimmed.match(/type\s+(\w+)/);
|
|
130
|
+
return match ? match[1] : null;
|
|
131
|
+
}
|
|
132
|
+
if (trimmed.startsWith('enum ')) {
|
|
133
|
+
const match = trimmed.match(/enum\s+(\w+)/);
|
|
134
|
+
return match ? match[1] : null;
|
|
135
|
+
}
|
|
136
|
+
return null;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Vérifie si une déclaration est exportée plus tard dans le fichier
|
|
140
|
+
*/
|
|
141
|
+
const isExportedLater = (lines, declarationName) => {
|
|
142
|
+
return lines.some(line => {
|
|
143
|
+
const trimmed = line.trim();
|
|
144
|
+
return (trimmed === `export default ${declarationName};` ||
|
|
145
|
+
trimmed.includes(`export { ${declarationName}`) ||
|
|
146
|
+
trimmed.includes(`export * as ${declarationName}`));
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Détermine le type de déclaration
|
|
151
|
+
*/
|
|
152
|
+
const getDeclarationKind = (line) => {
|
|
153
|
+
const trimmed = line.trim();
|
|
154
|
+
if (trimmed.startsWith('const '))
|
|
155
|
+
return 'const';
|
|
156
|
+
if (trimmed.startsWith('let '))
|
|
157
|
+
return 'let';
|
|
158
|
+
if (trimmed.startsWith('var '))
|
|
159
|
+
return 'var';
|
|
160
|
+
if (trimmed.startsWith('function '))
|
|
161
|
+
return 'function';
|
|
162
|
+
if (trimmed.startsWith('class '))
|
|
163
|
+
return 'class';
|
|
164
|
+
if (trimmed.startsWith('interface '))
|
|
165
|
+
return 'interface';
|
|
166
|
+
if (trimmed.startsWith('type '))
|
|
167
|
+
return 'type';
|
|
168
|
+
if (trimmed.startsWith('enum '))
|
|
169
|
+
return 'enum';
|
|
170
|
+
return 'variable';
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Ajoute des JSDoc aux expressions exportées dans le texte source
|
|
174
|
+
*/
|
|
175
|
+
const addJSDocToSourceText = (sourceFile) => {
|
|
176
|
+
// Obtenir le texte sans les imports dès le début
|
|
177
|
+
const fullText = sourceFile.getText();
|
|
178
|
+
const imports = sourceFile
|
|
179
|
+
.getImportDeclarations()
|
|
180
|
+
.map(importDecl => importDecl.getText());
|
|
181
|
+
const linesWithoutImports = fullText
|
|
182
|
+
.replace(imports.join('\n'), '')
|
|
183
|
+
.trimStart();
|
|
184
|
+
let modifiedText = linesWithoutImports;
|
|
185
|
+
// Collecter toutes les positions d'insertion avec leurs JSDoc
|
|
186
|
+
const insertions = [];
|
|
187
|
+
// Une approche plus simple : analyser le texte directement pour trouver les exports
|
|
188
|
+
const lines = modifiedText.split('\n');
|
|
189
|
+
lines.forEach((line, lineIndex) => {
|
|
190
|
+
const trimmedLine = line.trim();
|
|
191
|
+
// Détecter les lignes qui commencent par export ET contiennent une déclaration
|
|
192
|
+
if (trimmedLine.startsWith('export ') && hasDeclaration(trimmedLine)) {
|
|
193
|
+
// Calculer la position dans le texte original
|
|
194
|
+
const position = lines.slice(0, lineIndex).join('\n').length +
|
|
195
|
+
(lineIndex > 0 ? 1 : 0);
|
|
196
|
+
// Déterminer le nom et le type d'export
|
|
197
|
+
const { exportName, declarationKind } = extractExportDetails(trimmedLine);
|
|
198
|
+
const jsdoc = generateJSDoc(exportName, declarationKind);
|
|
199
|
+
insertions.push({ position, jsdoc: `${jsdoc}\n` });
|
|
200
|
+
}
|
|
201
|
+
// Détecter les déclarations internes (const, function, etc.) qui sont ensuite exportées
|
|
202
|
+
if (!trimmedLine.startsWith('export ') &&
|
|
203
|
+
(trimmedLine.startsWith('const ') ||
|
|
204
|
+
trimmedLine.startsWith('function ') ||
|
|
205
|
+
trimmedLine.startsWith('class ') ||
|
|
206
|
+
trimmedLine.startsWith('interface ') ||
|
|
207
|
+
trimmedLine.startsWith('type ') ||
|
|
208
|
+
trimmedLine.startsWith('enum '))) {
|
|
209
|
+
// Vérifier si cette déclaration est exportée plus tard dans le fichier
|
|
210
|
+
const declarationName = extractDeclarationName(trimmedLine);
|
|
211
|
+
if (declarationName && isExportedLater(lines, declarationName)) {
|
|
212
|
+
// Calculer la position dans le texte original
|
|
213
|
+
const position = lines.slice(0, lineIndex).join('\n').length +
|
|
214
|
+
(lineIndex > 0 ? 1 : 0);
|
|
215
|
+
const declarationKind = getDeclarationKind(trimmedLine);
|
|
216
|
+
const jsdoc = generateJSDoc(declarationName, declarationKind);
|
|
217
|
+
insertions.push({ position, jsdoc: `${jsdoc}\n` });
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
// Trier par position décroissante pour insérer de la fin vers le début
|
|
222
|
+
insertions.sort((a, b) => b.position - a.position);
|
|
223
|
+
// Insérer les JSDoc
|
|
224
|
+
for (const insertion of insertions) {
|
|
225
|
+
modifiedText =
|
|
226
|
+
modifiedText.slice(0, insertion.position) +
|
|
227
|
+
insertion.jsdoc +
|
|
228
|
+
modifiedText.slice(insertion.position);
|
|
229
|
+
}
|
|
230
|
+
return modifiedText;
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
exports.addJSDocToSourceText = addJSDocToSourceText;
|
|
234
|
+
exports.extractDeclarationName = extractDeclarationName;
|
|
235
|
+
exports.extractExportDetails = extractExportDetails;
|
|
236
|
+
exports.generateJSDoc = generateJSDoc;
|
|
237
|
+
exports.getDeclarationKind = getDeclarationKind;
|
|
238
|
+
exports.hasDeclaration = hasDeclaration;
|
|
239
|
+
exports.isExportedLater = isExportedLater;
|
|
240
|
+
//# sourceMappingURL=analyse.utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyse.utils.cjs","sources":["../src/analyse.utils.ts"],"sourcesContent":["import type { SourceFile } from 'ts-morph';\n\n/**\n * Génère un JSDoc pour une expression exportée générée automatiquement\n */\nexport const generateJSDoc = (\n exportName: string,\n declarationKind?: string,\n): string => {\n const kindText = declarationKind ? ` ${declarationKind}` : '';\n return `/**\n * ${exportName}${kindText} - Auto-generated expression\n * \n * ⚠️ WARNING: This expression is auto-generated and should not be modified.\n * Any manual changes will be overwritten during the next generation.\n * \n * @generated\n * @readonly\n * @author chlbri (bri_lvi@icloud.com)\n */`;\n};\n\nexport const extractExportDetails = (trimmedLine: string) => {\n let exportName = 'export';\n let declarationKind: string | undefined;\n\n if (trimmedLine.includes('export default ')) {\n exportName = 'default';\n if (trimmedLine.includes('function')) declarationKind = 'function';\n else if (trimmedLine.includes('class')) declarationKind = 'class';\n else declarationKind = 'value';\n } else if (trimmedLine.includes('export const ')) {\n const match = trimmedLine.match(/export const (\\w+)/);\n exportName = match ? match[1] : 'const';\n declarationKind = 'variable';\n } else if (trimmedLine.includes('export let ')) {\n const match = trimmedLine.match(/export let (\\w+)/);\n exportName = match ? match[1] : 'let';\n declarationKind = 'variable';\n } else if (trimmedLine.includes('export var ')) {\n const match = trimmedLine.match(/export var (\\w+)/);\n exportName = match ? match[1] : 'var';\n declarationKind = 'variable';\n } else if (trimmedLine.includes('export function ')) {\n const match = trimmedLine.match(/export function (\\w+)/);\n exportName = match ? match[1] : 'function';\n declarationKind = 'function';\n } else if (trimmedLine.includes('export class ')) {\n const match = trimmedLine.match(/export class (\\w+)/);\n exportName = match ? match[1] : 'class';\n declarationKind = 'class';\n } else if (trimmedLine.includes('export interface ')) {\n const match = trimmedLine.match(/export interface (\\w+)/);\n exportName = match ? match[1] : 'interface';\n declarationKind = 'interface';\n } else if (trimmedLine.includes('export type ')) {\n const match = trimmedLine.match(/export type (\\w+)/);\n exportName = match ? match[1] : 'type';\n declarationKind = 'type';\n } else if (trimmedLine.includes('export enum ')) {\n const match = trimmedLine.match(/export enum (\\w+)/);\n exportName = match ? match[1] : 'enum';\n declarationKind = 'enum';\n }\n return { exportName, declarationKind };\n};\n\n/**\n * Vérifie si une ligne d'export contient une déclaration et non pas un simple re-export\n */\nexport const hasDeclaration = (exportLine: string): boolean => {\n const trimmed = exportLine.trim();\n const falsy =\n trimmed.startsWith('export {') || // export { something }\n trimmed.startsWith('export *') || // export * from\n trimmed.includes('} from ') || // export { a, b } from\n trimmed.match(/^export\\s+\\{[^}]*\\}\\s*;?\\s*$/) || // export { a, b };\n trimmed.match(/^export\\s+default\\s+[a-zA-Z_$][a-zA-Z0-9_$]*\\s*;?\\s*$/); // export default identifier;\n\n // Re-exports et exports simples à exclure\n if (falsy) return false;\n\n // Déclarations à inclure (avec mots-clés de déclaration)\n const keywords = [\n 'export const ',\n 'export let ',\n 'export var ',\n 'export function ',\n 'export class ',\n 'export interface ',\n 'export type ',\n 'export enum ',\n 'export namespace ',\n 'export default function ',\n 'export default class ',\n 'export default interface ',\n 'export default enum ',\n 'export default const ',\n 'export default let ',\n 'export default var ',\n ];\n\n return keywords.some(kw => trimmed.includes(kw));\n};\n\n/**\n * Extrait le nom d'une déclaration (const, function, etc.)\n */\nexport const extractDeclarationName = (line: string): string | null => {\n const trimmed = line.trim();\n\n if (trimmed.startsWith('const ')) {\n const match = trimmed.match(/const\\s+(\\w+)/);\n return match ? match[1] : null;\n }\n if (trimmed.startsWith('function ')) {\n const match = trimmed.match(/function\\s+(\\w+)/);\n return match ? match[1] : null;\n }\n if (trimmed.startsWith('class ')) {\n const match = trimmed.match(/class\\s+(\\w+)/);\n return match ? match[1] : null;\n }\n if (trimmed.startsWith('interface ')) {\n const match = trimmed.match(/interface\\s+(\\w+)/);\n return match ? match[1] : null;\n }\n if (trimmed.startsWith('type ')) {\n const match = trimmed.match(/type\\s+(\\w+)/);\n return match ? match[1] : null;\n }\n if (trimmed.startsWith('enum ')) {\n const match = trimmed.match(/enum\\s+(\\w+)/);\n return match ? match[1] : null;\n }\n\n return null;\n};\n\n/**\n * Vérifie si une déclaration est exportée plus tard dans le fichier\n */\nexport const isExportedLater = (\n lines: string[],\n declarationName: string,\n): boolean => {\n return lines.some(line => {\n const trimmed = line.trim();\n return (\n trimmed === `export default ${declarationName};` ||\n trimmed.includes(`export { ${declarationName}`) ||\n trimmed.includes(`export * as ${declarationName}`)\n );\n });\n};\n\n/**\n * Détermine le type de déclaration\n */\nexport const getDeclarationKind = (line: string): string => {\n const trimmed = line.trim();\n\n if (trimmed.startsWith('const ')) return 'const';\n if (trimmed.startsWith('let ')) return 'let';\n if (trimmed.startsWith('var ')) return 'var';\n if (trimmed.startsWith('function ')) return 'function';\n if (trimmed.startsWith('class ')) return 'class';\n if (trimmed.startsWith('interface ')) return 'interface';\n if (trimmed.startsWith('type ')) return 'type';\n if (trimmed.startsWith('enum ')) return 'enum';\n\n return 'variable';\n};\n\n/**\n * Ajoute des JSDoc aux expressions exportées dans le texte source\n */\nexport const addJSDocToSourceText = (sourceFile: SourceFile): string => {\n // Obtenir le texte sans les imports dès le début\n const fullText = sourceFile.getText();\n const imports = sourceFile\n .getImportDeclarations()\n .map(importDecl => importDecl.getText());\n\n const linesWithoutImports = fullText\n .replace(imports.join('\\n'), '')\n .trimStart();\n\n let modifiedText = linesWithoutImports;\n\n // Collecter toutes les positions d'insertion avec leurs JSDoc\n const insertions: Array<{ position: number; jsdoc: string }> = [];\n\n // Une approche plus simple : analyser le texte directement pour trouver les exports\n const lines = modifiedText.split('\\n');\n\n lines.forEach((line, lineIndex) => {\n const trimmedLine = line.trim();\n\n // Détecter les lignes qui commencent par export ET contiennent une déclaration\n if (trimmedLine.startsWith('export ') && hasDeclaration(trimmedLine)) {\n // Calculer la position dans le texte original\n const position =\n lines.slice(0, lineIndex).join('\\n').length +\n (lineIndex > 0 ? 1 : 0);\n\n // Déterminer le nom et le type d'export\n const { exportName, declarationKind } =\n extractExportDetails(trimmedLine);\n\n const jsdoc = generateJSDoc(exportName, declarationKind);\n insertions.push({ position, jsdoc: `${jsdoc}\\n` });\n }\n\n // Détecter les déclarations internes (const, function, etc.) qui sont ensuite exportées\n if (\n !trimmedLine.startsWith('export ') &&\n (trimmedLine.startsWith('const ') ||\n trimmedLine.startsWith('function ') ||\n trimmedLine.startsWith('class ') ||\n trimmedLine.startsWith('interface ') ||\n trimmedLine.startsWith('type ') ||\n trimmedLine.startsWith('enum '))\n ) {\n // Vérifier si cette déclaration est exportée plus tard dans le fichier\n const declarationName = extractDeclarationName(trimmedLine);\n if (declarationName && isExportedLater(lines, declarationName)) {\n // Calculer la position dans le texte original\n const position =\n lines.slice(0, lineIndex).join('\\n').length +\n (lineIndex > 0 ? 1 : 0);\n\n const declarationKind = getDeclarationKind(trimmedLine);\n const jsdoc = generateJSDoc(declarationName, declarationKind);\n insertions.push({ position, jsdoc: `${jsdoc}\\n` });\n }\n }\n });\n\n // Trier par position décroissante pour insérer de la fin vers le début\n insertions.sort((a, b) => b.position - a.position);\n\n // Insérer les JSDoc\n for (const insertion of insertions) {\n modifiedText =\n modifiedText.slice(0, insertion.position) +\n insertion.jsdoc +\n modifiedText.slice(insertion.position);\n }\n\n return modifiedText;\n};\n"],"names":[],"mappings":";;AAEA;;AAEG;MACU,aAAa,GAAG,CAC3B,UAAkB,EAClB,eAAwB,KACd;AACV,IAAA,MAAM,QAAQ,GAAG,eAAe,GAAG,CAAA,CAAA,EAAI,eAAe,CAAA,CAAE,GAAG,EAAE;IAC7D,OAAO,CAAA;AACJ,GAAA,EAAA,UAAU,GAAG,QAAQ,CAAA;;;;;;;;IAQtB;AACJ;AAEO,MAAM,oBAAoB,GAAG,CAAC,WAAmB,KAAI;IAC1D,IAAI,UAAU,GAAG,QAAQ;AACzB,IAAA,IAAI,eAAmC;AAEvC,IAAA,IAAI,WAAW,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE;QAC3C,UAAU,GAAG,SAAS;AACtB,QAAA,IAAI,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC;YAAE,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AAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC;;AAGlD,IAAA,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QAClC,YAAY;YACV,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC;AACzC,gBAAA,SAAS,CAAC,KAAK;AACf,gBAAA,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC;IAC1C;AAEA,IAAA,OAAO,YAAY;AACrB;;;;;;;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { SourceFile } from 'ts-morph';
|
|
2
|
+
/**
|
|
3
|
+
* Génère un JSDoc pour une expression exportée générée automatiquement
|
|
4
|
+
*/
|
|
5
|
+
export declare const generateJSDoc: (exportName: string, declarationKind?: string) => string;
|
|
6
|
+
export declare const extractExportDetails: (trimmedLine: string) => {
|
|
7
|
+
exportName: string;
|
|
8
|
+
declarationKind: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Vérifie si une ligne d'export contient une déclaration et non pas un simple re-export
|
|
12
|
+
*/
|
|
13
|
+
export declare const hasDeclaration: (exportLine: string) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Extrait le nom d'une déclaration (const, function, etc.)
|
|
16
|
+
*/
|
|
17
|
+
export declare const extractDeclarationName: (line: string) => string | null;
|
|
18
|
+
/**
|
|
19
|
+
* Vérifie si une déclaration est exportée plus tard dans le fichier
|
|
20
|
+
*/
|
|
21
|
+
export declare const isExportedLater: (lines: string[], declarationName: string) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Détermine le type de déclaration
|
|
24
|
+
*/
|
|
25
|
+
export declare const getDeclarationKind: (line: string) => string;
|
|
26
|
+
/**
|
|
27
|
+
* Ajoute des JSDoc aux expressions exportées dans le texte source
|
|
28
|
+
*/
|
|
29
|
+
export declare const addJSDocToSourceText: (sourceFile: SourceFile) => string;
|
|
30
|
+
//# sourceMappingURL=analyse.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyse.utils.d.ts","sourceRoot":"","sources":["../src/analyse.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,YAAY,MAAM,EAClB,kBAAkB,MAAM,KACvB,MAYF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,aAAa,MAAM;;;CA2CvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,YAAY,MAAM,KAAG,OAiCnD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,MAAM,MAAM,KAAG,MAAM,GAAG,IA6B9D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,MAAM,EAAE,EACf,iBAAiB,MAAM,KACtB,OASF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,MAajD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,YAAY,UAAU,KAAG,MA0E7D,CAAC"}
|