Skip to content

Commit

Permalink
pluginkit initial
Browse files Browse the repository at this point in the history
  • Loading branch information
booploops committed Oct 3, 2024
1 parent f99aca6 commit 8a32067
Show file tree
Hide file tree
Showing 35 changed files with 6,222 additions and 3 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

[*.js]
indent_style = space
indent_size = 2

[{package.json,*.yml,*.cjson}]
indent_style = space
indent_size = 2
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
coverage
dist
build
.vscode
.DS_Store
.eslintcache
*.log*
*.env*
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
# Cider-PluginKit
# ciderapp/pluginkit

**Note** This repository is not for reporting issues for individual plugins, please report issues with plugins themselves to their respective authors.

Please use this repository to report bugs and feature requests for the Cider 2 Plugin API.

## Usage

## Get Started
[Plugin Template Repo](https://github.com/ciderapp/plugin-template-wip)
Import:

**ESM** (Node.js, Bun)

```js
import {} from "@ciderapp/pluginkit";
```

## Development

<details>

<summary>local development</summary>

- Clone this repository
- Install latest LTS version of [Node.js](https://nodejs.org/en/)
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
- Install dependencies using `pnpm install`
- Run interactive tests using `pnpm dev`

</details>

## License

Published under the [MIT](https://github.com/unjs/packageName/blob/main/LICENSE) license.
23 changes: 23 additions & 0 deletions build.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { defineBuildConfig } from "unbuild";

export default defineBuildConfig({
// If entries is not provided, will be automatically inferred from package.json
entries: [
// default
"./src/index",
// mkdist builder transpiles file-to-file keeping original sources structure
{
builder: "mkdist",
format: "esm",
input: "./src/api/",
outDir: "./build/api",
// loaders: ['vue'],
},
],
externals: ['vue', 'lodash'],
// Change outDir, default is 'dist'
outDir: "build",
failOnWarn: false,
// Generates .d.ts declaration file
declaration: true,
});
16 changes: 16 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import unjs from "eslint-config-unjs";

export default unjs({
ignores: [
// ignore paths
],
rules: {
"unicorn/filename-case": "off",
// other rule overrides
},
markdown: {
rules: {
// markdown rule overrides
},
},
});
58 changes: 58 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "@ciderapp/pluginkit",
"version": "0.0.1",
"description": "",
"repository": "ciderapp/pluginkit",
"license": "MIT",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"types": "./build/index.d.ts",
"import": "./build/index.mjs"
},
"./api/*": {
"types": "./build/api/*.d.ts",
"import": "./build/api/*.mjs"
},
"./api/*.vue": {
"import": "./build/api/*.vue"
},
"./types": {
"import": "./src/api/ciderapi-types/*.ts"
}
},
"module": "./build/index.mjs",
"types": "./build/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "unbuild",
"dev": "vitest dev",
"lint": "eslint . && prettier -c .",
"lint:fix": "automd && eslint . --fix && prettier -w .",
"prepack": "pnpm build",
"play": "jiti playground",
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
"test": "pnpm lint && pnpm test:types && vitest run --coverage",
"test:types": "tsc --noEmit --skipLibCheck"
},
"devDependencies": {
"@types/lodash": "^4.17.9",
"@types/node": "^22.1.0",
"@vitest/coverage-v8": "^2.0.5",
"automd": "^0.3.8",
"changelogen": "^0.5.5",
"eslint": "^9.8.0",
"eslint-config-unjs": "^0.3.2",
"jiti": "^2.0.0-beta.3",
"lodash": "^4.17.21",
"prettier": "^3.3.3",
"typescript": "^5.5.4",
"unbuild": "^3.0.0-rc.7",
"vitest": "^2.0.5",
"vue": "^3.5.10"
},
"packageManager": "pnpm@9.7.0"
}
18 changes: 18 additions & 0 deletions playground/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { definePluginContext } from "../build/index.mjs";

export default definePluginContext({
author: "Cider",
ce_prefix: "cider",
CustomElements: {
"home": "Home",
"settings": "Settings",
},
description: "Cider Plugin",
identifier: "cider",
name: "Cider",
repo: "",
version: "0.0.1",
setup() {
//
}
})
Loading

0 comments on commit 8a32067

Please sign in to comment.