md-hopper 1.0.0-alpha.5 → 1.0.0-alpha.6

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 CHANGED
@@ -2,16 +2,30 @@
2
2
 
3
3
  # MD HOPPER
4
4
 
5
- This Package Link md files in same repository.
5
+ md-hopper is a tool that recursively processes README.md files, starting from a specified README.md file and adding links to other README.md files nested within its directories to the parent README.md file.
6
+ This helps consolidate dispersed README files into a single, easily manageable document.
6
7
 
7
- # Commands
8
+ ## Installation
9
+
10
+ ```bash
11
+ $ npm i -g md-hopper
12
+ ```
13
+
14
+ or
15
+
16
+ ```bash
17
+ $ npm i md-hopper
18
+ ```
19
+
20
+ ## Commands
8
21
 
9
22
  <!-- MD_HOPPER: LINK_NEXT_LINE:
10
23
  id: link-command
11
24
  inline: true
12
25
  -->
13
26
 
14
- - [generate][md_hopper:link-command]
27
+ ### [LINK][md_hopper:link-command]
28
+
15
29
  <!-- MD_HOPPER: BEFORE_GENERATE_LINK (6/4/2024, 10:23:14 AM): - [generate][md_hopper:generate-command] -->
16
30
 
17
31
  <!-- MD_HOPPER: BEGIN_DEFINE_LINKS: -->
@@ -7,7 +7,7 @@ export declare class CommandClass<CommandOptions extends Record<string, any>, Md
7
7
  private args;
8
8
  private getSettingFnc;
9
9
  constructor(program: Program, getSettingFnc: SettingsFnc<CommandOptions, MdSettings>);
10
- init(options: CommandOptions, settings: MdSettings): Promise<this>;
10
+ init(options: CommandOptions, settings: MdSettings): this;
11
11
  command(command: string): this;
12
12
  help(helpTxt: string): this;
13
13
  before(before: Action, ...args: any[]): this;
@@ -7,7 +7,7 @@ export class CommandClass {
7
7
  this.program = program;
8
8
  this.getSettingFnc = getSettingFnc;
9
9
  }
10
- async init(options, settings) {
10
+ init(options, settings) {
11
11
  this.args = {
12
12
  options,
13
13
  settings,
@@ -1,10 +1,19 @@
1
+ import { readdirSync } from 'fs';
2
+ import { join } from 'path';
1
3
  import { setCommands } from '../../_internal/utils/command.js';
4
+ import { isDirectory } from '../../_internal/utils/fs.js';
5
+ const __dirname = import.meta.dirname;
2
6
  const initCommand = async (filename, program) => {
7
+ console.log('initCommand', filename);
3
8
  const { COMMANDS, init, getSettings } = await import(`./${filename}/command.js`);
4
9
  setCommands(program, COMMANDS, init, getSettings);
5
10
  };
6
11
  export const init = async (program) => {
7
- await initCommand('generate', program);
8
- await initCommand('help', program);
9
- await initCommand('link', program);
12
+ const list = readdirSync(join(__dirname));
13
+ for (const dir of list) {
14
+ if (!isDirectory(join(__dirname, dir))) {
15
+ continue;
16
+ }
17
+ await initCommand(dir, program);
18
+ }
10
19
  };
package/dist/cli/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "md-hopper",
3
- "version": "1.0.0-alpha.5",
3
+ "version": "1.0.0-alpha.6",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "bin": {
@@ -60,7 +60,7 @@
60
60
  "engines": {
61
61
  "node": ">=19.0.0"
62
62
  },
63
- "license": "ISC",
63
+ "license": "MIT",
64
64
  "dependencies": {
65
65
  "@actions/core": "^1.10.1",
66
66
  "@actions/exec": "^1.1.1",