@bniladridas/cursor 0.1.8 → 0.1.10

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.
package/CMakeLists.txt CHANGED
@@ -1,7 +1,8 @@
1
1
  cmake_minimum_required(VERSION 3.14)
2
2
 
3
- # Get version from git tag if available, fallback to 0.1.6
4
- find_package(Git)
3
+ # Try to get version from git tag
4
+ find_package(Git QUIET)
5
+ set(PROJECT_VERSION "0.0.0")
5
6
  if(GIT_FOUND)
6
7
  execute_process(
7
8
  COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=0
@@ -12,11 +13,16 @@ if(GIT_FOUND)
12
13
  )
13
14
  if(GIT_TAG)
14
15
  string(REGEX REPLACE "^v" "" PROJECT_VERSION ${GIT_TAG})
15
- else()
16
- set(PROJECT_VERSION "0.1.6")
17
16
  endif()
18
- else()
19
- set(PROJECT_VERSION "0.1.6")
17
+ endif()
18
+
19
+ # Fallback: extract from source dir name (e.g., cursor-0.1.8 from tarball)
20
+ if(PROJECT_VERSION STREQUAL "0.0.0")
21
+ get_filename_component(SOURCE_DIR_NAME ${CMAKE_SOURCE_DIR} NAME)
22
+ string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" EXTRACTED_VERSION ${SOURCE_DIR_NAME})
23
+ if(EXTRACTED_VERSION)
24
+ set(PROJECT_VERSION ${EXTRACTED_VERSION})
25
+ endif()
20
26
  endif()
21
27
 
22
28
  project(cursor VERSION ${PROJECT_VERSION} LANGUAGES CXX)
@@ -317,43 +323,38 @@ if(NOT CPR_FOUND)
317
323
  message(FATAL_ERROR "Failed to find or build CPR. Please install it manually or check your network connection.")
318
324
  endif()
319
325
  endif()
320
- # Enable testing
321
- enable_testing()
326
+ option(CURSOR_BUILD_TESTS "Build tests" ON)
322
327
 
323
- # Fetch Google Test
324
- set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
328
+ if(CURSOR_BUILD_TESTS)
329
+ enable_testing()
325
330
 
326
- # Only fetch and build gtest if not already found
327
- if(NOT TARGET gtest)
328
- message(STATUS "Downloading and building Google Test...")
329
- FetchContent_Declare(
330
- googletest
331
- GIT_REPOSITORY https://github.com/google/googletest.git
332
- GIT_TAG v1.14.0
333
- GIT_SHALLOW TRUE
334
- )
331
+ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
335
332
 
336
- # For Windows: Prevent overriding the parent project's compiler/linker settings
337
- set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
338
-
339
- # Build static libraries to avoid runtime dependencies
340
- set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
333
+ if(NOT TARGET gtest)
334
+ message(STATUS "Downloading and building Google Test...")
335
+ FetchContent_Declare(
336
+ googletest
337
+ GIT_REPOSITORY https://github.com/google/googletest.git
338
+ GIT_TAG v1.14.0
339
+ GIT_SHALLOW TRUE
340
+ )
341
341
 
342
- # Make sure we're not overriding compiler flags
343
- set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
344
- set(BUILD_GMOCK ON CACHE BOOL "" FORCE)
345
- set(BUILD_GTEST ON CACHE BOOL "" FORCE)
342
+ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
343
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
344
+ set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
345
+ set(BUILD_GMOCK ON CACHE BOOL "" FORCE)
346
+ set(BUILD_GTEST ON CACHE BOOL "" FORCE)
346
347
 
347
- FetchContent_MakeAvailable(googletest)
348
+ FetchContent_MakeAvailable(googletest)
348
349
 
349
- # Create an interface library for gtest to make it easier to link
350
- if(NOT TARGET gtest_all_tests)
351
- add_library(gtest_all_tests INTERFACE)
352
- target_link_libraries(gtest_all_tests
353
- INTERFACE
354
- GTest::GTest
355
- GTest::Main
356
- )
350
+ if(NOT TARGET gtest_all_tests)
351
+ add_library(gtest_all_tests INTERFACE)
352
+ target_link_libraries(gtest_all_tests
353
+ INTERFACE
354
+ GTest::GTest
355
+ GTest::Main
356
+ )
357
+ endif()
357
358
  endif()
358
359
  endif()
359
360
 
@@ -517,26 +518,26 @@ target_link_libraries(cursor-agent PRIVATE
517
518
  cursor_lib
518
519
  )
519
520
 
520
- # Test executable
521
- add_executable(cursor-tests tests/main_test.cpp src/utils/version.cpp)
522
- target_include_directories(cursor-tests PRIVATE
523
- ${CMAKE_CURRENT_SOURCE_DIR}/include
524
- ${CMAKE_CURRENT_BINARY_DIR}/include
525
- )
526
- target_link_libraries(cursor-tests PRIVATE
527
- cursor_lib
528
- gtest_main
529
- gtest
530
- )
531
- add_test(NAME basic_tests COMMAND cursor-tests)
521
+ if(CURSOR_BUILD_TESTS)
522
+ add_executable(cursor-tests tests/main_test.cpp src/utils/version.cpp)
523
+ target_include_directories(cursor-tests PRIVATE
524
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
525
+ ${CMAKE_CURRENT_BINARY_DIR}/include
526
+ )
527
+ target_link_libraries(cursor-tests PRIVATE
528
+ cursor_lib
529
+ gtest_main
530
+ gtest
531
+ )
532
+ add_test(NAME basic_tests COMMAND cursor-tests)
532
533
 
