-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
46 changed files
with
11,649 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
bin | ||
coverage | ||
dist | ||
*.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bin | ||
dist | ||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'], | ||
}; |
Oops, something went wrong.