ADR-013 Phase 4: all 13 plugin frontends relocated + staging machinery
This commit is contained in:
@@ -45,11 +45,11 @@ const childParts = []
|
||||
const topParts = []
|
||||
for (const name of chosen) {
|
||||
const id = 'p_' + name.replace(/[^a-zA-Z0-9]/g, '_')
|
||||
lines.push(
|
||||
`import ${id}Default, { toplevel as ${id}Top } from `
|
||||
+ `'../.plugins-staged/${name}/routes.js'`)
|
||||
childParts.push(`...(${id}Default || [])`)
|
||||
topParts.push(`...(${id}Top || [])`)
|
||||
// Namespace import so a route file without a `toplevel` export is not a
|
||||
// (strict ESM) build error - the binding is just undefined on the namespace.
|
||||
lines.push(`import * as ${id} from '../.plugins-staged/${name}/routes.js'`)
|
||||
childParts.push(`...(${id}.default || [])`)
|
||||
topParts.push(`...(${id}.toplevel || [])`)
|
||||
}
|
||||
lines.push('')
|
||||
lines.push(`export const stagedChildren = [${childParts.join(', ')}]`)
|
||||
|
||||
Reference in New Issue
Block a user