Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
Co-authored-by: Josh <[email protected]>
  • Loading branch information
innerdvations and joshuaellis committed May 7, 2024
0 parents commit 1703a30
Show file tree
Hide file tree
Showing 46 changed files with 11,649 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"commit": false,
"changelog": false,
"access": "public",
"baseBranch": "main"
}
26 changes: 26 additions & 0 deletions .commitlintrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import type { UserConfig } from '@commitlint/types';
import { RuleConfigSeverity } from '@commitlint/types';

const config: UserConfig = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
RuleConfigSeverity.Error,
'always',
[
'chore',
'ci',
'docs',
'enhancement',
'feat',
'fix',
'release',
'revert',
'security',
'test',
],
],
},
};

export default config;
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{package.json,*.yml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bin
coverage
dist
*.yaml
58 changes: 58 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
module.exports = {
root: true,
extends: ['@strapi/eslint-config/back/typescript'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'eslint-plugin-rxjs'],
parserOptions: {
project: ['./tsconfig.eslint.json'],
},
overrides: [
{
files: ['./scripts/**/*', './src/cli/errors.ts', './src/cli/index.ts'],
rules: {
'no-console': ['error', { allow: ['error'] }],
},
},
{
files: ['./src/cli/commands/utils/logger.ts'],
rules: {
'no-console': 'off',
},
},
],
rules: {
'rxjs/finnish': 'error',
// TODO: The following rules from @strapi/eslint-config/back/typescript are disabled because they're causing problems we need to solve or fix
// to be solved in configuration
'node/no-unsupported-features/es-syntax': 'off',
'import/prefer-default-export': 'off',
'import/namespace': 'off',
'node/no-missing-import': 'off',
'no-process-exit': 'off',
'import/no-dynamic-require': 'off',
'global-require': 'off',
'no-underscore-dangle': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-explicit-any': 'off',
/**
* Force us to use the Logger instance.
*/
'no-console': 'error',
'import/extensions': 'off',
'import/order': [
'error',
{
groups: [
['external', 'internal', 'builtin'],
'parent',
['sibling', 'index'],
'object',
'type',
],
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
'nonblock-statement-body-position': ['error', 'below'],
},
};
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
95 changes: 95 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
############################
# OS X
############################

.DS_Store
.AppleDouble
.LSOverride
Icon
.Spotlight-V100
.Trashes
._*

############################
# Linux
############################

*~

############################
# Windows
############################

Thumbs.db
ehthumbs.db
Desktop.ini
$RECYCLE.BIN/
*.cab
*.msi
*.msm
*.msp

############################
# Packages
############################

*.7z
*.csv
*.dat
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
*.com
*.class
*.dll
*.exe
*.o
*.seed
*.so
*.swo
*.swp
*.swn
*.swm
*.out
*.pid

############################
# Logs and databases
############################

.tmp
*.log
*.sql
*.sqlite

############################
# Misc.
############################

*#
.idea
nbproject

############################
# Node.js
############################

lib-cov
lcov.info
pids
logs
results
dist
node_modules
.node_history
package-lock.json

############################
# Tests
############################

__tmp__/
3 changes: 3 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{js,ts,jsx,tsx,yml,yaml}": ["pnpm prettier:write", "pnpm lint"]
}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bin
dist
pnpm-lock.yaml
9 changes: 9 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
endOfLine: 'lf',
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
printWidth: 100,
arrowParens: 'always',
};
Empty file added CHANGELOG.md
Empty file.
5 changes: 5 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Code of Conduct

This project and everyone participating in it are governed by the [Strapi Code of Conduct](https://github.com/strapi/strapi/blob/master/CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code. Please read the [full text](https://github.com/strapi/strapi/blob/master/CODE_OF_CONDUCT.md)
so that you can read which actions may or may not be tolerated.
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2015-present Strapi Solutions SAS

Portions of the Strapi software are licensed as follows:

- All software that resides under an "ee/" directory (the “EE Software”), if that directory exists, is licensed under the license defined in "ee/LICENSE".

- All software outside of the above-mentioned directories or restrictions above is available under the "MIT Expat" license as set forth below.

MIT Expat License

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.
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<h1 align="center">sdk-plugin</h1>
<h3 align="center">Everything you need to develop an awesome Strapi plugin</h3>

<br />

<p align="center">
<a href="https://www.npmjs.com/package/@strapi/sdk-plugin" target="_blank">
<img src="https://img.shields.io/npm/v/@strapi/sdk-plugin.svg?style=flat&colorA=4945ff&colorB=4945ff" />
</a>
<a href="https://www.npmjs.com/package/@strapi/sdk-plugin" target="_blank">
<img src="https://img.shields.io/npm/dm/@strapi/sdk-plugin.svg?style=flat&colorA=4945ff&colorB=4945ff" />
</a>
<a href="https://discord.gg/strapi" target="_blank">
<img src="https://img.shields.io/discord/811989166782021633?style=flat&colorA=4945ff&colorB=4945ff&label=discord&logo=discord&logoColor=f0f0ff" alt="Chat on Discord" />
</a>
</p>

<br />

sdk-plugin is a set of command line utilities for developing a Strapi plugin

## Getting Started

If you're setting up a brand new plugin we recommend you use the `init` command to get started:

```sh
npx @strapi/sdk-plugin@latest init my-plugin
```

That will create a directory with all your plugin project files.

Run `strapi-plugin -h` for more information on CLI usage.

## Commands

All of the following comands have the following options available:

-- `-d, --debug` – Enable debugging mode with verbose logs (default: false)
-- `--silent` – Don't log anything (default: false)
-- `-h, --help` – Display help for command

### `init [path]`

Creates a new plugin at the given path.

### `build`

Builds your current package based on the configuration in your `package.json` and `packup.config.ts` (if applicable).

- `--minify` – minifies the output (default `false`).
- `--sourcemap` – generates sourcemaps for the output (default `true`).

### `watch`

Watch & compile your strapi plugin for local development.

### `watch:link`

Recompiles your plugin automatically on changes and runs yalc push --publish

### `verify`

Verifies the output of your plugin before publishing it
4 changes: 4 additions & 0 deletions bin/strapi-plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env node
const { runCLI } = require('../dist/cli');

runCLI(process.argv);
12 changes: 12 additions & 0 deletions jest.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @type {import('jest').Config}
*/
export default {
modulePathIgnorePatterns: ['dist'],
testMatch: ['**/__tests__/**/*.{js,ts}'],
transform: {
'^.+\\.(t|j)sx?$': ['@swc/jest'],
},
displayName: 'Plugin CLI',
collectCoverageFrom: ['src/**/*.ts'],
};
Loading

0 comments on commit 1703a30

Please sign in to comment.