md-hopper 1.0.0-alpha → 1.0.0-alpha.2

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
@@ -11,7 +11,7 @@ id: generate-command
11
11
  inline: true
12
12
  -->
13
13
 
14
- [generate][md_hopper:generate-command]
14
+ - [generate][md_hopper:generate-command]
15
15
 
16
16
  <!-- MD_HOPPER: BEGIN_DEFINE_LINKS: -->
17
17
 
@@ -14,7 +14,7 @@ export const PARAM_SEPARATOR = ':';
14
14
  export const MD_HOPPER_COMMENT_PREFIX = 'MD_HOPPER';
15
15
  export const COMMENT_REG_EXP = new RegExp(`${BEGIN_COMMENT}\\s*.*?${END_COMMENT}`, 'gs');
16
16
  export const BRAKE_LINE_REG_EXP = new RegExp(/\r?\n/, 'g');
17
- export const LINK_REG_EXP = new RegExp('^\\s*.*\\[(.+)][(|\\[](.+)[)|\\]].*');
17
+ export const LINK_REG_EXP = new RegExp('^(\\s*.*)\\[(.+)][(|\\[](.+)[)|\\]].*');
18
18
  export const MD_HOPPER_COMMENT_PREFIX_REG_EXP = new RegExp(`${BEGIN_COMMENT}\\s*${MD_HOPPER_COMMENT_PREFIX}${PARAM_SEPARATOR}\\s*`);
19
19
  export const MD_HOPPER_PARAMS_REG_EXP = new RegExp(`^[^${PARAM_SEPARATOR}]+${PARAM_SEPARATOR}(.*?)${END_COMMENT}.*`, 's');
20
20
  export const MD_HOPPER_CONTENT_REG_EXP = new RegExp(`^[^${PARAM_SEPARATOR}]+${PARAM_SEPARATOR}.*${END_COMMENT}(.*)`, 's');
@@ -1,10 +1,12 @@
1
1
  export interface BundleOptions {
2
+ debug?: boolean;
2
3
  skipHidden?: boolean;
3
4
  include?: string;
4
5
  exclude?: string;
5
6
  filenames?: string;
6
7
  output?: string;
7
8
  input?: string;
9
+ depth?: string;
8
10
  }
