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
4 changes: 2 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ module.exports = {
jest: true,
},
extends: [
'@doist/eslint-config/recommended-type-checked',
'@doist/eslint-config/simple-import-sort',
'@todoist/eslint-config/eslintrc/recommended-type-checked',
'@todoist/eslint-config/eslintrc/simple-import-sort',
],
root: true,
ignorePatterns: ['scripts/', '.eslintrc.cjs', 'global-setup.js', 'jest.config.js'],
Expand Down
2 changes: 1 addition & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["github>doist/renovate-config:frontend-base"],
"extends": ["github>todoist/renovate-config:frontend-base"],
"hostRules": [
{
"hostType": "npm",
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/core-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- 'packages/ui-extensions-core/**'
- 'package.json'
- 'package-lock.json'
- '.github/workflows/**'
- '.eslintrc.cjs'
- 'tsconfig.json'

jobs:
ci-core:
Expand All @@ -13,15 +16,13 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: Configure doist package repository
- name: Configure Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'

- name: Bootstrap
run: npm run bootstrap-ci:common
env:
NODE_AUTH_TOKEN: ${{secrets.GH_PACKAGES_TOKEN}}

- name: Integrity Check
run: npm run integrity-check
Expand Down
88 changes: 35 additions & 53 deletions .github/workflows/core-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,51 @@
name: Publish core package

on:
push:
tags:
- 'core-v*'
workflow_dispatch:

permissions:
# Enable reading repository contents (allows checkout without token)
contents: read
# Enable the use of OIDC for trusted publishing and npm provenance
id-token: write
# Enable the use of GitHub Packages registry
packages: write

concurrency:
group: publish-core
cancel-in-progress: false

jobs:
# Publish to GitHub package registry
publish-github:
publish:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

P2 The PR description and the prior review rounds reference scripts/release.mjs, scripts/release-policy.mjs, .github/workflows/core-pack.yml, and their mocked tests (inspect/downloadOriginal guards, both-registry preflight, artifact recovery) — none of those files exist in this diff or in the working tree. What actually ships is a single workflow that packs and publishes directly, with no digest/provenance validation, no both-registry preflight, and no consumer of the uploaded core-package artifact for the retry path the README describes ("Keep the original tarball if either registry needs a retry"). Either restore the described publisher and its tests or correct the PR description and README so operators know the retained artifact is currently download-only and retries are manual.

if: github.repository == 'todoist/ui-extensions' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 60
timeout-minutes: 15
steps:
- name: Git checkout
uses: actions/checkout@v6

- name: Configure Doist package repository
uses: actions/setup-node@v6
- uses: actions/checkout@v6
with:
node-version-file: '.nvmrc'
registry-url: https://npm.pkg.github.com/
scope: '@doist'

- name: Install dependencies
run: npm run bootstrap-ci:common
env:
NODE_AUTH_TOKEN: ${{secrets.GH_PACKAGES_TOKEN}}

- name: Publish package
working-directory: ./packages/ui-extensions-core
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GH_PACKAGES_TOKEN}}

# Publish to npm package registry
publish-npm:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Git checkout
uses: actions/checkout@v6

- name: Configure Doist package repository
uses: actions/setup-node@v6
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
registry-url: https://registry.npmjs.org/
scope: '@doist'

- name: Install dependencies
run: npm run bootstrap-ci:common

# npm must be upgraded AFTER installing dependencies to avoid package-lock.json
# sync errors. Upgrading npm before running npm ci can cause lock file format
# mismatches that prevent successful dependency installation.
- name: Ensure npm 11.5.1 or later is installed
run: npm install -g npm@latest

