Skip to content

Improve the parsing of workspaces #90

@Vanisper

Description

@Vanisper

Clear and concise description of the problem

In package.json - schema, the workspaces should be able to be an object.

Image

However, our project only considered it as a string array.

// check npm/bun workspace config
if (fsSync.existsSync('package.json')) {
const packageJson = await fs.readFile('package.json', 'utf8').then(JSON.parse) as { workspaces?: string[] }
workspaces.push(...(packageJson.workspaces ?? []))
}

Suggested solution

According to the scheme, improve the parsing process.

Alternative

No response

Additional context

The current demand is actually because of bun.

As far as I know, the bun workspace configuration can only be set in package.json (of course, I might be wrong).

So if a complex workspace configuration is needed (for example, the configuration of the dependent catalog), it is necessary to use objects to configure the workspaces.

I am willing to provide a pr for this.

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions