Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,16 @@ message(STATUS "Sourcemeta One edition: ${ONE_EDITION}")

find_package(Core REQUIRED)
find_package(Blaze REQUIRED)
find_program(JSONSCHEMA_BIN NAMES jsonschema
PATHS "${PROJECT_SOURCE_DIR}/node_modules/.bin"
NO_DEFAULT_PATH REQUIRED)
find_package(JSONBinPack REQUIRED)
find_package(JSONSchema REQUIRED)

include(GNUInstallDirs)

if(ONE_DEBUG_SYMBOLS)
sourcemeta_debug_symbols_extract(jsonschema_cli
COMPONENT sourcemeta_jsonschema)
endif()

if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(ONE_VERSION "${PROJECT_VERSION}")
else()
Expand Down
6 changes: 4 additions & 2 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
vendorpull https://github.com/sourcemeta/vendorpull 1dcbac42809cf87cb5b045106b863e17ad84ba02
uwebsockets https://github.com/uNetworking/uWebSockets v20.78.0
core https://github.com/sourcemeta/core 708730fe29acd954ab5fb26b7e5e5f9de07927d4
blaze https://github.com/sourcemeta/blaze ef88266186084f201b806cbc921d03631b9fac17
core https://github.com/sourcemeta/core bb1c78e8fa148a2ece951bb776798a43fe328821
blaze https://github.com/sourcemeta/blaze 6dd44d2e59074d004020e3413c15423ddeba0925
jsonbinpack https://github.com/sourcemeta/jsonbinpack e2f99ed5e69ab17b027c3d7bb0ef95b27953bb08
jsonschema https://github.com/sourcemeta/jsonschema 65c553b19ef0fc758c3ec2efa76852422ae8f187
bootstrap https://github.com/twbs/bootstrap v5.3.3
bootstrap-icons https://github.com/twbs/icons v1.11.3
collections/sourcemeta/std/v0 https://github.com/sourcemeta/std v0.4.0
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ RUN cmake --build /build \
RUN cmake --install /build --prefix /usr --verbose \
--config ${SOURCEMETA_ONE_BUILD_TYPE} \
--component sourcemeta_one
RUN cmake --install /build --prefix /usr --verbose \
--config ${SOURCEMETA_ONE_BUILD_TYPE} \
--component sourcemeta_jsonschema

# Linting
RUN cmake --build /build --config ${SOURCEMETA_ONE_BUILD_TYPE} \
Expand Down Expand Up @@ -70,6 +73,12 @@ COPY --from=builder /usr/bin/sourcemeta-one-server \
/usr/bin/sourcemeta-one-server
COPY --from=builder /usr/bin/sourcemeta-one-server.debug \
/usr/bin/sourcemeta-one-server.debug
COPY --from=builder /usr/bin/jsonschema \
/usr/bin/jsonschema
COPY --from=builder /usr/bin/jsonschema.debug \
/usr/bin/jsonschema.debug
COPY --from=builder /usr/share/bash-completion/completions/jsonschema \
/usr/share/bash-completion/completions/jsonschema
COPY --from=builder /usr/share/sourcemeta/one \
/usr/share/sourcemeta/one

Expand Down
2 changes: 0 additions & 2 deletions cmake/FindBlaze.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
if(NOT Blaze_FOUND)
set(BLAZE_INSTALL OFF CACHE BOOL "disable installation")
set(BLAZE_CODEGEN OFF CACHE BOOL "Codegen")
set(BLAZE_DOCUMENTATION OFF CACHE BOOL "Documentation")
set(BLAZE_TEST OFF CACHE BOOL "Test runner")
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/blaze")
set(Blaze_FOUND ON)
endif()
4 changes: 1 addition & 3 deletions cmake/FindCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ if(NOT Core_FOUND)

if(ONE_ENTERPRISE)
set(SOURCEMETA_CORE_CRYPTO_USE_SYSTEM_OPENSSL ON CACHE BOOL "Enable OpenSSL")
set(SOURCEMETA_CORE_HTTP_USE_SYSTEM_CURL ON CACHE BOOL "Enable system cURL")
endif()

set(SOURCEMETA_CORE_CONTRIB_GOOGLEBENCHMARK OFF CACHE BOOL "GoogleBenchmark")

set(SOURCEMETA_CORE_LANG_PROCESS OFF CACHE BOOL "Process")
set(SOURCEMETA_CORE_JSONL OFF CACHE BOOL "JSONL")

