-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from solid-contrib/bookmarks/create-bookmark
Bookmarks/create bookmark
- Loading branch information
Showing
36 changed files
with
1,012 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: Bookmarks rdflib CI/CD | ||
|
||
on: | ||
push: | ||
paths: | ||
- bookmarks/rdflib/** | ||
- .github/workflows/bookmarks-rdflib-ci-cd.yml | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./bookmarks/rdflib/ | ||
strategy: | ||
matrix: | ||
node-version: [ 20 ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- run: npm ci | ||
- run: npm run lint | ||
- run: npm run build | ||
- run: npm test | ||
- run: npm run test:e2e | ||
- name: Save e2e test data | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: e2e-test-data | ||
path: | | ||
bookmarks/rdflib/src/e2e-tests/.test-data/ | ||
retention-days: 1 | ||
- name: Save build | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build | ||
path: | | ||
bookmarks/rdflib/dist/ | ||
bookmarks/rdflib/README.md | ||
bookmarks/rdflib/package.json | ||
retention-days: 1 | ||
|
||
npm-publish: | ||
if: github.ref == 'refs/heads/main' | ||
needs: build | ||
runs-on: ubuntu-latest | ||
outputs: | ||
prereleaseVersion: ${{ steps.prerelease.outputs.version }} | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: build | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
- uses: rlespinasse/github-slug-action@v4.4.1 | ||
- name: prerelease version | ||
run: | | ||
echo "::set-output name=version::$(npm version prerelease --preid ${GITHUB_SHA_SHORT} --no-git-tag-version)" | ||
id: prerelease | ||
- run: echo prerelease version is ${{ steps.prerelease.outputs.version }} | ||
- uses: JS-DevTools/npm-publish@v3 | ||
name: Publish @solid-data-modules/bookmarks-rdflib | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
tag: ${{ env.GITHUB_REF_SLUG }} | ||
access: public | ||
|
||
npm-release-latest: | ||
if: github.ref == 'refs/heads/main' | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: build | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
- uses: JS-DevTools/npm-publish@v3 | ||
name: Release @solid-data-modules/bookmarks-rdflib | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
tag: latest | ||
access: public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"proseWrap": "always", | ||
"printWidth": 80 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Changelog | ||
|
||
All notable changes to this module will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## 0.1.0 | ||
|
||
### Added | ||
|
||
- [createBookmark](https://solid-contrib.github.io/data-modules/bookmarks-rdflib-api/interfaces/BookmarksModule.html#createBookmark) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
bookmarks/rdflib/examples/create-bookmark-within-container.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import BookmarksModule from '../dist/index.js'; | ||
import {Fetcher, graph, UpdateManager} from "rdflib"; | ||
|
||
const store = graph() | ||
const fetcher = new Fetcher(store) | ||
const updater = new UpdateManager(store) | ||
const bookmarks = new BookmarksModule({store, fetcher, updater}) | ||
|
||
const uri = await bookmarks.createBookmark({ | ||
storageUrl: "http://localhost:3000/alice/bookmarks/", | ||
title: "My favorite website", | ||
url: "https://favorite.example" | ||
}) | ||
|
||
console.log("new bookmark: " + uri) |
15 changes: 15 additions & 0 deletions
15
bookmarks/rdflib/examples/create-bookmark-within-document.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import BookmarksModule from '../dist/index.js'; | ||
import {Fetcher, graph, UpdateManager} from "rdflib"; | ||
|
||
const store = graph() | ||
const fetcher = new Fetcher(store) | ||
const updater = new UpdateManager(store) | ||
const bookmarks = new BookmarksModule({store, fetcher, updater}) | ||
|
||
const uri = await bookmarks.createBookmark({ | ||
storageUrl: "http://localhost:3000/alice/public/bookmarks", | ||
title: "My favorite website", | ||
url: "https://favorite.example" | ||
}) | ||
|
||
console.log("new bookmark: " + uri) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { Config } from "jest"; | ||
|
||
const config: Config = { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
rootDir: "src", | ||
testPathIgnorePatterns: [".*\\.e2e\\.spec\\.ts"], | ||
detectOpenHandles: true, | ||
forceExit: true, | ||
extensionsToTreatAsEsm: [".ts"], | ||
moduleNameMapper: { | ||
"^(\\.{1,2}/.*)\\.js$": "$1", | ||
}, | ||
transform: { | ||
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest` | ||
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest` | ||
"^.+\\.ts$": [ | ||
"ts-jest", | ||
{ | ||
useESM: true, | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import type { Config } from "jest"; | ||
|
||
const config: Config = { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
rootDir: "src/e2e-tests", | ||
testTimeout: 60000, | ||
detectOpenHandles: true, | ||
globalSetup: "<rootDir>/globalSetup.ts", | ||
globalTeardown: "<rootDir>/globalTeardown.ts", | ||
forceExit: true, | ||
extensionsToTreatAsEsm: [".ts"], | ||
moduleNameMapper: { | ||
"^(\\.{1,2}/.*)\\.js$": "$1", | ||
}, | ||
transform: { | ||
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest` | ||
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest` | ||
"^.+\\.ts$": [ | ||
"ts-jest", | ||
{ | ||
useESM: true, | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
export default config; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.