- name: Publish package
working-directory: ./packages/ui-extensions-core
run: npm publish --provenance --access public
scope: '@todoist'
- run: npm install --global npm@11.19.0
- run: npm ci --ignore-scripts
- run: npm run integrity-check --workspace=packages/ui-extensions-core
- name: Pack once
run: |
mkdir -p "$RUNNER_TEMP/core-release"
npm pack --workspace=packages/ui-extensions-core --ignore-scripts --pack-destination="$RUNNER_TEMP/core-release"
- uses: actions/upload-artifact@v4
with:
name: core-package
path: ${{ runner.temp }}/core-release/*.tgz
if-no-files-found: error
- name: Publish to npm

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

P2 Publishing to npmjs first in the same job makes partial failures unrecoverable. If the GitHub Packages publish at line 48 fails after npm succeeds, the two registries are left divergent, but re-running this workflow re-runs the entire job and fails here because npm refuses to republish the same version. The old workflow kept the npm and GitHub publishes as separate jobs, so only the failed mirror needed re-running. Split these back into separate jobs that download the retained core-package artifact (or otherwise make each registry write idempotent/preflighted) so a single-mirror failure can be retried without repacking or hitting the already-published registry.

run: npm publish "$RUNNER_TEMP/core-release/"*.tgz --ignore-scripts --provenance --access public --registry=https://registry.npmjs.org/
- uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
registry-url: https://npm.pkg.github.com/
scope: '@todoist'
- name: Publish to GitHub Packages
run: npm publish "$RUNNER_TEMP/core-release/"*.tgz --ignore-scripts --access public --registry=https://npm.pkg.github.com/
env:
NODE_AUTH_TOKEN: ${{ github.token }}
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Todoist UI Extensions

This repository contains the source code for the `@doist/ui-extensions-core` npm package used to develop UI Extensions for [Todoist](https://developer.todoist.com/ui-extensions) and [Twist](https://developer.twist.com/ui-extensions).
This repository contains the source code for the `@todoist/ui-extensions-core` npm package used to develop UI Extensions for [Todoist](https://developer.todoist.com/ui-extensions) and [Twist](https://developer.twist.com/ui-extensions).

## Repository structure

Expand All @@ -13,3 +13,25 @@ To install the dependencies run `npm install`.
_TodoistCard_ components and _Todoist UI Extension Data Exchange Format_ types. You can use this package to construct your integration's UI which will then provide the TodoistCards JSON payload to be rendered on our clients.

You can learn more about building Todoist UI Extensions [here](https://developer.todoist.com/ui-extensions) and Twist UI Extensions [here](https://developer.twist.com/ui-extensions).

## Publishing

Only `packages/ui-extensions-core` is published. Update its version and the root
lockfile, merge the changes, then run the **Publish core package** workflow on
`main`. It checks and builds the package, packs it once, and publishes the same
tarball to npmjs and GitHub Packages. npm publication uses trusted publishing for
`todoist/ui-extensions`, workflow `core-deploy.yml`, with no environment.

For the first npm release, an authorized maintainer publishes the built tarball
interactively, then mirrors that same tarball to GitHub Packages. Configure npm
trusted publishing after the package exists. Keep the original tarball if either
registry needs a retry; do not rebuild an already-published version.

## Legacy React consumers

`ui-extensions-react` was [retired in #334](https://github.com/Doist/ui-extensions/pull/334).
It has no active manifest, implementation or publisher here. The two remaining
React test files are not an active workspace. There is no supported
`@todoist/ui-extensions-react` release or drop-in renderer replacement in core.
See [consumer compatibility](docs/consumer-compatibility.md) before changing a
legacy renderer dependency or a pre-v6 core consumer.
56 changes: 56 additions & 0 deletions docs/consumer-compatibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Current core and retired React consumers

The supported current-forward release is `@todoist/ui-extensions-core@6.0.1`.
It preserves the v6 card construction, serialization and Todoist/Twist data-exchange
API. It does not render React components, implement renderer connection hooks or
ship a stylesheet. Its only exported package entry is `.`; output is CommonJS,
ES modules and declarations under `dist/`.

[Retirement PR #334](https://github.com/Doist/ui-extensions/pull/334), merged as
`21eb3de2512cf05f2c57a1a2b6c9be1c87ced732`, removed the React source, manifest,
workspace and publishing workflows. Existing historical versions remain intact.
The orphan tests under `packages/ui-extensions-react/src/types/` do not provide a
buildable producer. Rebuilding an old branch or republishing the retired package
under a new scope is not part of this migration.

## Exact consumer blockers

Current source inspection at the following commits confirms incompatible edges:

| Consumer | Declared dependencies | Missing renderer API |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `frontend-toolbox` `ba614970a60636e7a67e3280aa5805b8311e1dc3`, `packages/extensions-renderers` | core peer `^4.1.1`, React peer `^11.0.0` | `CanHaveAutoFocus`, `TextInputist`, `ToggleInputist`, `ClipboardAction`, `SubmitActionist` in `src/renderers/input-renderers.tsx` and `actions.tsx` |
| `twist-web` `30d98585dddc9e8fe337186acbd5fd75f4454cb6` | core `3.2.1`, React `6.0.0` | `AdaptiveCardRenderer`, `useAdaptiveCardsConnection`, `BridgeActionCallbacks`, `ExtensionError`, `ExtensionVersion`, `ExtensionContext`, `ChoiceSetInputist`, `CanHaveAutoFocus`, `AdaptiveCardistCard`, `DoistCardResult`, `DoistCardConnectionParams`, plus `styles/index.css` |

These symbols are absent from current core. Core's `SubmitAction`/`TextInput`
construct serialized card data; they are not substitutes for renderer subclasses
such as `SubmitActionist`/`TextInputist`. Do not replace the React package with a core
alias or claim a scope-only dependency update is compatible. Preserve each legacy
dependency until the consumer owners approve and implement a supported renderer
path in current source, or remove the feature through a separately approved product
change. Henning routes this to the existing UI Extensions/toolbox/Twist owners;
the specific D06 owner assignment is not available in this repository.

## Core API migration is also required for pre-v6 clients

The breaking v6 API change predates this scope migration; see
[PR #342](https://github.com/Doist/ui-extensions/pull/342). Examples:

| Legacy API | Current core API |
| -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `DoistCard`, `DoistCardVersion` | `TodoistCard`, `TodoistCardVersion` |
| `DoistCardAction*`, `DoistCardContext*`, `DoistCardExtensionType` | corresponding `TodoistCard*` types (check Twist-specific types below) |
| `DoistCardRequest`, `DoistCardResponse`, `DoistCardError`, `DoistCardBridge*` | corresponding `TodoistCard*` types |
| `DoistContextUser` | `BaseContextUser` |
| `card.doistCardVersion` | `card.todoistCardVersion` |
| Twist's legacy `DoistCardContextChannel`, `DoistCardContextConversation`, `DoistCardContextThread` | inspect `TwistContextChannel`, `TwistContextConversation`, `TwistContextThread` and actual shapes in `src/types/twist.ts` |

`ContextMenuData` still exists. Requests now require both
`maximumTodoistCardVersion` and the preserved `maximumDoistCardVersion` compatibility
field. Serialized cards preserve the existing legacy version keys. Consumers with
subclasses compiled against older core class names must recompile against v6;
serializer base-class identity means a dependency-only bump is insufficient.
These are migration starting points, not a verified compatibility assertion for
core 3/4 plus retired renderer 6/11. Consumer owners must verify type checks,
renderer/connection behavior, schema serialization and CSS in their actual current
applications after a forward renderer decision and real package publication.
Loading
Loading