MCPcopy Index your code
hub / github.com/adobe/react-spectrum / enforcePublishing

Function enforcePublishing

yarn.config.cjs:217–239  ·  view source on GitHub ↗

@param {Context} context

({Yarn})

Source from the content-addressed store, hash-verified

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

Callers 1

yarn.config.cjsFile · 0.85

Calls 2

isPublishingFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected