@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
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Génère un JSDoc pour une expression exportée générée automatiquement
|
|
3
|
+
*/
|
|
4
|
+
const generateJSDoc = (exportName, declarationKind) => {
|
|
5
|
+
const kindText = declarationKind ? ` ${declarationKind}` : '';
|
|
6
|
+
return `/**
|
|
7
|
+
* ${exportName}${kindText} - Auto-generated expression
|
|
8
|
+
*
|
|
9
|
+
* ⚠️ WARNING: This expression is auto-generated and should not be modified.
|
|
10
|
+
* Any manual changes will be overwritten during the next generation.
|
|
11
|
+
*
|
|
12
|
+
* @generated
|
|
13
|
+
* @readonly
|
|
14
|
+
* @author chlbri (bri_lvi@icloud.com)
|
|
15
|
+
*/`;
|
|
16
|
+
};
|
|
17
|
+
const extractExportDetails = (trimmedLine) => {
|
|
18
|
+
let exportName = 'export';
|
|
19
|
+
let declarationKind;
|
|
20
|
+
if (trimmedLine.includes('export default ')) {
|
|
21
|
+
exportName = 'default';
|
|
22
|
+
if (trimmedLine.includes('function'))
|
|
23
|
+
declarationKind = 'function';
|
|
24
|
+
else if (trimmedLine.includes('class'))
|
|
25
|
+
declarationKind = 'class';
|
|
26
|
+
else
|
|
27
|
+
declarationKind = 'value';
|
|
28
|
+
}
|
|
29
|
+
else if (trimmedLine.includes('export const ')) {
|
|
30
|
+
const match = trimmedLine.match(/export const (\w+)/);
|
|
31
|
+
exportName = match ? match[1] : 'const';
|
|
32
|
+
declarationKind = 'variable';
|
|
33
|
+
}
|
|
34
|
+
else if (trimmedLine.includes('export let ')) {
|
|
35
|
+
const match = trimmedLine.match(/export let (\w+)/);
|
|
36
|
+
exportName = match ? match[1] : 'let';
|
|
37
|
+
declarationKind = 'variable';
|
|
38
|
+
}
|
|
39
|
+
else if (trimmedLine.includes('export var ')) {
|
|
40
|
+
const match = trimmedLine.match(/export var (\w+)/);
|
|
41
|
+
exportName = match ? match[1] : 'var';
|
|
42
|
+
declarationKind = 'variable';
|
|
43
|
+
}
|
|
44
|
+
else if (trimmedLine.includes('export function ')) {
|
|
45
|
+
const match = trimmedLine.match(/export function (\w+)/);
|
|
46
|
+
exportName = match ? match[1] : 'function';
|
|
47
|
+
declarationKind = 'function';
|
|
48
|
+
}
|
|
49
|
+
else if (trimmedLine.includes('export class ')) {
|
|
50
|
+
const match = trimmedLine.match(/export class (\w+)/);
|
|
51
|
+
exportName = match ? match[1] : 'class';
|
|
52
|
+
declarationKind = 'class';
|
|
53
|
+
}
|
|
54
|
+
else if (trimmedLine.includes('export interface ')) {
|
|
55
|
+
const match = trimmedLine.match(/export interface (\w+)/);
|
|
56
|
+
exportName = match ? match[1] : 'interface';
|
|
57
|
+
declarationKind = 'interface';
|
|
58
|
+
}
|
|
59
|
+
else if (trimmedLine.includes('export type ')) {
|
|
60
|
+
const match = trimmedLine.match(/export type (\w+)/);
|
|
61
|
+
exportName = match ? match[1] : 'type';
|
|
62
|
+
declarationKind = 'type';
|
|
63
|
+
}
|
|
64
|
+
else if (trimmedLine.includes('export enum ')) {
|
|
65
|
+
const match = trimmedLine.match(/export enum (\w+)/);
|
|
66
|
+
exportName = match ? match[1] : 'enum';
|
|
67
|
+
declarationKind = 'enum';
|
|
68
|
+
}
|
|
69
|
+
return { exportName, declarationKind };
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Vérifie si une ligne d'export contient une déclaration et non pas un simple re-export
|
|
73
|
+
*/
|
|
74
|
+
const hasDeclaration = (exportLine) => {
|
|
75
|
+
const trimmed = exportLine.trim();
|
|
76
|
+
const falsy = trimmed.startsWith('export {') || // export { something }
|
|
77
|
+
trimmed.startsWith('export *') || // export * from
|
|
78
|
+
trimmed.includes('} from ') || // export { a, b } from
|
|
79
|
+
trimmed.match(/^export\s+\{[^}]*\}\s*;?\s*$/) || // export { a, b };
|
|
80
|
+
trimmed.match(/^export\s+default\s+[a-zA-Z_$][a-zA-Z0-9_$]*\s*;?\s*$/); // export default identifier;
|
|
81
|
+
// Re-exports et exports simples à exclure
|
|
82
|
+
if (falsy)
|
|
83
|
+
return false;
|
|
84
|
+
// Déclarations à inclure (avec mots-clés de déclaration)
|
|
85
|
+
const keywords = [
|
|
86
|
+
'export const ',
|
|
87
|
+
'export let ',
|
|
88
|
+
'export var ',
|
|
89
|
+
'export function ',
|
|
90
|
+
'export class ',
|
|
91
|
+
'export interface ',
|
|
92
|
+
'export type ',
|
|
93
|
+
'export enum ',
|
|
94
|
+
'export namespace ',
|
|
95
|
+
'export default function ',
|
|
96
|
+
'export default class ',
|
|
97
|
+
'export default interface ',
|
|
98
|
+
'export default enum ',
|
|
99
|
+
'export default const ',
|
|
100
|
+
'export default let ',
|
|
101
|
+
'export default var ',
|
|
102
|
+
];
|
|
103
|
+
return keywords.some(kw => trimmed.includes(kw));
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Extrait le nom d'une déclaration (const, function, etc.)
|
|
107
|
+
*/
|
|
108
|
+
const extractDeclarationName = (line) => {
|
|
109
|
+
const trimmed = line.trim();
|
|
110
|
+
if (trimmed.startsWith('const ')) {
|
|
111
|
+
const match = trimmed.match(/const\s+(\w+)/);
|
|
112
|
+
return match ? match[1] : null;
|
|
113
|
+
}
|
|
114
|
+
if (trimmed.startsWith('function ')) {
|
|
115
|
+
const match = trimmed.match(/function\s+(\w+)/);
|
|
116
|
+
return match ? match[1] : null;
|
|
117
|
+
}
|
|
118
|
+
if (trimmed.startsWith('class ')) {
|
|
119
|
+
const match = trimmed.match(/class\s+(\w+)/);
|
|
120
|
+
return match ? match[1] : null;
|
|
121
|
+
}
|
|
122
|
+
if (trimmed.startsWith('interface ')) {
|
|
123
|
+
const match = trimmed.match(/interface\s+(\w+)/);
|
|
124
|
+
return match ? match[1] : null;
|
|
125
|
+
}
|
|
126
|
+
if (trimmed.startsWith('type ')) {
|
|
127
|
+
const match = trimmed.match(/type\s+(\w+)/);
|
|
128
|
+
return match ? match[1] : null;
|
|
129
|
+
}
|
|
130
|
+
if (trimmed.startsWith('enum ')) {
|
|
131
|
+
const match = trimmed.match(/enum\s+(\w+)/);
|
|
132
|
+
return match ? match[1] : null;
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Vérifie si une déclaration est exportée plus tard dans le fichier
|
|
138
|
+
*/
|
|
139
|
+
const isExportedLater = (lines, declarationName) => {
|
|
140
|
+
return lines.some(line => {
|
|
141
|
+
const trimmed = line.trim();
|
|
142
|
+
return (trimmed === `export default ${declarationName};` ||
|
|
143
|
+
trimmed.includes(`export { ${declarationName}`) ||
|
|
144
|
+
trimmed.includes(`export * as ${declarationName}`));
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Détermine le type de déclaration
|
|
149
|
+
*/
|
|
150
|
+
const getDeclarationKind = (line) => {
|
|
151
|
+
const trimmed = line.trim();
|
|
152
|
+
if (trimmed.startsWith('const '))
|
|
153
|
+
return 'const';
|
|
154
|
+
if (trimmed.startsWith('let '))
|
|
155
|
+
return 'let';
|
|
156
|
+
if (trimmed.startsWith('var '))
|
|
157
|
+
return 'var';
|
|
158
|
+
if (trimmed.startsWith('function '))
|
|
159
|
+
return 'function';
|
|
160
|
+
if (trimmed.startsWith('class '))
|
|
161
|
+
return 'class';
|
|
162
|
+
if (trimmed.startsWith('interface '))
|
|
163
|
+
return 'interface';
|
|
164
|
+
if (trimmed.startsWith('type '))
|
|
165
|
+
return 'type';
|
|
166
|
+
if (trimmed.startsWith('enum '))
|
|
167
|
+
return 'enum';
|
|
168
|
+
return 'variable';
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Ajoute des JSDoc aux expressions exportées dans le texte source
|
|
172
|
+
*/
|
|
173
|
+
const addJSDocToSourceText = (sourceFile) => {
|
|
174
|
+
// Obtenir le texte sans les imports dès le début
|
|
175
|
+
const fullText = sourceFile.getText();
|
|
176
|
+
const imports = sourceFile
|
|
177
|
+
.getImportDeclarations()
|
|
178
|
+
.map(importDecl => importDecl.getText());
|
|
179
|
+
const linesWithoutImports = fullText
|
|
180
|
+
.replace(imports.join('\n'), '')
|
|
181
|
+
.trimStart();
|
|
182
|
+
let modifiedText = linesWithoutImports;
|
|
183
|
+
// Collecter toutes les positions d'insertion avec leurs JSDoc
|
|
184
|
+
const insertions = [];
|
|
185
|
+
// Une approche plus simple : analyser le texte directement pour trouver les exports
|
|
186
|
+
const lines = modifiedText.split('\n');
|
|
187
|
+
lines.forEach((line, lineIndex) => {
|
|
188
|
+
const trimmedLine = line.trim();
|
|
189
|
+
// Détecter les lignes qui commencent par export ET contiennent une déclaration
|
|
190
|
+
if (trimmedLine.startsWith('export ') && hasDeclaration(trimmedLine)) {
|
|
191
|
+
// Calculer la position dans le texte original
|
|
192
|
+
const position = lines.slice(0, lineIndex).join('\n').length +
|
|
193
|
+
(lineIndex > 0 ? 1 : 0);
|
|
194
|
+
// Déterminer le nom et le type d'export
|
|
195
|
+
const { exportName, declarationKind } = extractExportDetails(trimmedLine);
|
|
196
|
+
const jsdoc = generateJSDoc(exportName, declarationKind);
|
|
197
|
+
insertions.push({ position, jsdoc: `${jsdoc}\n` });
|
|
198
|
+
}
|
|
199
|
+
// Détecter les déclarations internes (const, function, etc.) qui sont ensuite exportées
|
|
200
|
+
if (!trimmedLine.startsWith('export ') &&
|
|
201
|
+
(trimmedLine.startsWith('const ') ||
|
|
202
|
+
trimmedLine.startsWith('function ') ||
|
|
203
|
+
trimmedLine.startsWith('class ') ||
|
|
204
|
+
trimmedLine.startsWith('interface ') ||
|
|
205
|
+
trimmedLine.startsWith('type ') ||
|
|
206
|
+
trimmedLine.startsWith('enum '))) {
|
|
207
|
+
// Vérifier si cette déclaration est exportée plus tard dans le fichier
|
|
208
|
+
const declarationName = extractDeclarationName(trimmedLine);
|
|
209
|
+
if (declarationName && isExportedLater(lines, declarationName)) {
|
|
210
|
+
// Calculer la position dans le texte original
|
|
211
|
+
const position = lines.slice(0, lineIndex).join('\n').length +
|
|
212
|
+
(lineIndex > 0 ? 1 : 0);
|
|
213
|
+
const declarationKind = getDeclarationKind(trimmedLine);
|
|
214
|
+
const jsdoc = generateJSDoc(declarationName, declarationKind);
|
|
215
|
+
insertions.push({ position, jsdoc: `${jsdoc}\n` });
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
// Trier par position décroissante pour insérer de la fin vers le début
|
|
220
|
+
insertions.sort((a, b) => b.position - a.position);
|
|
221
|
+
// Insérer les JSDoc
|
|
222
|
+
for (const insertion of insertions) {
|
|
223
|
+
modifiedText =
|
|
224
|
+
modifiedText.slice(0, insertion.position) +
|
|
225
|
+
insertion.jsdoc +
|
|
226
|
+
modifiedText.slice(insertion.position);
|
|
227
|
+
}
|
|
228
|
+
return modifiedText;
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export { addJSDocToSourceText, extractDeclarationName, extractExportDetails, generateJSDoc, getDeclarationKind, hasDeclaration, isExportedLater };
|
|
232
|
+
//# sourceMappingURL=analyse.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyse.utils.js","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,eAAe,GAAG,UAAU;AAC7D,aAAA,IAAI,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC;YAAE,eAAe,GAAG,OAAO;;YAC5D,eAAe,GAAG,OAAO;IAChC;AAAO,SAAA,IAAI,WAAW,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE;QAChD,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,oBAAoB,CAAC;AACrD,QAAA,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO;QACvC,eAAe,GAAG,UAAU;IAC9B;AAAO,SAAA,IAAI,WAAW,CAAC,QA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ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var cmdTs = require('cmd-ts');
|
|
4
|
+
var constants = require('../constants.cjs');
|
|
5
|
+
var functions_generate = require('../functions/generate.cjs');
|
|
6
|
+
|
|
7
|
+
const cli = cmdTs.command({
|
|
8
|
+
name: 'generate',
|
|
9
|
+
args: {
|
|
10
|
+
output: cmdTs.option({
|
|
11
|
+
long: 'output',
|
|
12
|
+
short: 'o',
|
|
13
|
+
type: cmdTs.string,
|
|
14
|
+
description: 'Output file path',
|
|
15
|
+
defaultValue: () => constants.CODEBASE_FILE,
|
|
16
|
+
}),
|
|
17
|
+
excludes: cmdTs.restPositionals({
|
|
18
|
+
description: 'The files to exclude, relative to process.cwd()',
|
|
19
|
+
displayName: 'Excludes',
|
|
20
|
+
type: cmdTs.string,
|
|
21
|
+
}),
|
|
22
|
+
},
|
|
23
|
+
handler: functions_generate.generate,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
exports.cli = cli;
|
|
27
|
+
//# sourceMappingURL=cli.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.cjs","sources":["../../src/cli/cli.ts"],"sourcesContent":["import { command, option, restPositionals, string } from 'cmd-ts';\nimport { CODEBASE_FILE } from '../constants';\nimport { generate as handler } from '../functions/generate';\n\nexport const cli = command({\n name: 'generate',\n\n args: {\n output: option({\n long: 'output',\n short: 'o',\n type: string,\n description: 'Output file path',\n defaultValue: () => CODEBASE_FILE,\n }),\n excludes: restPositionals({\n description: 'The files to exclude, relative to process.cwd()',\n displayName: 'Excludes',\n type: string,\n }),\n },\n handler,\n});\n"],"names":["command","option","string","CODEBASE_FILE","restPositionals","handler"],"mappings":";;;;;;AAIO,MAAM,GAAG,GAAGA,aAAO,CAAC;AACzB,IAAA,IAAI,EAAE,UAAU;AAEhB,IAAA,IAAI,EAAE;QACJ,MAAM,EAAEC,YAAM,CAAC;AACb,YAAA,IAAI,EAAE,QAAQ;AACd,YAAA,KAAK,EAAE,GAAG;AACV,YAAA,IAAI,EAAEC,YAAM;AACZ,YAAA,WAAW,EAAE,kBAAkB;AAC/B,YAAA,YAAY,EAAE,MAAMC,uBAAa;SAClC,CAAC;QACF,QAAQ,EAAEC,qBAAe,CAAC;AACxB,YAAA,WAAW,EAAE,iDAAiD;AAC9D,YAAA,WAAW,EAAE,UAAU;AACvB,YAAA,IAAI,EAAEF,YAAM;SACb,CAAC;AACH,KAAA;aACDG,2BAAO;AACR,CAAA;;;;"}
|
package/lib/cli/cli.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const cli: Partial<import("cmd-ts/dist/cjs/argparser").Register> & {
|
|
2
|
+
parse(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{
|
|
3
|
+
output: string;
|
|
4
|
+
excludes: string[];
|
|
5
|
+
}>>;
|
|
6
|
+
} & import("cmd-ts/dist/cjs/helpdoc").PrintHelp & import("cmd-ts/dist/cjs/helpdoc").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc").Named & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/argparser").Register & import("cmd-ts/dist/cjs/runner").Handling<{
|
|
7
|
+
output: string;
|
|
8
|
+
excludes: string[];
|
|
9
|
+
}, boolean> & {
|
|
10
|
+
run(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<boolean>>;
|
|
11
|
+
} & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned & import("cmd-ts/dist/cjs/helpdoc").Descriptive & import("cmd-ts/dist/cjs/helpdoc").Aliased>;
|
|
12
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,GAAG;;;;;;;;;;oJAkBd,CAAC"}
|
package/lib/cli/cli.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { command, restPositionals, option, string } from 'cmd-ts';
|
|
2
|
+
import { CODEBASE_FILE } from '../constants.js';
|
|
3
|
+
import { generate } from '../functions/generate.js';
|
|
4
|
+
|
|
5
|
+
const cli = command({
|
|
6
|
+
name: 'generate',
|
|
7
|
+
args: {
|
|
8
|
+
output: option({
|
|
9
|
+
long: 'output',
|
|
10
|
+
short: 'o',
|
|
11
|
+
type: string,
|
|
12
|
+
description: 'Output file path',
|
|
13
|
+
defaultValue: () => CODEBASE_FILE,
|
|
14
|
+
}),
|
|
15
|
+
excludes: restPositionals({
|
|
16
|
+
description: 'The files to exclude, relative to process.cwd()',
|
|
17
|
+
displayName: 'Excludes',
|
|
18
|
+
type: string,
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
handler: generate,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export { cli };
|
|
25
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sources":["../../src/cli/cli.ts"],"sourcesContent":["import { command, option, restPositionals, string } from 'cmd-ts';\nimport { CODEBASE_FILE } from '../constants';\nimport { generate as handler } from '../functions/generate';\n\nexport const cli = command({\n name: 'generate',\n\n args: {\n output: option({\n long: 'output',\n short: 'o',\n type: string,\n description: 'Output file path',\n defaultValue: () => CODEBASE_FILE,\n }),\n excludes: restPositionals({\n description: 'The files to exclude, relative to process.cwd()',\n displayName: 'Excludes',\n type: string,\n }),\n },\n handler,\n});\n"],"names":["handler"],"mappings":";;;;AAIO,MAAM,GAAG,GAAG,OAAO,CAAC;AACzB,IAAA,IAAI,EAAE,UAAU;AAEhB,IAAA,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC;AACb,YAAA,IAAI,EAAE,QAAQ;AACd,YAAA,KAAK,EAAE,GAAG;AACV,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,WAAW,EAAE,kBAAkB;AAC/B,YAAA,YAAY,EAAE,MAAM,aAAa;SAClC,CAAC;QACF,QAAQ,EAAE,eAAe,CAAC;AACxB,YAAA,WAAW,EAAE,iDAAiD;AAC9D,YAAA,WAAW,EAAE,UAAU;AACvB,YAAA,IAAI,EAAE,MAAM;SACb,CAAC;AACH,KAAA;aACDA,QAAO;AACR,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.cjs","sources":["../../src/cli/constants.ts"],"sourcesContent":["export const BIN = 'codebase';\n"],"names":[],"mappings":";;AAAO,MAAM,GAAG,GAAG;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/cli/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../src/cli/constants.ts"],"sourcesContent":["export const BIN = 'codebase';\n"],"names":[],"mappings":"AAAO,MAAM,GAAG,GAAG;;;;"}
|
|
@@ -0,0 +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;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
|
package/lib/cli/index.js
ADDED
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,40 @@
|
|
|
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 = '-|||-';
|
|
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
|
+
],
|
|
20
|
+
};
|
|
21
|
+
const PATH_KEY = '#bemedev/*';
|
|
22
|
+
const JSON_FILE_NAME = '.bemedev.json';
|
|
23
|
+
const PATH_PROPERTY = 'path';
|
|
24
|
+
const FILES_PROPERTY = 'files';
|
|
25
|
+
const PROPERTIES = {
|
|
26
|
+
PATH: 'path',
|
|
27
|
+
FILES: 'files',
|
|
28
|
+
CODEBASE_ANALYSIS: 'CODEBASE_ANALYSIS',
|
|
29
|
+
STATS: 'STATS',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.CODEBASE_FILE = CODEBASE_FILE;
|
|
33
|
+
exports.FILES_PROPERTY = FILES_PROPERTY;
|
|
34
|
+
exports.JSON_FILE_NAME = JSON_FILE_NAME;
|
|
35
|
+
exports.PATH_KEY = PATH_KEY;
|
|
36
|
+
exports.PATH_PROPERTY = PATH_PROPERTY;
|
|
37
|
+
exports.PROPERTIES = PROPERTIES;
|
|
38
|
+
exports.REPLACERS = REPLACERS;
|
|
39
|
+
exports.SRC_DIR = SRC_DIR;
|
|
40
|
+
//# sourceMappingURL=constants.cjs.map
|
|
@@ -0,0 +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;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const SRC_DIR: string;
|
|
2
|
+
export declare const CODEBASE_FILE: string;
|
|
3
|
+
export declare const REPLACERS: {
|
|
4
|
+
readonly code: readonly [readonly ["\\`", "-|||-w"], readonly ["`", "\\`"], readonly ["${", "$-|||-{"], readonly ["\\s", "-|||-s"], readonly ["\\w", "-|||-w"]];
|
|
5
|
+
readonly init: readonly [readonly [RegExp, "`"], readonly ["-|||-", ""]];
|
|
6
|
+
};
|
|
7
|
+
export declare const PATH_KEY = "#bemedev/*";
|
|
8
|
+
export declare const JSON_FILE_NAME = ".bemedev.json";
|
|
9
|
+
export declare const PATH_PROPERTY = "path";
|
|
10
|
+
export declare const FILES_PROPERTY = "files";
|
|
11
|
+
export declare const PROPERTIES: {
|
|
12
|
+
readonly PATH: "path";
|
|
13
|
+
readonly FILES: "files";
|
|
14
|
+
readonly CODEBASE_ANALYSIS: "CODEBASE_ANALYSIS";
|
|
15
|
+
readonly STATS: "STATS";
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,QAA6B,CAAC;AAClD,eAAO,MAAM,aAAa,QAAwC,CAAC;AAInE,eAAO,MAAM,SAAS;;;CAYZ,CAAC;AAEX,eAAO,MAAM,QAAQ,eAAe,CAAC;AACrC,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAE9C,eAAO,MAAM,aAAa,SAAS,CAAC;AACpC,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC,eAAO,MAAM,UAAU;;;;;CAKb,CAAC"}
|
package/lib/constants.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
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 = '-|||-';
|
|
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
|
+
],
|
|
18
|
+
};
|
|
19
|
+
const PATH_KEY = '#bemedev/*';
|
|
20
|
+
const JSON_FILE_NAME = '.bemedev.json';
|
|
21
|
+
const PATH_PROPERTY = 'path';
|
|
22
|
+
const FILES_PROPERTY = 'files';
|
|
23
|
+
const PROPERTIES = {
|
|
24
|
+
PATH: 'path',
|
|
25
|
+
FILES: 'files',
|
|
26
|
+
CODEBASE_ANALYSIS: 'CODEBASE_ANALYSIS',
|
|
27
|
+
STATS: 'STATS',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { CODEBASE_FILE, FILES_PROPERTY, JSON_FILE_NAME, PATH_KEY, PATH_PROPERTY, PROPERTIES, REPLACERS, SRC_DIR };
|
|
31
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +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;;;;;"}
|
package/lib/exports.cjs
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tsMorph = require('ts-morph');
|
|
4
|
+
|
|
5
|
+
const analyzeExports = (sourceFile) => {
|
|
6
|
+
const exports = [];
|
|
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.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.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.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.push({
|
|
64
|
+
name,
|
|
65
|
+
kind: name === 'default' ? 'default' : 'named',
|
|
66
|
+
text: decl.getText(),
|
|
67
|
+
declarationKind,
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
return exports;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
exports.analyzeExports = analyzeExports;
|
|
75
|
+
//# sourceMappingURL=exports.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exports.cjs","sources":["../src/exports.ts"],"sourcesContent":["import { SourceFile, SyntaxKind } from 'ts-morph';\nimport type { ExportInfo } from './types';\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":["SyntaxKind"],"mappings":";;;;AAGO,MAAM,cAAc,GAAG,CAAC,UAAsB,KAAI;IACvD,MAAM,OAAO,GA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