@bemedev/codebase 0.3.0 → 1.1.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.
- package/README.md +26 -13
- package/lib/analyse.cjs +10 -8
- package/lib/analyse.cjs.map +1 -1
- package/lib/analyse.d.ts +4 -3
- package/lib/analyse.d.ts.map +1 -0
- package/lib/analyse.js +9 -7
- package/lib/analyse.js.map +1 -1
- package/lib/analyse.utils.cjs +6 -6
- package/lib/analyse.utils.cjs.map +1 -1
- package/lib/analyse.utils.d.ts +8 -7
- package/lib/analyse.utils.d.ts.map +1 -0
- package/lib/analyse.utils.js +6 -6
- package/lib/analyse.utils.js.map +1 -1
- package/lib/cli/cli.cjs +2 -2
- package/lib/cli/cli.cjs.map +1 -1
- package/lib/cli/cli.d.ts +1 -0
- package/lib/cli/cli.d.ts.map +1 -0
- package/lib/cli/cli.js +2 -1
- package/lib/cli/cli.js.map +1 -1
- package/lib/cli/constants.d.ts +1 -0
- package/lib/cli/constants.d.ts.map +1 -0
- package/lib/cli/index.cjs +0 -1
- package/lib/cli/index.cjs.map +1 -1
- package/lib/cli/index.d.ts +1 -0
- package/lib/cli/index.d.ts.map +1 -0
- package/lib/cli/index.js +0 -0
- package/lib/cli/index.js.map +1 -1
- package/lib/config.cjs +12 -0
- package/lib/config.cjs.map +1 -0
- package/lib/config.d.ts +7 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +11 -0
- package/lib/config.js.map +1 -0
- package/lib/constants.cjs +6 -5
- package/lib/constants.cjs.map +1 -1
- package/lib/constants.d.ts +4 -2
- package/lib/constants.d.ts.map +1 -0
- package/lib/constants.js +4 -3
- package/lib/constants.js.map +1 -1
- package/lib/exports.cjs +0 -1
- package/lib/exports.cjs.map +1 -1
- package/lib/exports.d.ts +1 -0
- package/lib/exports.d.ts.map +1 -0
- package/lib/exports.js.map +1 -1
- package/lib/functions/add.cjs +6 -5
- package/lib/functions/add.cjs.map +1 -1
- package/lib/functions/add.d.ts +2 -1
- package/lib/functions/add.d.ts.map +1 -0
- package/lib/functions/add.js +6 -5
- package/lib/functions/add.js.map +1 -1
- package/lib/functions/generate.cjs +5 -6
- package/lib/functions/generate.cjs.map +1 -1
- package/lib/functions/generate.d.ts +3 -2
- package/lib/functions/generate.d.ts.map +1 -0
- package/lib/functions/generate.js +5 -5
- package/lib/functions/generate.js.map +1 -1
- package/lib/functions/index.d.ts +1 -0
- package/lib/functions/index.d.ts.map +1 -0
- package/lib/functions/init.cjs +29 -16
- package/lib/functions/init.cjs.map +1 -1
- package/lib/functions/init.d.ts +6 -3
- package/lib/functions/init.d.ts.map +1 -0
- package/lib/functions/init.js +30 -16
- package/lib/functions/init.js.map +1 -1
- package/lib/functions/remove.cjs +11 -10
- package/lib/functions/remove.cjs.map +1 -1
- package/lib/functions/remove.d.ts +2 -1
- package/lib/functions/remove.d.ts.map +1 -0
- package/lib/functions/remove.js +11 -10
- package/lib/functions/remove.js.map +1 -1
- package/lib/helpers.cjs +1 -2
- package/lib/helpers.cjs.map +1 -1
- package/lib/helpers.d.ts +4 -3
- package/lib/helpers.d.ts.map +1 -0
- package/lib/helpers.js +1 -1
- package/lib/helpers.js.map +1 -1
- package/lib/imports.cjs +2 -3
- package/lib/imports.cjs.map +1 -1
- package/lib/imports.d.ts +4 -3
- package/lib/imports.d.ts.map +1 -0
- package/lib/imports.js +2 -2
- package/lib/imports.js.map +1 -1
- package/lib/index.cjs +2 -0
- package/lib/index.d.ts +6 -4
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +2 -1
- package/lib/schemas.cjs +1 -1
- package/lib/schemas.cjs.map +1 -1
- package/lib/schemas.d.ts +2 -1
- package/lib/schemas.d.ts.map +1 -0
- package/lib/schemas.js.map +1 -1
- package/lib/types.d.ts +1 -6
- package/lib/types.d.ts.map +1 -0
- package/lib/utils.cjs +2 -2
- package/lib/utils.cjs.map +1 -1
- package/lib/utils.d.ts +2 -1
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +2 -2
- package/lib/utils.js.map +1 -1
- package/package.json +43 -62
package/lib/functions/init.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../_virtual/_rolldown/runtime.cjs");
|
|
3
2
|
const require_constants = require("../constants.cjs");
|
|
4
3
|
const require_helpers = require("../helpers.cjs");
|
|
4
|
+
const require_config = require("../config.cjs");
|
|
5
5
|
let path = require("path");
|
|
6
6
|
let fs = require("fs");
|
|
7
7
|
//#region src/functions/init.ts
|
|
@@ -10,31 +10,44 @@ const createTypesStructure = (folderPath, CODEBASE_ANALYSIS) => {
|
|
|
10
10
|
return key.endsWith("types") || key.endsWith("constants");
|
|
11
11
|
});
|
|
12
12
|
const PATHS = [];
|
|
13
|
-
console.log(`🔧
|
|
13
|
+
console.log(`🔧 Creating types structure (${entries.length} files)...`);
|
|
14
14
|
for (const [, fileAnalysis] of entries) {
|
|
15
15
|
const file = require_helpers.writeFileAnalysis(fileAnalysis, folderPath);
|
|
16
16
|
if (file) PATHS.push(file);
|
|
17
17
|
}
|
|
18
|
-
console.log(`✅
|
|
18
|
+
console.log(`✅ Types structure successfully created!`);
|
|
19
19
|
return PATHS;
|
|
20
20
|
};
|
|
21
|
-
const
|
|
21
|
+
const initConfig = ({ root, json, path: path$1 = require_constants.DEFAULT_PATH_KEY, bin = require_constants.DEFAULT_CLI_NAME }) => {
|
|
22
|
+
require_config.config.bin = bin;
|
|
23
|
+
require_config.config.json = json;
|
|
24
|
+
require_config.config.tsConfigPath = path$1;
|
|
25
|
+
require_config.config.root = root;
|
|
26
|
+
return {
|
|
27
|
+
root,
|
|
28
|
+
json,
|
|
29
|
+
path: path$1,
|
|
30
|
+
bin
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
const init = (CODEBASE_ANALYSIS, options) => {
|
|
34
|
+
const { root, json, path: path$2, bin } = initConfig(options);
|
|
22
35
|
const cwd = process.cwd();
|
|
23
36
|
const configFile = (0, path.join)(cwd, json);
|
|
24
37
|
if ((0, fs.existsSync)(configFile)) return true;
|
|
25
38
|
const folderPath = require_helpers.getFolderPath(root);
|
|
26
39
|
try {
|
|
27
40
|
(0, fs.mkdirSync)(folderPath, { recursive: true });
|
|
28
|
-
console.log(`✅
|
|
41
|
+
console.log(`✅ Folder ${bin} created in: ${root}`);
|
|
29
42
|
} catch (error) {
|
|
30
|
-
console.error(`❌
|
|
43
|
+
console.error(`❌ Error creating the folder ${bin}:`, error);
|
|
31
44
|
return false;
|
|
32
45
|
}
|
|
33
46
|
let files = [];
|
|
34
47
|
try {
|
|
35
48
|
files = createTypesStructure(folderPath, CODEBASE_ANALYSIS);
|
|
36
49
|
} catch {
|
|
37
|
-
console.error(`❌
|
|
50
|
+
console.error(`❌ Error creating the types structure:`);
|
|
38
51
|
return false;
|
|
39
52
|
}
|
|
40
53
|
const tsconfigPath = (0, path.join)(cwd, "tsconfig.json");
|
|
@@ -44,27 +57,27 @@ const init = (CODEBASE_ANALYSIS, { root, json }) => {
|
|
|
44
57
|
if (!tsconfig.compilerOptions) tsconfig.compilerOptions = {};
|
|
45
58
|
if (!tsconfig.compilerOptions.paths) tsconfig.compilerOptions.paths = {};
|
|
46
59
|
const relativePath = (0, path.relative)(process.cwd(), folderPath);
|
|
47
|
-
tsconfig.compilerOptions.paths[
|
|
60
|
+
tsconfig.compilerOptions.paths[path$2] = [`./${relativePath}/*`];
|
|
48
61
|
(0, fs.writeFileSync)(tsconfigPath, JSON.stringify(tsconfig, null, 2), "utf8");
|
|
49
|
-
console.log(`✅ Path
|
|
62
|
+
console.log(`✅ Path ${path$2} added to tsconfig.json`);
|
|
50
63
|
} catch (error) {
|
|
51
|
-
console.error(`❌
|
|
64
|
+
console.error(`❌ Error updating tsconfig.json:`, error);
|
|
52
65
|
return false;
|
|
53
66
|
}
|
|
54
|
-
else console.warn(`⚠️
|
|
55
|
-
const
|
|
67
|
+
else console.warn(`⚠️ File tsconfig.json not found, path not added`);
|
|
68
|
+
const jsonConfig = {
|
|
56
69
|
version: "1.0.0",
|
|
57
70
|
[require_constants.PROPERTIES.PATH]: root,
|
|
58
71
|
[require_constants.PROPERTIES.FILES]: files
|
|
59
72
|
};
|
|
60
73
|
try {
|
|
61
|
-
(0, fs.writeFileSync)(configFile, JSON.stringify(
|
|
62
|
-
console.log(`✅
|
|
74
|
+
(0, fs.writeFileSync)(configFile, JSON.stringify(jsonConfig, null, 2), "utf8");
|
|
75
|
+
console.log(`✅ File ${json} created at the root of the project`);
|
|
63
76
|
} catch (error) {
|
|
64
|
-
console.error(`❌
|
|
77
|
+
console.error(`❌ Error creating the file ${json}:`, error);
|
|
65
78
|
return false;
|
|
66
79
|
}
|
|
67
|
-
console.log(`🎉
|
|
80
|
+
console.log(`🎉 Bemedev initialization completed successfully!`);
|
|
68
81
|
return true;
|
|
69
82
|
};
|
|
70
83
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.cjs","names":["writeFileAnalysis","
|
|
1
|
+
{"version":3,"file":"init.cjs","names":["writeFileAnalysis","DEFAULT_PATH_KEY","DEFAULT_CLI_NAME","path","getFolderPath","PROPERTIES"],"sources":["../../src/functions/init.ts"],"sourcesContent":["import {\n existsSync,\n mkdirSync,\n readFileSync,\n writeFileSync,\n} from 'node:fs';\nimport { join, relative } from 'node:path';\nimport {\n DEFAULT_CLI_NAME,\n DEFAULT_PATH_KEY,\n PROPERTIES,\n} from '../constants';\nimport { getFolderPath, writeFileAnalysis } from '../helpers';\nimport { CodebaseAnalysis } from '../schemas';\nimport { config } from '../config';\n\nexport interface InitOptions {\n /**\n * Custom location for the .bemedev folder\n * Default: 'src/.bemedev' if src exists, otherwise '.bemedev' at the root\n */\n root: string;\n json: string;\n path?: string;\n bin?: string;\n}\n\nexport const createTypesStructure = (\n folderPath: string,\n CODEBASE_ANALYSIS: CodebaseAnalysis,\n) => {\n const entries = Object.entries(CODEBASE_ANALYSIS).filter(([key]) => {\n return key.endsWith('types') || key.endsWith('constants');\n });\n\n const PATHS: string[] = [];\n\n console.log(\n `🔧 Creating types structure (${entries.length} files)...`,\n );\n\n for (const [, fileAnalysis] of entries) {\n const file = writeFileAnalysis(fileAnalysis, folderPath);\n if (file) PATHS.push(file);\n }\n\n console.log(`✅ Types structure successfully created!`);\n return PATHS;\n};\n\nconst initConfig = ({\n root,\n json,\n path = DEFAULT_PATH_KEY,\n bin = DEFAULT_CLI_NAME,\n}: InitOptions) => {\n config.bin = bin;\n config.json = json;\n config.tsConfigPath = path;\n config.root = root;\n return { root, json, path, bin };\n};\n\nexport const init = (\n CODEBASE_ANALYSIS: CodebaseAnalysis,\n options: InitOptions,\n) => {\n const { root, json, path, bin } = initConfig(options);\n const cwd = process.cwd();\n const configFile = join(cwd, json);\n const configExists = existsSync(configFile);\n if (configExists) return true;\n const folderPath = getFolderPath(root);\n\n // 1. Create the folder\n try {\n mkdirSync(folderPath, { recursive: true });\n console.log(`✅ Folder ${bin} created in: ${root}`);\n } catch (error) {\n console.error(`❌ Error creating the folder ${bin}:`, error);\n return false;\n }\n\n // eslint-disable-next-line no-useless-assignment\n let files: string[] = [];\n // 1.5. Create the types files structure\n try {\n files = createTypesStructure(folderPath, CODEBASE_ANALYSIS);\n } catch {\n console.error(`❌ Error creating the types structure:`);\n return false;\n }\n\n // 2. Update tsconfig.json\n const tsconfigPath = join(cwd, 'tsconfig.json');\n\n if (existsSync(tsconfigPath)) {\n try {\n const tsconfigContent = readFileSync(tsconfigPath, 'utf8');\n const tsconfig = JSON.parse(tsconfigContent);\n\n // Initialize compilerOptions and paths if they do not exist\n if (!tsconfig.compilerOptions) {\n tsconfig.compilerOptions = {};\n }\n\n if (!tsconfig.compilerOptions.paths) {\n tsconfig.compilerOptions.paths = {};\n }\n\n // Add the path #bemedev/*\n const relativePath = relative(process.cwd(), folderPath);\n\n {\n // Remove baseUrl since typescript 6.0 will no longer use it\n // const baseUrl = tsconfig.compilerOptions.baseUrl;\n // if (typeof baseUrl === 'string') {\n // // If baseUrl is defined, calculate the relative path with respect to baseUrl\n // relativePath = relative(baseUrl, relativePath);\n // } else {\n // // If baseUrl is not defined, use the absolute path\n // tsconfig.compilerOptions.baseUrl = '.';\n // }\n }\n\n tsconfig.compilerOptions.paths[path] = [`./${relativePath}/*`];\n\n writeFileSync(\n tsconfigPath,\n JSON.stringify(tsconfig, null, 2),\n 'utf8',\n );\n console.log(`✅ Path ${path} added to tsconfig.json`);\n } catch (error) {\n console.error(`❌ Error updating tsconfig.json:`, error);\n return false;\n }\n } else {\n console.warn(`⚠️ File tsconfig.json not found, path not added`);\n }\n\n // 3. Create the .bemedev.json file at the root\n\n const jsonConfig = {\n version: '1.0.0',\n [PROPERTIES.PATH]: root,\n [PROPERTIES.FILES]: files,\n };\n\n try {\n writeFileSync(\n configFile,\n JSON.stringify(jsonConfig, null, 2),\n 'utf8',\n );\n console.log(`✅ File ${json} created at the root of the project`);\n } catch (error) {\n console.error(`❌ Error creating the file ${json}:`, error);\n return false;\n }\n\n console.log(`🎉 Bemedev initialization completed successfully!`);\n return true;\n};\n"],"mappings":";;;;;;;AA2BA,MAAa,wBACX,YACA,sBACG;CACH,MAAM,UAAU,OAAO,QAAQ,iBAAiB,CAAC,CAAC,QAAQ,CAAC,SAAS;EAClE,OAAO,IAAI,SAAS,OAAO,KAAK,IAAI,SAAS,WAAW;CAC1D,CAAC;CAED,MAAM,QAAkB,CAAC;CAEzB,QAAQ,IACN,gCAAgC,QAAQ,OAAO,WACjD;CAEA,KAAK,MAAM,GAAG,iBAAiB,SAAS;EACtC,MAAM,OAAOA,gBAAAA,kBAAkB,cAAc,UAAU;EACvD,IAAI,MAAM,MAAM,KAAK,IAAI;CAC3B;CAEA,QAAQ,IAAI,yCAAyC;CACrD,OAAO;AACT;AAEA,MAAM,cAAc,EAClB,MACA,MACA,MAAA,SAAOC,kBAAAA,kBACP,MAAMC,kBAAAA,uBACW;CACjB,eAAA,OAAO,MAAM;CACb,eAAA,OAAO,OA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C,GAChC,MACF;EACA,QAAQ,IAAI,UAAUA,OAAK,wBAAwB;CACrD,SAAS,OAAO;EACd,QAAQ,MAAM,mCAAmC,KAAK;EACtD,OAAO;CACT;MAEA,QAAQ,KAAK,iDAAiD;CAKhE,MAAM,aAAa;EACjB,SAAS;GACRE,kBAAAA,WAAW,OAAO;GAClBA,kBAAAA,WAAW,QAAQ;CACtB;CAEA,IAAI;EACF,CAAA,GAAA,GAAA,cAAA,CACE,YACA,KAAK,UAAU,YAAY,MAAM,CAAC,GAClC,MACF;EACA,QAAQ,IAAI,UAAU,KAAK,oCAAoC;CACjE,SAAS,OAAO;EACd,QAAQ,MAAM,6BAA6B,KAAK,IAAI,KAAK;EACzD,OAAO;CACT;CAEA,QAAQ,IAAI,mDAAmD;CAC/D,OAAO;AACT"}
|
package/lib/functions/init.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { CodebaseAnalysis } from '../schemas';
|
|
2
2
|
export interface InitOptions {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Custom location for the .bemedev folder
|
|
5
|
+
* Default: 'src/.bemedev' if src exists, otherwise '.bemedev' at the root
|
|
6
6
|
*/
|
|
7
7
|
root: string;
|
|
8
8
|
json: string;
|
|
9
|
+
path?: string;
|
|
10
|
+
bin?: string;
|
|
9
11
|
}
|
|
10
12
|
export declare const createTypesStructure: (folderPath: string, CODEBASE_ANALYSIS: CodebaseAnalysis) => string[];
|
|
11
|
-
export declare const init: (CODEBASE_ANALYSIS: CodebaseAnalysis,
|
|
13
|
+
export declare const init: (CODEBASE_ANALYSIS: CodebaseAnalysis, options: InitOptions) => boolean;
|
|
14
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/functions/init.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG9C,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,oBAAoB,GAC/B,YAAY,MAAM,EAClB,mBAAmB,gBAAgB,aAmBpC,CAAC;AAeF,eAAO,MAAM,IAAI,GACf,mBAAmB,gBAAgB,EACnC,SAAS,WAAW,YAkGrB,CAAC"}
|
package/lib/functions/init.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DEFAULT_CLI_NAME, DEFAULT_PATH_KEY, PROPERTIES } from "../constants.js";
|
|
2
2
|
import { getFolderPath, writeFileAnalysis } from "../helpers.js";
|
|
3
|
+
import { config } from "../config.js";
|
|
3
4
|
import { join, relative } from "path";
|
|
4
5
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
5
6
|
//#region src/functions/init.ts
|
|
@@ -8,31 +9,44 @@ const createTypesStructure = (folderPath, CODEBASE_ANALYSIS) => {
|
|
|
8
9
|
return key.endsWith("types") || key.endsWith("constants");
|
|
9
10
|
});
|
|
10
11
|
const PATHS = [];
|
|
11
|
-
console.log(`🔧
|
|
12
|
+
console.log(`🔧 Creating types structure (${entries.length} files)...`);
|
|
12
13
|
for (const [, fileAnalysis] of entries) {
|
|
13
14
|
const file = writeFileAnalysis(fileAnalysis, folderPath);
|
|
14
15
|
if (file) PATHS.push(file);
|
|
15
16
|
}
|
|
16
|
-
console.log(`✅
|
|
17
|
+
console.log(`✅ Types structure successfully created!`);
|
|
17
18
|
return PATHS;
|
|
18
19
|
};
|
|
19
|
-
const
|
|
20
|
+
const initConfig = ({ root, json, path = DEFAULT_PATH_KEY, bin = DEFAULT_CLI_NAME }) => {
|
|
21
|
+
config.bin = bin;
|
|
22
|
+
config.json = json;
|
|
23
|
+
config.tsConfigPath = path;
|
|
24
|
+
config.root = root;
|
|
25
|
+
return {
|
|
26
|
+
root,
|
|
27
|
+
json,
|
|
28
|
+
path,
|
|
29
|
+
bin
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
const init = (CODEBASE_ANALYSIS, options) => {
|
|
33
|
+
const { root, json, path, bin } = initConfig(options);
|
|
20
34
|
const cwd = process.cwd();
|
|
21
35
|
const configFile = join(cwd, json);
|
|
22
36
|
if (existsSync(configFile)) return true;
|
|
23
37
|
const folderPath = getFolderPath(root);
|
|
24
38
|
try {
|
|
25
39
|
mkdirSync(folderPath, { recursive: true });
|
|
26
|
-
console.log(`✅
|
|
40
|
+
console.log(`✅ Folder ${bin} created in: ${root}`);
|
|
27
41
|
} catch (error) {
|
|
28
|
-
console.error(`❌
|
|
42
|
+
console.error(`❌ Error creating the folder ${bin}:`, error);
|
|
29
43
|
return false;
|
|
30
44
|
}
|
|
31
45
|
let files = [];
|
|
32
46
|
try {
|
|
33
47
|
files = createTypesStructure(folderPath, CODEBASE_ANALYSIS);
|
|
34
48
|
} catch {
|
|
35
|
-
console.error(`❌
|
|
49
|
+
console.error(`❌ Error creating the types structure:`);
|
|
36
50
|
return false;
|
|
37
51
|
}
|
|
38
52
|
const tsconfigPath = join(cwd, "tsconfig.json");
|
|
@@ -42,27 +56,27 @@ const init = (CODEBASE_ANALYSIS, { root, json }) => {
|
|
|
42
56
|
if (!tsconfig.compilerOptions) tsconfig.compilerOptions = {};
|
|
43
57
|
if (!tsconfig.compilerOptions.paths) tsconfig.compilerOptions.paths = {};
|
|
44
58
|
const relativePath = relative(process.cwd(), folderPath);
|
|
45
|
-
tsconfig.compilerOptions.paths[
|
|
59
|
+
tsconfig.compilerOptions.paths[path] = [`./${relativePath}/*`];
|
|
46
60
|
writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 2), "utf8");
|
|
47
|
-
console.log(`✅ Path
|
|
61
|
+
console.log(`✅ Path ${path} added to tsconfig.json`);
|
|
48
62
|
} catch (error) {
|
|
49
|
-
console.error(`❌
|
|
63
|
+
console.error(`❌ Error updating tsconfig.json:`, error);
|
|
50
64
|
return false;
|
|
51
65
|
}
|
|
52
|
-
else console.warn(`⚠️
|
|
53
|
-
const
|
|
66
|
+
else console.warn(`⚠️ File tsconfig.json not found, path not added`);
|
|
67
|
+
const jsonConfig = {
|
|
54
68
|
version: "1.0.0",
|
|
55
69
|
[PROPERTIES.PATH]: root,
|
|
56
70
|
[PROPERTIES.FILES]: files
|
|
57
71
|
};
|
|
58
72
|
try {
|
|
59
|
-
writeFileSync(configFile, JSON.stringify(
|
|
60
|
-
console.log(`✅
|
|
73
|
+
writeFileSync(configFile, JSON.stringify(jsonConfig, null, 2), "utf8");
|
|
74
|
+
console.log(`✅ File ${json} created at the root of the project`);
|
|
61
75
|
} catch (error) {
|
|
62
|
-
console.error(`❌
|
|
76
|
+
console.error(`❌ Error creating the file ${json}:`, error);
|
|
63
77
|
return false;
|
|
64
78
|
}
|
|
65
|
-
console.log(`🎉
|
|
79
|
+
console.log(`🎉 Bemedev initialization completed successfully!`);
|
|
66
80
|
return true;
|
|
67
81
|
};
|
|
68
82
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","names":[],"sources":["../../src/functions/init.ts"],"sourcesContent":["import {\n existsSync,\n mkdirSync,\n readFileSync,\n writeFileSync,\n} from 'node:fs';\nimport { join, relative } from 'node:path';\nimport {
|
|
1
|
+
{"version":3,"file":"init.js","names":[],"sources":["../../src/functions/init.ts"],"sourcesContent":["import {\n existsSync,\n mkdirSync,\n readFileSync,\n writeFileSync,\n} from 'node:fs';\nimport { join, relative } from 'node:path';\nimport {\n DEFAULT_CLI_NAME,\n DEFAULT_PATH_KEY,\n PROPERTIES,\n} from '../constants';\nimport { getFolderPath, writeFileAnalysis } from '../helpers';\nimport { CodebaseAnalysis } from '../schemas';\nimport { config } from '../config';\n\nexport interface InitOptions {\n /**\n * Custom location for the .bemedev folder\n * Default: 'src/.bemedev' if src exists, otherwise '.bemedev' at the root\n */\n root: string;\n json: string;\n path?: string;\n bin?: string;\n}\n\nexport const createTypesStructure = (\n folderPath: string,\n CODEBASE_ANALYSIS: CodebaseAnalysis,\n) => {\n const entries = Object.entries(CODEBASE_ANALYSIS).filter(([key]) => {\n return key.endsWith('types') || key.endsWith('constants');\n });\n\n const PATHS: string[] = [];\n\n console.log(\n `🔧 Creating types structure (${entries.length} files)...`,\n );\n\n for (const [, fileAnalysis] of entries) {\n const file = writeFileAnalysis(fileAnalysis, folderPath);\n if (file) PATHS.push(file);\n }\n\n console.log(`✅ Types structure successfully created!`);\n return PATHS;\n};\n\nconst initConfig = ({\n root,\n json,\n path = DEFAULT_PATH_KEY,\n bin = DEFAULT_CLI_NAME,\n}: InitOptions) => {\n config.bin = bin;\n config.json = json;\n config.tsConfigPath = path;\n config.root = root;\n return { root, json, path, bin };\n};\n\nexport const init = (\n CODEBASE_ANALYSIS: CodebaseAnalysis,\n options: InitOptions,\n) => {\n const { root, json, path, bin } = initConfig(options);\n const cwd = process.cwd();\n const configFile = join(cwd, json);\n const configExists = existsSync(configFile);\n if (configExists) return true;\n const folderPath = getFolderPath(root);\n\n // 1. Create the folder\n try {\n mkdirSync(folderPath, { recursive: true });\n console.log(`✅ Folder ${bin} created in: ${root}`);\n } catch (error) {\n console.error(`❌ Error creating the folder ${bin}:`, error);\n return false;\n }\n\n // eslint-disable-next-line no-useless-assignment\n let files: string[] = [];\n // 1.5. Create the types files structure\n try {\n files = createTypesStructure(folderPath, CODEBASE_ANALYSIS);\n } catch {\n console.error(`❌ Error creating the types structure:`);\n return false;\n }\n\n // 2. Update tsconfig.json\n const tsconfigPath = join(cwd, 'tsconfig.json');\n\n if (existsSync(tsconfigPath)) {\n try {\n const tsconfigContent = readFileSync(tsconfigPath, 'utf8');\n const tsconfig = JSON.parse(tsconfigContent);\n\n // Initialize compilerOptions and paths if they do not exist\n if (!tsconfig.compilerOptions) {\n tsconfig.compilerOptions = {};\n }\n\n if (!tsconfig.compilerOptions.paths) {\n tsconfig.compilerOptions.paths = {};\n }\n\n // Add the path #bemedev/*\n const relativePath = relative(process.cwd(), folderPath);\n\n {\n // Remove baseUrl since typescript 6.0 will no longer use it\n // const baseUrl = tsconfig.compilerOptions.baseUrl;\n // if (typeof baseUrl === 'string') {\n // // If baseUrl is defined, calculate the relative path with respect to baseUrl\n // relativePath = relative(baseUrl, relativePath);\n // } else {\n // // If baseUrl is not defined, use the absolute path\n // tsconfig.compilerOptions.baseUrl = '.';\n // }\n }\n\n tsconfig.compilerOptions.paths[path] = [`./${relativePath}/*`];\n\n writeFileSync(\n tsconfigPath,\n JSON.stringify(tsconfig, null, 2),\n 'utf8',\n );\n console.log(`✅ Path ${path} added to tsconfig.json`);\n } catch (error) {\n console.error(`❌ Error updating tsconfig.json:`, error);\n return false;\n }\n } else {\n console.warn(`⚠️ File tsconfig.json not found, path not added`);\n }\n\n // 3. Create the .bemedev.json file at the root\n\n const jsonConfig = {\n version: '1.0.0',\n [PROPERTIES.PATH]: root,\n [PROPERTIES.FILES]: files,\n };\n\n try {\n writeFileSync(\n configFile,\n JSON.stringify(jsonConfig, null, 2),\n 'utf8',\n );\n console.log(`✅ File ${json} created at the root of the project`);\n } catch (error) {\n console.error(`❌ Error creating the file ${json}:`, error);\n return false;\n }\n\n console.log(`🎉 Bemedev initialization completed successfully!`);\n return true;\n};\n"],"mappings":";;;;;;AA2BA,MAAa,wBACX,YACA,sBACG;CACH,MAAM,UAAU,OAAO,QAAQ,iBAAiB,CAAC,CAAC,QAAQ,CAAC,SAAS;EAClE,OAAO,IAAI,SAAS,OAAO,KAAK,IAAI,SAAS,WAAW;CAC1D,CAAC;CAED,MAAM,QAAkB,CAAC;CAEzB,QAAQ,IACN,gCAAgC,QAAQ,OAAO,WACjD;CAEA,KAAK,MAAM,GAAG,iBAAiB,SAAS;EACtC,MAAM,OAAO,kBAAkB,cAAc,UAAU;EACvD,IAAI,MAAM,MAAM,KAAK,IAAI;CAC3B;CAEA,QA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,QAAQ,MAAM,mCAAmC,KAAK;EACtD,OAAO;CACT;MAEA,QAAQ,KAAK,iDAAiD;CAKhE,MAAM,aAAa;EACjB,SAAS;GACR,WAAW,OAAO;GAClB,WAAW,QAAQ;CACtB;CAEA,IAAI;EACF,cACE,YACA,KAAK,UAAU,YAAY,MAAM,CAAC,GAClC,MACF;EACA,QAAQ,IAAI,UAAU,KAAK,oCAAoC;CACjE,SAAS,OAAO;EACd,QAAQ,MAAM,6BAA6B,KAAK,IAAI,KAAK;EACzD,OAAO;CACT;CAEA,QAAQ,IAAI,mDAAmD;CAC/D,OAAO;AACT"}
|
package/lib/functions/remove.cjs
CHANGED
|
@@ -2,10 +2,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
3
|
const require_constants = require("../constants.cjs");
|
|
4
4
|
const require_helpers = require("../helpers.cjs");
|
|
5
|
+
const require_config = require("../config.cjs");
|
|
5
6
|
let path = require("path");
|
|
6
7
|
let fs = require("fs");
|
|
7
8
|
let edit_json_file = require("edit-json-file");
|
|
8
|
-
edit_json_file = require_runtime.__toESM(edit_json_file);
|
|
9
|
+
edit_json_file = require_runtime.__toESM(edit_json_file, 1);
|
|
9
10
|
//#region src/functions/remove.ts
|
|
10
11
|
const transformModules = (entries, ...files) => {
|
|
11
12
|
const cwd = process.cwd();
|
|
@@ -27,7 +28,7 @@ const transformModules = (entries, ...files) => {
|
|
|
27
28
|
const remove = (CODEBASE_ANALYSIS, ...paths) => {
|
|
28
29
|
if (paths.length === 0) return console.warn("No files specified for removal.");
|
|
29
30
|
try {
|
|
30
|
-
let file = (0, edit_json_file.default)((0, path.join)(process.cwd(),
|
|
31
|
+
let file = (0, edit_json_file.default)((0, path.join)(process.cwd(), require_config.config.json));
|
|
31
32
|
if (!file) return;
|
|
32
33
|
const root = require_helpers.getFolderPath(file.get(require_constants.PATH_PROPERTY));
|
|
33
34
|
const files = file.get(require_constants.FILES_PROPERTY);
|
|
@@ -44,23 +45,23 @@ const remove = (CODEBASE_ANALYSIS, ...paths) => {
|
|
|
44
45
|
return safesToRemove.push(key);
|
|
45
46
|
});
|
|
46
47
|
require_helpers.consoleStars();
|
|
47
|
-
console.log(`🔧
|
|
48
|
+
console.log(`🔧 Deleting of files (${entries.length} files)...`);
|
|
48
49
|
if (cannotsRemove.length > 0) {
|
|
49
50
|
const len = cannotsRemove.length;
|
|
50
|
-
console.warn(`⚠️ ${len} ${len === 1 ? "
|
|
51
|
+
console.warn(`⚠️ ${len} ${len === 1 ? "file cannot be deleted (imported in other files)" : "files cannot be deleted (imported in other files)"} :`);
|
|
51
52
|
cannotsRemove.forEach(([key, modules]) => {
|
|
52
|
-
console.warn(` - ⚠️ ${key}
|
|
53
|
+
console.warn(` - ⚠️ ${key} imported by:`);
|
|
53
54
|
modules.forEach((m) => console.warn(` -> 📌 ${m}`));
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
if (safesToRemove.length === 0) {
|
|
57
|
-
console.warn("❌
|
|
58
|
+
console.warn("❌ No files can be deleted.");
|
|
58
59
|
return require_helpers.consoleStars();
|
|
59
60
|
}
|
|
60
61
|
const formatteds = safesToRemove.map((key) => {
|
|
61
62
|
return [key, (0, path.join)(root, `${key.replaceAll(".", "/")}.ts`)];
|
|
62
63
|
});
|
|
63
|
-
console.log(`🗑️
|
|
64
|
+
console.log(`🗑️ Deleting files (${safesToRemove.length} files)...`);
|
|
64
65
|
let success = 0;
|
|
65
66
|
const length = formatteds.length;
|
|
66
67
|
formatteds.forEach(([key, path$1]) => {
|
|
@@ -70,14 +71,14 @@ const remove = (CODEBASE_ANALYSIS, ...paths) => {
|
|
|
70
71
|
file?.set(require_constants.FILES_PROPERTY, files.filter((key1) => key1 !== key));
|
|
71
72
|
success++;
|
|
72
73
|
} catch {
|
|
73
|
-
console.error(` - ❌
|
|
74
|
+
console.error(` - ❌ Error, ${key} :`);
|
|
74
75
|
}
|
|
75
76
|
});
|
|
76
77
|
file.save();
|
|
77
|
-
console.log(`🗑️
|
|
78
|
+
console.log(`🗑️ Files deleted! (${success}/${length})`);
|
|
78
79
|
file = void 0;
|
|
79
80
|
} catch {
|
|
80
|
-
console.error(`❌
|
|
81
|
+
console.error(`❌ Error while deleting files`);
|
|
81
82
|
require_helpers.consoleStars();
|
|
82
83
|
return false;
|
|
83
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.cjs","names":["transformModule","
|
|
1
|
+
{"version":3,"file":"remove.cjs","names":["transformModule","config","getFolderPath","PATH_PROPERTY","FILES_PROPERTY","consoleStars","path"],"sources":["../../src/functions/remove.ts"],"sourcesContent":["import edit, { JsonEditor } from 'edit-json-file';\nimport { unlinkSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { config } from '../config';\nimport { FILES_PROPERTY, PATH_PROPERTY } from '../constants';\nimport {\n consoleStars,\n getFolderPath,\n transformModule,\n} from '../helpers';\nimport { CodebaseAnalysis, FileAnalysis } from '../schemas';\n\nconst transformModules = (\n entries: [string, FileAnalysis][],\n ...files: string[]\n) => {\n const cwd = process.cwd();\n const out = entries\n .map(\n ([key, { imports, relativePath }]) =>\n [key, relativePath, imports] as const,\n )\n .map(([key, relativePath, imports]) => {\n const specifiers = imports\n .map(({ moduleSpecifier }) => {\n return transformModule({\n cwd,\n relativePath,\n moduleSpecifier,\n });\n })\n .map(_path => [_path, `${_path}.index`]) // Add .index variants\n .flat()\n .filter(s => files.includes(s));\n\n return [key, Array.from(new Set(specifiers))] as const;\n });\n\n return out;\n};\n\nexport const remove = (\n CODEBASE_ANALYSIS: CodebaseAnalysis,\n ...paths: string[]\n) => {\n const isEmpty = paths.length === 0;\n if (isEmpty) return console.warn('No files specified for removal.');\n try {\n const cwd = process.cwd();\n const json = join(cwd, config.json);\n let file: JsonEditor | undefined = edit(json);\n\n if (!file) return;\n\n const root = getFolderPath(file.get(PATH_PROPERTY) as string);\n const files = file.get(FILES_PROPERTY) as string[];\n\n const entries2 = Object.entries(CODEBASE_ANALYSIS).filter(([key]) =>\n files.includes(key),\n );\n\n const entries = entries2.filter(([key]) =>\n paths.some(p => key.startsWith(p)),\n );\n\n // Check dependencies before deletion\n const safesToRemove: string[] = [];\n const cannotsRemove: [string, string[]][] = [];\n\n entries.forEach(([key]) => {\n const modules = transformModules(entries2, ...files);\n const importedFroms = modules\n .filter(([, specifiers]) => specifiers.includes(key))\n .map(([k]) => k);\n\n const check = importedFroms.length > 0;\n\n console.log('modules', '=>', importedFroms);\n console.log('key', '=>', key);\n\n if (check) return cannotsRemove.push([key, importedFroms]);\n return safesToRemove.push(key);\n });\n\n consoleStars();\n console.log(`🔧 Deleting of files (${entries.length} files)...`);\n\n // Display files that cannot be deleted\n if (cannotsRemove.length > 0) {\n const len = cannotsRemove.length;\n const one = 'file cannot be deleted (imported in other files)';\n const many = 'files cannot be deleted (imported in other files)';\n\n console.warn(`⚠️ ${len} ${len === 1 ? one : many} :`);\n cannotsRemove.forEach(([key, modules]) => {\n console.warn(` - ⚠️ ${key} imported by:`);\n modules.forEach(m => console.warn(` -> 📌 ${m}`));\n });\n }\n\n if (safesToRemove.length === 0) {\n console.warn('❌ No files can be deleted.');\n return consoleStars();\n }\n\n const formatteds = safesToRemove.map(key => {\n const _path = `${key.replaceAll('.', '/')}.ts`;\n const absolute = join(root, _path);\n return [key, absolute] as const;\n });\n\n console.log(`🗑️ Deleting files (${safesToRemove.length} files)...`);\n\n let success = 0;\n const length = formatteds.length;\n\n formatteds.forEach(([key, path]) => {\n try {\n unlinkSync(path);\n console.log(` - 🗑️ ${key}`);\n file?.set(\n FILES_PROPERTY,\n files.filter(key1 => key1 !== key),\n );\n success++;\n } catch {\n console.error(` - ❌ Error, ${key} :`);\n }\n });\n\n file.save();\n console.log(`🗑️ Files deleted! (${success}/${length})`);\n file = undefined;\n } catch {\n console.error(`❌ Error while deleting files`);\n consoleStars();\n return false;\n }\n consoleStars();\n return true;\n};\n"],"mappings":";;;;;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AQ,IAAI,uBAAuB,QAAQ,GAAG,OAAO,EAAE;EACvD,OAAO,KAAA;CACT,QAAQ;EACN,QAAQ,MAAM,8BAA8B;EAC5C,gBAAA,aAAa;EACb,OAAO;CACT;CACA,gBAAA,aAAa;CACb,OAAO;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../src/functions/remove.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAgB,MAAM,YAAY,CAAC;AA+B5D,eAAO,MAAM,MAAM,GACjB,mBAAmB,gBAAgB,EACnC,GAAG,OAAO,MAAM,EAAE,mBAiGnB,CAAC"}
|
package/lib/functions/remove.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { FILES_PROPERTY,
|
|
1
|
+
import { FILES_PROPERTY, PATH_PROPERTY } from "../constants.js";
|
|
2
2
|
import { consoleStars, getFolderPath, transformModule } from "../helpers.js";
|
|
3
|
+
import { config } from "../config.js";
|
|
3
4
|
import { join } from "path";
|
|
4
5
|
import { unlinkSync } from "fs";
|
|
5
6
|
import edit from "edit-json-file";
|
|
@@ -24,7 +25,7 @@ const transformModules = (entries, ...files) => {
|
|
|
24
25
|
const remove = (CODEBASE_ANALYSIS, ...paths) => {
|
|
25
26
|
if (paths.length === 0) return console.warn("No files specified for removal.");
|
|
26
27
|
try {
|
|
27
|
-
let file = edit(join(process.cwd(),
|
|
28
|
+
let file = edit(join(process.cwd(), config.json));
|
|
28
29
|
if (!file) return;
|
|
29
30
|
const root = getFolderPath(file.get(PATH_PROPERTY));
|
|
30
31
|
const files = file.get(FILES_PROPERTY);
|
|
@@ -41,23 +42,23 @@ const remove = (CODEBASE_ANALYSIS, ...paths) => {
|
|
|
41
42
|
return safesToRemove.push(key);
|
|
42
43
|
});
|
|
43
44
|
consoleStars();
|
|
44
|
-
console.log(`🔧
|
|
45
|
+
console.log(`🔧 Deleting of files (${entries.length} files)...`);
|
|
45
46
|
if (cannotsRemove.length > 0) {
|
|
46
47
|
const len = cannotsRemove.length;
|
|
47
|
-
console.warn(`⚠️ ${len} ${len === 1 ? "
|
|
48
|
+
console.warn(`⚠️ ${len} ${len === 1 ? "file cannot be deleted (imported in other files)" : "files cannot be deleted (imported in other files)"} :`);
|
|
48
49
|
cannotsRemove.forEach(([key, modules]) => {
|
|
49
|
-
console.warn(` - ⚠️ ${key}
|
|
50
|
+
console.warn(` - ⚠️ ${key} imported by:`);
|
|
50
51
|
modules.forEach((m) => console.warn(` -> 📌 ${m}`));
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
if (safesToRemove.length === 0) {
|
|
54
|
-
console.warn("❌
|
|
55
|
+
console.warn("❌ No files can be deleted.");
|
|
55
56
|
return consoleStars();
|
|
56
57
|
}
|
|
57
58
|
const formatteds = safesToRemove.map((key) => {
|
|
58
59
|
return [key, join(root, `${key.replaceAll(".", "/")}.ts`)];
|
|
59
60
|
});
|
|
60
|
-
console.log(`🗑️
|
|
61
|
+
console.log(`🗑️ Deleting files (${safesToRemove.length} files)...`);
|
|
61
62
|
let success = 0;
|
|
62
63
|
const length = formatteds.length;
|
|
63
64
|
formatteds.forEach(([key, path]) => {
|
|
@@ -67,14 +68,14 @@ const remove = (CODEBASE_ANALYSIS, ...paths) => {
|
|
|
67
68
|
file?.set(FILES_PROPERTY, files.filter((key1) => key1 !== key));
|
|
68
69
|
success++;
|
|
69
70
|
} catch {
|
|
70
|
-
console.error(` - ❌
|
|
71
|
+
console.error(` - ❌ Error, ${key} :`);
|
|
71
72
|
}
|
|
72
73
|
});
|
|
73
74
|
file.save();
|
|
74
|
-
console.log(`🗑️
|
|
75
|
+
console.log(`🗑️ Files deleted! (${success}/${length})`);
|
|
75
76
|
file = void 0;
|
|
76
77
|
} catch {
|
|
77
|
-
console.error(`❌
|
|
78
|
+
console.error(`❌ Error while deleting files`);
|
|
78
79
|
consoleStars();
|
|
79
80
|
return false;
|
|
80
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.js","names":[],"sources":["../../src/functions/remove.ts"],"sourcesContent":["import edit, { JsonEditor } from
|
|
1
|
+
{"version":3,"file":"remove.js","names":[],"sources":["../../src/functions/remove.ts"],"sourcesContent":["import edit, { JsonEditor } from 'edit-json-file';\nimport { unlinkSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { config } from '../config';\nimport { FILES_PROPERTY, PATH_PROPERTY } from '../constants';\nimport {\n consoleStars,\n getFolderPath,\n transformModule,\n} from '../helpers';\nimport { CodebaseAnalysis, FileAnalysis } from '../schemas';\n\nconst transformModules = (\n entries: [string, FileAnalysis][],\n ...files: string[]\n) => {\n const cwd = process.cwd();\n const out = entries\n .map(\n ([key, { imports, relativePath }]) =>\n [key, relativePath, imports] as const,\n )\n .map(([key, relativePath, imports]) => {\n const specifiers = imports\n .map(({ moduleSpecifier }) => {\n return transformModule({\n cwd,\n relativePath,\n moduleSpecifier,\n });\n })\n .map(_path => [_path, `${_path}.index`]) // Add .index variants\n .flat()\n .filter(s => files.includes(s));\n\n return [key, Array.from(new Set(specifiers))] as const;\n });\n\n return out;\n};\n\nexport const remove = (\n CODEBASE_ANALYSIS: CodebaseAnalysis,\n ...paths: string[]\n) => {\n const isEmpty = paths.length === 0;\n if (isEmpty) return console.warn('No files specified for removal.');\n try {\n const cwd = process.cwd();\n const json = join(cwd, config.json);\n let file: JsonEditor | undefined = edit(json);\n\n if (!file) return;\n\n const root = getFolderPath(file.get(PATH_PROPERTY) as string);\n const files = file.get(FILES_PROPERTY) as string[];\n\n const entries2 = Object.entries(CODEBASE_ANALYSIS).filter(([key]) =>\n files.includes(key),\n );\n\n const entries = entries2.filter(([key]) =>\n paths.some(p => key.startsWith(p)),\n );\n\n // Check dependencies before deletion\n const safesToRemove: string[] = [];\n const cannotsRemove: [string, string[]][] = [];\n\n entries.forEach(([key]) => {\n const modules = transformModules(entries2, ...files);\n const importedFroms = modules\n .filter(([, specifiers]) => specifiers.includes(key))\n .map(([k]) => k);\n\n const check = importedFroms.length > 0;\n\n console.log('modules', '=>', importedFroms);\n console.log('key', '=>', key);\n\n if (check) return cannotsRemove.push([key, importedFroms]);\n return safesToRemove.push(key);\n });\n\n consoleStars();\n console.log(`🔧 Deleting of files (${entries.length} files)...`);\n\n // Display files that cannot be deleted\n if (cannotsRemove.length > 0) {\n const len = cannotsRemove.length;\n const one = 'file cannot be deleted (imported in other files)';\n const many = 'files cannot be deleted (imported in other files)';\n\n console.warn(`⚠️ ${len} ${len === 1 ? one : many} :`);\n cannotsRemove.forEach(([key, modules]) => {\n console.warn(` - ⚠️ ${key} imported by:`);\n modules.forEach(m => console.warn(` -> 📌 ${m}`));\n });\n }\n\n if (safesToRemove.length === 0) {\n console.warn('❌ No files can be deleted.');\n return consoleStars();\n }\n\n const formatteds = safesToRemove.map(key => {\n const _path = `${key.replaceAll('.', '/')}.ts`;\n const absolute = join(root, _path);\n return [key, absolute] as const;\n });\n\n console.log(`🗑️ Deleting files (${safesToRemove.length} files)...`);\n\n let success = 0;\n const length = formatteds.length;\n\n formatteds.forEach(([key, path]) => {\n try {\n unlinkSync(path);\n console.log(` - 🗑️ ${key}`);\n file?.set(\n FILES_PROPERTY,\n files.filter(key1 => key1 !== key),\n );\n success++;\n } catch {\n console.error(` - ❌ Error, ${key} :`);\n }\n });\n\n file.save();\n console.log(`🗑️ Files deleted! (${success}/${length})`);\n file = undefined;\n } catch {\n console.error(`❌ Error while deleting files`);\n consoleStars();\n return false;\n }\n consoleStars();\n return true;\n};\n"],"mappings":";;;;;;;AAYA,MAAM,oBACJ,SACA,GAAG,UACA;CACH,MAAM,MAAM,QAAQ,IAAI;CAsBxB,OArBY,QACT,KACE,CAAC,KAAK,EAAE,SAAS,oBAChB;EAAC;EAAK;EAAc;CAAO,CAC/B,CAAC,CACA,KAAK,CAAC,KAAK,cAAc,aAAa;EACrC,MAAM,aAAa,QAChB,KAAK,EAAE,sBAAsB;GAC5B,OAAO,gBAAgB;IACrB;IACA;I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C5B,MAAM,MAAM,cAAc;GAI1B,QAAQ,KAAK,OAAO,IAAI,GAAG,QAAQ,IAAI,qDAAM,oDAAK,GAAG;GACrD,cAAc,SAAS,CAAC,KAAK,aAAa;IACxC,QAAQ,KAAK,WAAW,IAAI,cAAc;IAC1C,QAAQ,SAAQ,MAAK,QAAQ,KAAK,aAAa,GAAG,CAAC;GACrD,CAAC;EACH;EAEA,IAAI,cAAc,WAAW,GAAG;GAC9B,QAAQ,KAAK,4BAA4B;GACzC,OAAO,aAAa;EACtB;EAEA,MAAM,aAAa,cAAc,KAAI,QAAO;GAG1C,OAAO,CAAC,KADS,KAAK,MAAM,GADX,IAAI,WAAW,KAAK,GAAG,EAAE,IAEtB,CAAC;EACvB,CAAC;EAED,QAAQ,IAAI,uBAAuB,cAAc,OAAO,WAAW;EAEnE,IAAI,UAAU;EACd,MAAM,SAAS,WAAW;EAE1B,WAAW,SAAS,CAAC,KAAK,UAAU;GAClC,IAAI;IACF,WAAW,IAAI;IACf,QAAQ,IAAI,WAAW,KAAK;IAC5B,MAAM,IACJ,gBACA,MAAM,QAAO,SAAQ,SAAS,GAAG,CACnC;IACA;GACF,QAAQ;IACN,QAAQ,MAAM,gBAAgB,IAAI,GAAG;GACvC;EACF,CAAC;EAED,KAAK,KAAK;EACV,QAAQ,IAAI,uBAAuB,QAAQ,GAAG,OAAO,EAAE;EACvD,OAAO,KAAA;CACT,QAAQ;EACN,QAAQ,MAAM,8BAA8B;EAC5C,aAAa;EACb,OAAO;CACT;CACA,aAAa;CACb,OAAO;AACT"}
|
package/lib/helpers.cjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("./_virtual/_rolldown/runtime.cjs");
|
|
3
2
|
const require_constants = require("./constants.cjs");
|
|
4
3
|
let path = require("path");
|
|
5
4
|
let fs = require("fs");
|
|
@@ -21,7 +20,7 @@ const writeFileAnalysis = (fileAnalysis, folderPath) => {
|
|
|
21
20
|
console.log(` ✅ ${relativePath}`);
|
|
22
21
|
return relativePath.slice(0, -3).replaceAll("/", ".");
|
|
23
22
|
} catch (error) {
|
|
24
|
-
return console.error(` ❌
|
|
23
|
+
return console.error(` ❌ Error for ${relativePath}:`, error);
|
|
25
24
|
}
|
|
26
25
|
};
|
|
27
26
|
const consoleStars = () => {
|
package/lib/helpers.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.cjs","names":[],"sources":["../src/helpers.ts"],"sourcesContent":["import { existsSync, mkdirSync, writeFileSync } from
|
|
1
|
+
{"version":3,"file":"helpers.cjs","names":[],"sources":["../src/helpers.ts"],"sourcesContent":["import { existsSync, mkdirSync, writeFileSync } from 'node:fs';\nimport { dirname, join, relative, resolve } from 'node:path';\nimport { REPLACERS } from './constants';\nimport { FileAnalysis } from './schemas';\n\nexport type TransformModuleArgs = {\n cwd?: string;\n relativePath: string;\n moduleSpecifier: string;\n};\n\nexport const transformModule = ({\n cwd = process.cwd(),\n relativePath,\n moduleSpecifier,\n}: TransformModuleArgs) => {\n const out = relative(\n cwd,\n resolve(dirname(relativePath), moduleSpecifier),\n ).replaceAll('/', '.');\n\n return out;\n};\n\nexport const writeFileAnalysis = (\n fileAnalysis: FileAnalysis,\n folderPath: string,\n) => {\n const relativePath = fileAnalysis.relativePath;\n\n // Create the destination path in .bemedev maintaining the structure\n const destPath = join(folderPath, relativePath);\n const destDir = dirname(destPath);\n\n try {\n // Create the destination folder if necessary\n mkdirSync(destDir, { recursive: true });\n\n let fileContent = fileAnalysis.text;\n REPLACERS.init.forEach(([search, replace]) => {\n fileContent = fileContent.replaceAll(search, replace);\n });\n\n // Write the types file content\n writeFileSync(destPath, fileContent, 'utf8');\n\n console.log(` ✅ ${relativePath}`);\n return relativePath.slice(0, -3).replaceAll('/', '.');\n } catch (error) {\n return console.error(` ❌ Error for ${relativePath}:`, error);\n }\n};\n\nexport const consoleStars = () => {\n console.log();\n console.log('*'.repeat(30));\n console.log();\n};\n\nexport const toArray = <T>(value?: T | T[]): T[] => {\n return Array.isArray(value) ? value : !value ? [] : [value];\n};\n\nexport const getFolderPath = (root: string) => {\n const cwd = process.cwd();\n const srcExists = existsSync(join(cwd, 'src'));\n const folderPath = srcExists\n ? join(cwd, 'src', root)\n : join(cwd, root);\n\n return folderPath;\n};\n"],"mappings":";;;;;AAWA,MAAa,mBAAmB,EAC9B,MAAM,QAAQ,IAAI,GAClB,cACA,sBACyB;CAMzB,QAAA,GAAA,KAAA,SAAA,CAJE,MAAA,GAAA,KAAA,QAAA,EAAA,GAAA,KAAA,QAAA,CACgB,YAAY,GAAG,eAAe,CAChD,CAAC,CAAC,WAAW,KAAK,GAET;AACX;AAEA,MAAa,qBACX,cACA,eACG;CACH,MAAM,eAAe,aAAa;CAGlC,MAAM,YAAA,GAAA,KAAA,KAAA,CAAgB,YAAY,YAAY;CAC9C,MAAM,WAAA,GAAA,KAAA,QAAA,CAAkB,QAAQ;CAEhC,IAAI;EAEF,CAAA,GAAA,GAAA,UAAA,CAAU,SAAS,EAAE,WAAW,KAAK,CAAC;EAEtC,IAAI,cAAc,aAAa;EAC/B,kBAAA,UAAU,KAAK,SAAS,CAAC,QAAQ,aAAa;GAC5C,cAAc,YAAY,WAAW,QAAQ,OAAO;EACtD,CAAC;EAGD,CAAA,GAAA,GAAA,cAAA,CAAc,UAAU,aAAa,MAAM;EAE3C,QAAQ,IAAI,OAAO,cAAc;EACjC,OAAO,aAAa,MAAM,GAAG,EAAE,CAAC,CAAC,WAAW,KAAK,GAAG;CACtD,SAAS,OAAO;EACd,OAAO,QAAQ,MAAM,iBAAiB,aAAa,IAAI,KAAK;CAC9D;AACF;AAEA,MAAa,qBAAqB;CAChC,QAAQ,IAAI;CACZ,QAAQ,IAAI,IAAI,OAAO,EAAE,CAAC;CAC1B,QAAQ,IAAI;AACd;AAEA,MAAa,WAAc,UAAyB;CAClD,OAAO,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK;AAC5D;AAEA,MAAa,iBAAiB,SAAiB;CAC7C,MAAM,MAAM,QAAQ,IAAI;CAMxB,QAAA,GAAA,GAAA,WAAA,EAAA,GAAA,KAAA,KAAA,CALkC,KAAK,KAAK,CACjB,KAAA,GAAA,KAAA,KAAA,CAClB,KAAK,OAAO,IAAI,KAAA,GAAA,KAAA,KAAA,CAChB,KAAK,IAAI;AAGpB"}
|
package/lib/helpers.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { FileAnalysis } from
|
|
1
|
+
import { FileAnalysis } from './schemas';
|
|
2
2
|
export type TransformModuleArgs = {
|
|
3
3
|
cwd?: string;
|
|
4
4
|
relativePath: string;
|
|
5
5
|
moduleSpecifier: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const transformModule: ({ cwd, relativePath, moduleSpecifier, }: TransformModuleArgs) =>
|
|
8
|
-
export declare const writeFileAnalysis: (fileAnalysis: FileAnalysis, folderPath: string) =>
|
|
7
|
+
export declare const transformModule: ({ cwd, relativePath, moduleSpecifier, }: TransformModuleArgs) => string;
|
|
8
|
+
export declare const writeFileAnalysis: (fileAnalysis: FileAnalysis, folderPath: string) => string | void;
|
|
9
9
|
export declare const consoleStars: () => void;
|
|
10
10
|
export declare const toArray: <T>(value?: T | T[]) => T[];
|
|
11
11
|
export declare const getFolderPath: (root: string) => string;
|
|
12
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,yCAI7B,mBAAmB,WAOrB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,cAAc,YAAY,EAC1B,YAAY,MAAM,kBAyBnB,CAAC;AAEF,eAAO,MAAM,YAAY,YAIxB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAG,CAAC,EAE7C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,WAQzC,CAAC"}
|