533
- # Set target properties for test executable
534
- set_target_properties(cursor-tests PROPERTIES
535
- RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
536
- MACOSX_RPATH ON
537
- INSTALL_RPATH "@executable_path/lib"
538
- BUILD_WITH_INSTALL_RPATH TRUE
539
- )
534
+ set_target_properties(cursor-tests PROPERTIES
535
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
536
+ MACOSX_RPATH ON
537
+ INSTALL_RPATH "@executable_path/lib"
538
+ BUILD_WITH_INSTALL_RPATH TRUE
539
+ )
540
+ endif()
540
541
 
541
542
  # Set target properties
542
543
  set_target_properties(cursor-agent PROPERTIES
@@ -626,7 +627,7 @@ add_custom_target(test-quick
626
627
  # Code coverage target (requires lcov)
627
628
  find_program(LCOV_EXE lcov)
628
629
  find_program(GENHTML_EXE genhtml)
629
- if(LCOV_EXE)
630
+ if(LCOV_EXE AND CURSOR_BUILD_TESTS)
630
631
  add_custom_target(coverage
631
632
  COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/coverage
632
633
  COMMAND ctest --output-on-failure
package/Formula/cursor.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  class Cursor < Formula
2
2
  desc "Professional AI agent with command execution and file operations"
3
3
  homepage "https://github.com/bniladridas/cursor"
4
- url "https://github.com/bniladridas/cursor/archive/refs/tags/v0.1.8.tar.gz"
5
- sha256 "8f5e29528edc6be08acfc81b0408330a4004da19453984dbc6176799277eecdb"
4
+ url "https://github.com/bniladridas/cursor/archive/refs/tags/v0.1.10.tar.gz"
5
+ sha256 "8d1e4ef239c47d7bcca823582a43379c676b169436803256a462584b2ddaceb3"
6
6
  license "Apache-2.0"
7
7
 
8
8
  depends_on "cmake" => :build
@@ -10,7 +10,7 @@ class Cursor < Formula
10
10
  depends_on "nlohmann-json"
11
11
 
12
12
  def install
13
- system "cmake", "-S", ".", "-B", "build", *std_cmake_args
13
+ system "cmake", "-S", ".", "-B", "build", "-DCURSOR_BUILD_TESTS=OFF", *std_cmake_args
14
14
  system "cmake", "--build", "build"
15
15
  bin.install "build/bin/cursor-agent"
16
16
 
package/install.js CHANGED
@@ -27,24 +27,31 @@ fs.mkdirSync(binaryDir, { recursive: true });
27
27
  console.log(`downloading cursor v${version}...`);
28
28
 
29
29
  const file = fs.createWriteStream(path.join(binaryDir, archive));
30
- https.get(url, (res) => {
31
- if (res.statusCode !== 200) {
32
- console.error(`download failed (${res.statusCode}): ${url}`);
33
- process.exit(1);
34
- }
35
- res.pipe(file);
36
- file.on('finish', () => {
37
- file.close();
38
- console.log('extracting...');
39
- if (process.platform === 'win32') {
40
- execSync(`tar -xf "${path.join(binaryDir, archive)}" -C "${binaryDir}"`, { stdio: 'inherit' });
41
- } else {
42
- execSync(`tar -xzf "${path.join(binaryDir, archive)}" -C "${binaryDir}"`, { stdio: 'inherit' });
30
+ function download(url) {
31
+ https.get(url, (res) => {
32
+ if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
33
+ download(res.headers.location);
34
+ return;
35
+ }
36
+ if (res.statusCode !== 200) {
37
+ console.error(`download failed (${res.statusCode}): ${url}`);
38
+ process.exit(1);
43
39
  }
44
- fs.unlinkSync(path.join(binaryDir, archive));
45
- console.log('done');
40
+ res.pipe(file);
41
+ file.on('finish', () => {
42
+ file.close();
43
+ console.log('extracting...');
44
+ if (process.platform === 'win32') {
45
+ execSync(`tar -xf "${path.join(binaryDir, archive)}" -C "${binaryDir}"`, { stdio: 'inherit' });
46
+ } else {
47
+ execSync(`tar -xzf "${path.join(binaryDir, archive)}" -C "${binaryDir}"`, { stdio: 'inherit' });
48
+ }
49
+ fs.unlinkSync(path.join(binaryDir, archive));
50
+ console.log('done');
51
+ });
52
+ }).on('error', (err) => {
53
+ console.error(`download failed: ${err.message}`);
54
+ process.exit(1);
46
55
  });
47
- }).on('error', (err) => {
48
- console.error(`download failed: ${err.message}`);
49
- process.exit(1);
50
- });
56
+ }
57
+ download(url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bniladridas/cursor",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "Cross-platform AI coding agent",
5
5
  "bin": {
6
6
  "cursor": "cli.js"
@@ -1,3 +1,3 @@
1
- fb8696e4173e851d399c4efcf3c141298d72538db225b3143f7c4ce62e42696b release/cursor-macos/cursor_v0.1.8_darwin_arm64.tar.gz
2
- cc6dde0e8975a4c556c86f5b1c16d684e256ac0bc91900b475c3cfa3c8ad4803 release/cursor-linux/cursor_v0.1.8_linux_amd64.tar.gz
3
- a058e7b012614a190060f029661bec9f52fb05246b4c0ac8bd56392630628d8e release/cursor-windows/cursor__windows_amd64.zip
1
+ 51ce9c8c8f5ccddd8160eb8756eb123be7e52c9ab8ae819b31863184b8acfdba release/cursor-macos/cursor_v0.1.10_darwin_arm64.tar.gz
2
+ 622094ca34e6c6611dd68d7232d05f875366a34ec54c812143b04f4d0f382cf6 release/cursor-linux/cursor_v0.1.10_linux_amd64.tar.gz
3
+ 61e718c9ca581e897464691fc095a405b71000b4286969b9175357298c737724 release/cursor-windows/cursor__windows_amd64.zip