Skip to content

Commit d306289

Browse files
authored
Merge branch 'main' into ad-TW-4727-sync-web-elements-types
2 parents 9eb6ceb + dd8f630 commit d306289

4 files changed

Lines changed: 221 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,156 @@ jobs:
187187
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
188188
NPM_CONFIG_PROVENANCE: true
189189

190+
update-scheduler-consumers:
191+
name: Update Scheduler Consumers
192+
needs: release
193+
if: needs.release.outputs.published == 'true' && contains(needs.release.outputs.publishedPackages, '@nylas/react')
194+
runs-on: ubuntu-latest
195+
permissions:
196+
contents: read
197+
timeout-minutes: 15
198+
strategy:
199+
fail-fast: false
200+
matrix:
201+
include:
202+
- consumer: Dashboard v3
203+
repository: nylas/dashboard-v3
204+
package_json_path: packages/client/package.json
205+
node_version: 24.13.0
206+
pnpm_version: 10.15.1
207+
dependency_prefix: ''
208+
commit_scope: client
209+
- consumer: Scheduler v3
210+
repository: nylas/scheduler-v3
211+
package_json_path: package.json
212+
node_version: 22.12.0
213+
pnpm_version: 10.7.1
214+
dependency_prefix: '^'
215+
commit_scope: deps
216+
217+
steps:
218+
- name: Resolve published @nylas/react version
219+
id: version
220+
run: |
221+
REACT_VERSION=$(echo '${{ needs.release.outputs.publishedPackages }}' | jq -r '.[] | select(.name == "@nylas/react") | .version // empty')
222+
if [ -z "$REACT_VERSION" ]; then
223+
echo "Could not parse @nylas/react version from publishedPackages"
224+
exit 1
225+
fi
226+
227+
SAFE_VERSION=$(echo "$REACT_VERSION" | tr -c '[:alnum:]' '-')
228+
SAFE_VERSION="${SAFE_VERSION%-}"
229+
230+
echo "version=$REACT_VERSION" >> "$GITHUB_OUTPUT"
231+
echo "safe_version=$SAFE_VERSION" >> "$GITHUB_OUTPUT"
232+
233+
- name: Verify consumer update token
234+
env:
235+
CONSUMER_TOKEN: ${{ secrets.SCHEDULER_CONSUMER_TOKEN }}
236+
REPOSITORY: ${{ matrix.repository }}
237+
run: |
238+
if [ -z "$CONSUMER_TOKEN" ]; then
239+
echo "::error::Set SCHEDULER_CONSUMER_TOKEN in nylas/javascript with read/write access to nylas/dashboard-v3 and nylas/scheduler-v3."
240+
echo "::error::Fine-grained token permissions: Contents read/write and Pull requests read/write for both consumer repositories."
241+
exit 1
242+
fi
243+
244+
STATUS=$(curl --silent --show-error --output /tmp/repo.json --write-out "%{http_code}" \
245+
--header "Authorization: Bearer $CONSUMER_TOKEN" \
246+
--header "Accept: application/vnd.github+json" \
247+
--header "X-GitHub-Api-Version: 2022-11-28" \
248+
"https://api.github.com/repos/$REPOSITORY")
249+
250+
if [ "$STATUS" != "200" ]; then
251+
echo "::error::SCHEDULER_CONSUMER_TOKEN cannot access $REPOSITORY (GitHub API status: $STATUS)."
252+
exit 1
253+
fi
254+
255+
- name: Checkout ${{ matrix.consumer }}
256+
uses: actions/checkout@v4
257+
with:
258+
repository: ${{ matrix.repository }}
259+
token: ${{ secrets.SCHEDULER_CONSUMER_TOKEN }}
260+
ref: main
261+
fetch-depth: 0
262+
263+
- name: Setup pnpm
264+
uses: pnpm/action-setup@v4
265+
with:
266+
version: ${{ matrix.pnpm_version }}
267+
run_install: false
268+
269+
- name: Setup Node.js
270+
uses: actions/setup-node@v4
271+
with:
272+
node-version: ${{ matrix.node_version }}
273+
cache: pnpm
274+
275+
- name: Update @nylas/react dependency
276+
env:
277+
PACKAGE_JSON_PATH: ${{ matrix.package_json_path }}
278+
REACT_VERSION: ${{ steps.version.outputs.version }}
279+
DEPENDENCY_PREFIX: ${{ matrix.dependency_prefix }}
280+
run: |
281+
node <<'NODE'
282+
const fs = require('node:fs');
283+
284+
const packageJsonPath = process.env.PACKAGE_JSON_PATH;
285+
const reactVersion = process.env.REACT_VERSION;
286+
const dependencyPrefix = process.env.DEPENDENCY_PREFIX || '';
287+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
288+
289+
if (!packageJson.dependencies || !Object.prototype.hasOwnProperty.call(packageJson.dependencies, '@nylas/react')) {
290+
throw new Error(`${packageJsonPath} does not declare @nylas/react as a dependency`);
291+
}
292+
293+
packageJson.dependencies['@nylas/react'] = `${dependencyPrefix}${reactVersion}`;
294+
fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`);
295+
NODE
296+
297+
- name: Update lockfile
298+
run: pnpm install --lockfile-only
299+
env:
300+
CI: true
301+
HUSKY: 0
302+
303+
- name: Create or update pull request
304+
env:
305+
GH_TOKEN: ${{ secrets.SCHEDULER_CONSUMER_TOKEN }}
306+
PACKAGE_JSON_PATH: ${{ matrix.package_json_path }}
307+
REACT_VERSION: ${{ steps.version.outputs.version }}
308+
SAFE_VERSION: ${{ steps.version.outputs.safe_version }}
309+
REPOSITORY: ${{ matrix.repository }}
310+
CONSUMER: ${{ matrix.consumer }}
311+
COMMIT_SCOPE: ${{ matrix.commit_scope }}
312+
JIRA_TICKET: ${{ vars.SCHEDULER_CONSUMER_UPDATE_JIRA || 'CUST-5380' }}
313+
run: |
314+
if git diff --quiet -- "$PACKAGE_JSON_PATH" pnpm-lock.yaml; then
315+
echo "$CONSUMER already uses @nylas/react $REACT_VERSION"
316+
exit 0
317+
fi
318+
319+
BRANCH="chore/${JIRA_TICKET}-upgrade-nylas-react-${SAFE_VERSION}"
320+
TITLE="[${JIRA_TICKET}] chore(${COMMIT_SCOPE}): upgrade @nylas/react to ${REACT_VERSION}"
321+
BODY=$(cat <<EOF
322+
Automated PR to upgrade @nylas/react to ${REACT_VERSION} after it was published from nylas/javascript.
323+
324+
Jira: https://nylas.atlassian.net/browse/${JIRA_TICKET}
325+
326+
This keeps ${CONSUMER} on the latest Scheduler component wrapper. Existing ${CONSUMER} GitHub/Cloudflare deployment workflows handle preview and staging once this PR is opened and merged.
327+
EOF
328+
)
329+
330+
git config user.name "github-actions[bot]"
331+
git config user.email "github-actions[bot]@users.noreply.github.com"
332+
git checkout -B "$BRANCH"
333+
git add "$PACKAGE_JSON_PATH" pnpm-lock.yaml
334+
git commit -m "$TITLE"
335+
git fetch origin "$BRANCH":"refs/remotes/origin/$BRANCH" || true
336+
git push --force-with-lease origin "$BRANCH"
337+
338+
if gh pr view "$BRANCH" --repo "$REPOSITORY" >/dev/null 2>&1; then
339+
gh pr edit "$BRANCH" --repo "$REPOSITORY" --title "$TITLE" --body "$BODY"
340+
else
341+
gh pr create --repo "$REPOSITORY" --base main --head "$BRANCH" --title "$TITLE" --body "$BODY"
342+
fi

packages/react/CHANGELOG.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,65 @@
11
# @nylas/react
22

3+
## 3.2.7
4+
5+
### Patch Changes
6+
7+
- 44ddeaf: Upgrade @nylas/web-elements dependency to 2.5.8:
8+
- [nylas-scheduler-editor] Fixed template variable suggestions opening in Microsoft Edge when typing $ in the event title or description fields.
9+
- [nylas-scheduling] Fixed selected date labels so they stay localized when the scheduler language is set or changed.
10+
11+
## 3.2.6
12+
13+
### Patch Changes
14+
15+
- 521b77d: Upgrade @nylas/web-elements dependency to 2.5.7
16+
- [nylas-scheduler-editor] Preserve existing Scheduler configuration settings when saving edits so custom redirect URLs and related booking flow settings are not reset by unrelated changes.
17+
18+
## 3.2.5
19+
20+
### Patch Changes
21+
22+
- f78e65d: Upgrade @nylas/web-elements dependency to 2.5.5:
23+
- Fix time slot selection and date picker clicks being non-functional after upgrading to v2.5.0. When configurationId or other auth props were set post-mount (e.g. via React), the scheduler entered a deferred init path where click handlers on the date picker and timeslot picker were registered before the connector existed. Clicking a date or time slot appeared to do nothing. The connector reference is now resolved at click time rather than at registration time, so all interactions work correctly regardless of when auth props arrive.
24+
- [nylas-scheduling] Fix schedulerApiUrl prop being ignored on full page refresh when using React wrappers. The component now correctly waits for React's commit phase to apply props before reading schedulerApiUrl to create the scheduler connector, ensuring the correct API region is used on both client-side navigation and hard page refreshes.
25+
26+
- f43d9c9: Upgrade @nylas/web-elements dependency to 2.5.6
27+
- [nylas-scheduling] Improve localized scheduler copy so supported browser languages are reflected in the language dropdown, date labels, and empty states.
28+
29+
## 3.2.4
30+
31+
### Patch Changes
32+
33+
- a9b373b: Upgrade @nylas/web-elements dependency to 2.5.4:
34+
- [nylas-scheduler-editor] Fix calendar not immediately reflecting newly created, updated, or deleted events. Events now appear or disappear without requiring a page reload.
35+
- scheduler Fix radio button fields in booking forms capturing the field label instead of the selected option value. Radio button selections now correctly appear in confirmation emails.
36+
- Fixed scheduler date picker page disappearing in reschedule mode when external JavaScript sets inline styles on shadow DOM elements. Added VDOM key to the footer element to prevent Stencil from reusing it by position during loading-to-content transitions. Also exposed ns_footer CSS part on the footer element for external styling.
37+
38+
## 3.2.3
39+
40+
### Patch Changes
41+
42+
- 5143c9f: - [nylas-scheduling] Fixed confirmation redirect URL incorrectly appending query parameters with ? instead of & when the confirmationRedirectUrl already contains existing query parameters. URLs with pre-existing parameters (e.g. JWT tokens) now correctly preserve all query parameters.
43+
- Fix deferred initialization when rescheduleBookingRef or cancelBookingRef is set via JavaScript after mount (CDN / vanilla HTML pattern). Watch handlers now emit the bookingRefExtracted event, include error handling for malformed booking refs, and properly coordinate with the base provider during deferred init.
44+
- [nylas-page-styling] The Page Styles section in the scheduler editor now renders translated labels by default when no custom slot content is provided. Labels for "Company logo URL", "Primary color", "Submit button label", and "Thank you message" are now available in all supported languages (en, es, fr, de, sv, zh, ja, nl, ko). The color picker's "Select a color" placeholder is also now translated.
45+
46+
## 3.2.2
47+
48+
### Patch Changes
49+
50+
- bab1dad: Upgrade @nylas/web-elements dependency to 2.5.2:
51+
- Fix schedulerApiUrl not being applied before the connector's first API call when using React wrappers on a full page refresh. The connector now syncs the latest schedulerApiUrl prop value before every data fetch, ensuring EU and other non-US regions work correctly regardless of prop timing.
52+
- [nylas-scheduling] The scheduler now automatically detects the user's browser language and displays localized content when a supported language is available. Previously, users always saw English unless the ?lang= URL parameter or defaultLanguage prop was explicitly set.
53+
54+
## 3.2.1
55+
56+
### Patch Changes
57+
58+
- 777b798: Upgrade @nylas/web-elements dependency from 2.5.0 to 2.5.1
59+
- Improve error handling for authentication failures in the scheduler editor. Auth errors now display a visible error banner on the login screen instead of failing silently. The `nylasSchedulerEditorError` event is emitted with `category: 'auth'` for programmatic error handling. Session expiry detection is also improved to catch additional error patterns.
60+
- Fix scheduler date handling to normalize mixed date inputs (Date, ISO string, and unix timestamp values), preventing incorrect fallback dates like 1970 and ensuring timezone-aware selected-day comparisons remain stable across components.
61+
- Fix deferred initialization for booking refs in private scheduler configurations. Booking ref props (reschedule, cancel, organizer confirmation) no longer prematurely trigger initialization without proper auth credentials. Organizer confirmation salt is now correctly persisted when the booking ref is set dynamically.
62+
363
## 3.2.0
464

565
### Minor Changes

packages/react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nylas/react",
3-
"version": "3.2.0",
3+
"version": "3.2.7",
44
"description": "React components and hooks for Nylas API integration",
55
"type": "module",
66
"scripts": {
@@ -78,7 +78,7 @@
7878
"dependencies": {
7979
"@nylas/connect": "workspace:^",
8080
"@nylas/core": "^1.2.0",
81-
"@nylas/web-elements": "2.5.0",
81+
"@nylas/web-elements": "2.5.8",
8282
"@stencil/react-output-target": "^1.2.0",
8383
"axios": "^1.7.7",
8484
"dayjs": "1.11.7",

pnpm-lock.yaml

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)