MCPcopy Create free account
hub / github.com/adobe/react-spectrum / enforcePublishing

Function enforcePublishing

yarn.config.cjs:221–243  ·  view source on GitHub ↗

@param {Context} context

({Yarn})

Source from the content-addressed store, hash-verified

219
220/** @param {Context} context */
221function enforcePublishing({Yarn}) {
222 // make sure fields required for publishing have been set
223 for (const workspace of Yarn.workspaces()) {
224 let name = workspace.ident;
225 if (
226 isPublishing(workspace) ||
227 (workspace.manifest.rsp?.type === 'cli' && !workspace.manifest.private)
228 ) {
229 if (name.startsWith('@react-spectrum')) {
230 workspace.set('license', 'Apache-2.0');
231 }
232 if (!workspace.manifest.private) {
233 workspace.set('publishConfig', {access: 'public'});
234 }
235 workspace.set('repository', {
236 type: 'git',
237 url: name.startsWith('@internationalized/date')
238 ? 'https://github.com/adobe/react-spectrum/tree/main/packages/@internationalized/date'
239 : 'https://github.com/adobe/react-spectrum'
240 });
241 }
242 }
243}
244
245/** @param {Context} context */
246function enforceExports({Yarn}) {

Callers 1

yarn.config.cjsFile · 0.85

Calls 2

isPublishingFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected