Skip to content

Commit c6766cf

Browse files
Migration for 1.103.0 and Windows docs (#21652)
* Add migration for 1.103 * Workflows: Add default platforms when merging * Update docs for windows
1 parent e7fdf50 commit c6766cf

File tree

14 files changed

+112
-33
lines changed

14 files changed

+112
-33
lines changed

.github/workflows/changelog_enforcer.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,6 @@ jobs:
1414
id: enforce
1515
uses: raycast/github-actions/changelog-enforcer@master
1616
continue-on-error: true
17-
- name: Prompt Claude for missing changelog
18-
if: steps.enforce.outcome == 'failure'
19-
uses: actions/github-script@v7
20-
with:
21-
github-token: ${{ secrets.GITHUB_TOKEN }}
22-
script: |
23-
const body = "@claude Please add a CHANGELOG.md entry for this pull request.";
24-
await github.rest.issues.createComment({
25-
owner: context.repo.owner,
26-
repo: context.repo.repo,
27-
issue_number: context.issue.number,
28-
body,
29-
});
3017
- name: Fail if changelog missing
3118
if: steps.enforce.outcome == 'failure'
3219
run: exit 1

.github/workflows/pull_request_merge.yml

Lines changed: 88 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,73 @@ jobs:
2828
- name: Checkout PR
2929
run: gh pr checkout ${{ github.event.inputs.pr_number }}
3030
- name: Update CHANGELOG.md
31+
id: update_changelog
3132
run: |
33+
changelog_updated=false
34+
updated_count=0
3235
changelogs=$(gh pr view ${{ github.event.inputs.pr_number }} --json files --jq '.files.[].path' | grep -i CHANGELOG.md || true)
3336
for changelog in $changelogs
3437
do
35-
echo "$changelog:"
36-
if [[ -f "$changelog" ]]; then
37-
pattern="{PR_MERGE_DATE}"
38-
replacement=$(date '+%Y-%m-%d')
39-
if grep -q $pattern $changelog; then
40-
echo " pattern found"
41-
sed -i "" "s/$pattern/$replacement/g" $changelog
42-
# ubuntu: sed -i "s/$pattern/$replacement/g" $changelog
43-
echo " updated to $replacement"
44-
else
45-
echo " pattern not found - skipping"
46-
fi
38+
echo "$changelog:"
39+
if [[ -f "$changelog" ]]; then
40+
pattern="{PR_MERGE_DATE}"
41+
replacement=$(date '+%Y-%m-%d')
42+
if grep -q $pattern $changelog; then
43+
echo " pattern found"
44+
sed -i "" "s/$pattern/$replacement/g" $changelog
45+
# ubuntu: sed -i "s/$pattern/$replacement/g" $changelog
46+
echo " updated to $replacement"
47+
updated_count=$((updated_count+1))
4748
else
48-
echo " skipping (file not existing)"
49+
echo " pattern not found - skipping"
4950
fi
51+
else
52+
echo " skipping (file not existing)"
53+
fi
5054
done
55+
if [[ $updated_count -gt 0 ]]; then
56+
changelog_updated=true
57+
fi
58+
echo "changelog_updated=$changelog_updated" >> $GITHUB_OUTPUT
59+
60+
- name: Add platforms field to package.json
61+
id: add_platforms_field
62+
run: |
63+
platforms_added=false
64+
modified_count=0
65+
changed_extensions="${{ steps.get_changed_extensions.outputs.paths }}"
66+
if [[ -n "$changed_extensions" ]]; then
67+
echo "Changed extensions: $changed_extensions"
68+
IFS=',' read -ra extension_paths <<< "$changed_extensions"
69+
for extension_path in "${extension_paths[@]}"; do
70+
package_json="$extension_path/package.json"
71+
echo "Checking: $package_json"
72+
if [[ -f "$package_json" ]]; then
73+
# Check if platforms field exists
74+
if ! jq -e '.platforms' "$package_json" > /dev/null 2>&1; then
75+
echo " Adding platforms field to $package_json"
76+
# Add platforms field with ["macOS"] as default
77+
jq '. + {"platforms": ["macOS"]}' "$package_json" > "${package_json}.tmp" && mv "${package_json}.tmp" "$package_json"
78+
modified_count=$((modified_count+1))
79+
else
80+
echo " platforms field already exists in $package_json"
81+
fi
82+
else
83+
echo " package.json not found in $extension_path"
84+
fi
85+
done
86+
else
87+
echo "No changed extensions found"
88+
fi
89+
if [[ $modified_count -gt 0 ]]; then
90+
platforms_added=true
91+
fi
92+
echo "platforms_added=$platforms_added" >> $GITHUB_OUTPUT
93+
5194
- name: Optimise images
95+
id: optimise_images
5296
run: |
97+
images_optimized=false
5398
images=$(gh pr view ${{ github.event.inputs.pr_number }} --json files | jq -r '.files[].path | select(endswith("png") or endswith("jpeg") or endswith("jpg"))')
5499
images_array=()
55100
if [[ -n "$images" ]]; then
@@ -75,7 +120,9 @@ jobs:
75120
imageoptim "${batch[@]}"
76121
((batch_number++))
77122
done
123+
images_optimized=true
78124
fi
125+
echo "images_optimized=$images_optimized" >> $GITHUB_OUTPUT
79126
- name: Commit changes
80127
id: commit_changes
81128
run: |
@@ -91,12 +138,39 @@ jobs:
91138
if [[ "$can_modify" == "false" ]]; then
92139
error="Edits from maintainers are disabled."
93140
echo $error
141+
echo "error=$error" >> $GITHUB_OUTPUT
94142
exit 1
95143
fi
96144
145+
# Build a dynamic commit message based on previous steps
146+
parts=()
147+
if [[ "${{ steps.update_changelog.outputs.changelog_updated }}" == "true" ]]; then
148+
parts+=("Update CHANGELOG.md")
149+
fi
150+
if [[ "${{ steps.add_platforms_field.outputs.platforms_added }}" == "true" ]]; then
151+
parts+=("add platforms field")
152+
fi
153+
if [[ "${{ steps.optimise_images.outputs.images_optimized }}" == "true" ]]; then
154+
parts+=("optimise images")
155+
fi
156+
157+
# Join parts with commas and 'and' for the last item
158+
if [[ ${#parts[@]} -eq 0 ]]; then
159+
commit_msg="Automated maintenance updates"
160+
else
161+
commit_msg="${parts[0]}"
162+
for (( i=1; i<${#parts[@]}; i++ )); do
163+
if [[ $i -eq $((${#parts[@]}-1)) ]]; then
164+
commit_msg+=" and ${parts[$i]}"
165+
else
166+
commit_msg+=", ${parts[$i]}"
167+
fi
168+
done
169+
fi
170+
97171
git add .
98172
git status .
99-
git commit --message "Update CHANGELOG.md and optimise images"
173+
git commit --message "$commit_msg"
100174
101175
git push https://${{ env.GITHUB_TOKEN }}@github.com/$pr_repo_owner/$pr_repo_name.git HEAD:$pr_branch
102176
echo "Pushed changes."

docs/ai/getting-started.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ There are two ways to leverage the power of AI inside your extensions.
88

99
{% hint style="info" %}
1010
To use AI APIs or AI Extensions, you need to subscribe to [Raycast Pro](https://raycast.com/pro).
11+
12+
AI Extensions aren't available on Windows for now.
13+
1114
{% endhint %}
1215

1316
## AI APIs

docs/api-reference/browser-extension.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Some users might not have installed the Browser Extension. If a user doesn't hav
88

99
You can check if a user has the Browser Extension installed using [`environment.canAccess(BrowserExtension)`](./environment.md).
1010

11+
The API is not accessible on Windows for now.
12+
1113
{% endhint %}
1214

1315
## API Reference

docs/api-reference/menu-bar-commands.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
The `MenuBarExtra` component can be used to create commands which populate the [extras](https://developer.apple.com/design/human-interface-guidelines/components/system-experiences/the-menu-bar#menu-bar-commands) section of macOS' menu bar.
44

5+
{% hint style="info" %}
6+
7+
Menubar commands aren't available on Windows.
8+
9+
{% endhint %}
10+
511
## Getting Started
612

713
If you don't have an extension yet, follow the [getting started](../basics/getting-started.md) guide and then return to this page.

docs/api-reference/window-management.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Some users might not have access to this API. If a user doesn't have access to R
88

99
You can check if a user has access to the API using [`environment.canAccess(WindowManagement)`](./environment.md).
1010

11+
The API is not accessible on Windows for now.
12+
1113
{% endhint %}
1214

1315
## API Reference

docs/basics/contribute-to-an-extension.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ When you're done editing the extension, make sure to add yourself to the contrib
2424

2525
Additionally, ensure the `CHANGELOG.md` file is updated with your changes; create it if it doesn't exist. Use the `{PR_MERGE_DATE}` placeholder for the date – see the [Version History documentation](prepare-an-extension-for-store.md#version-history) for details.
2626

27-
Once everything is ready, see [how to publish an extension](publish-an-extension.md) for instructions on validating and publishing the changes (via a pull request).
27+
Once everything is ready, see [how to publish an extension](publish-an-extension.md) for instructions on validating and publishing the changes.

docs/basics/prepare-an-extension-for-store.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Here you will find requirements and guidelines that you'll need to follow in ord
1212
- Ensure you use your **Raycast** account username in the `author` field
1313
- Ensure you use `MIT` in the `license` field
1414
- Ensure you are using the latest Raycast API version
15+
- Ensure the `platforms` field matching the requirement of your extension, eg. if you use platform-specific APIs, restrict the `platforms` field to the corresponding platform
1516
- Please use `npm` for installing dependencies and include `package-lock.json` in your pull request. We use `npm` on our Continuous Integration (CI) environment when building and publishing extensions so, by providing a `package-lock.json` file, we ensure that the dependencies on the server match the same versions as your local dependencies.
1617
- Please check the terms of service of third-party services that your extension uses.
1718
- Read the [Extension Guidelines](https://manual.raycast.com/extensions) and make sure that your Extension comply with it.

docs/information/manifest.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Here is a typical manifest file:
1111
"description": "My extension that can do a lot of things",
1212
"icon": "icon.png",
1313
"author": "thomas",
14+
"platforms": ["macOS", "Windows"],
1415
"categories": ["Fun", "Communication"],
1516
"license": "MIT",
1617
"commands": [
@@ -35,10 +36,10 @@ All Raycast related properties for an extension.
3536
| description<mark style="color:red;">\*</mark> | The full description of the extension shown in the Store. |
3637
| icon<mark style="color:red;">\*</mark> | A reference to an icon file in the assets folder. Use png format with a size of 512 x 512 pixels. To support light and dark theme, add two icons, one with `@dark` as suffix, e.g. `icon.png` and `icon@dark.png`. |
3738
| author <mark style="color:red;">\*</mark> | Your Raycast Store handle (username) |
39+
| platforms <mark style="color:red;">\*</mark> | An Array of platforms supported by the extension(`"macOS"` or `"Windows"`). If the extension uses some platform-specific APIs, restrict which platform can install it. |
3840
| categories<mark style="color:red;">\*</mark> | An array of categories that your extension belongs in. |
3941
| commands<mark style="color:red;">\*</mark> | An array of [commands](./terminology.md#command) exposed by the extension, see [Command properties](manifest.md#command-properties). |
4042
| tools | An array of tools that the AI can use to interact with this extension, see [Tool properties](#tool-properties). |
41-
| platforms | An Array of platforms supported by the extension. If the extension uses some platform-specific APIs, add this field to restrict which platform can install it (`"macOS"` or `"Windows"`). |
4243
| ai | Additional information related to the AI capabilities of the extension, see [AI properties](#ai-properties). |
4344
| owner | Used for extensions published under an organisation. When defined, the extension will be [private](../teams/getting-started.md) (except when specifying `access`). |
4445
| access | Either `"public"` or `"private"`. Public extensions are downloadable by anybody, while [private](../teams/getting-started.md) extensions can only be downloaded by a member of a given organization. |
@@ -78,7 +79,7 @@ All properties for extension or command-specific preferences. Use the [Preferenc
7879
| type<mark style="color:red;">\*</mark> | The preference type. We currently support `"textfield"` and `"password"` (for secure entry), `"checkbox"`, `"dropdown"`, `"appPicker"`, `"file"`, and `"directory"`. |
7980
| required<mark style="color:red;">\*</mark> | Indicates whether the value is required and must be entered by the user before the extension is usable. |
8081
| placeholder | Text displayed in the preference's field when no value has been input. |
81-
| default | The optional default value for the field. For textfields, this is a string value; for checkboxes a boolean; for dropdowns the value of an object in the data array; for appPickers an application name, bundle ID or path. Additionally, you can specify a different value per plaform by passing an object: <code>{ "macOS": ..., "Windows": ... }</code>`. |
82+
| default | <p>The optional default value for the field. For textfields, this is a string value; for checkboxes a boolean; for dropdowns the value of an object in the data array; for appPickers an application name, bundle ID or path.</p><p>Additionally, you can specify a different value per plaform by passing an object: <code>{ "macOS": ..., "Windows": ... }</code>`.</p> |
8283

8384
Depending on the `type` of the Preference, some additional properties can be required:
8485

examples/api-examples/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"icon": "command-icon.png",
77
"license": "MIT",
88
"author": "raycast",
9+
"platforms": ["Windows", "macOS"],
910
"commands": [
1011
{
1112
"name": "markdown",

0 commit comments

Comments
 (0)