Skip to content

Commit

Permalink
feat: copy into independent package
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Dec 27, 2021
1 parent e4d9b63 commit 794a2b2
Show file tree
Hide file tree
Showing 10 changed files with 3,510 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
10 changes: 10 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.6.3/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/tame-cycles-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-loader-rdf": minor
---

First release
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_size = 2
indent_style = space
insert_final_newline = true

[*.hydra]
indent_size = 4
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

on:
push:
branches:
- master

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v2.1.2
with:
node-version: 14

- name: Install Dependencies
run: yarn

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@master
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
27 changes: 27 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { extensions } = require('rdf-utils-fs/defaults')
const { extname } = require('path')
const { parsers } = require('@rdfjs/formats-common')
const toStream = require('string-to-stream')
const Serializer = require('@rdfjs/serializer-rdfjs')

const serializer = new Serializer({
module: 'esm'
})

function loader (source) {
const callback = this.async()

const extension = extname(this.resourcePath).split('.').pop()
const mediaType = extensions[extension]

Promise.resolve().then(async () => {
const quadStream = parsers.import(mediaType, toStream(source))
const module = serializer.import(quadStream)

module.on('data', (code) => {
callback(null, code)
})
})
}

module.exports = loader
37 changes: 37 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "webpack-loader-rdf",
"version": "0.0.0",
"main": "index.js",
"scripts": {
"prepare": "husky install",
"lint": "standard --fix",
"release": "changeset publish"
},
"dependencies": {
"@rdfjs/serializer-rdfjs": "^0.0.4",
"@rdfjs/formats-common": "^2.2.0",
"rdf-utils-fs": "^2.2.0",
"string-to-stream": "^3.0.1"
},
"devDependencies": {
"@changesets/cli": "^2.19.0",
"husky": "^7.0.4",
"lint-staged": "^12.1.2",
"standard": "^16"
},
"repository": {
"type": "git",
"url": "git+https://github.com/hypermedia-app/webpack-loader-rdf.git"
},
"author": "Tomasz Pluskiewicz",
"license": "MIT",
"bugs": {
"url": "https://github.com/hypermedia-app/webpack-loader-rdf/issues"
},
"homepage": "https://github.com/hypermedia-app/webpack-loader-rdf#readme",
"lint-staged": {
"*.{js,ts}": [
"standard --fix --quiet"
]
}
}
Loading

0 comments on commit 794a2b2

Please sign in to comment.