@@ -19,6 +19,7 @@ import type { ConfigurationHint } from './types/issues.ts';
1919import type { PluginName } from './types/PluginNames.ts' ;
2020import type { PackageJson } from './types/package-json.ts' ;
2121import type { DependencySet } from './types/workspace.ts' ;
22+ import { createManifest , type Manifest } from './util/package-json.ts' ;
2223import { collectStringLiterals , isExternalReExportsOnly } from './typescript/ast-helpers.ts' ;
2324import { parseFile } from './typescript/visitors/helpers.ts' ;
2425import { compact } from './util/array.ts' ;
@@ -50,7 +51,7 @@ type WorkspaceManagerOptions = {
5051 config : WorkspaceConfiguration ;
5152 manifest : PackageJson ;
5253 dependencies : DependencySet ;
53- rootManifest : PackageJson | undefined ;
54+ rootManifest : Manifest | undefined ;
5455 handleInput : HandleInput ;
5556 findWorkspaceByFilePath : ( filePath : string ) => Workspace | undefined ;
5657 readFile : ( filePath : string ) => string ;
@@ -80,8 +81,8 @@ export class WorkspaceWorker {
8081 name : string ;
8182 dir : string ;
8283 config : WorkspaceConfiguration ;
83- manifest : PackageJson ;
84- rootManifest : PackageJson | undefined ;
84+ manifest : Manifest ;
85+ rootManifest : Manifest | undefined ;
8586 dependencies : DependencySet ;
8687 handleInput : HandleInput ;
8788 findWorkspaceByFilePath : ( filePath : string ) => Workspace | undefined ;
@@ -118,7 +119,7 @@ export class WorkspaceWorker {
118119 this . name = name ;
119120 this . dir = dir ;
120121 this . config = config ;
121- this . manifest = manifest ;
122+ this . manifest = createManifest ( manifest ) ;
122123 this . rootManifest = rootManifest ;
123124 this . dependencies = dependencies ;
124125 this . negatedWorkspacePatterns = negatedWorkspacePatterns ;
@@ -296,12 +297,11 @@ export class WorkspaceWorker {
296297 const isProduction = this . options . isProduction ;
297298 const knownBinsOnly = false ;
298299
299- const manifestScriptNames = new Set ( Object . keys ( manifest . scripts ?? { } ) ) ;
300300 const rootManifest = this . rootManifest ;
301- const baseOptions = { manifestScriptNames , rootManifest, cwd, rootCwd, containingFilePath, knownBinsOnly } ;
301+ const baseOptions = { manifest , rootManifest, cwd, rootCwd, containingFilePath, knownBinsOnly } ;
302302
303303 // Get dependencies from package.json#scripts
304- const baseScriptOptions = { ...baseOptions , manifest , isProduction, enabledPlugins : this . enabledPlugins } ;
304+ const baseScriptOptions = { ...baseOptions , isProduction, enabledPlugins : this . enabledPlugins } ;
305305 const [ productionScripts , developmentScripts ] = getFilteredScripts ( manifest . scripts ?? { } ) ;
306306 const inputsFromManifest = _getInputsFromScripts ( Object . values ( developmentScripts ) , baseOptions ) ;
307307 const productionInputsFromManifest = _getInputsFromScripts ( Object . values ( productionScripts ) , baseOptions ) ;
0 commit comments