Skip to content

Commit

Permalink
feat: log when import is reolved
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Dec 18, 2023
1 parent 5842efe commit 4ca309b
Show file tree
Hide file tree
Showing 5 changed files with 402 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-crabs-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"rdf-transform-graph-imports": patch
---

Add log when import is resolved
4 changes: 4 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import through2 from 'through2'
import type { AnyPointer } from 'clownface'
import type { Quad } from '@rdfjs/types'
import anylogger from 'anylogger'
import { resolveImport } from './lib/path.js'
import Environment from './lib/env.js'
import fetchImport from './lib/fetchImport.js'

const log = anylogger('rdf-transform-graph-imports')

function transform(env: Environment) {
const code = env.namespace('https://code.described.at/')

Expand All @@ -27,6 +30,7 @@ function transform(env: Environment) {
})

for (const importTarget of imports) {
log.debug(`Importing ${importTarget}`)
const fetchStream = await fetchImport(env, importTarget)
const importStream = fetchStream.pipe(transform(env))

Expand Down
208 changes: 205 additions & 3 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"lint": "eslint --ext .ts --quiet --ignore-path .gitignore .",
"test": "mocha",
"prepare": "husky install",
"prepare": "husky install; patch-package",
"prepack": "tsc",
"release": "changeset publish"
},
Expand Down Expand Up @@ -36,6 +36,7 @@
},
"homepage": "https://github.com/zazuko/rdf-merge-stream#readme",
"dependencies": {
"anylogger": "^1.0.11",
"readable-stream": "3 - 4",
"through2": "^4.0.2"
},
Expand Down Expand Up @@ -67,6 +68,7 @@
"lint-staged": "^15.0.2",
"mocha": "^10.2.0",
"mocha-chai-jest-snapshot": "^1.1.4",
"patch-package": "^8.0.0",
"sinon": "^17.0.1",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
Expand Down
Loading

0 comments on commit 4ca309b

Please sign in to comment.