aaex-file-router 1.3.1 → 1.3.2
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 +1 -1
- package/dist/core/FileScanner.d.ts +11 -1
- package/dist/core/FileScanner.d.ts.map +1 -1
- package/dist/core/FileScanner.js +23 -8
- package/dist/core/FileScanner.js.map +1 -1
- package/dist/core/RouteGenerator.d.ts +13 -13
- package/dist/core/RouteGenerator.d.ts.map +1 -1
- package/dist/core/RouteGenerator.js +65 -78
- package/dist/core/RouteGenerator.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,10 +10,20 @@ export declare class FileScanner {
|
|
|
10
10
|
constructor(pages_dir: string);
|
|
11
11
|
/**
|
|
12
12
|
* Recursively scan directory and return nested FileData
|
|
13
|
+
* - Scans files of a given folder
|
|
14
|
+
* - converts and returns as usable data
|
|
15
|
+
* - Format:
|
|
16
|
+
* {name: string,
|
|
17
|
+
* relative_path: string,
|
|
18
|
+
* parent_path: string,
|
|
19
|
+
* isDirectory: string
|
|
20
|
+
* }
|
|
21
|
+
* @param dir string
|
|
22
|
+
* @returns FileData[]
|
|
13
23
|
*/
|
|
14
24
|
private scan_files;
|
|
15
25
|
/**
|
|
16
|
-
* Public
|
|
26
|
+
* Public file point: returns nested FileData structure
|
|
17
27
|
*/
|
|
18
28
|
get_file_data(): Promise<FileData[]>;
|
|
19
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileScanner.d.ts","sourceRoot":"","sources":["../../src/core/FileScanner.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED,qBAAa,WAAW;IACtB,QAAQ,EAAE,MAAM,CAAC;gBAEL,SAAS,EAAE,MAAM;IAI7B
|
|
1
|
+
{"version":3,"file":"FileScanner.d.ts","sourceRoot":"","sources":["../../src/core/FileScanner.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED,qBAAa,WAAW;IACtB,QAAQ,EAAE,MAAM,CAAC;gBAEL,SAAS,EAAE,MAAM;IAI7B;;;;;;;;;;;;OAYG;YACW,UAAU;IA+BxB;;OAEG;IACU,aAAa,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;CAKlD"}
|
package/dist/core/FileScanner.js
CHANGED
|
@@ -7,21 +7,36 @@ export class FileScanner {
|
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Recursively scan directory and return nested FileData
|
|
10
|
+
* - Scans files of a given folder
|
|
11
|
+
* - converts and returns as usable data
|
|
12
|
+
* - Format:
|
|
13
|
+
* {name: string,
|
|
14
|
+
* relative_path: string,
|
|
15
|
+
* parent_path: string,
|
|
16
|
+
* isDirectory: string
|
|
17
|
+
* }
|
|
18
|
+
* @param dir string
|
|
19
|
+
* @returns FileData[]
|
|
10
20
|
*/
|
|
11
21
|
async scan_files(dir) {
|
|
12
|
-
|
|
22
|
+
//scans the parent folder and outputs an array of files
|
|
23
|
+
const files = await fs.readdir(dir, { withFileTypes: true });
|
|
13
24
|
const result = [];
|
|
14
|
-
for (const
|
|
15
|
-
const fullPath = path.join(dir,
|
|
16
|
-
const relativePath = path
|
|
25
|
+
for (const file of files) {
|
|
26
|
+
const fullPath = path.join(dir, file.name);
|
|
27
|
+
const relativePath = path
|
|
28
|
+
.relative(process.cwd(), fullPath)
|
|
29
|
+
.replace(/\\/g, "/");
|
|
17
30
|
const parentPath = path.relative(process.cwd(), dir).replace(/\\/g, "/") + "/";
|
|
31
|
+
// convert to usable data
|
|
18
32
|
const fileData = {
|
|
19
|
-
name:
|
|
33
|
+
name: file.name,
|
|
20
34
|
relative_path: relativePath,
|
|
21
35
|
parent_path: parentPath,
|
|
22
|
-
isDirectory:
|
|
36
|
+
isDirectory: file.isDirectory(),
|
|
23
37
|
};
|
|
24
|
-
|
|
38
|
+
//recurivly scan directories for more files
|
|
39
|
+
if (file.isDirectory()) {
|
|
25
40
|
fileData.children = await this.scan_files(fullPath);
|
|
26
41
|
}
|
|
27
42
|
result.push(fileData);
|
|
@@ -29,7 +44,7 @@ export class FileScanner {
|
|
|
29
44
|
return result;
|
|
30
45
|
}
|
|
31
46
|
/**
|
|
32
|
-
* Public
|
|
47
|
+
* Public file point: returns nested FileData structure
|
|
33
48
|
*/
|
|
34
49
|
async get_file_data() {
|
|
35
50
|
const fullDir = path.join(process.cwd(), this.page_dir);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileScanner.js","sourceRoot":"","sources":["../../src/core/FileScanner.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"FileScanner.js","sourceRoot":"","sources":["../../src/core/FileScanner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAUxB,MAAM,OAAO,WAAW;IACtB,QAAQ,CAAS;IAEjB,YAAY,SAAiB;QAC3B,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC5B,CAAC;IAED;;;;;;;;;;;;OAYG;IACK,KAAK,CAAC,UAAU,CAAC,GAAW;QAClC,uDAAuD;QACvD,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7D,MAAM,MAAM,GAAe,EAAE,CAAC;QAE9B,KAAK,M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
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
/** Converts filenames/folders to URL-friendly paths, e.g., [id] -> :id */
|
|
12
|
+
private normalizeSegment;
|
|
13
|
+
/** Converts string to PascalCase for React component names */
|
|
14
|
+
private toPascal;
|
|
15
|
+
/** Adds import statement for codegen, avoiding duplicates */
|
|
16
|
+
private addImport;
|
|
17
|
+
/** Generates PascalCase import name, handles nested index files */
|
|
18
|
+
private getImportName;
|
|
19
|
+
private createDirectoryRoute;
|
|
20
|
+
private createFileRoute;
|
|
21
|
+
/** Converts file tree to nested RouteConfig array */
|
|
16
22
|
private fileDataToRoutes;
|
|
17
|
-
/**
|
|
18
|
-
* Generates a React Router routes file as a string
|
|
19
|
-
* @param fileData - FileData-like tree
|
|
20
|
-
*/
|
|
23
|
+
/** Generates a TypeScript routes file as a string */
|
|
21
24
|
generateRoutesFile(fileData: FileNode[]): Promise<string>;
|
|
22
|
-
/**
|
|
23
|
-
* Generates TypeScript type definition for all route paths
|
|
24
|
-
* @param fileData - FileData-like tree
|
|
25
|
-
*/
|
|
25
|
+
/** Generates a TypeScript union type for all routes */
|
|
26
26
|
generateRoutesTypeDef(fileData: FileNode[]): Promise<string>;
|
|
27
27
|
}
|
|
28
28
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteGenerator.d.ts","sourceRoot":"","sources":["../../src/core/RouteGenerator.ts"],"names":[],"mappings":"AAMA,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,eAAe,CAAgB;IACvC,OAAO,CAAC,SAAS,CAA0B;
|
|
1
|
+
{"version":3,"file":"RouteGenerator.d.ts","sourceRoot":"","sources":["../../src/core/RouteGenerator.ts"],"names":[],"mappings":"AAMA,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,eAAe,CAAgB;IACvC,OAAO,CAAC,SAAS,CAA0B;IAI3C,0EAA0E;IAC1E,OAAO,CAAC,gBAAgB;IAIxB,8DAA8D;IAC9D,OAAO,CAAC,QAAQ;IAMhB,6DAA6D;IAC7D,OAAO,CAAC,SAAS;IAQjB,mEAAmE;IACnE,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,oBAAoB;IA0B5B,OAAO,CAAC,eAAe;IAmBvB,qDAAqD;IACrD,OAAO,CAAC,gBAAgB;IAcxB,qDAAqD;IACxC,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAuBtE,uDAAuD;IAC1C,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;CA6B1E"}
|
|
@@ -1,87 +1,77 @@
|
|
|
1
1
|
export class RouteGenerator {
|
|
2
2
|
topLevelImports = [];
|
|
3
|
-
importSet = new Set();
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const toPascal = (str) => str
|
|
3
|
+
importSet = new Set(); // avoids duplicate imports
|
|
4
|
+
// ---------------- Helpers ----------------
|
|
5
|
+
/** Converts filenames/folders to URL-friendly paths, e.g., [id] -> :id */
|
|
6
|
+
normalizeSegment(name) {
|
|
7
|
+
return name.replace(/\[([^\]]+)\]/g, ":$1").toLowerCase();
|
|
8
|
+
}
|
|
9
|
+
/** Converts string to PascalCase for React component names */
|
|
10
|
+
toPascal(str) {
|
|
11
|
+
return str
|
|
13
12
|
.replace(/\[|\]/g, "")
|
|
14
13
|
.replace(/(^\w|[-_]\w)/g, (m) => m.replace(/[-_]/, "").toUpperCase());
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
else {
|
|
49
|
-
const nameWithoutExt = file.name.replace(/\.[jt]sx?$/, "");
|
|
50
|
-
const isIndex = nameWithoutExt.toLowerCase() === "index";
|
|
51
|
-
// If child, path is relative; otherwise, top-level gets full path
|
|
52
|
-
let pathSegment = isIndex ? "" : normalizeSegment(nameWithoutExt);
|
|
53
|
-
if (isChild) {
|
|
54
|
-
// Children always use relative paths
|
|
55
|
-
pathSegment = pathSegment;
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
pathSegment = parentPath
|
|
59
|
-
? `${parentPath}/${pathSegment}`
|
|
60
|
-
: pathSegment;
|
|
61
|
-
}
|
|
62
|
-
const importName = getImportName(file, parentPath);
|
|
63
|
-
;
|
|
64
|
-
const importPath = `./${file.relative_path.replace(/^src[\/\\]/, "")}`;
|
|
65
|
-
if (!this.importSet.has(file.relative_path)) {
|
|
66
|
-
this.topLevelImports.push(`import ${importName} from '${importPath}';`);
|
|
67
|
-
this.importSet.add(file.relative_path);
|
|
68
|
-
}
|
|
69
|
-
routes.push({
|
|
70
|
-
path: pathSegment,
|
|
71
|
-
element: `React.createElement(${importName})`,
|
|
72
|
-
});
|
|
14
|
+
}
|
|
15
|
+
/** Adds import statement for codegen, avoiding duplicates */
|
|
16
|
+
addImport(file, importName) {
|
|
17
|
+
if (!this.importSet.has(file.relative_path)) {
|
|
18
|
+
const importPath = `./${file.relative_path.replace(/^src[\/\\]/, "")}`;
|
|
19
|
+
this.topLevelImports.push(`import ${importName} from '${importPath}';`);
|
|
20
|
+
this.importSet.add(file.relative_path);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** Generates PascalCase import name, handles nested index files */
|
|
24
|
+
getImportName(file, parentPath) {
|
|
25
|
+
const nameWithoutExt = file.name.replace(/\.[jt]sx?$/, "");
|
|
26
|
+
if (nameWithoutExt.toLowerCase() === "index" && parentPath) {
|
|
27
|
+
const segments = parentPath.split("/").filter(Boolean);
|
|
28
|
+
return this.toPascal(segments.join("")) + "Index";
|
|
29
|
+
}
|
|
30
|
+
return this.toPascal(nameWithoutExt);
|
|
31
|
+
}
|
|
32
|
+
// ---------------- Route Creation ----------------
|
|
33
|
+
createDirectoryRoute(file) {
|
|
34
|
+
const route = { path: this.normalizeSegment(file.name) };
|
|
35
|
+
// Use layout if present
|
|
36
|
+
const layout = file.children?.find((f) => !f.isDirectory && /^layout\.(tsx|jsx|ts|js)$/i.test(f.name));
|
|
37
|
+
if (layout) {
|
|
38
|
+
const importName = `${this.toPascal(file.name)}Layout`;
|
|
39
|
+
this.addImport(layout, importName);
|
|
40
|
+
route.element = `React.createElement(${importName})`;
|
|
41
|
+
}
|
|
42
|
+
// Recursively add children routes
|
|
43
|
+
if (file.children?.length) {
|
|
44
|
+
const children = file.children.filter((f) => !/^layout\.(tsx|jsx|ts|js)$/i.test(f.name));
|
|
45
|
+
if (children.length) {
|
|
46
|
+
route.children = this.fileDataToRoutes(children, route.path, true);
|
|
73
47
|
}
|
|
74
48
|
}
|
|
75
|
-
return
|
|
49
|
+
return route;
|
|
50
|
+
}
|
|
51
|
+
createFileRoute(file, parentPath, isChild) {
|
|
52
|
+
const nameWithoutExt = file.name.replace(/\.[jt]sx?$/, "");
|
|
53
|
+
const isIndex = nameWithoutExt.toLowerCase() === "index";
|
|
54
|
+
let pathSegment = isIndex ? "" : this.normalizeSegment(nameWithoutExt);
|
|
55
|
+
if (!isChild && parentPath)
|
|
56
|
+
pathSegment = `${parentPath}/${pathSegment}`;
|
|
57
|
+
const importName = this.getImportName(file, parentPath);
|
|
58
|
+
this.addImport(file, importName);
|
|
59
|
+
return { path: pathSegment, element: `React.createElement(${importName})` };
|
|
60
|
+
}
|
|
61
|
+
// ---------------- Recursion ----------------
|
|
62
|
+
/** Converts file tree to nested RouteConfig array */
|
|
63
|
+
fileDataToRoutes(files, parentPath = "", isChild = false) {
|
|
64
|
+
return files.map((file) => file.isDirectory
|
|
65
|
+
? this.createDirectoryRoute(file)
|
|
66
|
+
: this.createFileRoute(file, parentPath, isChild));
|
|
76
67
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
* @param fileData - FileData-like tree
|
|
80
|
-
*/
|
|
68
|
+
// ---------------- Code Generation ----------------
|
|
69
|
+
/** Generates a TypeScript routes file as a string */
|
|
81
70
|
async generateRoutesFile(fileData) {
|
|
82
71
|
this.topLevelImports = [];
|
|
83
|
-
this.importSet
|
|
72
|
+
this.importSet.clear();
|
|
84
73
|
const routes = this.fileDataToRoutes(fileData);
|
|
74
|
+
// Replace quotes around element strings with actual React code
|
|
85
75
|
const routesString = JSON.stringify(routes, null, 2).replace(/"React\.createElement\((\w+)\)"/g, "React.createElement($1)");
|
|
86
76
|
return `//* AUTO GENERATED: DO NOT EDIT
|
|
87
77
|
import React from 'react';
|
|
@@ -93,10 +83,7 @@ const routes: RouteObject[] = ${routesString};
|
|
|
93
83
|
export default routes;
|
|
94
84
|
`;
|
|
95
85
|
}
|
|
96
|
-
/**
|
|
97
|
-
* Generates TypeScript type definition for all route paths
|
|
98
|
-
* @param fileData - FileData-like tree
|
|
99
|
-
*/
|
|
86
|
+
/** Generates a TypeScript union type for all routes */
|
|
100
87
|
async generateRoutesTypeDef(fileData) {
|
|
101
88
|
const routes = this.fileDataToRoutes(fileData);
|
|
102
89
|
const paths = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteGenerator.js","sourceRoot":"","sources":["../../src/core/RouteGenerator.ts"],"names":[],"mappings":"AAcA,MAAM,OAAO,cAAc;IACjB,eAAe,GAAa,EAAE,CAAC;IAC/B,SAAS,GAAgB,IAAI,GAAG,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"RouteGenerator.js","sourceRoot":"","sources":["../../src/core/RouteGenerator.ts"],"names":[],"mappings":"AAcA,MAAM,OAAO,cAAc;IACjB,eAAe,GAAa,EAAE,CAAC;IAC/B,SAAS,GAAgB,IAAI,GAAG,EAAE,CAAC,CAAC,2BAA2B;IAEvE,4CAA4C;IAE5C,0EAA0E;IAClE,gBAAgB,CAAC,IAAY;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5D,CAAC;IAED,8DAA8D;IACtD,QAAQ,CAAC,GAAW;QAC1B,OAAO,GAAG;aACP,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;aACrB,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,6DAA6D;IACrD,SAAS,CAAC,IAAc,EAAE,UAAkB;QAClD,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;YAC5C,MAAM,UAAU,GAAG,KAAK,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,EAAE,CAAC;YACvE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,UAAU,UAAU,UAAU,IA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G,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;qBACvD,IAAI,CAAC,GAAG,CAAC,CAAC;gBACb,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACnB,IAAI,KAAK,CAAC,QAAQ;oBAAE,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC,CAAC;QAEF,YAAY,CAAC,MAAM,CAAC,CAAC;QAErB,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;aAC3C,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;aACtB,IAAI,CAAC,KAAK,CAAC,CAAC;QAEf,OAAO;;2BAEgB,WAAW;CACrC,CAAC;IACA,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aaex-file-router",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "A file-based routing system for React projects that automatically generates routes from your file structure. Similar to Next.js App Router or Remix file conventions.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|