create-notegen-plugin 0.1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 NoteGen contributors
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,96 @@
1
+ # `create-notegen-plugin`
2
+
3
+ `create-notegen-plugin` is the small `npx` entry point for creating a NoteGen
4
+ plugin project. It delegates to the `create` command in
5
+ `@notegen/plugin-cli`.
6
+
7
+ > Its source is implemented in the NoteGen Plugin SDK repository, but the first
8
+ > npm release has not been published. `npx create-notegen-plugin` becomes
9
+ > available only after that release.
10
+
11
+ ## Usage after the npm release
12
+
13
+ ```bash
14
+ npx create-notegen-plugin my-plugin \
15
+ --id com.example.my-plugin \
16
+ --name "My Plugin"
17
+ ```
18
+
19
+ Then install dependencies and build the development snapshot:
20
+
21
+ ```bash
22
+ cd my-plugin
23
+ pnpm install
24
+ pnpm build
25
+ pnpm validate
26
+ ```
27
+
28
+ Import the absolute path to `my-plugin/.notegen/package` from NoteGen desktop's
29
+ Settings → Plugins → Developer page.
30
+
31
+ ## Use from an SDK source checkout
32
+
33
+ ```bash
34
+ git clone https://github.com/codexu/note-gen-plugin-sdk.git
35
+ cd note-gen-plugin-sdk
36
+ pnpm install
37
+ pnpm build
38
+ node packages/create-notegen-plugin/dist/bin.js ../my-plugin \
39
+ --id com.example.my-plugin \
40
+ --name "My Plugin"
41
+ ```
42
+
43
+ Before the npm release, do not use `--install`: the generated
44
+ `@notegen/plugin-api` and `@notegen/plugin-cli` dependencies are not available
45
+ from the registry. You may run the built source CLI directly instead:
46
+
47
+ ```bash
48
+ node packages/plugin-cli/dist/bin.js build ../my-plugin
49
+ node packages/plugin-cli/dist/bin.js validate ../my-plugin/.notegen/package
50
+ ```
51
+
52
+ ## Options
53
+
54
+ ```text
55
+ create-notegen-plugin <directory> [options]
56
+ ```
57
+
58
+ | Option | Meaning |
59
+ | --- | --- |
60
+ | `--id <id>` | Reverse-domain plugin ID; prompted interactively and required with `--yes` |
61
+ | `--name <name>` | Plugin display name; the prompt offers the directory name as its default |
62
+ | `--description <text>` | Initial manifest description |
63
+ | `--template <name>` | `command` or `editor-statistics` |
64
+ | `--min-app-version <version>` | Oldest supported NoteGen version |
65
+ | `--api-version <range>` | Required plugin API range |
66
+ | `--package-manager <name>` | `pnpm` or `npm` |
67
+ | `--install` | Install dependencies after creating files |
68
+ | `--yes` | Disable prompts; `--id` is required and a missing name defaults from the directory |
69
+ | `--json` | Emit machine-readable success output and diagnostic errors |
70
+
71
+ Use a lowercase reverse-domain ID under a namespace you control. The
72
+ `app.notegen` namespace is reserved for NoteGen. The command refuses to
73
+ overwrite a non-empty directory. In automation, use `--id <id> --json` to
74
+ prevent prompts and receive one structured JSON document on stdout. When
75
+ `--install` is also used, package-manager logs are redirected to stderr.
76
+
77
+ ## Generated project
78
+
79
+ ```text
80
+ my-plugin/
81
+ ├── .gitignore
82
+ ├── package.json
83
+ ├── plugin.json
84
+ ├── tsconfig.json
85
+ └── src/
86
+ └── main.ts
87
+ ```
88
+
89
+ The generated `build` and `validate` scripts run TypeScript in strict, no-emit
90
+ mode before invoking `notegen-plugin`, so type errors cannot be hidden by the
91
+ bundler. The `pack` script creates the unsigned distribution archive. Choose
92
+ the `command` template for a minimal command contribution or `editor-statistics`
93
+ for an active-editor status-bar example.
94
+
95
+ For all build, package, signing, and verification commands, see
96
+ [`@notegen/plugin-cli`](../plugin-cli/README.md).
package/dist/bin.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/bin.js ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { runCreateCli } from '@notegen/plugin-cli';
3
+ process.exitCode = await runCreateCli();
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "create-notegen-plugin",
3
+ "version": "0.1.0",
4
+ "description": "Create a NoteGen plugin project.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "bin": {
9
+ "create-notegen-plugin": "./dist/bin.js"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
16
+ "publishConfig": {
17
+ "access": "public",
18
+ "provenance": true
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/codexu/note-gen-plugin-sdk.git",
23
+ "directory": "packages/create-notegen-plugin"
24
+ },
25
+ "homepage": "https://notegen.top",
26
+ "bugs": {
27
+ "url": "https://github.com/codexu/note-gen-plugin-sdk/issues"
28
+ },
29
+ "dependencies": {
30
+ "@notegen/plugin-cli": "^0.1.0"
31
+ },
32
+ "devDependencies": {
33
+ "@types/node": "^20.19.43",
34
+ "typescript": "^5.8.3"
35
+ },
36
+ "engines": {
37
+ "node": ">=20"
38
+ },
39
+ "scripts": {
40
+ "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
41
+ "build": "pnpm run clean && tsc -p tsconfig.json"
42
+ }
43
+ }