Publish a widget set

A widget set may be published through one of the following methods:

  • Manual upload of a .zip archive file in the user interface
  • CLI command from @osdk/cli
  • Foundry CI/CD for widget sets using Foundry Code Repositories

Publishing a new version of a widget set does not affect existing usages of widgets in the widget set. Host applications such as Workshop will not automatically display new changes until the applications have been configured to use the new published widget set version.

Build a project

The instructions below to build a project are typically automated for CI/CD pipelines but must be followed when manually publishing a widget set.

Before starting, ensure you have followed the instructions in set up a project to set up your FOUNDRY_TOKEN token environment variable. Run the following commands to install dependencies, lint your project for errors and create a production build of your widget set.

Copied!
1 2 3 npm install npm run lint npm run build

An example production build of a widget set in an output dist/ folder looks like the following:

dist/
├── .palantir
│   └── widgets.config.json
├── assets
│   ├── allPaths-1o-wu5D1.js
│   ├── allPathsLoader-B5dDtRyf.js
│   ├── index-BKzgFDAn.js
│   ├── index-BvSuWPlB.js
│   ├── index-fzE76D9V.css
│   ├── index-JZHrjpfy.js
│   └── splitPathsBySizeLoader-BdSoFTZJ.js
└── index.html

A special .palantir/widgets.config.json manifest file describes the widgets contained in the build which is typically produced automatically from the project code using @osdk/widget.vite-plugin when starting from project templates.

The version of the widget set to publish is included in this manifest file. When using @osdk/widget.vite-plugin, a foundry.config.json file in the project describes how the version is calculated in the widgetSet.autoVersion field. This may be package-json which reads the version field from package.json, or git-describe which calculates the version based on a git repository's tags and commits.

Publish with a manual upload of a .zip archive file in the user interface

On your local machine, follow the instructions for building a project. Create a .zip archive file containing the production build of your widget set, ensuring that there are no additional folders (such as the output dist/ or equivalent folder).

The following code snippet creates an asset.zip archive file in the project root with the production build in a dist/ folder using a bash terminal. Any suitable zip tool can be used for your operating system.

Copied!
1 2 cd dist/ zip -r ../asset.zip .

Use the Upload release option on the custom widgets page for a widget set. Drag and drop the .zip archive file into the dialog and then select Upload.

The dialog for manually uploading a .zip archive file in the user interface.

Publish with a CLI command from @osdk/cli

The NPM package @osdk/cli helps automate the .zip archive file creation and publish step with a single command and can be configured in an external CI/CD pipeline such as GitHub Actions or CircleCI.

To publish from a terminal on your local machine, follow the instructions for building a project.

Run the following CLI command from your terminal:

Copied!
1 npx @osdk/cli@latest widgetset deploy

An example output for publishing a production build with the version 1.0.0 in the manifest will look like the following:

Copied!
1 2 3 4 5 6 7 ℹ Palantir OSDK CLI 0.26.3 ℹ Found version from manifest: 1.0.0 ◐ Zipping widget set files ◐ Publishing widget set files ℹ Zipped 1.04 MiB total over 11 files ✔ Publish complete

To publish from an external CI/CD pipeline, follow the provider's documentation to set up the workflow steps to build the project and run the @osdk/cli deploy command.

Publish with Foundry CI/CD

For widget sets using Foundry Code Repositories, Foundry CI/CD is automatically set up to build and publish the widget set on tag builds.

To create a new tag, you can use the platform user interface, or use standard git commands such as the following example:

Copied!
1 2 git tag <x.y.z> git push origin tag

View the status of the tag build through the Tags tab in VS Code Workspaces or Code Repositories.

The status of a tag build in the Tags tab.