Skip to content

Commit

Permalink
chore: rename to @kopflos/core
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Mar 28, 2024
1 parent d02e2d2 commit a7fc4ef
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 25 deletions.
7 changes: 3 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# hydra-box
# @kopflos/core

## 0.7.0
## 0.1.0

### Minor Changes

- edc3783: Convert package to ESM
- 2643a0a: Source changes to TypeScript
- First release, renamed from `hydra-box`
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# hydra-box
# @kopflos/core

[Hydra](http://www.hydra-cg.com/spec/latest/core/) is a machine readable description for APIs.
Hydra Box extends the API description with links to the actual code, which provides the API.
Expand All @@ -8,7 +8,7 @@ Hydra Box will use such an API description to create an express middleware which

### Application

Hydra-Box uses an object that implements the [RDF/JS Store interface](http://rdf.js.org/stream-spec/#store-interface) to read resources and find types of resources to identify matching operations.
`@kopflos/core` uses an object that implements the [RDF/JS Store interface](http://rdf.js.org/stream-spec/#store-interface) to read resources and find types of resources to identify matching operations.
The resource is read using the IRI as named graph filter.

Here an example for a store on the local file system using `rdf-store-fs`:
Expand Down Expand Up @@ -43,7 +43,7 @@ app.listen(9000)
### Operation

The operations must implement a [Express routing handler](http://expressjs.com/en/starter/basic-routing.html) interface (`(req, res, next) => {}`).
Hydra-Box adds the [@rdfjs/express-handler](https://github.com/rdfjs-base/express-handler) to handle incoming and outgoing RDF data.
@kopflos/core adds the [@rdfjs/express-handler](https://github.com/rdfjs-base/express-handler) to handle incoming and outgoing RDF data.
For `GET` requests with a matching IRI Template, the `.dataset()` and `.quadStream()` as defined by `express-handler` are also available to read the given variables.
Additionally there is a `hydra` property assigned to `req` that contains more data about the request:

Expand Down
4 changes: 2 additions & 2 deletions examples/blog/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hydra-Box - Blog Example
# kopflos - Blog Example

Simple hydra-box blog application that stores the RDF data in a file store in the local file system.
Simple blog application that stores the RDF data in a file store in the local file system.

Before you can run the example, you need to create an initial store.
Run the following command in the directory `examples/blog/`:
Expand Down
4 changes: 2 additions & 2 deletions examples/blog/api.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@prefix hydra: <http://www.w3.org/ns/hydra/core#>.
@prefix code: <https://code.described.at/>.
@prefix hydrabox: <http://hydra-box.org/schema/>.
@prefix kopflos: <https://kopflos.described.at/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xml: <http://www.w3.org/XML/1998/namespace>.
Expand All @@ -15,7 +15,7 @@
<blog#post>.

<blog#get> a hydra:SupportedOperation;
hydrabox:variables <blog#search>;
kopflos:variables <blog#search>;
hydra:expects <TimeRange>;
hydra:method "GET";
hydra:returns <Result>;
Expand Down
2 changes: 1 addition & 1 deletion lib/log.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import debug0 from 'debug'

const debug = debug0('hydra-box')
const debug = debug0('kopflos:core')

export default (ns: string) => {
if (ns) {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

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

23 changes: 15 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
{
"name": "hydra-box",
"description": "Hydra Box middleware",
"version": "0.7.0",
"name": "@kopflos/core",
"description": "Hydra middleware for web APIs",
"version": "0.1.0",
"main": "index.js",
"type": "module",
"scripts": {
"lint": "eslint . --quiet --ignore-path .gitignore",
"test": "c8 --all --reporter lcovonly --reporter text mocha",
"build": "tsc",
"preblog": "npm run build",
"blog": "(cd examples/blog; bash init.sh --keep; DEBUG=hydra-box* nodemon --ext ttl,js,json --exec node --inspect=0.0.0.0:9001 server.js)",
"blog": "(cd examples/blog; bash init.sh --keep; DEBUG=kopflos:core* nodemon --ext ttl,js,json --exec node --inspect=0.0.0.0:9001 server.js)",
"prepack": "npm run build",
"release": "changeset publish"
},
"author": "Thomas Bergwinkl <[email protected]> (https://www.bergnet.org/people/bergi/card#me)",
"author": "Zazuko GmbH",
"contributors": [
{
"name": "Thomas Bergwinkl",
"email": "[email protected]",
"url": "https://www.bergnet.org/people/bergi/card#me"
}
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/zazuko/hydra-box.git"
"url": "git://github.com/zazuko/kopflos.git"
},
"bugs": {
"url": "https://github.com/zazuko/hydra-box/issues"
"url": "https://github.com/zazuko/kopflos/issues"
},
"homepage": "https://github.com/zazuko/hydra-box",
"homepage": "https://github.com/zazuko/kopflos",
"dependencies": {
"@rdfjs/express-handler": "^2.0.0",
"@zazuko/env-node": "^2.1.1",
Expand Down
2 changes: 1 addition & 1 deletion test/middleware.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import hydraBox from '../middleware.js'

const example = RDF.namespace('http://example.org/')

describe('hydra-box', () => {
describe('@kopflos/core', () => {
let api

beforeEach(() => {
Expand Down

0 comments on commit a7fc4ef

Please sign in to comment.