probe-shell-compile.mjs 1.3 KB

1234567891011121314151617181920
  1. // t64 K 组补充:外壳 CockpitShell.vue 的 script 也必须编译过(本票改了它的 panelViewOf 分支)。
  2. import assert from 'node:assert/strict'
  3. import { readFileSync } from 'node:fs'
  4. import { parse, compileScript, compileTemplate } from '@vue/compiler-sfc'
  5. // artifacts/t64 → artifacts → verify → effort → .scratch → repo root(5 级)
  6. const rel = '../../../../../src/modules/cockpit/CockpitShell.vue'
  7. const source = readFileSync(new URL(rel, import.meta.url), 'utf8')
  8. const { descriptor, errors } = parse(source, { filename: 'CockpitShell.vue' })
  9. assert.deepEqual(errors, [], 'CockpitShell parse')
  10. const script = compileScript(descriptor, { id: 't64' })
  11. const template = compileTemplate({
  12. source: descriptor.template.content, filename: 'CockpitShell.vue', id: 't64',
  13. compilerOptions: { bindingMetadata: script.bindings },
  14. })
  15. assert.deepEqual(template.errors, [], 'CockpitShell template')
  16. console.log('PASS CockpitShell.vue script+template 编译通过')
  17. // 本票接线:operation 面板要吃到当前片区键(换片区复位判据)
  18. assert.ok(/panelId === 'operation'\) extra = \{ scope: scope\.value \}/.test(source), '外壳没把 scope 传给运行信息面板')
  19. console.log('PASS 外壳把 scope 传给运行信息面板(换片区复位判据的输入)')