Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
19 changes: 18 additions & 1 deletion renderers/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
{
"name": "@a2ui/angular",
"version": "0.8.5",
"version": "0.8.4",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rolling back the version?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to put v0.9.0 here sorry - updated.

"license": "Apache-2.0",
"homepage": "https://a2ui.org/",
"repository": {
"directory": "renderers/angular",
"type": "git",
"url": "git+https://github.com/google/A2UI.git"
},
"bugs": {
"url": "https://github.com/google/A2UI/issues"
},
"keywords": [
"a2ui",
"angular",
"ai",
"agent",
"ui",
"renderer"
],
"scripts": {
"generate-examples": "node scripts/generate-examples.mjs",
"build": "npm run generate-examples && ng build && node postprocess-build.mjs",
Expand Down
2 changes: 1 addition & 1 deletion renderers/angular/postprocess-build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if (!packageJson.dependencies['@a2ui/web_core']) {
);
}

packageJson.dependencies['@a2ui/web_core'] = '^' + coreVersion;
packageJson.dependencies['@a2ui/web_core'] = coreVersion;

// Remove scripts and properties that should not be in the published package
delete packageJson.scripts;
Expand Down
31 changes: 19 additions & 12 deletions renderers/lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@
"name": "@a2ui/lit",
"version": "0.8.4",
"description": "A2UI Lit Library",
"author": "Google",
"license": "Apache-2.0",
"homepage": "https://a2ui.org/",
"repository": {
"directory": "renderers/lit",
"type": "git",
"url": "git+https://github.com/google/A2UI.git"
},
"bugs": {
"url": "https://github.com/google/A2UI/issues"
},
"keywords": [
"a2ui",
"lit",
"ai",
"agent",
"ui",
"renderer"
],
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"exports": {
Expand Down Expand Up @@ -72,21 +91,9 @@
"clean": "if-file-deleted"
}
},
"repository": {
"directory": "renderers/lit",
"type": "git",
"url": "git+https://github.com/google/A2UI.git"
},
"files": [
"dist/src"
],
"keywords": [],
"author": "Google",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/google/A2UI/issues"
},
"homepage": "https://github.com/google/A2UI/tree/main/web#readme",
"devDependencies": {
"@types/jsdom": "^28.0.1",
"@types/node": "^24.10.1",
Expand Down
4 changes: 2 additions & 2 deletions renderers/lit/prepare-publish.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ const litPkg = JSON.parse(readFileSync(litPkgPath, 'utf8'));

// 3. Update Dependency
if (litPkg.dependencies && litPkg.dependencies['@a2ui/web_core']) {
litPkg.dependencies['@a2ui/web_core'] = '^' + coreVersion;
litPkg.dependencies['@a2ui/web_core'] = coreVersion;
} else {
console.warn('Warning: @a2ui/web_core not found in dependencies.');
throw new Error('Error: @a2ui/web_core not found in dependencies. This is a mandatory dependency for publishing.');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this script so different from the one on the angular renderer? Can we share this script across all packages we want to publish?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point. I centralized it now.

}

// 4. Adjust Paths for Dist
Expand Down
3 changes: 2 additions & 1 deletion renderers/markdown/markdown-it/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 13 additions & 7 deletions renderers/markdown/markdown-it/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@
"name": "@a2ui/markdown-it",
"version": "0.0.2",
"description": "A Markdown renderer using markdown-it and dompurify.",
"keywords": [],
"homepage": "https://github.com/google/A2UI/tree/main/web#readme",
"bugs": {
"url": "https://github.com/google/A2UI/issues"
},
"repository": {
"directory": "renderers/markdown/markdown-it",
"type": "git",
"url": "git+https://github.com/google/A2UI.git",
"directory": "renderers/markdown/markdown-it"
"url": "git+https://github.com/google/A2UI.git"
},
"bugs": {
"url": "https://github.com/google/A2UI/issues"
},
"keywords": [
"a2ui",
"markdown",
"ai",
"agent",
"ui",
"renderer"
],
"license": "Apache-2.0",
"author": "Google",
"type": "module",
Expand Down
6 changes: 3 additions & 3 deletions renderers/markdown/markdown-it/prepare-publish.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));

// 3. Update Dependency
if (pkg.peerDependencies && pkg.peerDependencies['@a2ui/web_core']) {
pkg.peerDependencies['@a2ui/web_core'] = '^' + coreVersion;
pkg.peerDependencies['@a2ui/web_core'] = coreVersion;
} else {
console.warn('Warning: @a2ui/web_core not found in peerDependencies.');
throw new Error('Error: @a2ui/web_core not found in peerDependencies. This is a mandatory dependency for publishing.');
}
if (pkg.devDependencies && pkg.devDependencies['@a2ui/web_core']) {
// We can just remove devDependencies for the published package, or update it
pkg.devDependencies['@a2ui/web_core'] = '^' + coreVersion;
pkg.devDependencies['@a2ui/web_core'] = coreVersion;
}

