Skip to content

Commit

Permalink
feat: add initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
janbiasi committed Nov 14, 2023
1 parent 18fd184 commit 8d517b6
Show file tree
Hide file tree
Showing 30 changed files with 3,971 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
root = true

### All files
[*]
# Force charset utf-8
charset = utf-8
# Force Unix-style newlines with a newline ending every file & trim trailing whitespace
end_of_line = lf
# Indentation
indent_style = space
indent_size = 4

insert_final_newline = true
trim_trailing_whitespace = true

# Backend files
[*.{groovy,java,kt,kts,xml,xsd}]
continuation_indent_size = 8

### Frontend files
[*.{css,scss,less,js,json,jsx,ts,tsx,sass,html}]

### Markdown
[*.{md,mdx}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = false

### YAML
[*.{yml,yaml}]
indent_style = space
indent_size = 2

### Storybook stories
[*.stories.{ts,tsx}]
indent_style = space
indent_size = 2

### Specific files
[{package,bower,lerna}.json]
indent_style = space
indent_size = 2
21 changes: 21 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto

# Explicitly declare text files we want to always be normalized and converted
# to native line endings on checkout.
*.sh text eol=lf
*.pp text eol=lf
*.rb text eol=lf
*.yaml text eol=lf
*.bash_aliases text eol=lf

# Denote all files that are truly binary and should not be modified.
*.eot binary
*.ttf binary
*.woff binary
*.woff2 binary

# Windows-specific files get windows endings
*.bat eol=crlf
*.cmd eol=crlf
*-windows.tmpl eol=crlf
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
```[tasklist]
### Tasks
- [ ] I've read the [CONTRIBUTING](./CONTRIBUTING) guide
- [ ] Necessary tests have been added
```
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,35 @@
# rollup-plugin-sbom
Create SBOMs for your Vite or Rollup projects

Create SBOMs for your Vite or Rollup projects.

### Compatibility

| Plugin | Vite | Rollup |
| ------ | ---- | ------ |
| v1 | v4 | v4 |

### Installation and usage

```sh
npm install --save-dev rollup-plugin-sbom
```

```ts
import { defineConfig } from "vite";
import sbom from "rollup-plugin-sbom";

export default defineConfig({
plugins: [sbom()],
});
```

### Options

| Name | Default | Description |
| ------------------- | ------- | ------------------------------------------------------ |
| `specVersion` | TODO | The CycloneDX specification version to use |
| `rootComponentType` | TODO | The root component type, can be library or application |
| `outDir` | TODO | TODO |
| `saveTimestamp` | TODO | TODO |
| `autodetect` | TODO | TODO |
| `generateSerial` | TODO | TODO |
12 changes: 12 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineBuildConfig } from "unbuild";

export default defineBuildConfig({
entries: ["src/index"],
externals: ["rollup"],
clean: true,
declaration: true,
rollup: {
emitCJS: true,
inlineDependencies: true,
},
});
47 changes: 47 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"type": "module",
"name": "rollup-plugin-sbom",
"version": "1.0.0",
"description": "",
"packageManager": "pnpm@8.9.0",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"scripts": {
"dev": "unbuild --stub",
"build": "unbuild",
"preinstall": "npx only-allow pnpm",
"prepublishOnly": "npm run build"
},
"keywords": [
"vite-plugin",
"rollup-plugin",
"sbom",
"cyclonedx"
],
"author": "Jan Biasi (https://github.com/janbiasi)",
"license": "MIT",
"dependencies": {
"normalize-package-data": "6.0.0",
"@cyclonedx/cyclonedx-library": "6.1.0"
},
"peerDependencies": {
"rollup": "^4"
},
"devDependencies": {
"@types/node": "^20",
"prettier": "3.1.0",
"rollup": "4.4.1",
"typescript": "5.2.2",
"unbuild": "2.0.0"
},
"prettier": {
"printWidth": 120
}
}
Loading

0 comments on commit 8d517b6

Please sign in to comment.