Skip to content

Commit 1703a30

Browse files
chore: initial commit
Co-authored-by: Josh <[email protected]>
0 parents  commit 1703a30

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+11649
-0
lines changed

.changeset/config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"commit": false,
4+
"changelog": false,
5+
"access": "public",
6+
"baseBranch": "main"
7+
}

.commitlintrc.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import type { UserConfig } from '@commitlint/types';
2+
import { RuleConfigSeverity } from '@commitlint/types';
3+
4+
const config: UserConfig = {
5+
extends: ['@commitlint/config-conventional'],
6+
rules: {
7+
'type-enum': [
8+
RuleConfigSeverity.Error,
9+
'always',
10+
[
11+
'chore',
12+
'ci',
13+
'docs',
14+
'enhancement',
15+
'feat',
16+
'fix',
17+
'release',
18+
'revert',
19+
'security',
20+
'test',
21+
],
22+
],
23+
},
24+
};
25+
26+
export default config;

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[{package.json,*.yml}]
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.md]
16+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
bin
2+
coverage
3+
dist
4+
*.yaml

.eslintrc.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['@strapi/eslint-config/back/typescript'],
4+
parser: '@typescript-eslint/parser',
5+
plugins: ['@typescript-eslint', 'eslint-plugin-rxjs'],
6+
parserOptions: {
7+
project: ['./tsconfig.eslint.json'],
8+
},
9+
overrides: [
10+
{
11+
files: ['./scripts/**/*', './src/cli/errors.ts', './src/cli/index.ts'],
12+
rules: {
13+
'no-console': ['error', { allow: ['error'] }],
14+
},
15+
},
16+
{
17+
files: ['./src/cli/commands/utils/logger.ts'],
18+
rules: {
19+
'no-console': 'off',
20+
},
21+
},
22+
],
23+
rules: {
24+
'rxjs/finnish': 'error',
25+
// TODO: The following rules from @strapi/eslint-config/back/typescript are disabled because they're causing problems we need to solve or fix
26+
// to be solved in configuration
27+
'node/no-unsupported-features/es-syntax': 'off',
28+
'import/prefer-default-export': 'off',
29+
'import/namespace': 'off',
30+
'node/no-missing-import': 'off',
31+
'no-process-exit': 'off',
32+
'import/no-dynamic-require': 'off',
33+
'global-require': 'off',
34+
'no-underscore-dangle': 'off',
35+
'@typescript-eslint/no-use-before-define': 'off',
36+
'@typescript-eslint/no-explicit-any': 'off',
37+
/**
38+
* Force us to use the Logger instance.
39+
*/
40+
'no-console': 'error',
41+
'import/extensions': 'off',
42+
'import/order': [
43+
'error',
44+
{
45+
groups: [
46+
['external', 'internal', 'builtin'],
47+
'parent',
48+
['sibling', 'index'],
49+
'object',
50+
'type',
51+
],
52+
'newlines-between': 'always',
53+
alphabetize: { order: 'asc', caseInsensitive: true },
54+
},
55+
],
56+
'nonblock-statement-body-position': ['error', 'below'],
57+
},
58+
};

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
############################
2+
# OS X
3+
############################
4+
5+
.DS_Store
6+
.AppleDouble
7+
.LSOverride
8+
Icon
9+
.Spotlight-V100
10+
.Trashes
11+
._*
12+
13+
############################
14+
# Linux
15+
############################
16+
17+
*~
18+
19+
############################
20+
# Windows
21+
############################
22+
23+
Thumbs.db
24+
ehthumbs.db
25+
Desktop.ini
26+
$RECYCLE.BIN/
27+
*.cab
28+
*.msi
29+
*.msm
30+
*.msp
31+
32+
############################
33+
# Packages
34+
############################
35+
36+
*.7z
37+
*.csv
38+
*.dat
39+
*.dmg
40+
*.gz
41+
*.iso
42+
*.jar
43+
*.rar
44+
*.tar
45+
*.zip
46+
*.com
47+
*.class
48+
*.dll
49+
*.exe
50+
*.o
51+
*.seed
52+
*.so
53+
*.swo
54+
*.swp
55+
*.swn
56+
*.swm
57+
*.out
58+
*.pid
59+
60+
############################
61+
# Logs and databases
62+
############################
63+
64+
.tmp
65+
*.log
66+
*.sql
67+
*.sqlite
68+
69+
############################
70+
# Misc.
71+
############################
72+
73+
*#
74+
.idea
75+
nbproject
76+
77+
############################
78+
# Node.js
79+
############################
80+
81+
lib-cov
82+
lcov.info
83+
pids
84+
logs
85+
results
86+
dist
87+
node_modules
88+
.node_history
89+
package-lock.json
90+
91+
############################
92+
# Tests
93+
############################
94+
95+
__tmp__/

.lintstagedrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"*.{js,ts,jsx,tsx,yml,yaml}": ["pnpm prettier:write", "pnpm lint"]
3+
}

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
bin
2+
dist
3+
pnpm-lock.yaml

.prettierrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
endOfLine: 'lf',
3+
semi: true,
4+
singleQuote: true,
5+
tabWidth: 2,
6+
trailingComma: 'es5',
7+
printWidth: 100,
8+
arrowParens: 'always',
9+
};

CHANGELOG.md

Whitespace-only changes.

CODE_OF_CONDUCT.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Code of Conduct
2+
3+
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).
4+
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)
5+
so that you can read which actions may or may not be tolerated.

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2015-present Strapi Solutions SAS
2+
3+
Portions of the Strapi software are licensed as follows:
4+
5+
- All software that resides under an "ee/" directory (the “EE Software”), if that directory exists, is licensed under the license defined in "ee/LICENSE".
6+
7+
- All software outside of the above-mentioned directories or restrictions above is available under the "MIT Expat" license as set forth below.
8+
9+
MIT Expat License
10+
11+
Permission is hereby granted, free of charge, to any person obtaining a copy
12+
of this software and associated documentation files (the "Software"), to deal
13+
in the Software without restriction, including without limitation the rights
14+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15+
copies of the Software, and to permit persons to whom the Software is
16+
furnished to do so, subject to the following conditions:
17+
18+
The above copyright notice and this permission notice shall be included in all
19+
copies or substantial portions of the Software.
20+
21+
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
22+
SOFTWARE.

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<h1 align="center">sdk-plugin</h1>
2+
<h3 align="center">Everything you need to develop an awesome Strapi plugin</h3>
3+
4+
<br />
5+
6+
<p align="center">
7+
<a href="https://www.npmjs.com/package/@strapi/sdk-plugin" target="_blank">
8+
<img src="https://img.shields.io/npm/v/@strapi/sdk-plugin.svg?style=flat&colorA=4945ff&colorB=4945ff" />
9+
</a>
10+
<a href="https://www.npmjs.com/package/@strapi/sdk-plugin" target="_blank">
11+
<img src="https://img.shields.io/npm/dm/@strapi/sdk-plugin.svg?style=flat&colorA=4945ff&colorB=4945ff" />
12+
</a>
13+
<a href="https://discord.gg/strapi" target="_blank">
14+
<img src="https://img.shields.io/discord/811989166782021633?style=flat&colorA=4945ff&colorB=4945ff&label=discord&logo=discord&logoColor=f0f0ff" alt="Chat on Discord" />
15+
</a>
16+
</p>
17+
18+
<br />
19+
20+
sdk-plugin is a set of command line utilities for developing a Strapi plugin
21+
22+
## Getting Started
23+
24+
If you're setting up a brand new plugin we recommend you use the `init` command to get started:
25+
26+
```sh
27+
npx @strapi/sdk-plugin@latest init my-plugin
28+
```
29+
30+
That will create a directory with all your plugin project files.
31+
32+
Run `strapi-plugin -h` for more information on CLI usage.
33+
34+
## Commands
35+
36+
All of the following comands have the following options available:
37+
38+
-- `-d, --debug` – Enable debugging mode with verbose logs (default: false)
39+
-- `--silent` – Don't log anything (default: false)
40+
-- `-h, --help` – Display help for command
41+
42+
### `init [path]`
43+
44+
Creates a new plugin at the given path.
45+
46+
### `build`
47+
48+
Builds your current package based on the configuration in your `package.json` and `packup.config.ts` (if applicable).
49+
50+
- `--minify` – minifies the output (default `false`).
51+
- `--sourcemap` – generates sourcemaps for the output (default `true`).
52+
53+
### `watch`
54+
55+
Watch & compile your strapi plugin for local development.
56+
57+
### `watch:link`
58+
59+
Recompiles your plugin automatically on changes and runs yalc push --publish
60+
61+
### `verify`
62+
63+
Verifies the output of your plugin before publishing it

bin/strapi-plugin.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env node
2+
const { runCLI } = require('../dist/cli');
3+
4+
runCLI(process.argv);

jest.config.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @type {import('jest').Config}
3+
*/
4+
export default {
5+
modulePathIgnorePatterns: ['dist'],
6+
testMatch: ['**/__tests__/**/*.{js,ts}'],
7+
transform: {
8+
'^.+\\.(t|j)sx?$': ['@swc/jest'],
9+
},
10+
displayName: 'Plugin CLI',
11+
collectCoverageFrom: ['src/**/*.ts'],
12+
};

0 commit comments

Comments
 (0)