9
11
  export interface HelpOptions {
10
12
  [key: string]: any;
@@ -4,5 +4,6 @@ export interface Settings {
4
4
  exclude: string[];
5
5
  filenames: string[];
6
6
  output: string;
7
+ depth: number;
7
8
  }
8
9
  export type RcSettings = Partial<Settings>;
@@ -1 +1,3 @@
1
+ /// <reference types="node" resolution-mode="require"/>
1
2
  export { getAllFiles } from 'my-gadgetry/fs';
3
+ export declare const readJsonFileSync: (path: string, encode?: BufferEncoding) => {};
@@ -1 +1,10 @@
1
+ import { readFileSync } from 'fs';
2
+ import { isJson } from 'my-gadgetry/type-check';
1
3
  export { getAllFiles } from 'my-gadgetry/fs';
4
+ export const readJsonFileSync = (path, encode = 'utf-8') => {
5
+ const json = isJson(readFileSync(path, encode));
6
+ if (!json) {
7
+ return {};
8
+ }
9
+ return json;
10
+ };
@@ -2,3 +2,4 @@ export declare const success: (...args: any[]) => void;
2
2
  export declare const warn: (...args: any[]) => void;
3
3
  export declare const info: (...args: any[]) => void;
4
4
  export declare const error: (...args: any[]) => void;
5
+ export declare const hop: (...args: any[]) => void;
@@ -11,3 +11,6 @@ export const info = (...args) => {
11
11
  export const error = (...args) => {
12
12
  console.log(chalk.red(...args));
13
13
  };
14
+ export const hop = (...args) => {
15
+ console.log(chalk.hex('#F577F5')(...args));
16
+ };
@@ -0,0 +1 @@
1
+ export declare const lexer: (txt: string) => import("marked").Token;
@@ -0,0 +1,5 @@
1
+ import { marked } from 'marked';
2
+ export const lexer = (txt) => {
3
+ const tokens = marked.lexer(txt);
4
+ return tokens[0];
5
+ };
@@ -0,0 +1,22 @@
1
+ import { Token as _Token, Tokens } from 'marked';
2
+ type Token = Tokens.ListItem | Tokens.Heading;
3
+ interface SymbolEl {
4
+ raw: Token['raw'];
5
+ text: Token['text'];
6
+ }
7
+ export declare const getSymbolAndText: ({ raw, text }: SymbolEl) => {
8
+ symbol: string;
9
+ text: string;
10
+ };
11
+ export declare const getElements: (txt: string) => {
12
+ indent: string;
13
+ str: string;
14
+ token: _Token;
15
+ };
16
+ export declare const getProperties: (txt: string) => {
17
+ indent: string;
18
+ symbol: string;
19
+ text: string;
20
+ } | null;
21
+ export declare const replaceLineToLink: (txt: string, defineName: string) => string;
22
+ export {};
@@ -0,0 +1,51 @@
1
+ import { lexer } from './lexer.js';
2
+ const TOKEN_TYPES = {
3
+ list: 'list',
4
+ heading: 'heading',
5
+ };
6
+ export const getSymbolAndText = ({ raw, text }) => {
7
+ return {
8
+ symbol: raw.replace(new RegExp(`${text}$`), ''),
9
+ text,
10
+ };
11
+ };
12
+ export const getElements = (txt) => {
13
+ const indent = txt.replace(/^(\s*)(.*)$/, '$1');
14
+ const str = txt.replace(/^(\s*)(.*)$/, '$2');
15
+ const token = lexer(str);
16
+ return {
17
+ indent,
18
+ str,
19
+ token,
20
+ };
21
+ };
22
+ export const getProperties = (txt) => {
23
+ const { indent, token } = getElements(txt);
24
+ let symbol = '';
25
+ let text = '';
26
+ switch (token.type) {
27
+ case TOKEN_TYPES.list: {
28
+ const symbolAndText = getSymbolAndText(token.items[0]);
29
+ symbol = symbolAndText.symbol;
30
+ text = symbolAndText.text;
31
+ break;
32
+ }
33
+ case TOKEN_TYPES.heading: {
34
+ const symbolAndText = getSymbolAndText(token);
35
+ symbol = symbolAndText.symbol;
36
+ text = symbolAndText.text;
37
+ break;
38
+ }
39
+ default:
40
+ return null;
41
+ }
42
+ return { indent, symbol, text };
43
+ };
44
+ export const replaceLineToLink = (txt, defineName) => {
45
+ const properties = getProperties(txt);
46
+ if (!properties) {
47
+ return `[${txt}][${defineName}]`;
48
+ }
49
+ const { indent, symbol, text } = properties;
50
+ return `${indent}${symbol}[${text}][${defineName}]`;
51
+ };
@@ -1,5 +1,4 @@
1
1
  import { Detail } from '../types/md.js';
2
- export declare const getParam: (text: string, key: string) => string;
3
- export declare const getParams: (text: string, key: string) => RegExpMatchArray | "";
4
- export declare const getTitle: (text: string) => string;
2
+ export declare const getParam: (txt: string, key: string) => string;
3
+ export declare const getTitle: (txt: string) => string;
5
4
  export declare const replace: (detail: Detail, details: Detail[]) => string;
@@ -1,35 +1,28 @@
1
1
  import { readFileSync } from 'fs';
2
2
  import { PROPERTIES, LINK_NAME_PREFIX, COMMENT_REG_EXP, PARAM_SEPARATOR, LINK_REG_EXP, MD_HOPPER_COMMENT_PREFIX, MD_HOPPER_COMMENT_PREFIX_REG_EXP, MD_HOPPER_PROPERTY_REG_EXP, MD_HOPPER_PARAMS_REG_EXP, BRAKE_LINE_REG_EXP, MD_HOPPER_CONTENT_REG_EXP, BEGIN_COMMENT, END_COMMENT, } from '../types/md.js';
3
+ import { replaceLineToLink } from './md/line.js';
3
4
  import { getRelative } from './path.js';
4
5
  import { isBoolean } from './type-check.js';
5
- export const getParam = (text, key) => {
6
+ export const getParam = (txt, key) => {
6
7
  const PREFIX = `${BEGIN_COMMENT}\\s*${MD_HOPPER_COMMENT_PREFIX}:\\s*${key}:`;
7
8
  const reg = new RegExp(`${PREFIX}(.*?)${END_COMMENT}`, 's');
8
- if (!reg.test(text)) {
9
+ if (!reg.test(txt)) {
9
10
  return '';
10
11
  }
11
- return reg.exec(text)[1];
12
+ return reg.exec(txt)[1];
12
13
  };
13
- export const getParams = (text, key) => {
14
- const PREFIX = `${BEGIN_COMMENT}\\s*${MD_HOPPER_COMMENT_PREFIX}:\\s*${key}:`;
15
- const reg = new RegExp(`${PREFIX}(.*?)${END_COMMENT}`, 'gs');
16
- if (!reg.test(text)) {
17
- return '';
18
- }
19
- return text.match(reg);
20
- };
21
- const getRemovedCommentOut = (text) => text.replace(COMMENT_REG_EXP, '');
22
- const getFirstLine = (text) => {
23
- const lines = text.split('\n').filter(line => line.trim().length);
14
+ const getRemovedComment = (txt) => txt.replace(COMMENT_REG_EXP, '');
15
+ const getFirstLine = (txt) => {
16
+ const lines = txt.split('\n').filter(line => line.trim().length);
24
17
  return lines.length ? lines[0].trim() : '';
25
18
  };
26
- export const getTitle = (text) => {
27
- const title = getParam(text, 'TITLE');
19
+ export const getTitle = (txt) => {
20
+ const title = getParam(txt, 'TITLE');
28
21
  if (title) {
29
22
  return title;
30
23
  }
31
- const md = getRemovedCommentOut(text);
32
- return getParam(text, 'TITLE') || md.replace(/\r?\n?#+(.*?)\r?\n.*/s, '$1').trim() || getFirstLine(md);
24
+ const md = getRemovedComment(txt);
25
+ return md.replace(/\r?\n?#+(.*?)\r?\n.*/s, '$1').trim() || getFirstLine(md);
33
26
  };
34
27
  const getLinkName = (id) => `${LINK_NAME_PREFIX}${id}`;
35
28
  const getLink = (id, title) => `[${title}][${getLinkName(id)}]`;
@@ -37,17 +30,16 @@ const getLinksByDetails = (details) => details.map(d => getLink(d.id, d.title));
37
30
  const getDefineLink = (id, url, title) => `[${getLinkName(id)}]: ${url}${title ? ` '${title}'` : ''}`;
38
31
  const replaceToLink = (txt, inline, detail) => {
39
32
  if (LINK_REG_EXP.test(txt)) {
40
- const url = txt.replace(LINK_REG_EXP, '$2');
33
+ const url = txt.replace(LINK_REG_EXP, '$3');
41
34
  if (url === getLinkName(detail.id)) {
42
35
  return txt;
43
36
  }
44
- return `[${txt.replace(LINK_REG_EXP, '$1')}][${getLinkName(detail.id)}]
45
- <!-- ${MD_HOPPER_COMMENT_PREFIX}${PARAM_SEPARATOR} ${PROPERTIES.BEFORE_GENERATE_LINK}${PARAM_SEPARATOR} -->
46
- <!-- ${txt} -->
37
+ return `${replaceLineToLink(txt.replace(LINK_REG_EXP, '$1$2'), getLinkName(detail.id))}
38
+ <!-- ${MD_HOPPER_COMMENT_PREFIX}${PARAM_SEPARATOR} ${PROPERTIES.BEFORE_GENERATE_LINK} (${new Date().toLocaleString()})${PARAM_SEPARATOR} ${txt} -->
47
39
  `;
48
40
  }
49
41
  if (inline) {
50
- return `[${txt}][${getLinkName(detail.id)}]`;
42
+ return replaceLineToLink(txt, getLinkName(detail.id));
51
43
  }
52
44
  else {
53
45
  return `[${detail.title}][${getLinkName(detail.id)}]
@@ -1,5 +1,4 @@
1
- export declare const getProjectRootPath: () => string;
2
- export declare const getFullPath: (...path: string[]) => string;
1
+ export declare const getExecDir: () => string;
3
2
  export declare const getDir: (path: string) => string;
4
3
  export declare const DEPTH_TYPES: {
5
4
  ancestor: string;
@@ -1,19 +1,5 @@
1
- import { existsSync } from 'fs';
2
- import { join, parse, relative } from 'path';
3
- import { SETTING_FILE_NAME } from './configs.js';
4
- export const getProjectRootPath = () => {
5
- let path = process.cwd();
6
- if (!existsSync(join(path, SETTING_FILE_NAME))) {
7
- for (const _ in process.cwd().split(/\//g)) {
8
- path = join(path, '..');
9
- if (existsSync(join(path, SETTING_FILE_NAME))) {
10
- break;
11
- }
12
- }
13
- }
14
- return path;
15
- };
16
- export const getFullPath = (...path) => join(getProjectRootPath(), ...path);
1
+ import { parse, relative } from 'path';
2
+ export const getExecDir = () => process.cwd();
17
3
  export const getDir = (path) => {
18
4
  return parse(path).dir;
19
5
  };
@@ -1,8 +1,11 @@
1
+ import { join } from 'path';
1
2
  import { ENVS } from '../types/process.js';
2
- import pkg from '../../../package.json' assert { type: 'json' };
3
+ import { readJsonFileSync } from './fs.js';
3
4
  export * from '../types/process.js';
5
+ const __dirname = import.meta.dirname;
4
6
  export const args = process.argv.slice(2);
5
7
  export const init = () => {
8
+ const pkg = readJsonFileSync(join(__dirname, '../../..', 'package.json'));
6
9
  set(ENVS.PACKAGE_VERSION, pkg.version);
7
10
  set(ENVS.IS_DEBUG, bool(process.env.DEBUG) || args.includes('--debug'));
8
11
  };
@@ -1,9 +1,10 @@
1
1
  import { readFileSync } from 'fs';
2
2
  import { getParam } from './md.js';
3
3
  import { SETTING_FILE_NAME } from './configs.js';
4
- import { getProjectRootPath } from './path.js';
5
- const Booleans = ['skip-hidden'];
6
- const Strings = ['exclude', 'include', 'filenames'];
4
+ import { getExecDir } from './path.js';
5
+ const BOOLEANS = ['skip-hidden'];
6
+ const STRINGS = ['exclude', 'include', 'filenames'];
7
+ const NUMBERS = ['depth'];
7
8
  export const DEFAULT_MD_FILE_NAME = 'README.md';
8
9
  export const DEFAULT_SETTINGS = Object.freeze({
9
10
  'skip-hidden': true,
@@ -11,6 +12,7 @@ export const DEFAULT_SETTINGS = Object.freeze({
11
12
  include: [],
12
13
  filenames: [DEFAULT_MD_FILE_NAME],
13
14
  output: DEFAULT_MD_FILE_NAME,
15
+ depth: 0,
14
16
  });
15
17
  export const parse = (txt) => {
16
18
  const lines = txt.split('\n');
@@ -23,12 +25,15 @@ export const parse = (txt) => {
23
25
  const key = keyValue[0].trim();
24
26
  const value = keyValue[1].trim();
25
27
  let val;
26
- if (Booleans.includes(key)) {
28
+ if (BOOLEANS.includes(key)) {
27
29
  val = JSON.parse(`${value}`);
28
30
  }
29
- else if (Strings.includes(key)) {
31
+ else if (STRINGS.includes(key)) {
30
32
  val = value.split(',');
31
33
  }
34
+ else if (NUMBERS.includes(key)) {
35
+ val = Number(value);
36
+ }
32
37
  else {
33
38
  continue;
34
39
  }
@@ -40,6 +45,6 @@ export const parse = (txt) => {
40
45
  };
41
46
  };
42
47
  export const getSettings = (inputFilename) => {
43
- const readme = readFileSync(`${getProjectRootPath()}/${inputFilename || SETTING_FILE_NAME}`, 'utf-8');
48
+ const readme = readFileSync(`${getExecDir()}/${inputFilename || SETTING_FILE_NAME}`, 'utf-8');
44
49
  return parse(getParam(readme, 'CONFIG'));
45
50
  };
@@ -1,8 +1,9 @@
1
1
  import { readFileSync, writeFileSync } from 'fs';
2
2
  import { join } from 'path';
3
3
  import { getAllFiles } from '../../../_internal/utils/fs.js';
4
+ import { info, warn, success } from '../../../_internal/utils/log.js';
4
5
  import { getParam, getTitle, replace } from '../../../_internal/utils/md.js';
5
- import { getProjectRootPath } from '../../../_internal/utils/path.js';
6
+ import { getExecDir } from '../../../_internal/utils/path.js';
6
7
  import { getDir, getDepthType, DEPTH_TYPES } from '../../../_internal/utils/path.js';
7
8
  const replacePath = (str) => str.replace(/\/{2,}/, '/');
8
9
  const splitComma = (str, alternative) => (str ? str.split(',') : null) || alternative;
@@ -13,6 +14,7 @@ const mergeConfig = ({ options, settings }) => {
13
14
  include: splitComma(options.include, settings.include),
14
15
  filenames: splitComma(options.filenames, settings.filenames),
15
16
  output: options.output || settings.output,
17
+ depth: Number(options.depth) || settings.depth,
16
18
  };
17
19
  };
18
20
  const classify = (dataList) => {
@@ -63,17 +65,43 @@ const getPathDetails = (paths, config) => {
63
65
  return classify(list);
64
66
  };
65
67
  export const action = async (args) => {
66
- const rootPath = getProjectRootPath();
68
+ const isDebug = args.options.debug;
69
+ if (isDebug) {
70
+ info('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
71
+ info('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- DEBUG MODE =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
72
+ info('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
73
+ }
74
+ else {
75
+ warn('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
76
+ warn('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- PRODUCTION MODE =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
77
+ warn('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
78
+ }
79
+ const execDir = getExecDir();
80
+ info('exec dir path', execDir);
67
81
  const config = mergeConfig(args);
82
+ info('settings', JSON.stringify(config, null, 2));
68
83
  const skipHidden = config['skip-hidden'] ? ['**/.*/**/*', '**/.*'] : [];
69
84
  const exclude = [
70
85
  '**/node_modules/.*/*',
71
86
  '**/node_modules/**/*',
72
87
  ...skipHidden,
73
- ...config.exclude.map(path => replacePath(`${rootPath}/${path}`)),
88
+ ...config.exclude.map(path => replacePath(`${execDir}/${path}`)),
74
89
  ];
75
- const include = config.include.map(path => replacePath(`${rootPath}/${path}`));
76
- const paths = getAllFiles(rootPath, [], { include, exclude }).filter(path => config.filenames.some(filename => path.endsWith(`/${filename}`)));
90
+ info('exclude', JSON.stringify(exclude, null, 2));
91
+ const include = config.include.map(path => replacePath(`${execDir}/${path}`));
92
+ info('include', JSON.stringify(include, null, 2));
93
+ const paths = getAllFiles(execDir, {
94
+ include,
95
+ exclude,
96
+ ...(config.depth >= 1 ? { depth: config.depth } : {}),
97
+ }).filter(path => config.filenames.some(filename => path.endsWith(`/${filename}`)));
98
+ info('target paths', JSON.stringify(paths, null, 2));
99
+ if (isDebug) {
100
+ info('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
101
+ info('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- END OF DEBUG MODE =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
102
+ info('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
103
+ return;
104
+ }
77
105
  const pathDetails = getPathDetails(paths, config);
78
106
  for (const pathDetail of pathDetails) {
79
107
  if (pathDetail.lock) {
@@ -82,6 +110,10 @@ export const action = async (args) => {
82
110
  const content = replace(pathDetail, pathDetails);
83
111
  const output = pathDetail.output || config.output;
84
112
  const writePath = output ? join(pathDetail.dir, output) : pathDetail.path;
113
+ success('write file: ', writePath);
85
114
  writeFileSync(writePath, content, 'utf-8');
86
115
  }
116
+ success('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
117
+ success('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- END OF PRODUCTION MODE =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
118
+ success('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
87
119
  };
@@ -9,6 +9,7 @@ const setAliases = (commandClass) => {
9
9
  .option('-f, --filenames <strings>', 'filenames, default: README.md only')
10
10
  .option('-o, --output <filename>', 'output filename. default: README.md (replace)')
11
11
  .option('-i, --input <filename>', 'target root filename, default: README.md')
12
+ .option('-D, --depth <filename>', 'depth level more than 0')
12
13
  .action(options => {
13
14
  return action(options);
14
15
  });
@@ -1,23 +1,23 @@
1
1
  import { platform } from 'node:process';
2
- import { info } from '../../../_internal/utils/log.js';
2
+ import { info, hop } from '../../../_internal/utils/log.js';
3
3
  import { get, ENVS } from '../../../_internal/utils/process.js';
4
4
  const ASCII_ART = `
5
5
 
6
- _ _ __ _ _ _ ___ ___ _____
7
- | | | | | \\ | | | | / / / |/ | | _ \\
8
- | | | | | \\| | | |/ / / /| /| | | | | |
9
- | | | | | |\\ | | |\\ \\ / / |__/ | | | | | |
10
- | |___ | | | | \\ | | | \\ \\ / / | | | |_| |
11
- |_____| |_| |_| \\_| |_| \\_\\ /_/ |_| |_____/
6
+ ___ ___ _____ _ _ _____ _____ _____ _____ _____
7
+ / |/ | | _ \\ | | | | / _ \\ | _ \\ | _ \\ | ____| | _ \\
8
+ / /| /| | | | | | | |_| | | | | | | |_| | | |_| | | |__ | |_| |
9
+ / / |__/ | | | | | | | _ | | | | | | ___/ | ___/ | __| | _ /
10
+ / / | | | |_| | | | | | | |_| | | | | | | |___ | | \\ \\
11
+ /_/ |_| |_____/ |_| |_| \\_____/ |_| |_| |_____| |_| \\_\\
12
12
 
13
13
  `;
14
14
  const VERSIONS = `
15
- Link MD: ${get(ENVS.PACKAGE_VERSION)}
15
+ MD Hopper: ${get(ENVS.PACKAGE_VERSION)}
16
16
  Node: ${process.versions.node}
17
17
  OS: ${platform} ${process.arch}
18
18
  `;
19
19
  const show = () => {
20
- info(ASCII_ART);
20
+ hop(ASCII_ART);
21
21
  info(VERSIONS);
22
22
  };
23
23
  export const action = async (_) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "md-hopper",
3
- "version": "1.0.0-alpha",
3
+ "version": "1.0.0-alpha.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,6 +16,12 @@
16
16
  "url": "https://github.com/cilly-yllic/md-hopper/issues"
17
17
  },
18
18
  "homepage": "https://github.com/cilly-yllic/md-hopper#readme",
19
+ "keywords": [
20
+ "markdown",
21
+ "readme",
22
+ "md",
23
+ "links"
24
+ ],
19
25
  "scripts": {
20
26
  "prepare": "husky",
21
27
  "jest": "jest",
@@ -30,20 +36,17 @@
30
36
  "generate": "tsx --tsconfig ./tsconfig.zx.json ./tools/generate-alias.zx.ts",
31
37
  "ci:update-version": "tsx --tsconfig ./tsconfig.zx.json ./tools/update-version.zx.ts",
32
38
  "md:generate": "tsx --tsconfig ./tsconfig.zx.json ./tools/generate-md.ts",
33
-
34
39
  "//--- test ---//": "",
35
40
  "test": "run-s test:*",
36
41
  "test:lint": "npm run lint",
37
42
  "test:prettier": "npm run prettier:check",
38
43
  "test:jest": "npm run jest",
39
-
40
44
  "//--- build ---//": "",
41
45
  "build": "run-s build:*",
42
46
  "build:test": "npm run test",
43
47
  "build:clean": "npm run clean",
44
48
  "build:tsc": "npm run tsc",
45
49
  "build:generate": "npm run generate",
46
-
47
50
  "//--- publish ---//": "",
48
51
  "publish:build": "run-s build:{clean,tsc,generate}"
49
52
  },
@@ -60,15 +63,16 @@
60
63
  "@actions/exec": "^1.1.1",
61
64
  "@actions/github": "^6.0.0",
62
65
  "chalk": "^5.3.0",
63
- "commander": "^12.0.0",
66
+ "commander": "^12.1.0",
67
+ "marked": "^12.0.2",
64
68
  "minimatch": "^9.0.4",
65
- "my-gadgetry": "^1.1.2",
66
- "zx": "^8.1.0"
69
+ "my-gadgetry": "^1.2.5",
70
+ "zx": "^8.1.2"
67
71
  },
68
72
  "devDependencies": {
69
- "@babel/core": "^7.24.5",
70
- "@babel/preset-env": "^7.24.5",
71
- "@babel/preset-typescript": "^7.24.1",
73
+ "@babel/core": "^7.24.6",
74
+ "@babel/preset-env": "^7.24.6",
75
+ "@babel/preset-typescript": "^7.24.6",
72
76
  "@eslint/js": "^8.57.0",
73
77
  "@types/jest": "^29.5.12",
74
78
  "@typescript-eslint/eslint-plugin": "^7.9.0",
@@ -83,15 +87,15 @@
83
87
  "fs-extra": "^11.2.0",
84
88
  "husky": "^9.0.11",
85
89
  "jest": "^29.7.0",
86
- "lint-staged": "^15.2.2",
90
+ "lint-staged": "^15.2.5",
87
91
  "npm-run-all2": "^6.2.0",
88
92
  "prettier": "^3.2.5",
89
- "ts-jest": "^29.1.2",
93
+ "ts-jest": "^29.1.4",
90
94
  "ts-node": "^10.9.2",
91
95
  "tsc-alias": "^1.8.10",
92
- "tsx": "^4.10.4",
96
+ "tsx": "^4.11.0",
93
97
  "typescript": "^5.4.5",
94
- "typescript-eslint": "^7.9.0"
98
+ "typescript-eslint": "^7.11.0"
95
99
  },
96
100
  "files": [
97
101
  "cli",