@teardown/navigation-metro 2.0.77 → 2.0.78
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/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/package.json +2 -2
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoHH;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE;QACV,cAAc,CAAC,EAAE,CAChB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,KACnB;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,GAAG,IAAI,CAAC;QAC/C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACvB,CAAC;IACF,WAAW,CAAC,EAAE;QACb,4BAA4B,CAAC,EAAE,OAAO,CAAC;QACvC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACvB,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,GAAE,yBAA8B,GAAG,WAAW,CAqFhH;AAED,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAChG,OAAO,EACN,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,aAAa,EACb,mBAAmB,GACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EACf,WAAW,EACX,iBAAiB,GACjB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -45,6 +45,10 @@ function readTeardownConfig(projectRoot) {
|
|
|
45
45
|
if (autoTemplateMatch) {
|
|
46
46
|
config.autoTemplate = autoTemplateMatch[1] === "true";
|
|
47
47
|
}
|
|
48
|
+
const verboseMatch = content.match(/verbose:\s*(true|false)/);
|
|
49
|
+
if (verboseMatch) {
|
|
50
|
+
config.verbose = verboseMatch[1] === "true";
|
|
51
|
+
}
|
|
48
52
|
return config;
|
|
49
53
|
}
|
|
50
54
|
catch {
|
|
@@ -66,12 +70,17 @@ function readSlugFromConfig(projectRoot) {
|
|
|
66
70
|
*/
|
|
67
71
|
function populateEmptyRouteFiles(routesDir, verbose) {
|
|
68
72
|
const files = (0, file_scanner_1.findRouteFiles)(routesDir);
|
|
73
|
+
if (verbose) {
|
|
74
|
+
console.log(`[teardown/navigation] Scanning ${files.length} route files for empty templates`);
|
|
75
|
+
}
|
|
76
|
+
let populatedCount = 0;
|
|
69
77
|
for (const file of files) {
|
|
70
78
|
const absolutePath = (0, node_path_1.join)(routesDir, file);
|
|
71
79
|
if ((0, route_templates_1.isFileEmpty)(absolutePath)) {
|
|
72
80
|
try {
|
|
73
81
|
const templateContent = (0, route_templates_1.generateRouteTemplate)(file);
|
|
74
82
|
(0, node_fs_1.writeFileSync)(absolutePath, templateContent);
|
|
83
|
+
populatedCount++;
|
|
75
84
|
if (verbose) {
|
|
76
85
|
console.log(`[teardown/navigation] Generated template for: ${file}`);
|
|
77
86
|
}
|
|
@@ -83,6 +92,9 @@ function populateEmptyRouteFiles(routesDir, verbose) {
|
|
|
83
92
|
}
|
|
84
93
|
}
|
|
85
94
|
}
|
|
95
|
+
if (verbose && populatedCount === 0 && files.length > 0) {
|
|
96
|
+
console.log(`[teardown/navigation] All ${files.length} route files already have content`);
|
|
97
|
+
}
|
|
86
98
|
}
|
|
87
99
|
/**
|
|
88
100
|
* Wraps a Metro configuration with Teardown Navigation support
|
|
@@ -120,7 +132,7 @@ function withTeardownNavigation(config, options = {}) {
|
|
|
120
132
|
const routesDir = options.routesDir ?? teardownConfig?.routesDir ?? "./src/_routes";
|
|
121
133
|
const generatedDir = options.generatedDir ?? teardownConfig?.generatedDir ?? "./.teardown";
|
|
122
134
|
const autoTemplate = options.autoTemplate ?? teardownConfig?.autoTemplate ?? true;
|
|
123
|
-
const verbose = options.verbose ?? false;
|
|
135
|
+
const verbose = options.verbose ?? teardownConfig?.verbose ?? false;
|
|
124
136
|
const usePolling = options.usePolling ?? false;
|
|
125
137
|
const absoluteRoutesDir = (0, node_path_1.resolve)(projectRoot, routesDir);
|
|
126
138
|
const absoluteGeneratedDir = (0, node_path_1.resolve)(projectRoot, generatedDir);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teardown/navigation-metro",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.78",
|
|
4
4
|
"description": "Metro plugin for @teardown/navigation type generation",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@biomejs/biome": "2.3.11",
|
|
45
|
-
"@teardown/tsconfig": "2.0.
|
|
45
|
+
"@teardown/tsconfig": "2.0.78",
|
|
46
46
|
"@types/node": "24.10.1",
|
|
47
47
|
"typescript": "5.9.3"
|
|
48
48
|
}
|