Skip to content

preview.yml default globs ./packages/** and ./examples/** recurse into node_modules #34

Description

@natemoo-re

Problem

preview.yml defaults its inputs to recursive globs:

publish:
  default: "./packages/**"
template:
  default: "./examples/**"

and passes them to pkg-pr-new:

pnpx pkg-pr-new publish --pnpm "$PUBLISH_GLOB" --template "$TEMPLATE_GLOB"

The ** matches recursively, including into each package's node_modules. pkg-pr-new then walks nested dependency package.json files and aborts on any that lack a name field — which is common for internal stub manifests such as vite's:

[error] "name" field in .../packages/clink/node_modules/vite/types/package.json should be defined
##[error]Process completed with exit code 1.

(Preceded by many Skipping .../node_modules/.../*.ts: not a directory or .tgz/.tar.gz file lines as it scans the dependency tree.)

Impact

Any repo whose packages depend on something that ships a nameless nested package.json (vite is a frequent one). The preview job fails at the publish step even though install and build succeed. Latent until the build step actually completes and pkg-pr-new runs.

Repro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions