A plugin marketplace for GitHub Copilot and other AI agents that provides Power Platform development plugins, including reusable skills, agents, and commands for building and deploying solutions.
JavaScript claude-code-pluginclaude-code-skillscode-appsgithub-copilot-pluginpower-appspower-pagespower-platform
'use strict';
// Loaded with `node --require` ahead of a script, for tests/pcf-printers-whole-before-exit.test.js: makes a script's OWN failure printers print a text of
// HUGE_FAILURE_SIZE characters — with no command line that long (Windows allows 32,767 characters, Linux 128 KiB per argument):
// HUGE_FAILURE=flag validateFlags (lib/dataverse-auth.js) answers every call with a message that long, which each script prints as its usage error
// (check-auth.js as the message of its usage blocker, on stdout);
// HUGE_FAILURE=throw parseArgs throws an error with that message.
// Everything else is the real module, and the code that prints the text and ends the process is the script's own. A test requires this file for
// hugeFailureText (HUGE_FAILURE is not set in the test's own process, so nothing is replaced there). The same helper as model-apps'
// tests/helpers/huge-failure-preload.js: this plugin's suite runs on its own.
const path = require('node:path');
// The text, recognisable at both ends so that a test can tell a whole one from one cut short.
function hugeFailureText(kind, size) {
return `${kind}-failure<${'0123456789'.repeat(Math.ceil(size / 10)).slice(0, size)}>`;
}
module.exports = { hugeFailureText };
if (process.env.HUGE_FAILURE) {
const target = require.resolve(path.join(__dirname, '..', '..', 'lib', 'dataverse-auth.js'));
const real = require(target);
const kind = process.env.HUGE_FAILURE;
const text = hugeFailureText(kind, Number(process.env.HUGE_FAILURE_SIZE || 0));
// A script takes its helpers from the module cache when it is loaded, so it is handed this object.
require.cache[target].exports = {
...real,
...(kind === 'flag' ? { validateFlags: () => text } : {}),
...(kind === 'throw' ? { parseArgs: () => { throw new Error(text); } } : {}),
};
}