@notegen/plugin-cli 0.1.1 → 0.1.3
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/dist/cli.d.ts +1 -1
- package/dist/cli.js +4 -3
- package/dist/lib/constants.d.ts +2 -0
- package/dist/lib/constants.js +3 -0
- package/dist/lib/scaffold.js +6 -4
- package/package.json +2 -2
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
export
|
|
2
|
+
export { PLUGIN_CLI_VERSION } from './lib/constants.js';
|
|
3
3
|
export interface CliIo {
|
|
4
4
|
readonly stdout: Pick<NodeJS.WriteStream, 'write'>;
|
|
5
5
|
readonly stderr: Pick<NodeJS.WriteStream, 'write'>;
|
package/dist/cli.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { PLUGIN_API_VERSION } from '@notegen/plugin-api';
|
|
1
2
|
import { basename } from 'node:path';
|
|
2
3
|
import { createInterface } from 'node:readline/promises';
|
|
3
4
|
import { Command, CommanderError, Option } from 'commander';
|
|
4
|
-
import { EXIT_PROJECT_FAILURE, EXIT_SUCCESS, EXIT_UNSAFE_REFUSAL, EXIT_UNEXPECTED, EXIT_USAGE, } from './lib/constants.js';
|
|
5
|
+
import { PLUGIN_CLI_VERSION, EXIT_PROJECT_FAILURE, EXIT_SUCCESS, EXIT_UNSAFE_REFUSAL, EXIT_UNEXPECTED, EXIT_USAGE, } from './lib/constants.js';
|
|
5
6
|
import { diagnostic, diagnosticsFromError, fail, formatDiagnostic, isDiagnosticError, } from './lib/diagnostics.js';
|
|
6
7
|
import { createPluginProject, } from './lib/scaffold.js';
|
|
7
8
|
import { buildPluginProject } from './lib/project.js';
|
|
8
9
|
import { watchPluginProject } from './lib/watch.js';
|
|
9
10
|
import { generatePublisherKeys, packPluginProject, signPluginArchive, validatePluginTarget, } from './lib/tasks.js';
|
|
10
|
-
export
|
|
11
|
+
export { PLUGIN_CLI_VERSION } from './lib/constants.js';
|
|
11
12
|
function writeLine(stream, value = '') {
|
|
12
13
|
stream.write(`${value}\n`);
|
|
13
14
|
}
|
|
@@ -128,7 +129,7 @@ export function createCliProgram(io = { stdout: process.stdout, stderr: process.
|
|
|
128
129
|
.choices(['command', 'editor-statistics'])
|
|
129
130
|
.default('command'))
|
|
130
131
|
.option('--min-app-version <version>', 'minimum NoteGen version', '0.37.0')
|
|
131
|
-
.option('--api-version <range>', 'supported plugin API range',
|
|
132
|
+
.option('--api-version <range>', 'supported plugin API range', `^${PLUGIN_API_VERSION}`)
|
|
132
133
|
.addOption(new Option('--package-manager <manager>', 'generated project package manager')
|
|
133
134
|
.choices(['pnpm', 'npm'])
|
|
134
135
|
.default('pnpm'))
|
package/dist/lib/constants.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** Read the installed package metadata so release bumps cannot leave a stale CLI version. */
|
|
2
|
+
export declare const PLUGIN_CLI_VERSION: string;
|
|
1
3
|
export declare const PACKAGE_EXTENSION = ".notegen-plugin";
|
|
2
4
|
export declare const UNSIGNED_PACKAGE_EXTENSION = ".unsigned.notegen-plugin";
|
|
3
5
|
export declare const DEVELOPMENT_OUTPUT_DIRECTORY = ".notegen/package";
|
package/dist/lib/constants.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
/** Read the installed package metadata so release bumps cannot leave a stale CLI version. */
|
|
3
|
+
export const PLUGIN_CLI_VERSION = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8')).version;
|
|
1
4
|
export const PACKAGE_EXTENSION = '.notegen-plugin';
|
|
2
5
|
export const UNSIGNED_PACKAGE_EXTENSION = '.unsigned.notegen-plugin';
|
|
3
6
|
export const DEVELOPMENT_OUTPUT_DIRECTORY = '.notegen/package';
|
package/dist/lib/scaffold.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PLUGIN_API_VERSION } from '@notegen/plugin-api';
|
|
2
|
+
import { PLUGIN_CLI_VERSION } from './constants.js';
|
|
1
3
|
import { spawn } from 'node:child_process';
|
|
2
4
|
import { lstat, mkdir, readdir, rm, rmdir } from 'node:fs/promises';
|
|
3
5
|
import { basename, join, resolve } from 'node:path';
|
|
@@ -36,7 +38,7 @@ function templateFiles(options) {
|
|
|
36
38
|
name: options.name,
|
|
37
39
|
description: options.description ?? 'Show statistics for the active NoteGen editor.',
|
|
38
40
|
version: '0.1.0',
|
|
39
|
-
apiVersion: options.apiVersion ??
|
|
41
|
+
apiVersion: options.apiVersion ?? `^${PLUGIN_API_VERSION}`,
|
|
40
42
|
minAppVersion: options.minAppVersion ?? '0.37.0',
|
|
41
43
|
platforms: ['desktop'],
|
|
42
44
|
entry: 'dist/main.js',
|
|
@@ -58,7 +60,7 @@ function templateFiles(options) {
|
|
|
58
60
|
name: options.name,
|
|
59
61
|
description: options.description ?? 'A NoteGen command plugin.',
|
|
60
62
|
version: '0.1.0',
|
|
61
|
-
apiVersion: options.apiVersion ??
|
|
63
|
+
apiVersion: options.apiVersion ?? `^${PLUGIN_API_VERSION}`,
|
|
62
64
|
minAppVersion: options.minAppVersion ?? '0.37.0',
|
|
63
65
|
platforms: ['desktop'],
|
|
64
66
|
entry: 'dist/main.js',
|
|
@@ -90,8 +92,8 @@ function templateFiles(options) {
|
|
|
90
92
|
scripts,
|
|
91
93
|
notegen: { source: 'src/main.ts' },
|
|
92
94
|
devDependencies: {
|
|
93
|
-
'@notegen/plugin-api':
|
|
94
|
-
'@notegen/plugin-cli':
|
|
95
|
+
'@notegen/plugin-api': `^${PLUGIN_API_VERSION}`,
|
|
96
|
+
'@notegen/plugin-cli': `^${PLUGIN_CLI_VERSION}`,
|
|
95
97
|
typescript: '^5.8.3',
|
|
96
98
|
},
|
|
97
99
|
packageManager: packageManager === 'pnpm' ? 'pnpm@10.20.0' : undefined,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@notegen/plugin-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Create, validate, build, package, sign, and verify NoteGen plugins.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"semver": "^7.8.5",
|
|
46
46
|
"yauzl": "^3.4.0",
|
|
47
47
|
"yazl": "^3.3.1",
|
|
48
|
-
"@notegen/plugin-api": "^0.1.
|
|
48
|
+
"@notegen/plugin-api": "^0.1.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "^20.19.43",
|