Skip to content

Commit

Permalink
Update CLI ownership
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti committed Aug 24, 2024
1 parent 50040f6 commit ea444d6
Show file tree
Hide file tree
Showing 37 changed files with 86 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
20 changes: 1 addition & 19 deletions CONTRIBUTING.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -76,41 +76,41 @@ 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/[email protected]
- uses: sourcemeta/[email protected]
```
Where `X.Y.Z` is replaced with the desired version. For example:

```yaml
- uses: intelligence-ai/[email protected]
- uses: sourcemeta/[email protected]
# Then use as usual
- run: jsonschema fmt path/to/schemas --check
```

### 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
Expand Down Expand Up @@ -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 <prefix> \
--config Release --verbose --component intelligence_jsonschema
--config Release --verbose --component sourcemeta_jsonschema
```

Where `<prefix>` can be any destination prefix of your choosing, such as `/opt`
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.2
rm "${GITHUB_WORKSPACE}/install.sh"
4 changes: 2 additions & 2 deletions docs/format.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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)" }
```

Expand All @@ -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}$"
Expand Down
4 changes: 2 additions & 2 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand All @@ -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
14 changes: 7 additions & 7 deletions npm-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down Expand Up @@ -46,28 +46,28 @@ 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",
"bin": {
"jsonschema": "cli.js"
},
"license": "AGPL-3.0",
"homepage": "https://github.com/intelligence-ai/jsonschema",
"author": "Juan Cruz Viotti <[email protected]>",
"homepage": "https://github.com/sourcemeta/jsonschema",
"author": "Juan Cruz Viotti <[email protected]>",
"keywords": [
"jsonschema", "json", "schema", "json-schema",
"cli", "\$ref", "dereference", "reference", "resolve",
"json-pointer", "validator", "bundle",
"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"
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
8 changes: 4 additions & 4 deletions src/command.h
Original file line number Diff line number Diff line change
@@ -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 <span> // std::span
#include <string> // std::string

namespace intelligence::jsonschema::cli {
namespace sourcemeta::jsonschema::cli {
auto fmt(const std::span<const std::string> &arguments) -> int;
auto frame(const std::span<const std::string> &arguments) -> int;
auto bundle(const std::span<const std::string> &arguments) -> int;
Expand All @@ -14,6 +14,6 @@ auto lint(const std::span<const std::string> &arguments) -> int;
auto validate(const std::span<const std::string> &arguments) -> int;
auto metaschema(const std::span<const std::string> &arguments) -> int;
auto identify(const std::span<const std::string> &arguments) -> int;
} // namespace intelligence::jsonschema::cli
} // namespace sourcemeta::jsonschema::cli

#endif
2 changes: 1 addition & 1 deletion src/command_bundle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "command.h"
#include "utils.h"

auto intelligence::jsonschema::cli::bundle(
auto sourcemeta::jsonschema::cli::bundle(
const std::span<const std::string> &arguments) -> int {
const auto options{
parse_options(arguments, {"h", "http", "w", "without-id"})};
Expand Down
2 changes: 1 addition & 1 deletion src/command_compile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "command.h"
#include "utils.h"

auto intelligence::jsonschema::cli::compile(
auto sourcemeta::jsonschema::cli::compile(
const std::span<const std::string> &arguments) -> int {
const auto options{parse_options(arguments, {})};

Expand Down
2 changes: 1 addition & 1 deletion src/command_fmt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "command.h"
#include "utils.h"

auto intelligence::jsonschema::cli::fmt(
auto sourcemeta::jsonschema::cli::fmt(
const std::span<const std::string> &arguments) -> int {
const auto options{parse_options(arguments, {"c", "check"})};

Expand Down
2 changes: 1 addition & 1 deletion src/command_frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static auto enum_to_string(
}
}

auto intelligence::jsonschema::cli::frame(
auto sourcemeta::jsonschema::cli::frame(
const std::span<const std::string> &arguments) -> int {
const auto options{parse_options(arguments, {})};
if (options.at("").size() < 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/command_identify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ find_relative_to(const std::map<std::string, std::vector<std::string>> &options)
return std::nullopt;
}

auto intelligence::jsonschema::cli::identify(
auto sourcemeta::jsonschema::cli::identify(
const std::span<const std::string> &arguments) -> int {
const auto options{parse_options(arguments, {})};
if (options.at("").size() < 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/command_lint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "command.h"
#include "utils.h"

auto intelligence::jsonschema::cli::lint(
auto sourcemeta::jsonschema::cli::lint(
const std::span<const std::string> &arguments) -> int {
const auto options{parse_options(arguments, {"f", "fix"})};

Expand Down
2 changes: 1 addition & 1 deletion src/command_metaschema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<const std::string> &arguments) -> int {
const auto options{parse_options(arguments, {"h", "http"})};
const auto custom_resolver{
Expand Down
Loading

0 comments on commit ea444d6

Please sign in to comment.