From 11b24a8db4d7110593d1e404dd08de83a5f926f0 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Fri, 23 Aug 2024 22:16:47 -0400 Subject: [PATCH] Update CLI ownership Signed-off-by: Juan Cruz Viotti --- .github/workflows/package.yml | 2 +- .github/workflows/test.yml | 2 +- CONTRIBUTING.markdown | 20 +------------- Dockerfile | 2 +- Makefile | 2 +- README.markdown | 18 ++++++------- action.yml | 2 +- docs/format.markdown | 4 +-- install | 4 +-- npm-deploy.sh | 14 +++++----- src/CMakeLists.txt | 2 +- src/command.h | 8 +++--- src/command_bundle.cc | 2 +- src/command_compile.cc | 2 +- src/command_fmt.cc | 2 +- src/command_frame.cc | 2 +- src/command_identify.cc | 2 +- src/command_lint.cc | 2 +- src/command_metaschema.cc | 2 +- src/command_test.cc | 26 +++++++++---------- src/command_validate.cc | 2 +- src/configure.h.in | 6 ++--- src/main.cc | 26 +++++++++---------- src/utils.cc | 4 +-- src/utils.h | 8 +++--- test/test/fail_no_schema.sh | 2 +- test/test/fail_no_tests.sh | 2 +- test/test/fail_not_object.sh | 2 +- test/test/fail_schema_non_string.sh | 2 +- .../test/fail_test_case_data_and_data_path.sh | 2 +- test/test/fail_test_case_no_data.sh | 2 +- test/test/fail_test_case_no_valid.sh | 2 +- test/test/fail_test_case_non_boolean_valid.sh | 2 +- test/test/fail_test_case_non_object.sh | 2 +- .../fail_test_case_non_string_data_path.sh | 2 +- .../fail_test_case_non_string_description.sh | 2 +- test/test/fail_tests_non_array.sh | 2 +- 37 files changed, 86 insertions(+), 104 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index c8794edd..2a8b7e81 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -79,7 +79,7 @@ jobs: - run: cmake --build ./build --config Release --parallel 4 - run: > cmake --install ./build --prefix ./build/dist --config Release --verbose - --component intelligence_jsonschema + --component sourcemeta_jsonschema # Not every CTest version supports the --test-dir option. If such option # is not recognized, `ctest` will successfully exit finding no tests. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e9a1a453..1d3ddc9b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -66,7 +66,7 @@ jobs: - run: cmake --build ./build --config Release --parallel 4 - run: > cmake --install ./build --prefix ./build/dist --config Release --verbose - --component intelligence_jsonschema + --component sourcemeta_jsonschema # Not every CTest version supports the --test-dir option. If such option # is not recognized, `ctest` will successfully exit finding no tests. diff --git a/CONTRIBUTING.markdown b/CONTRIBUTING.markdown index d7a959b7..0c26877e 100644 --- a/CONTRIBUTING.markdown +++ b/CONTRIBUTING.markdown @@ -37,22 +37,4 @@ git tag -a "vX.Y.Z" -m "vX.Y.Z" git push ``` -Then update https://github.com/Intelligence-AI/homebrew-apps. - -Grant of Rights ---------------- - -By contributing to this project, the Contributor irrevocably assigns, -transfers, and conveys to Intelligence.AI all right, title, and interest in -and to any contributions, including, but not limited to, all intellectual -property rights. - -The contributor acknowledges and agrees that Intelligence.AI shall have the -exclusive right to use, reproduce, modify, distribute, publicly display, -publicly perform, sublicense, and otherwise exploit the contributions, whether -in original or modified form, for any purpose and without any obligation to -account to the contributor. - -The contributor grants Intelligence.AI the right to re-license the -contributions, including any derivative works, under other licenses as -Intelligence.AI deems appropriate. +Then update https://github.com/sourcemeta/homebrew-apps. diff --git a/Dockerfile b/Dockerfile index 9b4d1f6d..d96da7ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ COPY CMakeLists.txt /source/CMakeLists.txt RUN cmake -S /source -B ./build -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF RUN cmake --build /build --config Release --parallel 4 -RUN cmake --install /build --prefix /usr/local --config Release --verbose --component intelligence_jsonschema +RUN cmake --install /build --prefix /usr/local --config Release --verbose --component sourcemeta_jsonschema FROM debian:bookworm-slim COPY --from=builder /usr/local/bin/jsonschema /usr/local/bin/jsonschema diff --git a/Makefile b/Makefile index e87037b4..1e8f0151 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ compile: .always $(CMAKE) --build ./build --config $(PRESET) --target shellcheck $(CMAKE) --build ./build --config $(PRESET) --parallel 4 $(CMAKE) --install ./build --prefix $(PREFIX) --config $(PRESET) --verbose \ - --component intelligence_jsonschema + --component sourcemeta_jsonschema $(CPACK) --config build/CPackConfig.cmake -B build/out -C $(PRESET) lint: .always diff --git a/README.markdown b/README.markdown index 7cd99369..aa4b4b46 100644 --- a/README.markdown +++ b/README.markdown @@ -76,19 +76,19 @@ powerful [JSON Toolkit](https://github.com/sourcemeta/jsontoolkit) library. ### From Homebrew ```sh -brew install intelligence-ai/apps/jsonschema +brew install sourcemeta/apps/jsonschema ``` ### From GitHub Actions ```yaml -- uses: intelligence-ai/jsonschema@vX.Y.Z +- uses: sourcemeta/jsonschema@vX.Y.Z ``` Where `X.Y.Z` is replaced with the desired version. For example: ```yaml -- uses: intelligence-ai/jsonschema@v3.2.3 +- uses: sourcemeta/jsonschema@v3.2.3 # Then use as usual - run: jsonschema fmt path/to/schemas --check ``` @@ -96,21 +96,21 @@ Where `X.Y.Z` is replaced with the desired version. For example: ### From NPM ```sh -npm install --global @intelligence-ai/jsonschema +npm install --global @sourcemeta/jsonschema ``` ### From GitHub Releases We publish precompiled binaries for every supported platform to [GitHub -Releases](https://github.com/Intelligence-AI/jsonschema/releases), including a -[continuous](https://github.com/Intelligence-AI/jsonschema/releases/tag/continuous) +Releases](https://github.com/sourcemeta/jsonschema/releases), including a +[continuous](https://github.com/sourcemeta/jsonschema/releases/tag/continuous) that is updated on every commit from the main branch. For convenience, we also provide a POSIX shell script capable of installing the latest pre-built binaries, which you can run as follows: ```sh -/bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/intelligence-ai/jsonschema/main/install -H "Cache-Control: no-cache, no-store, must-revalidate")" +/bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/sourcemeta/jsonschema/main/install -H "Cache-Control: no-cache, no-store, must-revalidate")" ``` ### From Dockerfile @@ -142,12 +142,12 @@ docker run --interactive --volume "$PWD:/workspace" jsonschema lint --verbose my ### Building from source ```sh -git clone https://github.com/intelligence-ai/jsonschema +git clone https://github.com/sourcemeta/jsonschema cd jsonschema cmake -S . -B ./build -DCMAKE_BUILD_TYPE:STRING=Release cmake --build ./build --config Release --parallel 4 cmake --install ./build --prefix \ - --config Release --verbose --component intelligence_jsonschema + --config Release --verbose --component sourcemeta_jsonschema ``` Where `` can be any destination prefix of your choosing, such as `/opt` diff --git a/action.yml b/action.yml index a6a5202b..b1470265 100644 --- a/action.yml +++ b/action.yml @@ -8,7 +8,7 @@ runs: run: | curl --retry 5 --location --fail-early --silent --show-error \ --output "${GITHUB_WORKSPACE}/install.sh" \ - "https://raw.githubusercontent.com/intelligence-ai/jsonschema/main/install" + "https://raw.githubusercontent.com/sourcemeta/jsonschema/main/install" chmod +x "${GITHUB_WORKSPACE}/install.sh" "${GITHUB_WORKSPACE}/install.sh" 3.2.3 rm "${GITHUB_WORKSPACE}/install.sh" diff --git a/docs/format.markdown b/docs/format.markdown index 2718c9ac..942c4d8d 100644 --- a/docs/format.markdown +++ b/docs/format.markdown @@ -24,7 +24,7 @@ spacing, keyword ordering, and more: ```json { "$schema":"https://json-schema.org/draft/2020-12/schema", "type": "string","pattern": "^(?!0000)\\d{4}$", - "$id": "https://schemas.intelligence.ai/std/iso8601-year/v1.json", + "$id": "https://example.com/iso8601/v1.json", "title": "ISO 8601 four-digit year (YYYY)" } ``` @@ -33,7 +33,7 @@ After formatting it, the JSON Schema looks like this: ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://schemas.intelligence.ai/std/iso8601-year/v1.json", + "$id": "https://example.com/iso8601/v1.json", "title": "ISO 8601 four-digit year (YYYY)", "type": "string", "pattern": "^(?!0000)\\d{4}$" diff --git a/install b/install index 7fe3e6e5..41d8b3b4 100755 --- a/install +++ b/install @@ -9,7 +9,7 @@ ARCH="$(uname -m)" if [ "$UNAME" = "Darwin" ] || [ "$UNAME" = "Linux" ] then echo "---- Fetching the pre-built JSON Schema CLI binary from GitHub Releases" 1>&2 - OWNER="intelligence-ai" + OWNER="sourcemeta" REPOSITORY="jsonschema" if [ $# -lt 1 ] @@ -34,6 +34,6 @@ then install -v -m 0755 "$TMP/out/jsonschema-$VERSION-$PACKAGE_PLATFORM_NAME-$ARCH/bin/jsonschema" "$OUTPUT/bin" else echo "ERROR: I don't know how to install the JSON Schema CLI in $UNAME!" 1>&2 - echo "Open an issue here: https://github.com/Intelligence-AI/jsonschema/issues" 1>&2 + echo "Open an issue here: https://github.com/sourcemeta/jsonschema/issues" 1>&2 exit 1 fi diff --git a/npm-deploy.sh b/npm-deploy.sh index 04a63e2a..08b2b74b 100755 --- a/npm-deploy.sh +++ b/npm-deploy.sh @@ -15,7 +15,7 @@ VERSION="$(echo "$1" | tr -d 'v')" # (1) Download artifacts mkdir -p "$OUTPUT/npm/artifacts" echo "Preparing $VERSION" 1>&2 -PACKAGE_BASE_URL="https://github.com/intelligence-ai/jsonschema/releases/download/v$VERSION" +PACKAGE_BASE_URL="https://github.com/sourcemeta/jsonschema/releases/download/v$VERSION" curl --retry 5 --location --output "$OUTPUT/npm/artifacts/darwin-arm64.zip" \ "$PACKAGE_BASE_URL/jsonschema-$VERSION-darwin-arm64.zip" curl --retry 5 --location --output "$OUTPUT/npm/artifacts/darwin-x86_64.zip" \ @@ -46,7 +46,7 @@ install -m 0644 "$(pwd)/README.markdown" "$OUTPUT/npm/staging/README.md" cat << EOF > "$OUTPUT/npm/staging/package.json" { - "name": "@intelligence-ai/jsonschema", + "name": "@sourcemeta/jsonschema", "version": "$VERSION", "description": "The CLI for working with JSON Schema. Covers formatting, linting, testing, and much more for both local development and CI/CD pipelines", "main": "cli.js", @@ -54,8 +54,8 @@ cat << EOF > "$OUTPUT/npm/staging/package.json" "jsonschema": "cli.js" }, "license": "AGPL-3.0", - "homepage": "https://github.com/intelligence-ai/jsonschema", - "author": "Juan Cruz Viotti ", + "homepage": "https://github.com/sourcemeta/jsonschema", + "author": "Juan Cruz Viotti ", "keywords": [ "jsonschema", "json", "schema", "json-schema", "cli", "\$ref", "dereference", "reference", "resolve", @@ -63,11 +63,11 @@ cat << EOF > "$OUTPUT/npm/staging/package.json" "lint", "format" ], "bugs": { - "url": "https://github.com/intelligence-ai/jsonschema/issues" + "url": "https://github.com/sourcemeta/jsonschema/issues" }, "repository": { "type": "git", - "url": "git+https://github.com/intelligence-ai/jsonschema.git" + "url": "git+https://github.com/sourcemeta/jsonschema.git" }, "publishConfig": { "access": "public" @@ -90,7 +90,7 @@ const EXECUTABLE = PLATFORM === 'windows' if (!fs.existsSync(EXECUTABLE)) { console.error(`The JSON Schema CLI NPM package does not support ${os.platform()} for ${ARCH} yet`); - console.error('Please open a GitHub issue at https://github.com/Intelligence-AI/jsonschema'); + console.error('Please open a GitHub issue at https://github.com/sourcemeta/jsonschema'); process.exit(1); } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 60be8e88..d5df5310 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -27,4 +27,4 @@ target_include_directories(jsonschema_cli PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") include(GNUInstallDirs) install(TARGETS jsonschema_cli RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - COMPONENT intelligence_jsonschema) + COMPONENT sourcemeta_jsonschema) diff --git a/src/command.h b/src/command.h index e2015d67..35eb3e4a 100644 --- a/src/command.h +++ b/src/command.h @@ -1,10 +1,10 @@ -#ifndef INTELLIGENCE_JSONSCHEMA_CLI_COMMAND_H_ -#define INTELLIGENCE_JSONSCHEMA_CLI_COMMAND_H_ +#ifndef SOURCEMETA_JSONSCHEMA_CLI_COMMAND_H_ +#define SOURCEMETA_JSONSCHEMA_CLI_COMMAND_H_ #include // std::span #include // std::string -namespace intelligence::jsonschema::cli { +namespace sourcemeta::jsonschema::cli { auto fmt(const std::span &arguments) -> int; auto frame(const std::span &arguments) -> int; auto bundle(const std::span &arguments) -> int; @@ -14,6 +14,6 @@ auto lint(const std::span &arguments) -> int; auto validate(const std::span &arguments) -> int; auto metaschema(const std::span &arguments) -> int; auto identify(const std::span &arguments) -> int; -} // namespace intelligence::jsonschema::cli +} // namespace sourcemeta::jsonschema::cli #endif diff --git a/src/command_bundle.cc b/src/command_bundle.cc index fabfc2fd..2d0e791b 100644 --- a/src/command_bundle.cc +++ b/src/command_bundle.cc @@ -7,7 +7,7 @@ #include "command.h" #include "utils.h" -auto intelligence::jsonschema::cli::bundle( +auto sourcemeta::jsonschema::cli::bundle( const std::span &arguments) -> int { const auto options{ parse_options(arguments, {"h", "http", "w", "without-id"})}; diff --git a/src/command_compile.cc b/src/command_compile.cc index fdfc576a..a06ef86c 100644 --- a/src/command_compile.cc +++ b/src/command_compile.cc @@ -7,7 +7,7 @@ #include "command.h" #include "utils.h" -auto intelligence::jsonschema::cli::compile( +auto sourcemeta::jsonschema::cli::compile( const std::span &arguments) -> int { const auto options{parse_options(arguments, {})}; diff --git a/src/command_fmt.cc b/src/command_fmt.cc index 7041d8a5..dfd80460 100644 --- a/src/command_fmt.cc +++ b/src/command_fmt.cc @@ -9,7 +9,7 @@ #include "command.h" #include "utils.h" -auto intelligence::jsonschema::cli::fmt( +auto sourcemeta::jsonschema::cli::fmt( const std::span &arguments) -> int { const auto options{parse_options(arguments, {"c", "check"})}; diff --git a/src/command_frame.cc b/src/command_frame.cc index d8501360..2375010d 100644 --- a/src/command_frame.cc +++ b/src/command_frame.cc @@ -22,7 +22,7 @@ static auto enum_to_string( } } -auto intelligence::jsonschema::cli::frame( +auto sourcemeta::jsonschema::cli::frame( const std::span &arguments) -> int { const auto options{parse_options(arguments, {})}; if (options.at("").size() < 1) { diff --git a/src/command_identify.cc b/src/command_identify.cc index 89030c40..c4935764 100644 --- a/src/command_identify.cc +++ b/src/command_identify.cc @@ -20,7 +20,7 @@ find_relative_to(const std::map> &options) return std::nullopt; } -auto intelligence::jsonschema::cli::identify( +auto sourcemeta::jsonschema::cli::identify( const std::span &arguments) -> int { const auto options{parse_options(arguments, {})}; if (options.at("").size() < 1) { diff --git a/src/command_lint.cc b/src/command_lint.cc index 0b4589b4..07da4ac0 100644 --- a/src/command_lint.cc +++ b/src/command_lint.cc @@ -10,7 +10,7 @@ #include "command.h" #include "utils.h" -auto intelligence::jsonschema::cli::lint( +auto sourcemeta::jsonschema::cli::lint( const std::span &arguments) -> int { const auto options{parse_options(arguments, {"f", "fix"})}; diff --git a/src/command_metaschema.cc b/src/command_metaschema.cc index 7ed6e376..44e97cf5 100644 --- a/src/command_metaschema.cc +++ b/src/command_metaschema.cc @@ -11,7 +11,7 @@ #include "utils.h" // TODO: Add a flag to emit output using the standard JSON Schema output format -auto intelligence::jsonschema::cli::metaschema( +auto sourcemeta::jsonschema::cli::metaschema( const std::span &arguments) -> int { const auto options{parse_options(arguments, {"h", "http"})}; const auto custom_resolver{ diff --git a/src/command_test.cc b/src/command_test.cc index 0a2d166a..78ad3a3c 100644 --- a/src/command_test.cc +++ b/src/command_test.cc @@ -61,7 +61,7 @@ static auto get_data(const sourcemeta::jsontoolkit::JSON &test_case, } } -auto intelligence::jsonschema::cli::test( +auto sourcemeta::jsonschema::cli::test( const std::span &arguments) -> int { const auto options{parse_options(arguments, {"h", "http"})}; bool result{true}; @@ -78,7 +78,7 @@ auto intelligence::jsonschema::cli::test( if (!test.is_object()) { std::cout << "\nerror: The test document must be an object\n\n"; std::cout << "Learn more here: " - "https://github.com/Intelligence-AI/jsonschema/blob/main/" + "https://github.com/sourcemeta/jsonschema/blob/main/" "docs/test.markdown\n"; return EXIT_FAILURE; } @@ -87,7 +87,7 @@ auto intelligence::jsonschema::cli::test( std::cout << "\nerror: The test document must contain a `target` property\n\n"; std::cout << "Learn more here: " - "https://github.com/Intelligence-AI/jsonschema/blob/main/" + "https://github.com/sourcemeta/jsonschema/blob/main/" "docs/test.markdown\n"; return EXIT_FAILURE; } @@ -96,7 +96,7 @@ auto intelligence::jsonschema::cli::test( std::cout << "\nerror: The test document `target` property must be a URI\n\n"; std::cout << "Learn more here: " - "https://github.com/Intelligence-AI/jsonschema/blob/main/" + "https://github.com/sourcemeta/jsonschema/blob/main/" "docs/test.markdown\n"; return EXIT_FAILURE; } @@ -105,7 +105,7 @@ auto intelligence::jsonschema::cli::test( std::cout << "\nerror: The test document must contain a `tests` property\n\n"; std::cout << "Learn more here: " - "https://github.com/Intelligence-AI/jsonschema/blob/main/" + "https://github.com/sourcemeta/jsonschema/blob/main/" "docs/test.markdown\n"; return EXIT_FAILURE; } @@ -114,7 +114,7 @@ auto intelligence::jsonschema::cli::test( std::cout << "\nerror: The test document `tests` property must be an array\n\n"; std::cout << "Learn more here: " - "https://github.com/Intelligence-AI/jsonschema/blob/main/" + "https://github.com/sourcemeta/jsonschema/blob/main/" "docs/test.markdown\n"; return EXIT_FAILURE; } @@ -169,7 +169,7 @@ auto intelligence::jsonschema::cli::test( << "\nerror: Test case documents must be objects\n at test case #" << index << "\n\n"; std::cout << "Learn more here: " - "https://github.com/Intelligence-AI/jsonschema/blob/main/" + "https://github.com/sourcemeta/jsonschema/blob/main/" "docs/test.markdown\n"; return EXIT_FAILURE; } @@ -179,7 +179,7 @@ auto intelligence::jsonschema::cli::test( "`dataPath` property\n at test case #" << index << "\n\n"; std::cout << "Learn more here: " - "https://github.com/Intelligence-AI/jsonschema/blob/main/" + "https://github.com/sourcemeta/jsonschema/blob/main/" "docs/test.markdown\n"; return EXIT_FAILURE; } @@ -190,7 +190,7 @@ auto intelligence::jsonschema::cli::test( "`dataPath` property, but not both\n at test case #" << index << "\n\n"; std::cout << "Learn more here: " - "https://github.com/Intelligence-AI/jsonschema/blob/main/" + "https://github.com/sourcemeta/jsonschema/blob/main/" "docs/test.markdown\n"; return EXIT_FAILURE; } @@ -201,7 +201,7 @@ auto intelligence::jsonschema::cli::test( "property to a string\n at test case #" << index << "\n\n"; std::cout << "Learn more here: " - "https://github.com/Intelligence-AI/jsonschema/blob/main/" + "https://github.com/sourcemeta/jsonschema/blob/main/" "docs/test.markdown\n"; return EXIT_FAILURE; } @@ -212,7 +212,7 @@ auto intelligence::jsonschema::cli::test( "a string\n at test case #" << index << "\n\n"; std::cout << "Learn more here: " - "https://github.com/Intelligence-AI/jsonschema/blob/main/" + "https://github.com/sourcemeta/jsonschema/blob/main/" "docs/test.markdown\n"; return EXIT_FAILURE; } @@ -222,7 +222,7 @@ auto intelligence::jsonschema::cli::test( "property\n at test case #" << index << "\n\n"; std::cout << "Learn more here: " - "https://github.com/Intelligence-AI/jsonschema/blob/main/" + "https://github.com/sourcemeta/jsonschema/blob/main/" "docs/test.markdown\n"; return EXIT_FAILURE; } @@ -232,7 +232,7 @@ auto intelligence::jsonschema::cli::test( "a boolean\n at test case #" << index << "\n\n"; std::cout << "Learn more here: " - "https://github.com/Intelligence-AI/jsonschema/blob/main/" + "https://github.com/sourcemeta/jsonschema/blob/main/" "docs/test.markdown\n"; return EXIT_FAILURE; } diff --git a/src/command_validate.cc b/src/command_validate.cc index 195317b5..6d314f4f 100644 --- a/src/command_validate.cc +++ b/src/command_validate.cc @@ -14,7 +14,7 @@ // TODO: Add a flag to emit output using the standard JSON Schema output format // TODO: Add a flag to collect annotations // TODO: Add a flag to take a pre-compiled schema as input -auto intelligence::jsonschema::cli::validate( +auto sourcemeta::jsonschema::cli::validate( const std::span &arguments) -> int { const auto options{parse_options(arguments, {"h", "http", "b", "benchmark"})}; diff --git a/src/configure.h.in b/src/configure.h.in index e6fe52cd..3b27098c 100644 --- a/src/configure.h.in +++ b/src/configure.h.in @@ -1,9 +1,9 @@ -#ifndef INTELLIGENCE_JSONSCHEMA_CLI_CONFIGURE_H_ -#define INTELLIGENCE_JSONSCHEMA_CLI_CONFIGURE_H_ +#ifndef SOURCEMETA_JSONSCHEMA_CLI_CONFIGURE_H_ +#define SOURCEMETA_JSONSCHEMA_CLI_CONFIGURE_H_ #include // std::string_view -namespace intelligence::jsonschema::cli { +namespace sourcemeta::jsonschema::cli { constexpr std::string_view PROJECT_VERSION{"@PROJECT_VERSION@"}; } diff --git a/src/main.cc b/src/main.cc index ea9fa9ce..10b569c7 100644 --- a/src/main.cc +++ b/src/main.cc @@ -69,32 +69,32 @@ Global Options: Print the URI of the given schema to standard output, optionally relative to a given base URI. -For more documentation, visit https://github.com/Intelligence-AI/jsonschema +For more documentation, visit https://github.com/sourcemeta/jsonschema )EOF"}; auto jsonschema_main(const std::string &program, const std::string &command, const std::span &arguments) -> int { if (command == "fmt") { - return intelligence::jsonschema::cli::fmt(arguments); + return sourcemeta::jsonschema::cli::fmt(arguments); } else if (command == "frame") { - return intelligence::jsonschema::cli::frame(arguments); + return sourcemeta::jsonschema::cli::frame(arguments); } else if (command == "bundle") { - return intelligence::jsonschema::cli::bundle(arguments); + return sourcemeta::jsonschema::cli::bundle(arguments); } else if (command == "compile") { - return intelligence::jsonschema::cli::compile(arguments); + return sourcemeta::jsonschema::cli::compile(arguments); } else if (command == "lint") { - return intelligence::jsonschema::cli::lint(arguments); + return sourcemeta::jsonschema::cli::lint(arguments); } else if (command == "validate") { - return intelligence::jsonschema::cli::validate(arguments); + return sourcemeta::jsonschema::cli::validate(arguments); } else if (command == "metaschema") { - return intelligence::jsonschema::cli::metaschema(arguments); + return sourcemeta::jsonschema::cli::metaschema(arguments); } else if (command == "test") { - return intelligence::jsonschema::cli::test(arguments); + return sourcemeta::jsonschema::cli::test(arguments); } else if (command == "identify") { - return intelligence::jsonschema::cli::identify(arguments); + return sourcemeta::jsonschema::cli::identify(arguments); } else { std::cout << "JSON Schema CLI - v" - << intelligence::jsonschema::cli::PROJECT_VERSION << "\n"; + << sourcemeta::jsonschema::cli::PROJECT_VERSION << "\n"; std::cout << "Usage: " << std::filesystem::path{program}.filename().string() << " [arguments...]\n"; std::cout << USAGE_DETAILS; @@ -124,7 +124,7 @@ auto main(int argc, char *argv[]) noexcept -> int { } catch (const sourcemeta::jsontoolkit::SchemaVocabularyError &error) { std::cerr << "error: " << error.what() << "\n " << error.uri() << "\n\nTo request support for it, please open an issue " - "at\nhttps://github.com/intelligence-ai/jsonschema\n"; + "at\nhttps://github.com/sourcemeta/jsonschema\n"; return EXIT_FAILURE; } catch (const sourcemeta::jsontoolkit::URIParseError &error) { std::cerr << "error: " << error.what() << " at column " << error.column() @@ -162,7 +162,7 @@ auto main(int argc, char *argv[]) noexcept -> int { } catch (const std::exception &error) { std::cerr << "unexpected error: " << error.what() << "\nPlease report it at " - << "https://github.com/intelligence-ai/jsonschema\n"; + << "https://github.com/sourcemeta/jsonschema\n"; return EXIT_FAILURE; } } diff --git a/src/utils.cc b/src/utils.cc index ac2eb232..7c6060ef 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -102,7 +102,7 @@ auto normalize_extension(const std::string &extension) -> std::string { } // namespace -namespace intelligence::jsonschema::cli { +namespace sourcemeta::jsonschema::cli { auto for_each_json(const std::vector &arguments, const std::set &blacklist, @@ -319,4 +319,4 @@ auto parse_ignore(const std::map> return result; } -} // namespace intelligence::jsonschema::cli +} // namespace sourcemeta::jsonschema::cli diff --git a/src/utils.h b/src/utils.h index 40da9d4a..62c3956a 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,5 +1,5 @@ -#ifndef INTELLIGENCE_JSONSCHEMA_CLI_UTILS_H_ -#define INTELLIGENCE_JSONSCHEMA_CLI_UTILS_H_ +#ifndef SOURCEMETA_JSONSCHEMA_CLI_UTILS_H_ +#define SOURCEMETA_JSONSCHEMA_CLI_UTILS_H_ #include #include @@ -15,7 +15,7 @@ #include // std::pair #include // std::vector -namespace intelligence::jsonschema::cli { +namespace sourcemeta::jsonschema::cli { auto parse_options(const std::span &arguments, const std::set &flags) @@ -44,6 +44,6 @@ auto parse_extensions(const std::map> auto parse_ignore(const std::map> &options) -> std::set; -} // namespace intelligence::jsonschema::cli +} // namespace sourcemeta::jsonschema::cli #endif diff --git a/test/test/fail_no_schema.sh b/test/test/fail_no_schema.sh index 9533b57d..e368b3ed 100755 --- a/test/test/fail_no_schema.sh +++ b/test/test/fail_no_schema.sh @@ -30,7 +30,7 @@ cat << EOF > "$TMP/expected.txt" $(realpath "$TMP")/test.json: error: The test document must contain a \`target\` property -Learn more here: https://github.com/Intelligence-AI/jsonschema/blob/main/docs/test.markdown +Learn more here: https://github.com/sourcemeta/jsonschema/blob/main/docs/test.markdown EOF diff "$TMP/output.txt" "$TMP/expected.txt" diff --git a/test/test/fail_no_tests.sh b/test/test/fail_no_tests.sh index 70a0d593..2af5abce 100755 --- a/test/test/fail_no_tests.sh +++ b/test/test/fail_no_tests.sh @@ -21,7 +21,7 @@ cat << EOF > "$TMP/expected.txt" $(realpath "$TMP")/test.json: error: The test document must contain a \`tests\` property -Learn more here: https://github.com/Intelligence-AI/jsonschema/blob/main/docs/test.markdown +Learn more here: https://github.com/sourcemeta/jsonschema/blob/main/docs/test.markdown EOF diff "$TMP/output.txt" "$TMP/expected.txt" diff --git a/test/test/fail_not_object.sh b/test/test/fail_not_object.sh index 58c2b385..2246b8b1 100755 --- a/test/test/fail_not_object.sh +++ b/test/test/fail_not_object.sh @@ -33,7 +33,7 @@ cat << EOF > "$TMP/expected.txt" $(realpath "$TMP")/test.json: error: The test document must be an object -Learn more here: https://github.com/Intelligence-AI/jsonschema/blob/main/docs/test.markdown +Learn more here: https://github.com/sourcemeta/jsonschema/blob/main/docs/test.markdown EOF diff "$TMP/output.txt" "$TMP/expected.txt" diff --git a/test/test/fail_schema_non_string.sh b/test/test/fail_schema_non_string.sh index 6b82df64..a9f61936 100755 --- a/test/test/fail_schema_non_string.sh +++ b/test/test/fail_schema_non_string.sh @@ -31,7 +31,7 @@ cat << EOF > "$TMP/expected.txt" $(realpath "$TMP")/test.json: error: The test document \`target\` property must be a URI -Learn more here: https://github.com/Intelligence-AI/jsonschema/blob/main/docs/test.markdown +Learn more here: https://github.com/sourcemeta/jsonschema/blob/main/docs/test.markdown EOF diff "$TMP/output.txt" "$TMP/expected.txt" diff --git a/test/test/fail_test_case_data_and_data_path.sh b/test/test/fail_test_case_data_and_data_path.sh index 7e7ad206..dde01d4c 100755 --- a/test/test/fail_test_case_data_and_data_path.sh +++ b/test/test/fail_test_case_data_and_data_path.sh @@ -29,7 +29,7 @@ $(realpath "$TMP")/test.json: error: Test case documents must contain either a \`data\` or \`dataPath\` property, but not both at test case #1 -Learn more here: https://github.com/Intelligence-AI/jsonschema/blob/main/docs/test.markdown +Learn more here: https://github.com/sourcemeta/jsonschema/blob/main/docs/test.markdown EOF diff "$TMP/output.txt" "$TMP/expected.txt" diff --git a/test/test/fail_test_case_no_data.sh b/test/test/fail_test_case_no_data.sh index a8e5420b..010e7343 100755 --- a/test/test/fail_test_case_no_data.sh +++ b/test/test/fail_test_case_no_data.sh @@ -35,7 +35,7 @@ $(realpath "$TMP")/test.json: error: Test case documents must contain a \`data\` or \`dataPath\` property at test case #3 -Learn more here: https://github.com/Intelligence-AI/jsonschema/blob/main/docs/test.markdown +Learn more here: https://github.com/sourcemeta/jsonschema/blob/main/docs/test.markdown EOF diff "$TMP/output.txt" "$TMP/expected.txt" diff --git a/test/test/fail_test_case_no_valid.sh b/test/test/fail_test_case_no_valid.sh index 18d12edc..771de766 100755 --- a/test/test/fail_test_case_no_valid.sh +++ b/test/test/fail_test_case_no_valid.sh @@ -31,7 +31,7 @@ $(realpath "$TMP")/test.json: error: Test case documents must contain a \`valid\` property at test case #1 -Learn more here: https://github.com/Intelligence-AI/jsonschema/blob/main/docs/test.markdown +Learn more here: https://github.com/sourcemeta/jsonschema/blob/main/docs/test.markdown EOF diff "$TMP/output.txt" "$TMP/expected.txt" diff --git a/test/test/fail_test_case_non_boolean_valid.sh b/test/test/fail_test_case_non_boolean_valid.sh index ccc7259b..aea87240 100755 --- a/test/test/fail_test_case_non_boolean_valid.sh +++ b/test/test/fail_test_case_non_boolean_valid.sh @@ -32,7 +32,7 @@ $(realpath "$TMP")/test.json: error: The test case document \`valid\` property must be a boolean at test case #1 -Learn more here: https://github.com/Intelligence-AI/jsonschema/blob/main/docs/test.markdown +Learn more here: https://github.com/sourcemeta/jsonschema/blob/main/docs/test.markdown EOF diff "$TMP/output.txt" "$TMP/expected.txt" diff --git a/test/test/fail_test_case_non_object.sh b/test/test/fail_test_case_non_object.sh index 92da3115..16bd7dce 100755 --- a/test/test/fail_test_case_non_object.sh +++ b/test/test/fail_test_case_non_object.sh @@ -29,7 +29,7 @@ $(realpath "$TMP")/test.json: error: Test case documents must be objects at test case #2 -Learn more here: https://github.com/Intelligence-AI/jsonschema/blob/main/docs/test.markdown +Learn more here: https://github.com/sourcemeta/jsonschema/blob/main/docs/test.markdown EOF diff "$TMP/output.txt" "$TMP/expected.txt" diff --git a/test/test/fail_test_case_non_string_data_path.sh b/test/test/fail_test_case_non_string_data_path.sh index a30edee2..703aeb6a 100755 --- a/test/test/fail_test_case_non_string_data_path.sh +++ b/test/test/fail_test_case_non_string_data_path.sh @@ -28,7 +28,7 @@ $(realpath "$TMP")/test.json: error: Test case documents must set the \`dataPath\` property to a string at test case #1 -Learn more here: https://github.com/Intelligence-AI/jsonschema/blob/main/docs/test.markdown +Learn more here: https://github.com/sourcemeta/jsonschema/blob/main/docs/test.markdown EOF diff "$TMP/output.txt" "$TMP/expected.txt" diff --git a/test/test/fail_test_case_non_string_description.sh b/test/test/fail_test_case_non_string_description.sh index 12f96ddf..749d81aa 100755 --- a/test/test/fail_test_case_non_string_description.sh +++ b/test/test/fail_test_case_non_string_description.sh @@ -34,7 +34,7 @@ $(realpath "$TMP")/test.json: error: If you set a test case description, it must be a string at test case #2 -Learn more here: https://github.com/Intelligence-AI/jsonschema/blob/main/docs/test.markdown +Learn more here: https://github.com/sourcemeta/jsonschema/blob/main/docs/test.markdown EOF diff "$TMP/output.txt" "$TMP/expected.txt" diff --git a/test/test/fail_tests_non_array.sh b/test/test/fail_tests_non_array.sh index 5ca7e9eb..c430c5c7 100755 --- a/test/test/fail_tests_non_array.sh +++ b/test/test/fail_tests_non_array.sh @@ -25,7 +25,7 @@ cat << EOF > "$TMP/expected.txt" $(realpath "$TMP")/test.json: error: The test document \`tests\` property must be an array -Learn more here: https://github.com/Intelligence-AI/jsonschema/blob/main/docs/test.markdown +Learn more here: https://github.com/sourcemeta/jsonschema/blob/main/docs/test.markdown EOF diff "$TMP/output.txt" "$TMP/expected.txt"