Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,18 @@ jobs:
npm run build-pack
node scripts/build-task.js

- name: Validate MCP package contents
run: npm run validate:package --workspace=@igniteui/mcp-server -- --expected-version "$VERSION"
Comment thread
dkalinovInfra marked this conversation as resolved.

- name: Define npm tag
run: |
if [[ ${VERSION} == *"alpha"* || ${VERSION} == *"beta"* || ${VERSION} == *"rc"* ]]; then echo "NPM_TAG=next"; else echo "NPM_TAG=latest"; fi >> $GITHUB_ENV
echo ${NPM_TAG}
if [[ ${VERSION} == *"alpha"* || ${VERSION} == *"beta"* || ${VERSION} == *"rc"* ]]; then
NPM_TAG=next
else
NPM_TAG=latest
fi
echo "NPM_TAG=$NPM_TAG" >> $GITHUB_ENV
echo "$NPM_TAG"

- name: Publish packages
# use npm run as yarn run changes the registry and publishes to https://registry.yarnpkg.com
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "igniteui-cli",
"version": "15.2.1",
"version": "15.2.2-alpha.3",
"description": "CLI tool for creating Ignite UI projects",
"keywords": [
"CLI",
Expand Down Expand Up @@ -66,9 +66,9 @@
"all": true
},
"dependencies": {
"@igniteui/angular-templates": "^21.2.1521",
"@igniteui/cli-core": "^15.2.1",
"@igniteui/mcp-server": "^15.2.1",
"@igniteui/angular-templates": "^21.2.1522-alpha.3",
"@igniteui/cli-core": "^15.2.2-alpha.3",
"@igniteui/mcp-server": "^15.2.2-alpha.3",
"@inquirer/prompts": "^7.9.0",
"chalk": "^5.3.0",
"glob": "^11.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@igniteui/cli-core",
"version": "15.2.1",
"version": "15.2.2-alpha.3",
"description": "Base types and functionality for Ignite UI CLI",
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion packages/igniteui-mcp/igniteui-doc-mcp/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@igniteui/mcp-server",
"mcpName": "io.github.IgniteUI/mcp-server",
"version": "15.2.1",
"version": "15.2.2-alpha.3",
"description": "Unified MCP server for Ignite UI — documentation, GitHub API, and CLI scaffolding",
"repository": {
"type": "git",
Expand Down Expand Up @@ -38,6 +38,7 @@
"test:watch": "vitest",
"coverage": "vitest run --coverage",
"build:db": "npx tsx scripts/build-db.ts",
"validate:package": "npx tsx scripts/validate-package.ts",
"inspector": "npx @modelcontextprotocol/inspector dist/index.js",
"clear": "npx tsx -e \"import{rmSync}from'fs';rmSync('dist',{recursive:true,force:true})\"",
"clear:angular": "npx tsx -e \"import{rmSync}from'fs';['docs_processing','docs_prepeared','docs_final'].forEach(d=>{rmSync('dist/'+d+'/angular',{recursive:true,force:true})})\"",
Expand Down
110 changes: 110 additions & 0 deletions packages/igniteui-mcp/igniteui-doc-mcp/scripts/validate-package.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import { readdirSync, readFileSync, statSync, existsSync } from "fs";
import { join, resolve } from "path";
import { fileURLToPath } from "url";

const PKG_ROOT = resolve(fileURLToPath(new URL("..", import.meta.url)));
const DB_PATH = join(PKG_ROOT, "dist", "igniteui-docs.db");
const DB_MIN_BYTES = 20 * 1024 * 1024; // 20 MB minimum for the SQLite DB
const DOCS_ROOT = join(PKG_ROOT, "docs");
const FRAMEWORK_DIRS = ["angular-api", "react-api", "webcomponents-api", "blazor-api"];
const FRAMEWORK_MIN_BYTES = 300 * 1024; // 300 KB minimum for each docs/<framework>-api directory

const errors: string[] = [];

function getExpectedVersion(): string | null {
const idx = process.argv.indexOf("--expected-version");
if (idx >= 0) {
const rawValue = process.argv[idx + 1];
const value = rawValue?.trim();
if (!value || value.startsWith("--")) {
console.error('Missing or invalid value for "--expected-version". Provide a version after the flag.');
process.exit(1);
}
return value.replace(/^v/, "");
}
if (process.env.EXPECTED_VERSION) return process.env.EXPECTED_VERSION.replace(/^v/, "");
return null;
}

const expectedVersion = getExpectedVersion();
if (expectedVersion) {
const pkgJsonPath = join(PKG_ROOT, "package.json");
const pkgJson = JSON.parse(readFileSync(pkgJsonPath, "utf8"));
if (pkgJson.version !== expectedVersion) {
errors.push(`package.json version mismatch: got ${pkgJson.version}, expected ${expectedVersion}`);
} else {
console.log(`OK ver package.json ${pkgJson.version}`);
}

const serverJsonPath = join(PKG_ROOT, "server.json");
if (!existsSync(serverJsonPath)) {
errors.push(`server.json missing: ${serverJsonPath}`);
} else {
const serverJson = JSON.parse(readFileSync(serverJsonPath, "utf8"));
if (serverJson.version !== expectedVersion) {
errors.push(`server.json version mismatch: got ${serverJson.version}, expected ${expectedVersion}`);
} else {
console.log(`OK ver server.json ${serverJson.version}`);
}
const pkgs: Array<{ identifier?: string; version?: string }> = serverJson.packages ?? [];
if (pkgs.length === 0) {
errors.push(`server.json has no entries in "packages"`);
}
pkgs.forEach((p, i) => {
const label = p.identifier ?? `packages[${i}]`;
if (p.version !== expectedVersion) {
errors.push(`server.json ${label} version mismatch: got ${p.version}, expected ${expectedVersion}`);
} else {
console.log(`OK ver server.json ${label.padEnd(20)} ${p.version}`);
}
});
}
}

function formatSize(bytes: number): string {
if (bytes >= 1024 * 1024) return `${(bytes / 1024 / 1024).toFixed(2)} MB`;
if (bytes >= 1024) return `${(bytes / 1024).toFixed(2)} KB`;
return `${bytes} B`;
}

function dirSize(dir: string): number {
let total = 0;
for (const entry of readdirSync(dir, { withFileTypes: true })) {
const full = join(dir, entry.name);
if (entry.isDirectory()) total += dirSize(full);
else if (entry.isFile()) total += statSync(full).size;
}
return total;
}

if (!existsSync(DB_PATH)) {
errors.push(`DB missing: ${DB_PATH}`);
} else {
const size = statSync(DB_PATH).size;
if (size < DB_MIN_BYTES) {
errors.push(`DB too small: ${formatSize(size)} < ${formatSize(DB_MIN_BYTES)} (${DB_PATH})`);
} else {
console.log(`OK db ${formatSize(size)} ${DB_PATH}`);
}
}

for (const framework of FRAMEWORK_DIRS) {
const frameworkDir = join(DOCS_ROOT, framework);
if (!existsSync(frameworkDir)) {
errors.push(`Docs framework dir missing: ${frameworkDir}`);
continue;
}
const size = dirSize(frameworkDir);
if (size < FRAMEWORK_MIN_BYTES) {
errors.push(`Docs framework dir too small: ${framework} = ${formatSize(size)} < ${formatSize(FRAMEWORK_MIN_BYTES)}`);
} else {
console.log(`OK dir ${formatSize(size).padStart(10)} ${framework}`);
}
}

if (errors.length > 0) {
console.error(`\nValidation failed with ${errors.length} error(s):`);
for (const e of errors) console.error(` - ${e}`);
process.exit(1);
}
console.log("\nAll checks passed.");
4 changes: 2 additions & 2 deletions packages/igniteui-mcp/igniteui-doc-mcp/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"source": "github",
"url": "https://github.com/IgniteUI/igniteui-cli"
},
"version": "15.2.1",
"version": "15.2.2-alpha.3",
"packages": [
{
"registryType": "npm",
"identifier": "@igniteui/mcp-server",
"version": "15.2.1",
"version": "15.2.2-alpha.3",
"transport": {
"type": "stdio"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/igx-templates/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@igniteui/angular-templates",
"version": "21.2.1521",
"version": "21.2.1522-alpha.3",
"description": "Templates for Ignite UI for Angular projects and components",
"repository": {
"type": "git",
Expand All @@ -12,7 +12,7 @@
"author": "Infragistics",
"license": "MIT",
"dependencies": {
"@igniteui/cli-core": "^15.2.1",
"@igniteui/cli-core": "^15.2.2-alpha.3",
"typescript": "~5.5.4"
}
}
6 changes: 3 additions & 3 deletions packages/ng-schematics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@igniteui/angular-schematics",
"version": "21.2.1521",
"version": "21.2.1522-alpha.3",
"description": "Ignite UI for Angular Schematics for ng new and ng generate",
"repository": {
"type": "git",
Expand All @@ -20,8 +20,8 @@
"dependencies": {
"@angular-devkit/core": "^21.0.0",
"@angular-devkit/schematics": "^21.0.0",
"@igniteui/angular-templates": "^21.2.1521",
"@igniteui/cli-core": "^15.2.1",
"@igniteui/angular-templates": "^21.2.1522-alpha.3",
"@igniteui/cli-core": "^15.2.2-alpha.3",
"@schematics/angular": "^21.0.0",
"minimatch": "^10.0.1",
"rxjs": "~7.8.1"
Expand Down