@raycast/api 1.85.2 → 1.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/bin/run.cmd +3 -0
  2. package/bin/run.js +4 -0
  3. package/dist/api/base.js +21 -0
  4. package/dist/api/github.js +31 -0
  5. package/dist/api/raycast.js +21 -0
  6. package/dist/commands/build/index.js +621 -0
  7. package/dist/commands/develop/index.js +622 -0
  8. package/dist/commands/lint/index.js +102 -0
  9. package/dist/commands/login/index.js +21 -0
  10. package/dist/commands/logout/index.js +1 -0
  11. package/dist/commands/migrate/index.js +43 -0
  12. package/dist/commands/profile/index.js +21 -0
  13. package/dist/commands/publish/index.js +811 -0
  14. package/dist/commands/pull-contributions/index.js +43 -0
  15. package/dist/commands/token/index.js +11 -0
  16. package/dist/commands/validate/index.js +102 -0
  17. package/dist/commands/version/index.js +1 -0
  18. package/dist/config.js +1 -0
  19. package/dist/index.js +1 -0
  20. package/dist/manifest.js +1 -0
  21. package/dist/types/json-source-map.d.js +1 -0
  22. package/dist/types/manifest-schema.d.js +1 -0
  23. package/dist/utils/BaseCommand.js +1 -0
  24. package/dist/utils/esbuild-plugins/node-files.js +1 -0
  25. package/dist/utils/esbuild-plugins/swift-files.js +150 -0
  26. package/dist/utils/generate-typeScript-definitions.js +37 -0
  27. package/dist/utils/output.js +13 -0
  28. package/dist/utils/publish/copy-dir.js +1 -0
  29. package/dist/utils/publish/git.js +4 -0
  30. package/dist/utils/publish/publish-to-public-repo.js +78 -0
  31. package/dist/utils/publish/publish-to-store.js +728 -0
  32. package/dist/utils/publish/pull-contributions.js +43 -0
  33. package/dist/utils/publish/setup-github-fork.js +43 -0
  34. package/dist/utils/raycast-app-communication.js +2 -0
  35. package/oclif.manifest.json +984 -0
  36. package/package.json +19 -7
  37. package/bin/ray +0 -71
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raycast/api",
3
- "version": "1.85.2",
3
+ "version": "1.86.0",
4
4
  "description": "Build extensions for Raycast with React and Node.js.",
5
5
  "author": "Raycast Technologies Ltd.",
6
6
  "homepage": "https://developers.raycast.com",
@@ -10,8 +10,13 @@
10
10
  "license": "MIT",
11
11
  "types": "types/index.d.ts",
12
12
  "dependencies": {
13
- "@types/node": "^20.8.10",
14
- "@types/react": "^18.3.3",
13
+ "@oclif/core": "^4.0.33",
14
+ "@oclif/plugin-autocomplete": "^3.2.10",
15
+ "@oclif/plugin-help": "^6.2.18",
16
+ "@oclif/plugin-not-found": "^3.2.28",
17
+ "@types/node": "20.8.10",
18
+ "@types/react": "18.3.3",
19
+ "esbuild": "^0.24.0",
15
20
  "react": "18.3.1"
16
21
  },
17
22
  "peerDependencies": {
@@ -30,10 +35,17 @@
30
35
  "optional": true
31
36
  }
32
37
  },
33
- "scripts": {
34
- "postinstall": "bin/ray npm-post-install"
35
- },
36
38
  "bin": {
37
- "ray": "bin/ray"
39
+ "ray": "./bin/run.js"
40
+ },
41
+ "oclif": {
42
+ "bin": "ray",
43
+ "dirname": "ray",
44
+ "commands": "./dist/commands",
45
+ "plugins": [
46
+ "@oclif/plugin-autocomplete",
47
+ "@oclif/plugin-help",
48
+ "@oclif/plugin-not-found"
49
+ ]
38
50
  }
39
51
  }
package/bin/ray DELETED
@@ -1,71 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Test chnages in the script:
4
- # - with `npm install` using a local directory reference
5
- # - with `npx @raycast/api@latest build` by modifying the one downloaded by `npx`` to the `~/.npm/_npx/xxx/node_modules/bin` folder
6
-
7
- # Determine the path for dist folder
8
- # Using 'readlink -f' is not an option as '-f' it's not available on older macOS versions
9
- source=${BASH_SOURCE:-$0}
10
- # resolve $source until the file is no longer a symlink
11
- while [ -L "$source" ]; do
12
- # Unsetting CDPATH is necessary to act on the current directory and avoid problems when the 'bin' directory exists in CDPATH
13
- dir=$( unset CDPATH && cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd )
14
- source=$(readlink "$source")
15
- # if $source was a relative symlink, we need to resolve it relative to the path where the symlink file was located
16
- [[ $source != /* ]] && source=$dir/$source
17
- done
18
- # Unsetting CDPATH is necessary to act on the current directory and avoid problems when the 'bin' directory exists in CDPATH
19
- bin_dir=$( unset CDPATH && cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd )
20
- dist_dir=$(dirname "$bin_dir")
21
-
22
- if [ -z "$bin_dir" ]; then
23
- echo "Unable to determine CLI path for source: ${BASH_SOURCE:-$0}"
24
- exit 1
25
- fi
26
-
27
- # Read API version from package.json from current NPM, which will define the CLI version
28
- api_version=$(sed -n 's|.*"version": "\([^"]*\)".*|\1|p' < "$dist_dir/package.json")
29
- if [ -z "$api_version" ]; then
30
- echo "Fail parsing version"
31
- exit 1
32
- fi
33
-
34
- # CLI installation subroutine, using custom version and path for the CLI
35
- function install_cli {
36
- if ! curl -f -sL https://www.raycast.com/get-cli/ | VERSION="$api_version" INSTALL_PATH="$ray_path" bash; then
37
- exit 1
38
- fi
39
- }
40
-
41
- # Define the architecture directory in /dist folder to pick the right CLI version
42
- os="$(uname)"
43
- architecture="$(uname -m)"
44
- architecture_dir="x86"
45
- if [[ "${os}" = "Darwin" && "${architecture}" = "arm64" ]]; then
46
- architecture_dir="arm64"
47
- elif [ "${os}" = "Linux" ]; then
48
- architecture_dir="linux"
49
- fi
50
-
51
- # Define the path for CLI for current architecture
52
- ray_path="$bin_dir/$architecture_dir/ray"
53
-
54
- # If there is no CLI for current architecture, download it
55
- if [ ! -f "$ray_path" ]; then
56
- install_cli;
57
- else
58
- # If version of the CLI for current architecture is outdated, re-download the CLI
59
- ray_version=$("$ray_path" version)
60
- if [ "$ray_version" != "$api_version" ]; then
61
- install_cli;
62
- fi
63
- fi
64
-
65
- # For npm-post-install script, we don't execute the CLI
66
- if [ "$1" == "npm-post-install" ]; then
67
- exit 0
68
- fi
69
-
70
- # Execute the CLI passing all parameters to it
71
- "$ray_path" "$@"