opencode-navigator 0.20.0 → 0.21.1

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.
@@ -60,7 +60,8 @@ export async function updateLocalSnapshot(wrapper, target, operations = {}) {
60
60
  if (target === version) return
61
61
 
62
62
  await validate(previous, version)
63
- const dependencies = JSON.parse(await readFile(join(previous, 'package.json'), 'utf8')).dependencies
63
+ const previousMetadata = JSON.parse(await readFile(join(previous, 'package.json'), 'utf8'))
64
+ const dependencies = previousMetadata.dependencies
64
65
 
65
66
  if (!dependencies?.['@opentui/core'] || !dependencies['@opentui/solid'] || !dependencies['solid-js'])
66
67
  throw new Error('Pinned Navigator runtime dependencies are missing')
@@ -99,20 +100,21 @@ export async function updateLocalSnapshot(wrapper, target, operations = {}) {
99
100
  private: true,
100
101
  type: 'module',
101
102
  dependencies,
103
+ optionalDependencies: { ...previousMetadata.optionalDependencies, ...metadata.optionalDependencies },
102
104
  }),
103
105
  )
104
106
 
105
- if (operations.install) await operations.install(staging)
106
- else
107
- await command('npm', [
108
- 'install',
109
- '--prefix',
110
- staging,
111
- '--omit=dev',
112
- '--ignore-scripts',
113
- '--no-package-lock',
114
- '--legacy-peer-deps',
115
- ])
107
+ await (operations.install
108
+ ? operations.install(staging)
109
+ : command('npm', [
110
+ 'install',
111
+ '--prefix',
112
+ staging,
113
+ '--omit=dev',
114
+ '--ignore-scripts',
115
+ '--no-package-lock',
116
+ '--legacy-peer-deps',
117
+ ]))
116
118
 
117
119
  await validate(staging, target)
118
120