@fudrouter/fsrouter 0.6.53 → 0.6.54
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/bin/copyJs.js +18 -0
- package/package.json +1 -1
package/bin/copyJs.js
CHANGED
|
@@ -58,6 +58,24 @@ function rewriteImports(content, filePath, isJsCopy = false) {
|
|
|
58
58
|
updated = updated.replace(/\.\.\/\.\.\/\.\.\/src\//g, '../../../');
|
|
59
59
|
updated = updated.replace(/\.\.\/\.\.\/src\//g, '../../');
|
|
60
60
|
|
|
61
|
+
// 4. Fix open-sse files referencing ../../../src/lib/* or ./src/lib/*
|
|
62
|
+
// (these are copied to dist/open-sse/, so they need to resolve to ../../dist/lib/*)
|
|
63
|
+
updated = updated.replace(/['"]\.\.\/\.\.\/\.\.\/src\/lib\/([^'"]+)['"]/g, (m, imp) => {
|
|
64
|
+
const resolved = imp.endsWith('.js') ? imp : imp + '.js';
|
|
65
|
+
return `'../../dist/lib/${resolved}'`;
|
|
66
|
+
});
|
|
67
|
+
updated = updated.replace(/import\(\s*['"]\.\.\/\.\.\/\.\.\/src\/lib\/([^'"]+)['"]\s*\)/g, (m, imp) => {
|
|
68
|
+
const resolved = imp.endsWith('.js') ? imp : imp + '.js';
|
|
69
|
+
return `import('../../dist/lib/${resolved}')`;
|
|
70
|
+
});
|
|
71
|
+
updated = updated.replace(/['"]\.\.\/\.\.\/src\/lib\/([^'"]+)['"]/g, (m, imp) => {
|
|
72
|
+
const resolved = imp.endsWith('.js') ? imp : imp + '.js';
|
|
73
|
+
return `'../../../dist/lib/${resolved}'`;
|
|
74
|
+
});
|
|
75
|
+
updated = updated.replace(/import\(\s*['"]\.\.\/\.\.\/src\/lib\/([^'"]+)['"]\s*\)/g, (m, imp) => {
|
|
76
|
+
const resolved = imp.endsWith('.js') ? imp : imp + '.js';
|
|
77
|
+
return `import('../../../dist/lib/${resolved}')`;
|
|
78
|
+
});
|
|
61
79
|
// Specific fix for tokenRefresh/providers
|
|
62
80
|
if (filePath.includes('tokenRefresh')) {
|
|
63
81
|
updated = updated.replace(/\.\.\/\.\.\/\.\.\/dist\/lib\/oauth\/kiroExternalIdp.js/g, '../../../dist/lib/oauth/kiroExternalIdp.js');
|