create-clovnet-plugin 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +27 -0
- package/bin/create-clovnet-plugin.mjs +29 -0
- package/package.json +42 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Clovnet
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# create-clovnet-plugin
|
|
2
|
+
|
|
3
|
+
Scaffold a CasinoWebEngine plugin:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pnpm create cwe-plugin my-cashback
|
|
7
|
+
# or: npm create cwe-plugin@latest my-cashback
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
This is a thin alias for [`@clovnet/plugin-cli`](https://www.npmjs.com/package/@clovnet/plugin-cli)'s
|
|
11
|
+
`cwe-plugin create` — all flags are forwarded:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm create cwe-plugin my-provider -- --kind provider --template provider-skeleton
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Templates: `blank` (minimum viable plugin), `cashback` (dataset + player
|
|
18
|
+
actions + nightly cron — the reference plugin shape), `provider-skeleton`
|
|
19
|
+
(game-provider adapter + fake backend + signature-verified callback).
|
|
20
|
+
|
|
21
|
+
After scaffolding:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
cd my-cashback && pnpm install
|
|
25
|
+
pnpm dev # hot reload + live logs against your local CWE runtime
|
|
26
|
+
pnpm test # unit tests on the in-memory test context
|
|
27
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// `pnpm create cwe-plugin <name>` — a thin alias that resolves the real CLI
|
|
3
|
+
// (a dependency of this package) and forwards to `cwe-plugin create`.
|
|
4
|
+
// One implementation, two entry points.
|
|
5
|
+
import { spawn } from "node:child_process";
|
|
6
|
+
import { createRequire } from "node:module";
|
|
7
|
+
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
9
|
+
|
|
10
|
+
let bin;
|
|
11
|
+
try {
|
|
12
|
+
bin = require.resolve("@clovnet/plugin-cli/bin/cwe-plugin.mjs");
|
|
13
|
+
} catch {
|
|
14
|
+
console.error(
|
|
15
|
+
"create-clovnet-plugin: cannot resolve @clovnet/plugin-cli — reinstall: npm i -g create-clovnet-plugin",
|
|
16
|
+
);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const child = spawn(process.execPath, [bin, "create", ...process.argv.slice(2)], {
|
|
21
|
+
stdio: "inherit",
|
|
22
|
+
});
|
|
23
|
+
child.on("error", (error) => {
|
|
24
|
+
console.error(`create-clovnet-plugin: failed to launch cwe-plugin (${error.message})`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
});
|
|
27
|
+
child.on("exit", (code, signal) => {
|
|
28
|
+
process.exit(signal ? 1 : (code ?? 1));
|
|
29
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-clovnet-plugin",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Scaffold a Clovnet plugin — thin alias for `clovnet-plugin create` (use via `pnpm create clovnet-plugin <name>`).",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"private": false,
|
|
7
|
+
"type": "module",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=20"
|
|
10
|
+
},
|
|
11
|
+
"bin": {
|
|
12
|
+
"create-clovnet-plugin": "bin/create-clovnet-plugin.mjs"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"bin",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@clovnet/plugin-cli": "^0.2.2"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"casinowebengine",
|
|
24
|
+
"cwe",
|
|
25
|
+
"plugin",
|
|
26
|
+
"create",
|
|
27
|
+
"scaffold"
|
|
28
|
+
],
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/Clovnet/casino-runtime-core.git",
|
|
35
|
+
"directory": "packages/create-clovnet-plugin"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://clovnet.com",
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/Clovnet/casino-runtime-core/issues"
|
|
40
|
+
},
|
|
41
|
+
"author": "Clovnet"
|
|
42
|
+
}
|