PackagePrivateFieldConfig
Defined in: policies/PackagePrivateField.ts:47
Configuration for the PackagePrivateField policy.
This policy enforces that packages are correctly marked as private or public based on their scope or name. This is essential for monorepos where some packages should be published to npm while others should remain internal.
All pattern matching uses glob patterns via picomatch.
Example
Section titled “Example”const config: PackagePrivateFieldConfig = { // Packages in myorg scope must be published (private: false or absent) mustPublish: ["@myorg/*"], // Packages in internal scope must be private mustBePrivate: ["@internal/*"], // Packages in experimental scope can choose mayPublish: ["@experimental/*"],};Properties
Section titled “Properties”mayPublish?
Section titled “mayPublish?”
optionalmayPublish?:string[]
Defined in: policies/PackagePrivateField.ts:99
A list of glob patterns for packages that may optionally be published.
Packages matching these patterns can choose whether to be private or public. The policy will not enforce either state for these packages.
Remarks
Section titled “Remarks”Uses glob patterns via picomatch (see mustPublish for pattern examples).
Packages not matching any list default to requiring private: true.
Example
Section titled “Example”mayPublish: ["@fluid-experimental/*"]mustBePrivate?
Section titled “mustBePrivate?”
optionalmustBePrivate?:string[]
Defined in: policies/PackagePrivateField.ts:81
A list of glob patterns for packages that must be private.
Packages matching these patterns must have private: true in their package.json.
If they don’t, the policy will fail and can auto-fix by adding private: true.
Remarks
Section titled “Remarks”Uses glob patterns via picomatch (see mustPublish for pattern examples).
Example
Section titled “Example”mustBePrivate: ["@fluid-internal/*", "@fluid-private/*"]mustPublish?
Section titled “mustPublish?”
optionalmustPublish?:string[]
Defined in: policies/PackagePrivateField.ts:64
A list of glob patterns for packages that must be published.
Packages matching these patterns must NOT have private: true in their package.json.
If they do, the policy will fail and can auto-fix by removing the private field.
Remarks
Section titled “Remarks”Uses glob patterns via picomatch. Use @scope/* to match all packages in a scope,
or use exact package names.
Example
Section titled “Example”mustPublish: ["@fluidframework/*", "@fluid-tools/*", "tinylicious"]unmatchedPackages?
Section titled “unmatchedPackages?”
optionalunmatchedPackages?:"private"|"ignore"|"public"
Defined in: policies/PackagePrivateField.ts:110
Default behavior for packages that don’t match any of the above lists.
"private"(default): Unmatched packages must haveprivate: true"public": Unmatched packages must NOT haveprivate: true"ignore": No enforcement for unmatched packages
Default Value
Section titled “Default Value”"private"