diff --git a/src/resolvers.ts b/src/resolvers.ts index 600dfb196..7a9ecb8ce 100644 --- a/src/resolvers.ts +++ b/src/resolvers.ts @@ -14,7 +14,8 @@ import type {LoaderResolver} from "./loader.js"; import type {MarkdownPage} from "./markdown.js"; import {extractNodeSpecifier, resolveNodeImport, resolveNodeImports} from "./node.js"; import {extractNpmSpecifier, populateNpmCache, resolveNpmImport, resolveNpmImports} from "./npm.js"; -import {isAssetPath, isPathImport, parseRelativeUrl, relativePath, resolveLocalPath, resolvePath} from "./path.js"; +import {isAssetPath, isPathImport, parseRelativeUrl} from "./path.js"; +import {relativePath, resolveLocalPath, resolvePath, resolveRelativePath} from "./path.js"; export interface Resolvers { path: string; @@ -133,7 +134,7 @@ export async function getResolvers(page: MarkdownPage, config: ResolversConfig): for (const value of Object.values(page.data.sql)) { const source = String(value); if (isAssetPath(source)) { - files.add(source); + files.add(resolveRelativePath(path, source)); } } } diff --git a/test/input/build/sql/index.md b/test/input/build/sql/index.md new file mode 100644 index 000000000..6c233ce7f --- /dev/null +++ b/test/input/build/sql/index.md @@ -0,0 +1,8 @@ +--- +sql: + table: /table.csv +--- + +```sql echo +FROM table +``` diff --git a/test/input/build/sql/table.csv b/test/input/build/sql/table.csv new file mode 100644 index 000000000..0099ae937 --- /dev/null +++ b/test/input/build/sql/table.csv @@ -0,0 +1,3 @@ +a,b +1,2 +3,4 diff --git a/test/output/build/sql/_duckdb/json-e3b0c442/v1.1.1/wasm_eh/json.duckdb_extension.wasm b/test/output/build/sql/_duckdb/json-e3b0c442/v1.1.1/wasm_eh/json.duckdb_extension.wasm new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_duckdb/json-e3b0c442/v1.1.1/wasm_mvp/json.duckdb_extension.wasm b/test/output/build/sql/_duckdb/json-e3b0c442/v1.1.1/wasm_mvp/json.duckdb_extension.wasm new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_duckdb/parquet-e3b0c442/v1.1.1/wasm_eh/parquet.duckdb_extension.wasm b/test/output/build/sql/_duckdb/parquet-e3b0c442/v1.1.1/wasm_eh/parquet.duckdb_extension.wasm new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_duckdb/parquet-e3b0c442/v1.1.1/wasm_mvp/parquet.duckdb_extension.wasm b/test/output/build/sql/_duckdb/parquet-e3b0c442/v1.1.1/wasm_mvp/parquet.duckdb_extension.wasm new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_file/table.b9485148.csv b/test/output/build/sql/_file/table.b9485148.csv new file mode 100644 index 000000000..0099ae937 --- /dev/null +++ b/test/output/build/sql/_file/table.b9485148.csv @@ -0,0 +1,3 @@ +a,b +1,2 +3,4 diff --git a/test/output/build/sql/_npm/@duckdb/duckdb-wasm@1.29.0/cd372fb8.js b/test/output/build/sql/_npm/@duckdb/duckdb-wasm@1.29.0/cd372fb8.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_npm/@duckdb/duckdb-wasm@1.29.0/dist/duckdb-browser-eh.worker.cd372fb8.js b/test/output/build/sql/_npm/@duckdb/duckdb-wasm@1.29.0/dist/duckdb-browser-eh.worker.cd372fb8.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_npm/@duckdb/duckdb-wasm@1.29.0/dist/duckdb-browser-mvp.worker.cd372fb8.js b/test/output/build/sql/_npm/@duckdb/duckdb-wasm@1.29.0/dist/duckdb-browser-mvp.worker.cd372fb8.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_npm/@duckdb/duckdb-wasm@1.29.0/dist/duckdb-eh.wasm b/test/output/build/sql/_npm/@duckdb/duckdb-wasm@1.29.0/dist/duckdb-eh.wasm new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_npm/@duckdb/duckdb-wasm@1.29.0/dist/duckdb-mvp.wasm b/test/output/build/sql/_npm/@duckdb/duckdb-wasm@1.29.0/dist/duckdb-mvp.wasm new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_npm/htl@0.3.1/cd372fb8.js b/test/output/build/sql/_npm/htl@0.3.1/cd372fb8.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_npm/isoformat@0.2.1/cd372fb8.js b/test/output/build/sql/_npm/isoformat@0.2.1/cd372fb8.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_observablehq/client.00000001.js b/test/output/build/sql/_observablehq/client.00000001.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_observablehq/runtime.00000002.js b/test/output/build/sql/_observablehq/runtime.00000002.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_observablehq/stdlib.00000003.js b/test/output/build/sql/_observablehq/stdlib.00000003.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_observablehq/stdlib/duckdb.00000005.js b/test/output/build/sql/_observablehq/stdlib/duckdb.00000005.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_observablehq/stdlib/inputs.00000006.css b/test/output/build/sql/_observablehq/stdlib/inputs.00000006.css new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_observablehq/stdlib/inputs.00000007.js b/test/output/build/sql/_observablehq/stdlib/inputs.00000007.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/_observablehq/theme-air,near-midnight.00000004.css b/test/output/build/sql/_observablehq/theme-air,near-midnight.00000004.css new file mode 100644 index 000000000..e69de29bb diff --git a/test/output/build/sql/index.html b/test/output/build/sql/index.html new file mode 100644 index 000000000..b79c552cf --- /dev/null +++ b/test/output/build/sql/index.html @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
FROM table
+
+
+ +
+ +