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
16 changes: 10 additions & 6 deletions src/build/delta.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,10 @@ auto delta(const BuildPhase phase, const BuildPlan::Type build_type,
case DirectoryDependencyKind::ExternalConfig:
rule_dependencies.push_back(configuration_string);
break;
case DirectoryDependencyKind::GlobalRoutes:
rule_dependencies.push_back(
(output / "routes.bin").lexically_normal().string());
break;
}
}

Expand Down Expand Up @@ -1271,12 +1275,6 @@ auto delta(const BuildPhase phase, const BuildPlan::Type build_type,
{BuildPlan::Action::Type::Remove, comment_path, {}, {}});
}

for (auto &wave : dag_waves) {
if (!wave.empty()) {
plan.waves.push_back(std::move(wave));
}
}

if (is_full || web_added || web_removed) {
std::vector<BuildPlan::Action> global_wave;
for (const auto &rule : GLOBAL_RULES) {
Expand All @@ -1296,6 +1294,12 @@ auto delta(const BuildPhase phase, const BuildPlan::Type build_type,
}
}

for (auto &wave : dag_waves) {
if (!wave.empty()) {
plan.waves.push_back(std::move(wave));
}
}

if (!remove_wave.empty()) {
std::ranges::sort(remove_wave, [](const BuildPlan::Action &left,
const BuildPlan::Action &right) {
Expand Down
9 changes: 6 additions & 3 deletions src/build/rules.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,16 @@ enum class DirectoryDependencyKind : std::uint8_t {
ChildDirectories,
AllDirectoryListings,
SameDirectoryTarget,
ExternalConfig
ExternalConfig,
GlobalRoutes
};

struct DirectoryDependency {
DirectoryDependencyKind kind;
const char *filename;
};

static constexpr std::size_t MAX_DIRECTORY_DEPENDENCIES = 2;
static constexpr std::size_t MAX_DIRECTORY_DEPENDENCIES = 3;

struct DirectoryRule {
BuildPlan::Action::Type action;
Expand Down Expand Up @@ -248,8 +249,10 @@ static constexpr std::array<DirectoryRule, 6> DIRECTORY_RULES{{
.dependencies = {{{.kind = DirectoryDependencyKind::SameDirectoryTarget,
.filename = "search.metapack"},
{.kind = DirectoryDependencyKind::ExternalConfig,
.filename = nullptr},
{.kind = DirectoryDependencyKind::GlobalRoutes,
.filename = nullptr}}},
.dependency_count = 2},
.dependency_count = 3},

{.action = BuildPlan::Action::Type::WebIndex,
.filename = "directory-html.metapack",
Expand Down
202 changes: 101 additions & 101 deletions test/cli/index/common/collection-path-dot.sh

Large diffs are not rendered by default.

202 changes: 101 additions & 101 deletions test/cli/index/common/collection-path-empty.sh

Large diffs are not rendered by default.

202 changes: 101 additions & 101 deletions test/cli/index/common/collection-path-skips-config-files.sh

Large diffs are not rendered by default.

202 changes: 101 additions & 101 deletions test/cli/index/common/comment-removed-on-rebuild.sh

Large diffs are not rendered by default.

202 changes: 101 additions & 101 deletions test/cli/index/common/comment-updated-on-rebuild.sh

Large diffs are not rendered by default.

202 changes: 101 additions & 101 deletions test/cli/index/common/draft4-ignore-vocabulary.sh

Large diffs are not rendered by default.

202 changes: 101 additions & 101 deletions test/cli/index/common/extra-files-on-rebuild.sh

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions test/cli/index/common/fail-bundle-ref-no-fragment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,49 +137,50 @@ Detecting: $ONE_PREFIX/share/sourcemeta/one/self/v1/schemas/mcp/response.json (#
(100%) Resolving: self/v1/schemas/mcp/response.json
( 0%) Producing: configuration.json
( 0%) Producing: version.json
( 0%) Producing: routes.bin
( 0%) Producing: explorer/%/404.metapack
( 0%) Producing: schemas/example/schemas/test/%/schema.metapack
( 0%) Producing: schemas/self/v1/schemas/api/error/%/schema.metapack
( 1%) Producing: schemas/self/v1/schemas/api/error/%/schema.metapack
( 1%) Producing: schemas/self/v1/schemas/api/list/response/%/schema.metapack
( 1%) Producing: schemas/self/v1/schemas/api/list/rpc/%/schema.metapack
( 1%) Producing: schemas/self/v1/schemas/api/schemas/dependencies/response/%/schema.metapack
( 1%) Producing: schemas/self/v1/schemas/api/schemas/dependencies/rpc/%/schema.metapack
( 1%) Producing: schemas/self/v1/schemas/api/schemas/dependents/response/%/schema.metapack
( 1%) Producing: schemas/self/v1/schemas/api/schemas/dependents/rpc/%/schema.metapack
( 2%) Producing: schemas/self/v1/schemas/api/schemas/dependents/rpc/%/schema.metapack
( 2%) Producing: schemas/self/v1/schemas/api/schemas/evaluate/request/%/schema.metapack
( 2%) Producing: schemas/self/v1/schemas/api/schemas/evaluate/response/%/schema.metapack
( 2%) Producing: schemas/self/v1/schemas/api/schemas/evaluate/rpc/%/schema.metapack
( 2%) Producing: schemas/self/v1/schemas/api/schemas/health/response/%/schema.metapack
( 2%) Producing: schemas/self/v1/schemas/api/schemas/health/rpc/%/schema.metapack
( 3%) Producing: schemas/self/v1/schemas/api/schemas/health/rpc/%/schema.metapack
( 3%) Producing: schemas/self/v1/schemas/api/schemas/locations/response/%/schema.metapack
( 3%) Producing: schemas/self/v1/schemas/api/schemas/locations/rpc/%/schema.metapack
( 3%) Producing: schemas/self/v1/schemas/api/schemas/metadata/response/%/schema.metapack
( 3%) Producing: schemas/self/v1/schemas/api/schemas/metadata/rpc/%/schema.metapack
( 3%) Producing: schemas/self/v1/schemas/api/schemas/position/%/schema.metapack
( 3%) Producing: schemas/self/v1/schemas/api/schemas/positions/response/%/schema.metapack
( 4%) Producing: schemas/self/v1/schemas/api/schemas/positions/response/%/schema.metapack
( 4%) Producing: schemas/self/v1/schemas/api/schemas/positions/rpc/%/schema.metapack
( 4%) Producing: schemas/self/v1/schemas/api/schemas/search/response/%/schema.metapack
( 4%) Producing: schemas/self/v1/schemas/api/schemas/search/rpc/%/schema.metapack
( 4%) Producing: schemas/self/v1/schemas/api/schemas/stats/response/%/schema.metapack
( 4%) Producing: schemas/self/v1/schemas/api/schemas/stats/rpc/%/schema.metapack
( 4%) Producing: schemas/self/v1/schemas/api/schemas/trace/request/%/schema.metapack
( 5%) Producing: schemas/self/v1/schemas/api/schemas/trace/request/%/schema.metapack
( 5%) Producing: schemas/self/v1/schemas/api/schemas/trace/response/%/schema.metapack
( 5%) Producing: schemas/self/v1/schemas/api/schemas/trace/rpc/%/schema.metapack
( 5%) Producing: schemas/self/v1/schemas/mcp/error/%/schema.metapack
( 5%) Producing: schemas/self/v1/schemas/mcp/initialize/request/%/schema.metapack
( 5%) Producing: schemas/self/v1/schemas/mcp/initialize/response/%/schema.metapack
( 6%) Producing: schemas/self/v1/schemas/mcp/initialize/response/%/schema.metapack
( 6%) Producing: schemas/self/v1/schemas/mcp/notifications/cancelled/%/schema.metapack
( 6%) Producing: schemas/self/v1/schemas/mcp/notifications/initialized/%/schema.metapack
( 6%) Producing: schemas/self/v1/schemas/mcp/ping/request/%/schema.metapack
( 6%) Producing: schemas/self/v1/schemas/mcp/ping/response/%/schema.metapack
( 6%) Producing: schemas/self/v1/schemas/mcp/request/%/schema.metapack
( 6%) Producing: schemas/self/v1/schemas/mcp/resources/list/request/%/schema.metapack
( 7%) Producing: schemas/self/v1/schemas/mcp/resources/list/request/%/schema.metapack
( 7%) Producing: schemas/self/v1/schemas/mcp/resources/list/response/%/schema.metapack
( 7%) Producing: schemas/self/v1/schemas/mcp/resources/read/request/%/schema.metapack
( 7%) Producing: schemas/self/v1/schemas/mcp/resources/read/response/%/schema.metapack
( 7%) Producing: schemas/self/v1/schemas/mcp/resources/templates/list/request/%/schema.metapack
( 7%) Producing: schemas/self/v1/schemas/mcp/resources/templates/list/response/%/schema.metapack
( 7%) Producing: schemas/self/v1/schemas/mcp/response/%/schema.metapack
( 8%) Producing: schemas/self/v1/schemas/mcp/response/%/schema.metapack
( 8%) Producing: schemas/example/schemas/test/%/dependencies.metapack
error: Could not resolve schema reference
to identifier https://sourcemeta.com/example/schemas/test#foo
Expand Down
17 changes: 9 additions & 8 deletions test/cli/index/common/fail-external-reference.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,49 +136,50 @@ Detecting: $ONE_PREFIX/share/sourcemeta/one/self/v1/schemas/mcp/response.json (#
(100%) Resolving: self/v1/schemas/mcp/response.json
( 0%) Producing: configuration.json
( 0%) Producing: version.json
( 0%) Producing: routes.bin
( 0%) Producing: explorer/%/404.metapack
( 0%) Producing: schemas/example/schemas/test/%/schema.metapack
( 0%) Producing: schemas/self/v1/schemas/api/error/%/schema.metapack
( 1%) Producing: schemas/self/v1/schemas/api/error/%/schema.metapack
( 1%) Producing: schemas/self/v1/schemas/api/list/response/%/schema.metapack
( 1%) Producing: schemas/self/v1/schemas/api/list/rpc/%/schema.metapack
( 1%) Producing: schemas/self/v1/schemas/api/schemas/dependencies/response/%/schema.metapack
( 1%) Producing: schemas/self/v1/schemas/api/schemas/dependencies/rpc/%/schema.metapack
( 1%) Producing: schemas/self/v1/schemas/api/schemas/dependents/response/%/schema.metapack
( 1%) Producing: schemas/self/v1/schemas/api/schemas/dependents/rpc/%/schema.metapack
( 2%) Producing: schemas/self/v1/schemas/api/schemas/dependents/rpc/%/schema.metapack
( 2%) Producing: schemas/self/v1/schemas/api/schemas/evaluate/request/%/schema.metapack
( 2%) Producing: schemas/self/v1/schemas/api/schemas/evaluate/response/%/schema.metapack
( 2%) Producing: schemas/self/v1/schemas/api/schemas/evaluate/rpc/%/schema.metapack
( 2%) Producing: schemas/self/v1/schemas/api/schemas/health/response/%/schema.metapack
( 2%) Producing: schemas/self/v1/schemas/api/schemas/health/rpc/%/schema.metapack
( 3%) Producing: schemas/self/v1/schemas/api/schemas/health/rpc/%/schema.metapack
( 3%) Producing: schemas/self/v1/schemas/api/schemas/locations/response/%/schema.metapack
( 3%) Producing: schemas/self/v1/schemas/api/schemas/locations/rpc/%/schema.metapack
( 3%) Producing: schemas/self/v1/schemas/api/schemas/metadata/response/%/schema.metapack
( 3%) Producing: schemas/self/v1/schemas/api/schemas/metadata/rpc/%/schema.metapack
( 3%) Producing: schemas/self/v1/schemas/api/schemas/position/%/schema.metapack
( 3%) Producing: schemas/self/v1/schemas/api/schemas/positions/response/%/schema.metapack
( 4%) Producing: schemas/self/v1/schemas/api/schemas/positions/response/%/schema.metapack
( 4%) Producing: schemas/self/v1/schemas/api/schemas/positions/rpc/%/schema.metapack
( 4%) Producing: schemas/self/v1/schemas/api/schemas/search/response/%/schema.metapack
( 4%) Producing: schemas/self/v1/schemas/api/schemas/search/rpc/%/schema.metapack
( 4%) Producing: schemas/self/v1/schemas/api/schemas/stats/response/%/schema.metapack
( 4%) Producing: schemas/self/v1/schemas/api/schemas/stats/rpc/%/schema.metapack
( 4%) Producing: schemas/self/v1/schemas/api/schemas/trace/request/%/schema.metapack
( 5%) Producing: schemas/self/v1/schemas/api/schemas/trace/request/%/schema.metapack
( 5%) Producing: schemas/self/v1/schemas/api/schemas/trace/response/%/schema.metapack
( 5%) Producing: schemas/self/v1/schemas/api/schemas/trace/rpc/%/schema.metapack
( 5%) Producing: schemas/self/v1/schemas/mcp/error/%/schema.metapack
( 5%) Producing: schemas/self/v1/schemas/mcp/initialize/request/%/schema.metapack
( 5%) Producing: schemas/self/v1/schemas/mcp/initialize/response/%/schema.metapack
( 6%) Producing: schemas/self/v1/schemas/mcp/initialize/response/%/schema.metapack
( 6%) Producing: schemas/self/v1/schemas/mcp/notifications/cancelled/%/schema.metapack
( 6%) Producing: schemas/self/v1/schemas/mcp/notifications/initialized/%/schema.metapack
( 6%) Producing: schemas/self/v1/schemas/mcp/ping/request/%/schema.metapack
( 6%) Producing: schemas/self/v1/schemas/mcp/ping/response/%/schema.metapack
( 6%) Producing: schemas/self/v1/schemas/mcp/request/%/schema.metapack
( 6%) Producing: schemas/self/v1/schemas/mcp/resources/list/request/%/schema.metapack
( 7%) Producing: schemas/self/v1/schemas/mcp/resources/list/request/%/schema.metapack
( 7%) Producing: schemas/self/v1/schemas/mcp/resources/list/response/%/schema.metapack
( 7%) Producing: schemas/self/v1/schemas/mcp/resources/read/request/%/schema.metapack
( 7%) Producing: schemas/self/v1/schemas/mcp/resources/read/response/%/schema.metapack
( 7%) Producing: schemas/self/v1/schemas/mcp/resources/templates/list/request/%/schema.metapack
( 7%) Producing: schemas/self/v1/schemas/mcp/resources/templates/list/response/%/schema.metapack
( 7%) Producing: schemas/self/v1/schemas/mcp/response/%/schema.metapack
( 8%) Producing: schemas/self/v1/schemas/mcp/response/%/schema.metapack
( 8%) Producing: schemas/example/schemas/test/%/dependencies.metapack
error: Could not resolve the reference to an external schema
at identifier https://sourcemeta.com/external
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Detecting: $ONE_PREFIX/share/sourcemeta/one/self/v1/schemas/mcp/response.json (#
(100%) Resolving: self/v1/schemas/mcp/response.json
( 0%) Producing: configuration.json
( 0%) Producing: version.json
( 0%) Producing: routes.bin
( 0%) Producing: explorer/%/404.metapack
( 0%) Producing: schemas/example/schemas/test/%/schema.metapack
error: A schema with a top-level \`\$ref\` in JSON Schema Draft 7 and older dialects ignores every sibling keywords (like identifiers and meta-schema declarations) and therefore many operations, like bundling, are not possible without undefined behavior
Expand Down
1 change: 1 addition & 0 deletions test/cli/index/common/fail-invalid-schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Detecting: $ONE_PREFIX/share/sourcemeta/one/self/v1/schemas/mcp/response.json (#
(100%) Resolving: self/v1/schemas/mcp/response.json
( 0%) Producing: configuration.json
( 0%) Producing: version.json
( 0%) Producing: routes.bin
( 0%) Producing: explorer/%/404.metapack
( 0%) Producing: schemas/example/schemas/test/%/schema.metapack
error: The schema does not adhere to its metaschema
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ Detecting: $ONE_PREFIX/share/sourcemeta/one/self/v1/schemas/mcp/response.json (#
(100%) Resolving: self/v1/schemas/mcp/response.json
( 0%) Producing: configuration.json
( 0%) Producing: version.json
( 0%) Producing: routes.bin
( 0%) Producing: schemas/example/custom-meta/%/schema.metapack
error: The metaschema requires an unrecognised vocabulary
at vocabulary https://example.com/vocab/totally-unknown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Detecting: $ONE_PREFIX/share/sourcemeta/one/self/v1/schemas/mcp/response.json (#
(100%) Resolving: self/v1/schemas/mcp/response.json
( 0%) Producing: configuration.json
( 0%) Producing: version.json
( 0%) Producing: routes.bin
( 0%) Producing: explorer/%/404.metapack
( 0%) Producing: schemas/example/schemas/test/%/schema.metapack
error: The schema does not adhere to its metaschema
Expand Down
1 change: 1 addition & 0 deletions test/cli/index/common/fail-schema-non-string-ref.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Detecting: $ONE_PREFIX/share/sourcemeta/one/self/v1/schemas/mcp/response.json (#
(100%) Resolving: self/v1/schemas/mcp/response.json
( 0%) Producing: configuration.json
( 0%) Producing: version.json
( 0%) Producing: routes.bin
( 0%) Producing: explorer/%/404.metapack
( 0%) Producing: schemas/example/schemas/test/%/schema.metapack
error: A schema with a top-level \`\$ref\` in JSON Schema Draft 7 and older dialects ignores every sibling keywords (like identifiers and meta-schema declarations) and therefore many operations, like bundling, are not possible without undefined behavior
Expand Down
1 change: 1 addition & 0 deletions test/cli/index/common/fail-schema-ref-as-object.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Detecting: $ONE_PREFIX/share/sourcemeta/one/self/v1/schemas/mcp/response.json (#
(100%) Resolving: self/v1/schemas/mcp/response.json
( 0%) Producing: configuration.json
( 0%) Producing: version.json
( 0%) Producing: routes.bin
( 0%) Producing: explorer/%/404.metapack
( 0%) Producing: schemas/example/schemas/test/%/schema.metapack
error: The schema does not adhere to its metaschema
Expand Down
1 change: 1 addition & 0 deletions test/cli/index/common/fail-schema-self-metaschema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ Detecting: $ONE_PREFIX/share/sourcemeta/one/self/v1/schemas/mcp/response.json (#
(100%) Resolving: self/v1/schemas/mcp/response.json
( 0%) Producing: configuration.json
( 0%) Producing: version.json
( 0%) Producing: routes.bin
( 0%) Producing: explorer/%/404.metapack
( 0%) Producing: schemas/example/schemas/test/%/schema.metapack
error: Could not resolve the metaschema of the schema
Expand Down
1 change: 1 addition & 0 deletions test/cli/index/common/fail-self-referencing-metaschema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ Detecting: $ONE_PREFIX/share/sourcemeta/one/self/v1/schemas/mcp/response.json (#
(100%) Resolving: self/v1/schemas/mcp/response.json
( 0%) Producing: configuration.json
( 0%) Producing: version.json
( 0%) Producing: routes.bin
( 0%) Producing: explorer/%/404.metapack
( 0%) Producing: schemas/example/schemas/my-metaschema/%/schema.metapack
error: Could not resolve the metaschema of the schema
Expand Down
1 change: 1 addition & 0 deletions test/cli/index/common/fail-unknown-dialect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ Detecting: $ONE_PREFIX/share/sourcemeta/one/self/v1/schemas/mcp/response.json (#
(100%) Resolving: self/v1/schemas/mcp/response.json
( 0%) Producing: configuration.json
( 0%) Producing: version.json
( 0%) Producing: routes.bin
( 0%) Producing: explorer/%/404.metapack
( 0%) Producing: schemas/example/schemas/test/%/schema.metapack
error: Could not resolve the metaschema of the schema
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ Detecting: $ONE_PREFIX/share/sourcemeta/one/self/v1/schemas/mcp/response.json (#
(100%) Resolving: self/v1/schemas/mcp/response.json
( 0%) Producing: configuration.json
( 0%) Producing: version.json
( 0%) Producing: routes.bin
( 0%) Producing: explorer/%/404.metapack
( 0%) Producing: schemas/example/schemas/meta-a/%/schema.metapack
( 0%) Producing: schemas/example/schemas/meta-b/%/schema.metapack
( 1%) Producing: schemas/example/schemas/meta-b/%/schema.metapack
error: The metaschema requires an unrecognised vocabulary
at vocabulary https://example.com/vocab/totally-unknown
at path $(realpath "$TMP")/schemas/meta-b.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ Detecting: $ONE_PREFIX/share/sourcemeta/one/self/v1/schemas/mcp/response.json (#
(100%) Resolving: self/v1/schemas/mcp/response.json
( 0%) Producing: configuration.json
( 0%) Producing: version.json
( 0%) Producing: routes.bin
( 0%) Producing: explorer/%/404.metapack
( 0%) Producing: schemas/example/schemas/custom-meta/%/schema.metapack
error: The metaschema requires an unrecognised vocabulary
Expand Down
1 change: 1 addition & 0 deletions test/cli/index/common/fail-unknown-required-vocabulary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ Detecting: $ONE_PREFIX/share/sourcemeta/one/self/v1/schemas/mcp/response.json (#
(100%) Resolving: self/v1/schemas/mcp/response.json
( 0%) Producing: configuration.json
( 0%) Producing: version.json
( 0%) Producing: routes.bin
( 0%) Producing: explorer/%/404.metapack
( 0%) Producing: schemas/example/schemas/custom-meta/%/schema.metapack
error: The metaschema requires an unrecognised vocabulary
Expand Down
Loading
Loading