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
#!/usr/bin/env node
'use strict';
const path = require('path');
const {
findProjectRoot,
} = require('./lib/validation-helpers');
const {
parseOptionalProjectRootArgs,
} = require('./lib/cli-arguments');
const {
validateSiteIntegrity,
} = require('./lib/site-integrity');
const USAGE =
'Usage: validate-site-integrity.js [--projectRoot <path>] ' +
'[--skip-localization | --allow-verified-localization-review]';
function parseArgs(argv) {
let skipLocalization = false;
let allowVerifiedLocalizationReview = false;
const remaining = [];
for (const arg of argv) {
if (arg === '--skip-localization') {
if (skipLocalization) {
throw new Error(
'Argument "--skip-localization" may be specified only once.'
);
}
skipLocalization = true;
} else if (arg === '--allow-verified-localization-review') {
if (allowVerifiedLocalizationReview) {
throw new Error(
'Argument "--allow-verified-localization-review" may be specified only once.'
);
}
allowVerifiedLocalizationReview = true;
} else {
remaining.push(arg);
}
}
// The review exception configures localization validation, so pairing it with
// a run that skips localization is contradictory and most likely a misuse.
if (skipLocalization && allowVerifiedLocalizationReview) {
throw new Error(
'"--allow-verified-localization-review" cannot be combined with ' +
`"--skip-localization".\n${USAGE}`
);
}
return {
...parseOptionalProjectRootArgs(remaining, USAGE),
skipLocalization,
allowVerifiedLocalizationReview,
};
}
function main() {
const args = parseArgs(process.argv.slice(2));
const requestedRoot = path.resolve(args.projectRoot || process.cwd());
const projectRoot = findProjectRoot(requestedRoot);
if (!projectRoot) {
process.stdout.write('[power-pages] Site integrity skipped: no Power Pages project found.\n');
return 0;
}
const result = validateSiteIntegrity(projectRoot, {
skipLocalization: args.skipLocalization,
allowVerifiedLocalizationReview: args.allowVerifiedLocalizationReview,
});
if (result.skipped) {
process.stdout.write(`[power-pages] Site integrity skipped: ${result.reason}\n`);
return 0;
}
for (const finding of result.reviewFindings) {
process.stdout.write(
`[power-pages] Site integrity review ${finding.file}:${finding.line} ` +
`[${finding.rule}]: ${finding.message}\n`
);
}
if (result.errors.length > 0) {
process.stderr.write(
`[power-pages] Site integrity validation failed:\n- ${result.errors.join('\n- ')}\n`
);
return 2;
}
process.stdout.write('[power-pages] Site integrity validation passed.\n');
return 0;
}
if (require.main === module) {
try {
process.exitCode = main();
} catch (error) {
process.stderr.write(`${error.message}\n`);
process.exitCode = 2;
}
}
module.exports = {
main,
parseArgs,
};