@optique/discover 1.2.0-dev.2281 → 1.2.0-dev.2282
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/README.md +8 -0
- package/dist/cli.cjs +2 -2
- package/dist/cli.js +2 -2
- package/dist/{generator-CkGpilfc.cjs → generator-CyGtPDkA.cjs} +11 -2
- package/dist/{generator-B8UY7n7b.js → generator-DDSCS6PX.js} +11 -2
- package/dist/generator.cjs +1 -1
- package/dist/generator.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -116,6 +116,14 @@ If you do not want to maintain the static module map by hand, generate one:
|
|
|
116
116
|
optique-discover ./commands --output ./commands.generated.ts --extension .ts
|
|
117
117
|
~~~~
|
|
118
118
|
|
|
119
|
+
The generated module starts with a fixed header containing lint, formatter,
|
|
120
|
+
TypeScript check suppression, and generated-file marker comments for tools
|
|
121
|
+
that support file-level comments. Biome suppressions appear first because
|
|
122
|
+
Biome expects file-level suppressions at the beginning of the file. Command
|
|
123
|
+
module exports are still validated at runtime by `commandsFromModules()`.
|
|
124
|
+
Prettier and Oxfmt users should exclude the generated module through formatter
|
|
125
|
+
configuration, such as *.prettierignore* or Oxfmt ignore paths.
|
|
126
|
+
|
|
119
127
|
Then import the generated module from your CLI entry point:
|
|
120
128
|
|
|
121
129
|
~~~~ typescript
|
package/dist/cli.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
3
3
|
require('./command-C-NgG0KJ.cjs');
|
|
4
4
|
require('./src-C3_a7SFM.cjs');
|
|
5
|
-
const require_generator = require('./generator-
|
|
5
|
+
const require_generator = require('./generator-CyGtPDkA.cjs');
|
|
6
6
|
const require_main_check = require('./main-check-CwunSNpK.cjs');
|
|
7
7
|
const __optique_core_constructs = require_chunk.__toESM(require("@optique/core/constructs"));
|
|
8
8
|
const __optique_core_message = require_chunk.__toESM(require("@optique/core/message"));
|
|
@@ -15,7 +15,7 @@ const node_process = require_chunk.__toESM(require("node:process"));
|
|
|
15
15
|
|
|
16
16
|
//#region deno.json
|
|
17
17
|
var name = "@optique/discover";
|
|
18
|
-
var version = "1.2.0-dev.
|
|
18
|
+
var version = "1.2.0-dev.2282+c9c50098";
|
|
19
19
|
var license = "MIT";
|
|
20
20
|
var exports$1 = {
|
|
21
21
|
".": "./src/index.ts",
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "./command-9sgrJtwh.js";
|
|
3
3
|
import "./src-wHLRsXWK.js";
|
|
4
|
-
import { watchCommandsModule, writeCommandsModule } from "./generator-
|
|
4
|
+
import { watchCommandsModule, writeCommandsModule } from "./generator-DDSCS6PX.js";
|
|
5
5
|
import { isMainModuleUrl } from "./main-check-mMnKfUZs.js";
|
|
6
6
|
import { object } from "@optique/core/constructs";
|
|
7
7
|
import { message } from "@optique/core/message";
|
|
@@ -14,7 +14,7 @@ import process from "node:process";
|
|
|
14
14
|
|
|
15
15
|
//#region deno.json
|
|
16
16
|
var name = "@optique/discover";
|
|
17
|
-
var version = "1.2.0-dev.
|
|
17
|
+
var version = "1.2.0-dev.2282+c9c50098";
|
|
18
18
|
var license = "MIT";
|
|
19
19
|
var exports = {
|
|
20
20
|
".": "./src/index.ts",
|
|
@@ -5,6 +5,15 @@ const node_path = require_chunk.__toESM(require("node:path"));
|
|
|
5
5
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
6
6
|
|
|
7
7
|
//#region src/generator.ts
|
|
8
|
+
const generatedHeader = [
|
|
9
|
+
"// biome-ignore-all lint: generated file",
|
|
10
|
+
"// biome-ignore-all format: generated file",
|
|
11
|
+
"// Generated by optique-discover. Do not edit.",
|
|
12
|
+
"/* eslint-disable */",
|
|
13
|
+
"// @ts-nocheck",
|
|
14
|
+
"// deno-lint-ignore-file",
|
|
15
|
+
"// deno-fmt-ignore-file"
|
|
16
|
+
].join("\n") + "\n\n";
|
|
8
17
|
/**
|
|
9
18
|
* Generates a TypeScript module that exports command entries.
|
|
10
19
|
*
|
|
@@ -89,7 +98,7 @@ async function collectGeneratedCommandFiles(options, collectOptions = {}) {
|
|
|
89
98
|
}
|
|
90
99
|
function generateCommandsModuleFromFiles(options, files) {
|
|
91
100
|
if (files.length < 1) return {
|
|
92
|
-
code:
|
|
101
|
+
code: `${generatedHeader}import type { ModuleCommand } from "@optique/discover";\n\nexport default [] satisfies readonly ModuleCommand[];\n`,
|
|
93
102
|
files
|
|
94
103
|
};
|
|
95
104
|
const imports = files.map(formatCommandModuleImport).join("\n");
|
|
@@ -100,7 +109,7 @@ function generateCommandsModuleFromFiles(options, files) {
|
|
|
100
109
|
...options.entryFileName === void 0 ? [] : [` entryFileName: ${JSON.stringify(options.entryFileName)},`]
|
|
101
110
|
].join("\n");
|
|
102
111
|
return {
|
|
103
|
-
code:
|
|
112
|
+
code: `${generatedHeader}import { commandsFromModules } from "@optique/discover";\n${imports}\n\nexport default commandsFromModules(\n {\n${entries}\n },\n {\n${optionEntries}\n },\n);\n`,
|
|
104
113
|
files
|
|
105
114
|
};
|
|
106
115
|
}
|
|
@@ -4,6 +4,15 @@ import { dirname, posix, relative, resolve } from "node:path";
|
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
|
|
6
6
|
//#region src/generator.ts
|
|
7
|
+
const generatedHeader = [
|
|
8
|
+
"// biome-ignore-all lint: generated file",
|
|
9
|
+
"// biome-ignore-all format: generated file",
|
|
10
|
+
"// Generated by optique-discover. Do not edit.",
|
|
11
|
+
"/* eslint-disable */",
|
|
12
|
+
"// @ts-nocheck",
|
|
13
|
+
"// deno-lint-ignore-file",
|
|
14
|
+
"// deno-fmt-ignore-file"
|
|
15
|
+
].join("\n") + "\n\n";
|
|
7
16
|
/**
|
|
8
17
|
* Generates a TypeScript module that exports command entries.
|
|
9
18
|
*
|
|
@@ -88,7 +97,7 @@ async function collectGeneratedCommandFiles(options, collectOptions = {}) {
|
|
|
88
97
|
}
|
|
89
98
|
function generateCommandsModuleFromFiles(options, files) {
|
|
90
99
|
if (files.length < 1) return {
|
|
91
|
-
code:
|
|
100
|
+
code: `${generatedHeader}import type { ModuleCommand } from "@optique/discover";\n\nexport default [] satisfies readonly ModuleCommand[];\n`,
|
|
92
101
|
files
|
|
93
102
|
};
|
|
94
103
|
const imports = files.map(formatCommandModuleImport).join("\n");
|
|
@@ -99,7 +108,7 @@ function generateCommandsModuleFromFiles(options, files) {
|
|
|
99
108
|
...options.entryFileName === void 0 ? [] : [` entryFileName: ${JSON.stringify(options.entryFileName)},`]
|
|
100
109
|
].join("\n");
|
|
101
110
|
return {
|
|
102
|
-
code:
|
|
111
|
+
code: `${generatedHeader}import { commandsFromModules } from "@optique/discover";\n${imports}\n\nexport default commandsFromModules(\n {\n${entries}\n },\n {\n${optionEntries}\n },\n);\n`,
|
|
103
112
|
files
|
|
104
113
|
};
|
|
105
114
|
}
|
package/dist/generator.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require('./command-C-NgG0KJ.cjs');
|
|
2
2
|
require('./src-C3_a7SFM.cjs');
|
|
3
|
-
const require_generator = require('./generator-
|
|
3
|
+
const require_generator = require('./generator-CyGtPDkA.cjs');
|
|
4
4
|
|
|
5
5
|
exports.generateCommandsModule = require_generator.generateCommandsModule;
|
|
6
6
|
exports.watchCommandsModule = require_generator.watchCommandsModule;
|
package/dist/generator.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./command-9sgrJtwh.js";
|
|
2
2
|
import "./src-wHLRsXWK.js";
|
|
3
|
-
import { generateCommandsModule, watchCommandsModule, writeCommandsModule } from "./generator-
|
|
3
|
+
import { generateCommandsModule, watchCommandsModule, writeCommandsModule } from "./generator-DDSCS6PX.js";
|
|
4
4
|
|
|
5
5
|
export { generateCommandsModule, watchCommandsModule, writeCommandsModule };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/discover",
|
|
3
|
-
"version": "1.2.0-dev.
|
|
3
|
+
"version": "1.2.0-dev.2282",
|
|
4
4
|
"description": "Runtime-aware command discovery for Optique CLI programs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"optique-discover": "./dist/cli.js"
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@optique/core": "1.2.0-dev.
|
|
87
|
-
"@optique/run": "1.2.0-dev.
|
|
86
|
+
"@optique/core": "1.2.0-dev.2282+c9c50098",
|
|
87
|
+
"@optique/run": "1.2.0-dev.2282+c9c50098"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@types/node": "^24.0.0",
|