Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Sourcebit helps developers build data-driven JAMstack sites by pulling data from any third-party resource
Sourcebit helps developers build data-driven JAMstack sites by pulling data from any third-party resource.
Sourcebit connects to multiple data sources using modular components called source plugins. These are responsible for fetching data, normalizing it to a standard format, and placing the resulting entries on sets of data called data buckets.
Subsequently, any combination of plugins may consume, transform and persist these data buckets in any way they like.
A specific group of plugins, called target plugins, is tasked with writing data into a format and location that other programs – such as static site generators – expect.
+----------------+ +---------------+ +-----------------+
| | | | | |
| Contentful | | DatoCMS | | Airtable |
| | | | | |
+--------\-------+ +-------|-------+ +--------/--------+
\ | /
\ | /
\ | /
\ | /
+--------------|-------------|--------------|-------------+
| | | | |
| +-----|-----+ +-----------+ +-----|-----+ |
S | | (Plugin) | | (Plugin) | | (Plugin) | | S
O | | | | | | | | O
U | +-----|-----+ +-----|-----+ +-----|-----+ | U
R | | | | | R
C | | | | | C
E | +-----|-----+ +-----|-----+ +-----|-----+ | E
B | | (Plugin) | | (Plugin) | | (Plugin) | | B
I | | | | | | | | I
T | +-----|-----+ +-----|-----+ +-----|-----+ | T
| | | | |
+--------------|-------------|--------------|-------------+
/ | \
/ | \
/ | \
/ | \
/ | \
+--------/--------+ +--------|-------+ +----------------+
| | | | | |
| Next.js | | Jekyll | | Hugo |
| | | | | |
+-----------------+ +----------------+ +----------------+
Sourcebit is distributed as an npm module. To install it and add it as a dependency to your project, run:
npm install sourcebit --save
Everything about Sourcebit, including its plugins and their parameters, is configured in a JavaScript object that typically lives in a file called sourcebit.js
.
It looks something like this:
module.exports = {
plugins: [
{
module: require("sourcebit-some-plugin-1"),
options: {
pluginOption1: "foo",
pluginOptino2: "bar"
}
},
{
module: require("sourcebit-some-plugin-2"),
options: {
pluginFunction1: (a, b) => a + b
}
}
]
};
It's important to note that while every plugin block is defined with the module
and options
properties, the actual options passed to each options block varies widely and is defined (and should be documented) by each plugin.
To ease the process of configuring Sourcebit, we've created a command-line tool that provides an interactive setup process. By asking you a series of questions defined by each plugin, this tool generates a sourcebit.js
file so that you can get up and running in no time.
To start this process, run npx sourcebit
in your project directory.
To use Sourcebit as a CommonJS module, include it in your project and call its fetch
method.
const sourcebit = require("sourcebit");
const sourcebitConfig = require("./sourcebit.js");
sourcebit.fetch(sourcebitConfig).then(data => {
console.log(data);
});
To use Sourcebit as a command-line tool, run the sourcebit fetch
command in your project directory.
$ sourcebit fetch
sourcebit-source-contentful
: A source plugin for the Contentful headless CMS.sourcebit-target-jekyll
: A target plugin for the Jekyll static site generator.sourcebit-plugin-content-mapper
: A plugin for creating different data buckets from content models.🚀 If you're interested in creating your own plugin, you might want to check out our sample plugin repository, which contains a basic plugin with a fully-annotated source.
FAQs
Sourcebit helps developers build data-driven JAMstack sites by pulling data from any third-party resource
We found that sourcebit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 15 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.