// 4. Adjust Paths for Dist
Expand Down
33 changes: 19 additions & 14 deletions renderers/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
"name": "@a2ui/react",
"version": "0.8.1",
"description": "React renderer for A2UI (Agent-to-User Interface)",
"homepage": "https://a2ui.org/",
"repository": {
"directory": "renderers/react",
"type": "git",
"url": "git+https://github.com/google/A2UI.git"
},
"bugs": {
"url": "https://github.com/google/A2UI/issues"
},
"keywords": [
"a2ui",
"react",
"ai",
"agent",
"ui",
"renderer"
],
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
Expand Down Expand Up @@ -56,6 +73,8 @@
"*.css"
],
"scripts": {
"prepublishOnly": "node -e \"if(!process.cwd().endsWith('dist')) { console.error('Error: This package must be published from the dist/ directory. Run `npm run build` then `npm publish dist/`'); process.exit(1); }\"",
"publish:package": "npm run build && node scripts/prepare-publish.mjs && npm publish dist/ --access public",
"build": "tsup && node scripts/postbuild.mjs",
"dev": "tsup --watch",
"test": "vitest run",
Expand Down Expand Up @@ -109,21 +128,7 @@
"vite": "^7.3.1",
"vitest": "^4.0.18"
},
"keywords": [
"a2ui",
"react",
"ai",
"agent",
"ui",
"renderer"
],
"engines": {
"node": ">=18.0.0"
},
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/google/A2UI.git",
"directory": "renderers/react"
}
}
112 changes: 112 additions & 0 deletions renderers/react/scripts/prepare-publish.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/**
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { readFileSync, writeFileSync, copyFileSync, mkdirSync, existsSync } from 'fs';
import { join } from 'path';

// This script prepares the React package for publishing by:
// 1. Copying package.json to dist/
// 2. Updating @a2ui/web_core dependency from 'file:...' to the actual exact version
// 3. Adjusting paths in package.json (main, types, exports) to be relative to dist/

const dirname = import.meta.dirname;
const corePkgPath = join(dirname, '../../web_core/package.json');
const pkgPath = join(dirname, '../package.json');
const distDir = join(dirname, '../dist');

if (!existsSync(distDir)) {
mkdirSync(distDir, { recursive: true });
}

// 1. Get Core Version
const corePkg = JSON.parse(readFileSync(corePkgPath, 'utf8'));
const coreVersion = corePkg.version;
if (!coreVersion) throw new Error('Cannot determine @a2ui/web_core version');

// 2. Read Package
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));

// 3. Update Dependency
if (pkg.dependencies && pkg.dependencies['@a2ui/web_core']) {
pkg.dependencies['@a2ui/web_core'] = coreVersion;
} else {
throw new Error('Error: @a2ui/web_core not found in dependencies. This is a mandatory dependency for publishing.');
}

// 4. Adjust Paths for Dist
pkg.main = adjustPath(pkg.main);
pkg.module = adjustPath(pkg.module);
pkg.types = adjustPath(pkg.types);

if (pkg.exports) {
for (const key in pkg.exports) {
const exp = pkg.exports[key];
if (typeof exp === 'string') {
pkg.exports[key] = adjustPath(exp);
} else {
if (exp.import) {
if (typeof exp.import === 'string') {
exp.import = adjustPath(exp.import);
} else {
if (exp.import.types) exp.import.types = adjustPath(exp.import.types);
if (exp.import.default) exp.import.default = adjustPath(exp.import.default);
}
}
if (exp.require) {
if (typeof exp.require === 'string') {
exp.require = adjustPath(exp.require);
} else {
if (exp.require.types) exp.require.types = adjustPath(exp.require.types);
if (exp.require.default) exp.require.default = adjustPath(exp.require.default);
}
}
if (exp.types) exp.types = adjustPath(exp.types);
if (exp.default) exp.default = adjustPath(exp.default);
}
}
}

// Remove properties that should not be in the published package
delete pkg.scripts;
delete pkg.files;
delete pkg.prepublishOnly;

// 5. Write to dist/package.json
writeFileSync(join(distDir, 'package.json'), JSON.stringify(pkg, null, 2));

// 6. Copy README and LICENSE
const readmeSrc = join(dirname, '../README.md');
const licenseSrc = join(dirname, '../../../LICENSE');

if (!existsSync(readmeSrc)) {
throw new Error(`Missing required file for publishing: README.md`);
}
copyFileSync(readmeSrc, join(distDir, 'README.md'));

if (!existsSync(licenseSrc)) {
throw new Error(`Missing required file for publishing: LICENSE`);
}
copyFileSync(licenseSrc, join(distDir, 'LICENSE'));

console.log(`Prepared dist/package.json with @a2ui/web_core@${coreVersion}`);

// Utility function to adjust the paths of the built files (dist/src/*) to (src/*)
function adjustPath(p) {
if (p && p.startsWith('./dist/')) {
return './' + p.substring(7); // Remove ./dist/
}
return p;
}
Loading
Loading