add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/core")
include(Sourcemeta)
set(Core_FOUND ON)
Expand Down
5 changes: 5 additions & 0 deletions cmake/FindJSONBinPack.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if(NOT JSONBinPack_FOUND)
set(JSONBINPACK_INSTALL OFF CACHE BOOL "disable installation")
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/jsonbinpack")
set(JSONBinPack_FOUND ON)
endif()
8 changes: 8 additions & 0 deletions cmake/FindJSONSchema.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if(NOT JSONSchema_FOUND)
if(ONE_ENTERPRISE)
set(JSONSCHEMA_USE_SYSTEM_CURL ON CACHE BOOL "Enable system cURL")
endif()

add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/jsonschema")
set(JSONSchema_FOUND ON)
endif()
4 changes: 2 additions & 2 deletions docs/guide/using-custom-metaschemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -1209,11 +1209,11 @@ the instance. Copying the schemas from the test stage is what forces that
stage, and therefore the tests, to run as part of the build:

```docker title="Dockerfile"
FROM node:24 AS tests
FROM ghcr.io/sourcemeta/one:<version> AS tests
WORKDIR /test
COPY schemas schemas
COPY test test
RUN npx --yes @sourcemeta/jsonschema test ./test
RUN jsonschema test ./test

FROM ghcr.io/sourcemeta/one:<version>
COPY one.json .
Expand Down
14 changes: 12 additions & 2 deletions enterprise/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM debian:trixie AS builder
# NodeSource provides npm >= 10, required for the "npm sbom" command
RUN apt-get --yes update && apt-get install --yes --no-install-recommends \
build-essential ca-certificates cmake ninja-build sassc esbuild shellcheck curl gnupg \
openssl libssl-dev openssl-provider-fips \
openssl libssl-dev openssl-provider-fips libcurl4-openssl-dev \
&& curl --fail --silent --show-error --location \
https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
| gpg --dearmor -o /usr/share/keyrings/nodesource.gpg \
Expand Down Expand Up @@ -57,6 +57,9 @@ RUN cmake --build /build \
RUN cmake --install /build --prefix /usr --verbose \
--config ${SOURCEMETA_ONE_BUILD_TYPE} \
--component sourcemeta_one
RUN cmake --install /build --prefix /usr --verbose \
--config ${SOURCEMETA_ONE_BUILD_TYPE} \
--component sourcemeta_jsonschema

# Linting
RUN cmake --build /build --config ${SOURCEMETA_ONE_BUILD_TYPE} \
Expand All @@ -77,7 +80,7 @@ RUN mkdir -p /usr/share/sourcemeta/one \
FROM debian:trixie-slim

RUN apt-get --yes update && apt-get install --yes --no-install-recommends \
openssl-provider-fips \
openssl-provider-fips libcurl4t64 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
COPY --from=builder /etc/ssl/openssl.cnf /etc/ssl/openssl.cnf

Expand All @@ -102,6 +105,12 @@ COPY --from=builder /usr/bin/sourcemeta-one-server \
/usr/bin/sourcemeta-one-server
COPY --from=builder /usr/bin/sourcemeta-one-server.debug \
/usr/bin/sourcemeta-one-server.debug
COPY --from=builder /usr/bin/jsonschema \
/usr/bin/jsonschema
COPY --from=builder /usr/bin/jsonschema.debug \
/usr/bin/jsonschema.debug
COPY --from=builder /usr/share/bash-completion/completions/jsonschema \
/usr/share/bash-completion/completions/jsonschema
COPY --from=builder /usr/share/sourcemeta/one \
/usr/share/sourcemeta/one

Expand All @@ -111,6 +120,7 @@ RUN ldd /usr/bin/sourcemeta-one-server

# Verify that the index binary uses system OpenSSL for cryptography
RUN ldd /usr/bin/sourcemeta-one-index | grep libcrypto
RUN ldd /usr/lib/*/libcurl.so.4 | grep libcrypto
# Verify that the OpenSSL FIPS provider is configured and present
RUN grep -q 'fips = fips_sect' /etc/ssl/openssl.cnf
RUN test -f /usr/lib/*/ossl-modules/fips.so
Expand Down
5 changes: 5 additions & 0 deletions enterprise/scripts/sbom-vendorpull.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { fileURLToPath } from "node:url";
const LICENSES = {
"core": "AGPL-3.0-or-later OR LicenseRef-Commercial",
"blaze": "AGPL-3.0-or-later OR LicenseRef-Commercial",
"jsonbinpack": "AGPL-3.0-or-later OR LicenseRef-Commercial",
"jsonschema": "AGPL-3.0-or-later OR LicenseRef-Commercial",
"uwebsockets": "Apache-2.0",
"bootstrap": "MIT",
"bootstrap-icons": "MIT",
Expand All @@ -24,6 +26,9 @@ const IGNORED = new Set([
"referencing-suite",
"uritemplate-test",
"pyca-cryptography",
"wycheproof",
"jose-cookbook",
"ctrf",
"googletest",
"googlebenchmark",
"jsonschema-2020-12",
Expand Down
26 changes: 0 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
},
"devDependencies": {
"@playwright/test": "^1.60.0",
"@sourcemeta/jsonschema": "^15.10.1",
"jsdom": "^29.1.1"
}
}
3 changes: 2 additions & 1 deletion src/configuration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ sourcemeta_library(NAMESPACE sourcemeta PROJECT one NAME configuration
set(CONFIGURATION_SCHEMA "${CMAKE_CURRENT_SOURCE_DIR}/schema")

add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/template.h"
COMMAND "${JSONSCHEMA_BIN}" compile
COMMAND "$<TARGET_FILE:jsonschema_cli>" compile
--include CONFIGURATION
"${CONFIGURATION_SCHEMA}/configuration.json"
> "${CMAKE_CURRENT_BINARY_DIR}/template.h"
DEPENDS
jsonschema_cli
"${CONFIGURATION_SCHEMA}/configuration.json"
"${CONFIGURATION_SCHEMA}/collection.json"
"${CONFIGURATION_SCHEMA}/contents.json"
Expand Down
8 changes: 2 additions & 6 deletions test/e2e/meta/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
FROM debian:trixie AS tests
RUN apt-get --yes update && apt-get install --yes --no-install-recommends \
nodejs npm && apt-get clean && rm -rf /var/lib/apt/lists/*
FROM one AS tests
WORKDIR /test
COPY --from=root package.json package-lock.json ./
RUN npm ci
COPY schemas schemas
COPY test test
RUN npx --no-install jsonschema test ./test
RUN jsonschema test ./test

FROM one
COPY one.json .
Expand Down
2 changes: 0 additions & 2 deletions test/e2e/meta/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ services:
build:
context: .
dockerfile: Dockerfile
additional_contexts:
root: ../../..
args:
SOURCEMETA_ONE_SANDBOX_EDITION: ${EDITION}
environment:
Expand Down
8 changes: 4 additions & 4 deletions test/unit/configuration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ target_compile_definitions(sourcemeta_one_configuration_unit
set(CONFIGURATION_SCHEMA "${PROJECT_SOURCE_DIR}/src/configuration/schema")

add_test(NAME one.configuration.schema COMMAND
"${JSONSCHEMA_BIN}" test --extension .test.json
"$<TARGET_FILE:jsonschema_cli>" test --extension .test.json
"${CMAKE_CURRENT_SOURCE_DIR}/configuration.test.json")
add_test(NAME one.configuration.schema.fmt COMMAND
"${JSONSCHEMA_BIN}" fmt --check "${CONFIGURATION_SCHEMA}")
"$<TARGET_FILE:jsonschema_cli>" fmt --check "${CONFIGURATION_SCHEMA}")
add_test(NAME one.configuration.schema.metaschema COMMAND
"${JSONSCHEMA_BIN}" metaschema "${CONFIGURATION_SCHEMA}")
"$<TARGET_FILE:jsonschema_cli>" metaschema "${CONFIGURATION_SCHEMA}")
add_test(NAME one.configuration.schema.lint COMMAND
"${JSONSCHEMA_BIN}" lint "${CONFIGURATION_SCHEMA}")
"$<TARGET_FILE:jsonschema_cli>" lint "${CONFIGURATION_SCHEMA}")
6 changes: 3 additions & 3 deletions test/unit/self/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
set(SELF_SCHEMAS "${PROJECT_SOURCE_DIR}/src/self/v1/schemas")

add_test(NAME one.self.schemas.fmt COMMAND
"${JSONSCHEMA_BIN}" fmt --check "${SELF_SCHEMAS}")
"$<TARGET_FILE:jsonschema_cli>" fmt --check "${SELF_SCHEMAS}")
add_test(NAME one.self.schemas.metaschema COMMAND
"${JSONSCHEMA_BIN}" metaschema "${SELF_SCHEMAS}")
"$<TARGET_FILE:jsonschema_cli>" metaschema "${SELF_SCHEMAS}")
add_test(NAME one.self.schemas.lint COMMAND
"${JSONSCHEMA_BIN}" lint "${SELF_SCHEMAS}")
"$<TARGET_FILE:jsonschema_cli>" lint "${SELF_SCHEMAS}")
2 changes: 1 addition & 1 deletion vendor/blaze/DEPENDENCIES

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 4 additions & 18 deletions vendor/blaze/schemas/canonical-draft3.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading