ts-markdown-builder 0.5.0 → 0.6.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/README.md +19 -17
- package/dist/commonjs/block.js +10 -0
- package/dist/commonjs/block.js.map +1 -1
- package/dist/commonjs/index.js +12 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/inline.js +4 -0
- package/dist/commonjs/inline.js.map +1 -1
- package/dist/esm/block.mjs +9 -0
- package/dist/esm/block.mjs.map +1 -1
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/inline.mjs +3 -0
- package/dist/esm/inline.mjs.map +1 -1
- package/dist/types/block.d.ts +16 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/inline.d.ts +8 -0
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -59,33 +59,35 @@ It supports:
|
|
|
59
59
|
|
|
60
60
|
### Utils
|
|
61
61
|
|
|
62
|
-
- `joinBlocks(blocks: string[])` - join blocks of text into a single markdown document (string)
|
|
62
|
+
- [`joinBlocks(blocks: string[])`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#joinblocks) - join blocks of text into a single markdown document (string)
|
|
63
63
|
|
|
64
64
|
### Block
|
|
65
|
-
- `heading(text: string, options?: { level: number = 1 })`
|
|
66
|
-
- `blockquote(text: string | string[])`
|
|
67
|
-
- `codeBlock(text: string, options?: { language?: string = '' })`
|
|
68
|
-
- `list(items: string[])`
|
|
69
|
-
- `orderedList(items: string[])`
|
|
70
|
-
- `
|
|
65
|
+
- [`heading(text: string, options?: { level: number = 1 })`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#heading)
|
|
66
|
+
- [`blockquote(text: string | string[])`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#blockquote)
|
|
67
|
+
- [`codeBlock(text: string, options?: { language?: string = '' })`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#codeblock)
|
|
68
|
+
- [`list(items: string[])`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#list)
|
|
69
|
+
- [`orderedList(items: string[])`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#orderedlist)
|
|
70
|
+
- [`taskList(items: (string | TaskListItem)[])`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#tasklist) - GFM task list with checkboxes (items can be strings or `{ text: string, done?: boolean }`)
|
|
71
|
+
- [`horizontalRule`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#horizontalrule)
|
|
71
72
|
|
|
72
73
|
### Inline
|
|
73
74
|
|
|
74
|
-
- `bold(text: string)`
|
|
75
|
-
- `italic(text: string)`
|
|
76
|
-
- `
|
|
77
|
-
- `
|
|
78
|
-
- `
|
|
79
|
-
- `
|
|
75
|
+
- [`bold(text: string)`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#bold)
|
|
76
|
+
- [`italic(text: string)`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#italic)
|
|
77
|
+
- [`strikethrough(text: string)`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#strikethrough) - GFM strikethrough
|
|
78
|
+
- [`code(text: string)`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#code)
|
|
79
|
+
- [`link(url: string, text?: string)`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#link) - link or autolink
|
|
80
|
+
- [`image(url: string, text?: string)`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#image)
|
|
81
|
+
- [`escape(text: string)`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#escape)
|
|
80
82
|
|
|
81
83
|
### Table
|
|
82
84
|
|
|
83
|
-
- `table(headers: string[], rows: string[][])`
|
|
85
|
+
- [`table(headers: string[], rows: string[][])`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#table)
|
|
84
86
|
|
|
85
87
|
### HTML
|
|
86
88
|
|
|
87
|
-
- `disclosure(title: string, content: string, options?: { open?: boolean })`
|
|
88
|
-
- `lineBreak`
|
|
89
|
+
- [`disclosure(title: string, content: string, options?: { open?: boolean })`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#disclosure)
|
|
90
|
+
- [`lineBreak`](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md#linebreak)
|
|
89
91
|
|
|
90
92
|
## Contributing
|
|
91
93
|
|
|
@@ -97,4 +99,4 @@ MIT
|
|
|
97
99
|
|
|
98
100
|
## Reference
|
|
99
101
|
|
|
100
|
-
|
|
102
|
+
See the full [API Reference](https://github.com/mdjastrzebski/ts-markdown-builder/blob/main/API.md) for detailed documentation, parameter descriptions, and usage examples.
|
package/dist/commonjs/block.js
CHANGED
|
@@ -6,6 +6,7 @@ exports.heading = heading;
|
|
|
6
6
|
exports.horizontalRule = void 0;
|
|
7
7
|
exports.list = list;
|
|
8
8
|
exports.orderedList = orderedList;
|
|
9
|
+
exports.taskList = taskList;
|
|
9
10
|
var _utils = require("./utils.js");
|
|
10
11
|
const horizontalRule = exports.horizontalRule = '---';
|
|
11
12
|
function heading(text, options) {
|
|
@@ -26,4 +27,13 @@ function list(items) {
|
|
|
26
27
|
function orderedList(items) {
|
|
27
28
|
return items.map((item, index) => `${index + 1}. ${item}`).join('\n');
|
|
28
29
|
}
|
|
30
|
+
function taskList(items) {
|
|
31
|
+
const result = [];
|
|
32
|
+
for (const item of items) {
|
|
33
|
+
const text = typeof item === 'string' ? item : item.text;
|
|
34
|
+
const done = typeof item === 'string' ? false : item.done;
|
|
35
|
+
result.push(`- [${done ? 'x' : ' '}] ${text}`);
|
|
36
|
+
}
|
|
37
|
+
return result.join('\n');
|
|
38
|
+
}
|
|
29
39
|
//# sourceMappingURL=block.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.js","names":["horizontalRule","exports","heading","text","options","level","repeat","blockquote","content","prefixLines","joinBlocks","codeBlock","language","backticks","Math","max","maxBackticks","list","items","map","item","join","orderedList","index"],"sources":["../../src/block.ts"],"sourcesContent":["import { joinBlocks, maxBackticks, prefixLines } from './utils';\n\n/**\n * Create a horizontal rule block.\n *\n * Markdown: `---`\n */\nexport const horizontalRule = '---';\n\ntype HeadingOptions = {\n level: number;\n};\n\n/**\n * Create a heading block.\n * Markdown: `# Heading`\n *\n * @param text - The text of the heading.\n * @param level - The level of the heading (defaults to 1).\n */\nexport function heading(text: string, options?: HeadingOptions): string {\n const level = options?.level ?? 1;\n return `${'#'.repeat(level)} ${text}`;\n}\n\n/**\n * Create a blockquote block.\n *\n * Markdown:\n * ```\n * > Content\n * > Content\n * ```\n *\n * @param text - The content of the blockquote.\n */\nexport function blockquote(content: string | readonly string[]): string {\n return prefixLines(joinBlocks(content), '> ');\n}\n\ntype CodeBlockOptions = {\n language?: string;\n};\n\n/**\n * Create a code block.\n *\n * Markdown:\n * ```js\n * Content\n * ```\n *\n * @param content - The content of the code block.\n * @param language - The language of the code block.\n */\nexport function codeBlock(content: string, options?: CodeBlockOptions): string {\n const language = options?.language ?? '';\n const backticks = Math.max(maxBackticks(content), 2) + 1;\n return '`'.repeat(backticks) + language + '\\n' + content + '\\n' + '`'.repeat(backticks);\n}\n\n/**\n * Create an unordered list block.\n *\n * Markdown:\n * ```\n * - Item\n * - Item\n * ```\n *\n * @param items - The items of the list.\n */\nexport function list(items: readonly string[]): string {\n return items.map((item) => `- ${item}`).join('\\n');\n}\n\n/**\n * Create an ordered list block.\n *\n * Markdown:\n * ```\n * 1. Item\n * 2. Item\n * ```\n *\n * @param items - The items of the list.\n */\nexport function orderedList(items: readonly string[]): string {\n return items.map((item, index) => `${index + 1}. ${item}`).join('\\n');\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"block.js","names":["horizontalRule","exports","heading","text","options","level","repeat","blockquote","content","prefixLines","joinBlocks","codeBlock","language","backticks","Math","max","maxBackticks","list","items","map","item","join","orderedList","index","taskList","result","done","push"],"sources":["../../src/block.ts"],"sourcesContent":["import { joinBlocks, maxBackticks, prefixLines } from './utils';\n\n/**\n * Create a horizontal rule block.\n *\n * Markdown: `---`\n */\nexport const horizontalRule = '---';\n\ntype HeadingOptions = {\n level: number;\n};\n\n/**\n * Create a heading block.\n * Markdown: `# Heading`\n *\n * @param text - The text of the heading.\n * @param level - The level of the heading (defaults to 1).\n */\nexport function heading(text: string, options?: HeadingOptions): string {\n const level = options?.level ?? 1;\n return `${'#'.repeat(level)} ${text}`;\n}\n\n/**\n * Create a blockquote block.\n *\n * Markdown:\n * ```\n * > Content\n * > Content\n * ```\n *\n * @param text - The content of the blockquote.\n */\nexport function blockquote(content: string | readonly string[]): string {\n return prefixLines(joinBlocks(content), '> ');\n}\n\ntype CodeBlockOptions = {\n language?: string;\n};\n\n/**\n * Create a code block.\n *\n * Markdown:\n * ```js\n * Content\n * ```\n *\n * @param content - The content of the code block.\n * @param language - The language of the code block.\n */\nexport function codeBlock(content: string, options?: CodeBlockOptions): string {\n const language = options?.language ?? '';\n const backticks = Math.max(maxBackticks(content), 2) + 1;\n return '`'.repeat(backticks) + language + '\\n' + content + '\\n' + '`'.repeat(backticks);\n}\n\n/**\n * Create an unordered list block.\n *\n * Markdown:\n * ```\n * - Item\n * - Item\n * ```\n *\n * @param items - The items of the list.\n */\nexport function list(items: readonly string[]): string {\n return items.map((item) => `- ${item}`).join('\\n');\n}\n\n/**\n * Create an ordered list block.\n *\n * Markdown:\n * ```\n * 1. Item\n * 2. Item\n * ```\n *\n * @param items - The items of the list.\n */\nexport function orderedList(items: readonly string[]): string {\n return items.map((item, index) => `${index + 1}. ${item}`).join('\\n');\n}\n\nexport type TaskListItem = {\n text: string;\n done?: boolean;\n};\n\n/**\n * Create a task list block.\n *\n * Markdown:\n * ```\n * - [x] Done item\n * - [ ] Pending item\n * ```\n *\n * @param items - The items of the task list.\n */\nexport function taskList(items: readonly (string | TaskListItem)[]): string {\n const result = [];\n for (const item of items) {\n const text = typeof item === 'string' ? item : item.text;\n const done = typeof item === 'string' ? false : item.done;\n result.push(`- [${done ? 'x' : ' '}] ${text}`);\n }\n\n return result.join('\\n');\n}\n"],"mappings":";;;;;;;;;;AAOO,MAAMA,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,KAAK;AAa5B,SAASE,OAAOA,CAACC,IAAY,EAAEC,OAAwB,EAAU;EACtE,MAAMC,KAAK,GAAGD,OAAO,EAAEC,KAAK,IAAI,CAAC;EACjC,OAAO,GAAG,GAAG,CAACC,MAAM,CAACD,KAAK,CAAC,IAAIF,IAAI,EAAE;AACvC;AAaO,SAASI,UAAUA,CAACC,OAAmC,EAAU;EACtE,OAAO,IAAAC,kBAAW,EAAC,IAAAC,iBAAU,EAACF,OAAO,CAAC,EAAE,IAAI,CAAC;AAC/C;AAiBO,SAASG,SAASA,CAACH,OAAe,EAAEJ,OAA0B,EAAU;EAC7E,MAAMQ,QAAQ,GAAGR,OAAO,EAAEQ,QAAQ,IAAI,EAAE;EACxC,MAAMC,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,IAAAC,mBAAY,EAACR,OAAO,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC;EACxD,OAAO,GAAG,CAACF,MAAM,CAACO,SAAS,CAAC,GAAGD,QAAQ,GAAG,IAAI,GAAGJ,OAAO,GAAG,IAAI,GAAG,GAAG,CAACF,MAAM,CAACO,SAAS,CAAC;AACzF;AAaO,SAASI,IAAIA,CAACC,KAAwB,EAAU;EACrD,OAAOA,KAAK,CAACC,GAAG,CAAEC,IAAI,IAAK,KAAKA,IAAI,EAAE,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;AACpD;AAaO,SAASC,WAAWA,CAACJ,KAAwB,EAAU;EAC5D,OAAOA,KAAK,CAACC,GAAG,CAAC,CAACC,IAAI,EAAEG,KAAK,KAAK,GAAGA,KAAK,GAAG,CAAC,KAAKH,IAAI,EAAE,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;AACvE;AAkBO,SAASG,QAAQA,CAACN,KAAyC,EAAU;EAC1E,MAAMO,MAAM,GAAG,EAAE;EACjB,KAAK,MAAML,IAAI,IAAIF,KAAK,EAAE;IACxB,MAAMf,IAAI,GAAG,OAAOiB,IAAI,KAAK,QAAQ,GAAGA,IAAI,GAAGA,IAAI,CAACjB,IAAI;IACxD,MAAMuB,IAAI,GAAG,OAAON,IAAI,KAAK,QAAQ,GAAG,KAAK,GAAGA,IAAI,CAACM,IAAI;IACzDD,MAAM,CAACE,IAAI,CAAC,MAAMD,IAAI,GAAG,GAAG,GAAG,GAAG,KAAKvB,IAAI,EAAE,CAAC;EAChD;EAEA,OAAOsB,MAAM,CAACJ,IAAI,CAAC,IAAI,CAAC;AAC1B","ignoreList":[]}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -90,12 +90,24 @@ Object.defineProperty(exports, "orderedList", {
|
|
|
90
90
|
return _block.orderedList;
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
|
+
Object.defineProperty(exports, "strikethrough", {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
get: function () {
|
|
96
|
+
return _inline.strikethrough;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
93
99
|
Object.defineProperty(exports, "table", {
|
|
94
100
|
enumerable: true,
|
|
95
101
|
get: function () {
|
|
96
102
|
return _table.table;
|
|
97
103
|
}
|
|
98
104
|
});
|
|
105
|
+
Object.defineProperty(exports, "taskList", {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
get: function () {
|
|
108
|
+
return _block.taskList;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
99
111
|
var _block = require("./block.js");
|
|
100
112
|
var _inline = require("./inline.js");
|
|
101
113
|
var _table = require("./table.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export {
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export {\n horizontalRule,\n heading,\n blockquote,\n orderedList,\n list,\n codeBlock,\n taskList,\n} from './block';\nexport { code, italic, bold, strikethrough, link, image } from './inline';\nexport { table } from './table';\nexport { lineBreak, disclosure } from './html';\nexport { escape, joinBlocks } from './utils';\n\nexport type { TableOptions } from './table';\nexport type { DisclosureOptions } from './html';\nexport type { TaskListItem } from './block';\n"],"mappings":"","ignoreList":[]}
|
package/dist/commonjs/inline.js
CHANGED
|
@@ -5,6 +5,7 @@ exports.code = code;
|
|
|
5
5
|
exports.image = image;
|
|
6
6
|
exports.italic = italic;
|
|
7
7
|
exports.link = link;
|
|
8
|
+
exports.strikethrough = strikethrough;
|
|
8
9
|
var _utils = require("./utils.js");
|
|
9
10
|
function italic(text) {
|
|
10
11
|
return `*${text}*`;
|
|
@@ -12,6 +13,9 @@ function italic(text) {
|
|
|
12
13
|
function bold(text) {
|
|
13
14
|
return `**${text}**`;
|
|
14
15
|
}
|
|
16
|
+
function strikethrough(text) {
|
|
17
|
+
return `~~${text}~~`;
|
|
18
|
+
}
|
|
15
19
|
function code(text) {
|
|
16
20
|
const backticksCount = (0, _utils.maxBackticks)(text) + 1;
|
|
17
21
|
const backticks = '`'.repeat(backticksCount);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline.js","names":["italic","text","bold","code","backticksCount","maxBackticks","backticks","repeat","frontPadding","startsWith","backPadding","endsWith","link","url","image"],"sources":["../../src/inline.ts"],"sourcesContent":["import { maxBackticks } from './utils';\n\n/**\n * Create an italic text.\n *\n * Markdown: `*text*`\n *\n * @param text - The text to be italicized.\n */\nexport function italic(text: string): string {\n return `*${text}*`;\n}\n\n/**\n * Create a bold text.\n *\n * Markdown: `**text**`\n *\n * @param text - The text to be bolded.\n */\nexport function bold(text: string): string {\n return `**${text}**`;\n}\n\n/**\n * Create a code text.\n *\n * Markdown: `code`\n *\n * @param text - The text to be marked as code.\n */\nexport function code(text: string): string {\n const backticksCount = maxBackticks(text) + 1;\n const backticks = '`'.repeat(backticksCount);\n const frontPadding = text.startsWith('`') ? ' ' : '';\n const backPadding = text.endsWith('`') ? ' ' : '';\n return `${backticks}${frontPadding}${text}${backPadding}${backticks}`;\n}\n\n/**\n * Create a link or autolink span.\n *\n * Markdown:\n * - `[text](url)` link when `text` is provided\n * - `<url>` autolink when `text` is not provided\n *\n * @param url - The URL to be linked.\n * @param text - The title for the link (optional).\n */\nexport function link(url: string, text?: string): string {\n return text ? `[${text}](${url})` : `<${url}>`;\n}\n\n/**\n * Create an image text.\n *\n * Markdown: ``\n *\n * @param url - The URL of the image.\n * @param text - The description for the image (optional).\n */\nexport function image(url: string, text?: string): string {\n return ``;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"inline.js","names":["italic","text","bold","strikethrough","code","backticksCount","maxBackticks","backticks","repeat","frontPadding","startsWith","backPadding","endsWith","link","url","image"],"sources":["../../src/inline.ts"],"sourcesContent":["import { maxBackticks } from './utils';\n\n/**\n * Create an italic text.\n *\n * Markdown: `*text*`\n *\n * @param text - The text to be italicized.\n */\nexport function italic(text: string): string {\n return `*${text}*`;\n}\n\n/**\n * Create a bold text.\n *\n * Markdown: `**text**`\n *\n * @param text - The text to be bolded.\n */\nexport function bold(text: string): string {\n return `**${text}**`;\n}\n\n/**\n * Create a strikethrough text.\n *\n * Markdown: `~~text~~`\n *\n * @param text - The text to be struck through.\n */\nexport function strikethrough(text: string): string {\n return `~~${text}~~`;\n}\n\n/**\n * Create a code text.\n *\n * Markdown: `code`\n *\n * @param text - The text to be marked as code.\n */\nexport function code(text: string): string {\n const backticksCount = maxBackticks(text) + 1;\n const backticks = '`'.repeat(backticksCount);\n const frontPadding = text.startsWith('`') ? ' ' : '';\n const backPadding = text.endsWith('`') ? ' ' : '';\n return `${backticks}${frontPadding}${text}${backPadding}${backticks}`;\n}\n\n/**\n * Create a link or autolink span.\n *\n * Markdown:\n * - `[text](url)` link when `text` is provided\n * - `<url>` autolink when `text` is not provided\n *\n * @param url - The URL to be linked.\n * @param text - The title for the link (optional).\n */\nexport function link(url: string, text?: string): string {\n return text ? `[${text}](${url})` : `<${url}>`;\n}\n\n/**\n * Create an image text.\n *\n * Markdown: ``\n *\n * @param url - The URL of the image.\n * @param text - The description for the image (optional).\n */\nexport function image(url: string, text?: string): string {\n return ``;\n}\n"],"mappings":";;;;;;;;;AASO,SAASA,MAAMA,CAACC,IAAY,EAAU;EAC3C,OAAO,IAAIA,IAAI,GAAG;AACpB;AASO,SAASC,IAAIA,CAACD,IAAY,EAAU;EACzC,OAAO,KAAKA,IAAI,IAAI;AACtB;AASO,SAASE,aAAaA,CAACF,IAAY,EAAU;EAClD,OAAO,KAAKA,IAAI,IAAI;AACtB;AASO,SAASG,IAAIA,CAACH,IAAY,EAAU;EACzC,MAAMI,cAAc,GAAG,IAAAC,mBAAY,EAACL,IAAI,CAAC,GAAG,CAAC;EAC7C,MAAMM,SAAS,GAAG,GAAG,CAACC,MAAM,CAACH,cAAc,CAAC;EAC5C,MAAMI,YAAY,GAAGR,IAAI,CAACS,UAAU,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE;EACpD,MAAMC,WAAW,GAAGV,IAAI,CAACW,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE;EACjD,OAAO,GAAGL,SAAS,GAAGE,YAAY,GAAGR,IAAI,GAAGU,WAAW,GAAGJ,SAAS,EAAE;AACvE;AAYO,SAASM,IAAIA,CAACC,GAAW,EAAEb,IAAa,EAAU;EACvD,OAAOA,IAAI,GAAG,IAAIA,IAAI,KAAKa,GAAG,GAAG,GAAG,IAAIA,GAAG,GAAG;AAChD;AAUO,SAASC,KAAKA,CAACD,GAAW,EAAEb,IAAa,EAAU;EACxD,OAAO,KAAKA,IAAI,IAAI,EAAE,KAAKa,GAAG,GAAG;AACnC","ignoreList":[]}
|
package/dist/esm/block.mjs
CHANGED
|
@@ -18,4 +18,13 @@ export function list(items) {
|
|
|
18
18
|
export function orderedList(items) {
|
|
19
19
|
return items.map((item, index) => `${index + 1}. ${item}`).join('\n');
|
|
20
20
|
}
|
|
21
|
+
export function taskList(items) {
|
|
22
|
+
const result = [];
|
|
23
|
+
for (const item of items) {
|
|
24
|
+
const text = typeof item === 'string' ? item : item.text;
|
|
25
|
+
const done = typeof item === 'string' ? false : item.done;
|
|
26
|
+
result.push(`- [${done ? 'x' : ' '}] ${text}`);
|
|
27
|
+
}
|
|
28
|
+
return result.join('\n');
|
|
29
|
+
}
|
|
21
30
|
//# sourceMappingURL=block.mjs.map
|
package/dist/esm/block.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.mjs","names":["joinBlocks","maxBackticks","prefixLines","horizontalRule","heading","text","options","level","repeat","blockquote","content","codeBlock","language","backticks","Math","max","list","items","map","item","join","orderedList","index"],"sources":["../../src/block.ts"],"sourcesContent":["import { joinBlocks, maxBackticks, prefixLines } from './utils';\n\n/**\n * Create a horizontal rule block.\n *\n * Markdown: `---`\n */\nexport const horizontalRule = '---';\n\ntype HeadingOptions = {\n level: number;\n};\n\n/**\n * Create a heading block.\n * Markdown: `# Heading`\n *\n * @param text - The text of the heading.\n * @param level - The level of the heading (defaults to 1).\n */\nexport function heading(text: string, options?: HeadingOptions): string {\n const level = options?.level ?? 1;\n return `${'#'.repeat(level)} ${text}`;\n}\n\n/**\n * Create a blockquote block.\n *\n * Markdown:\n * ```\n * > Content\n * > Content\n * ```\n *\n * @param text - The content of the blockquote.\n */\nexport function blockquote(content: string | readonly string[]): string {\n return prefixLines(joinBlocks(content), '> ');\n}\n\ntype CodeBlockOptions = {\n language?: string;\n};\n\n/**\n * Create a code block.\n *\n * Markdown:\n * ```js\n * Content\n * ```\n *\n * @param content - The content of the code block.\n * @param language - The language of the code block.\n */\nexport function codeBlock(content: string, options?: CodeBlockOptions): string {\n const language = options?.language ?? '';\n const backticks = Math.max(maxBackticks(content), 2) + 1;\n return '`'.repeat(backticks) + language + '\\n' + content + '\\n' + '`'.repeat(backticks);\n}\n\n/**\n * Create an unordered list block.\n *\n * Markdown:\n * ```\n * - Item\n * - Item\n * ```\n *\n * @param items - The items of the list.\n */\nexport function list(items: readonly string[]): string {\n return items.map((item) => `- ${item}`).join('\\n');\n}\n\n/**\n * Create an ordered list block.\n *\n * Markdown:\n * ```\n * 1. Item\n * 2. Item\n * ```\n *\n * @param items - The items of the list.\n */\nexport function orderedList(items: readonly string[]): string {\n return items.map((item, index) => `${index + 1}. ${item}`).join('\\n');\n}\n"],"mappings":"SAASA,UAAU,EAAEC,YAAY,EAAEC,WAAW;AAO9C,OAAO,MAAMC,cAAc,GAAG,KAAK;AAanC,OAAO,SAASC,OAAOA,CAACC,IAAY,EAAEC,OAAwB,EAAU;EACtE,MAAMC,KAAK,GAAGD,OAAO,EAAEC,KAAK,IAAI,CAAC;EACjC,OAAO,GAAG,GAAG,CAACC,MAAM,CAACD,KAAK,CAAC,IAAIF,IAAI,EAAE;AACvC;AAaA,OAAO,SAASI,UAAUA,CAACC,OAAmC,EAAU;EACtE,OAAOR,WAAW,CAACF,UAAU,CAACU,OAAO,CAAC,EAAE,IAAI,CAAC;AAC/C;AAiBA,OAAO,SAASC,SAASA,CAACD,OAAe,EAAEJ,OAA0B,EAAU;EAC7E,MAAMM,QAAQ,GAAGN,OAAO,EAAEM,QAAQ,IAAI,EAAE;EACxC,MAAMC,SAAS,GAAGC,IAAI,CAACC,GAAG,CAACd,YAAY,CAACS,OAAO,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC;EACxD,OAAO,GAAG,CAACF,MAAM,CAACK,SAAS,CAAC,GAAGD,QAAQ,GAAG,IAAI,GAAGF,OAAO,GAAG,IAAI,GAAG,GAAG,CAACF,MAAM,CAACK,SAAS,CAAC;AACzF;AAaA,OAAO,SAASG,IAAIA,CAACC,KAAwB,EAAU;EACrD,OAAOA,KAAK,CAACC,GAAG,CAAEC,IAAI,IAAK,KAAKA,IAAI,EAAE,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;AACpD;AAaA,OAAO,SAASC,WAAWA,CAACJ,KAAwB,EAAU;EAC5D,OAAOA,KAAK,CAACC,GAAG,CAAC,CAACC,IAAI,EAAEG,KAAK,KAAK,GAAGA,KAAK,GAAG,CAAC,KAAKH,IAAI,EAAE,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;AACvE","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"block.mjs","names":["joinBlocks","maxBackticks","prefixLines","horizontalRule","heading","text","options","level","repeat","blockquote","content","codeBlock","language","backticks","Math","max","list","items","map","item","join","orderedList","index","taskList","result","done","push"],"sources":["../../src/block.ts"],"sourcesContent":["import { joinBlocks, maxBackticks, prefixLines } from './utils';\n\n/**\n * Create a horizontal rule block.\n *\n * Markdown: `---`\n */\nexport const horizontalRule = '---';\n\ntype HeadingOptions = {\n level: number;\n};\n\n/**\n * Create a heading block.\n * Markdown: `# Heading`\n *\n * @param text - The text of the heading.\n * @param level - The level of the heading (defaults to 1).\n */\nexport function heading(text: string, options?: HeadingOptions): string {\n const level = options?.level ?? 1;\n return `${'#'.repeat(level)} ${text}`;\n}\n\n/**\n * Create a blockquote block.\n *\n * Markdown:\n * ```\n * > Content\n * > Content\n * ```\n *\n * @param text - The content of the blockquote.\n */\nexport function blockquote(content: string | readonly string[]): string {\n return prefixLines(joinBlocks(content), '> ');\n}\n\ntype CodeBlockOptions = {\n language?: string;\n};\n\n/**\n * Create a code block.\n *\n * Markdown:\n * ```js\n * Content\n * ```\n *\n * @param content - The content of the code block.\n * @param language - The language of the code block.\n */\nexport function codeBlock(content: string, options?: CodeBlockOptions): string {\n const language = options?.language ?? '';\n const backticks = Math.max(maxBackticks(content), 2) + 1;\n return '`'.repeat(backticks) + language + '\\n' + content + '\\n' + '`'.repeat(backticks);\n}\n\n/**\n * Create an unordered list block.\n *\n * Markdown:\n * ```\n * - Item\n * - Item\n * ```\n *\n * @param items - The items of the list.\n */\nexport function list(items: readonly string[]): string {\n return items.map((item) => `- ${item}`).join('\\n');\n}\n\n/**\n * Create an ordered list block.\n *\n * Markdown:\n * ```\n * 1. Item\n * 2. Item\n * ```\n *\n * @param items - The items of the list.\n */\nexport function orderedList(items: readonly string[]): string {\n return items.map((item, index) => `${index + 1}. ${item}`).join('\\n');\n}\n\nexport type TaskListItem = {\n text: string;\n done?: boolean;\n};\n\n/**\n * Create a task list block.\n *\n * Markdown:\n * ```\n * - [x] Done item\n * - [ ] Pending item\n * ```\n *\n * @param items - The items of the task list.\n */\nexport function taskList(items: readonly (string | TaskListItem)[]): string {\n const result = [];\n for (const item of items) {\n const text = typeof item === 'string' ? item : item.text;\n const done = typeof item === 'string' ? false : item.done;\n result.push(`- [${done ? 'x' : ' '}] ${text}`);\n }\n\n return result.join('\\n');\n}\n"],"mappings":"SAASA,UAAU,EAAEC,YAAY,EAAEC,WAAW;AAO9C,OAAO,MAAMC,cAAc,GAAG,KAAK;AAanC,OAAO,SAASC,OAAOA,CAACC,IAAY,EAAEC,OAAwB,EAAU;EACtE,MAAMC,KAAK,GAAGD,OAAO,EAAEC,KAAK,IAAI,CAAC;EACjC,OAAO,GAAG,GAAG,CAACC,MAAM,CAACD,KAAK,CAAC,IAAIF,IAAI,EAAE;AACvC;AAaA,OAAO,SAASI,UAAUA,CAACC,OAAmC,EAAU;EACtE,OAAOR,WAAW,CAACF,UAAU,CAACU,OAAO,CAAC,EAAE,IAAI,CAAC;AAC/C;AAiBA,OAAO,SAASC,SAASA,CAACD,OAAe,EAAEJ,OAA0B,EAAU;EAC7E,MAAMM,QAAQ,GAAGN,OAAO,EAAEM,QAAQ,IAAI,EAAE;EACxC,MAAMC,SAAS,GAAGC,IAAI,CAACC,GAAG,CAACd,YAAY,CAACS,OAAO,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC;EACxD,OAAO,GAAG,CAACF,MAAM,CAACK,SAAS,CAAC,GAAGD,QAAQ,GAAG,IAAI,GAAGF,OAAO,GAAG,IAAI,GAAG,GAAG,CAACF,MAAM,CAACK,SAAS,CAAC;AACzF;AAaA,OAAO,SAASG,IAAIA,CAACC,KAAwB,EAAU;EACrD,OAAOA,KAAK,CAACC,GAAG,CAAEC,IAAI,IAAK,KAAKA,IAAI,EAAE,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;AACpD;AAaA,OAAO,SAASC,WAAWA,CAACJ,KAAwB,EAAU;EAC5D,OAAOA,KAAK,CAACC,GAAG,CAAC,CAACC,IAAI,EAAEG,KAAK,KAAK,GAAGA,KAAK,GAAG,CAAC,KAAKH,IAAI,EAAE,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;AACvE;AAkBA,OAAO,SAASG,QAAQA,CAACN,KAAyC,EAAU;EAC1E,MAAMO,MAAM,GAAG,EAAE;EACjB,KAAK,MAAML,IAAI,IAAIF,KAAK,EAAE;IACxB,MAAMZ,IAAI,GAAG,OAAOc,IAAI,KAAK,QAAQ,GAAGA,IAAI,GAAGA,IAAI,CAACd,IAAI;IACxD,MAAMoB,IAAI,GAAG,OAAON,IAAI,KAAK,QAAQ,GAAG,KAAK,GAAGA,IAAI,CAACM,IAAI;IACzDD,MAAM,CAACE,IAAI,CAAC,MAAMD,IAAI,GAAG,GAAG,GAAG,GAAG,KAAKpB,IAAI,EAAE,CAAC;EAChD;EAEA,OAAOmB,MAAM,CAACJ,IAAI,CAAC,IAAI,CAAC;AAC1B","ignoreList":[]}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { horizontalRule, heading, blockquote, orderedList, list, codeBlock } from "./block.mjs";
|
|
2
|
-
export { code, italic, bold, link, image } from "./inline.mjs";
|
|
1
|
+
export { horizontalRule, heading, blockquote, orderedList, list, codeBlock, taskList } from "./block.mjs";
|
|
2
|
+
export { code, italic, bold, strikethrough, link, image } from "./inline.mjs";
|
|
3
3
|
export { table } from "./table.mjs";
|
|
4
4
|
export { lineBreak, disclosure } from "./html.mjs";
|
|
5
5
|
export { escape, joinBlocks } from "./utils.mjs";
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["horizontalRule","heading","blockquote","orderedList","list","codeBlock","code","italic","bold","link","image","table","lineBreak","disclosure","escape","joinBlocks"],"sources":["../../src/index.ts"],"sourcesContent":["export {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["horizontalRule","heading","blockquote","orderedList","list","codeBlock","taskList","code","italic","bold","strikethrough","link","image","table","lineBreak","disclosure","escape","joinBlocks"],"sources":["../../src/index.ts"],"sourcesContent":["export {\n horizontalRule,\n heading,\n blockquote,\n orderedList,\n list,\n codeBlock,\n taskList,\n} from './block';\nexport { code, italic, bold, strikethrough, link, image } from './inline';\nexport { table } from './table';\nexport { lineBreak, disclosure } from './html';\nexport { escape, joinBlocks } from './utils';\n\nexport type { TableOptions } from './table';\nexport type { DisclosureOptions } from './html';\nexport type { TaskListItem } from './block';\n"],"mappings":"SACEA,cAAc,EACdC,OAAO,EACPC,UAAU,EACVC,WAAW,EACXC,IAAI,EACJC,SAAS,EACTC,QAAQ;AAAA,SAEDC,IAAI,EAAEC,MAAM,EAAEC,IAAI,EAAEC,aAAa,EAAEC,IAAI,EAAEC,KAAK;AAAA,SAC9CC,KAAK;AAAA,SACLC,SAAS,EAAEC,UAAU;AAAA,SACrBC,MAAM,EAAEC,UAAU","ignoreList":[]}
|
package/dist/esm/inline.mjs
CHANGED
|
@@ -5,6 +5,9 @@ export function italic(text) {
|
|
|
5
5
|
export function bold(text) {
|
|
6
6
|
return `**${text}**`;
|
|
7
7
|
}
|
|
8
|
+
export function strikethrough(text) {
|
|
9
|
+
return `~~${text}~~`;
|
|
10
|
+
}
|
|
8
11
|
export function code(text) {
|
|
9
12
|
const backticksCount = maxBackticks(text) + 1;
|
|
10
13
|
const backticks = '`'.repeat(backticksCount);
|
package/dist/esm/inline.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline.mjs","names":["maxBackticks","italic","text","bold","code","backticksCount","backticks","repeat","frontPadding","startsWith","backPadding","endsWith","link","url","image"],"sources":["../../src/inline.ts"],"sourcesContent":["import { maxBackticks } from './utils';\n\n/**\n * Create an italic text.\n *\n * Markdown: `*text*`\n *\n * @param text - The text to be italicized.\n */\nexport function italic(text: string): string {\n return `*${text}*`;\n}\n\n/**\n * Create a bold text.\n *\n * Markdown: `**text**`\n *\n * @param text - The text to be bolded.\n */\nexport function bold(text: string): string {\n return `**${text}**`;\n}\n\n/**\n * Create a code text.\n *\n * Markdown: `code`\n *\n * @param text - The text to be marked as code.\n */\nexport function code(text: string): string {\n const backticksCount = maxBackticks(text) + 1;\n const backticks = '`'.repeat(backticksCount);\n const frontPadding = text.startsWith('`') ? ' ' : '';\n const backPadding = text.endsWith('`') ? ' ' : '';\n return `${backticks}${frontPadding}${text}${backPadding}${backticks}`;\n}\n\n/**\n * Create a link or autolink span.\n *\n * Markdown:\n * - `[text](url)` link when `text` is provided\n * - `<url>` autolink when `text` is not provided\n *\n * @param url - The URL to be linked.\n * @param text - The title for the link (optional).\n */\nexport function link(url: string, text?: string): string {\n return text ? `[${text}](${url})` : `<${url}>`;\n}\n\n/**\n * Create an image text.\n *\n * Markdown: ``\n *\n * @param url - The URL of the image.\n * @param text - The description for the image (optional).\n */\nexport function image(url: string, text?: string): string {\n return ``;\n}\n"],"mappings":"SAASA,YAAY;AASrB,OAAO,SAASC,MAAMA,CAACC,IAAY,EAAU;EAC3C,OAAO,IAAIA,IAAI,GAAG;AACpB;AASA,OAAO,SAASC,IAAIA,CAACD,IAAY,EAAU;EACzC,OAAO,KAAKA,IAAI,IAAI;AACtB;AASA,OAAO,SAASE,
|
|
1
|
+
{"version":3,"file":"inline.mjs","names":["maxBackticks","italic","text","bold","strikethrough","code","backticksCount","backticks","repeat","frontPadding","startsWith","backPadding","endsWith","link","url","image"],"sources":["../../src/inline.ts"],"sourcesContent":["import { maxBackticks } from './utils';\n\n/**\n * Create an italic text.\n *\n * Markdown: `*text*`\n *\n * @param text - The text to be italicized.\n */\nexport function italic(text: string): string {\n return `*${text}*`;\n}\n\n/**\n * Create a bold text.\n *\n * Markdown: `**text**`\n *\n * @param text - The text to be bolded.\n */\nexport function bold(text: string): string {\n return `**${text}**`;\n}\n\n/**\n * Create a strikethrough text.\n *\n * Markdown: `~~text~~`\n *\n * @param text - The text to be struck through.\n */\nexport function strikethrough(text: string): string {\n return `~~${text}~~`;\n}\n\n/**\n * Create a code text.\n *\n * Markdown: `code`\n *\n * @param text - The text to be marked as code.\n */\nexport function code(text: string): string {\n const backticksCount = maxBackticks(text) + 1;\n const backticks = '`'.repeat(backticksCount);\n const frontPadding = text.startsWith('`') ? ' ' : '';\n const backPadding = text.endsWith('`') ? ' ' : '';\n return `${backticks}${frontPadding}${text}${backPadding}${backticks}`;\n}\n\n/**\n * Create a link or autolink span.\n *\n * Markdown:\n * - `[text](url)` link when `text` is provided\n * - `<url>` autolink when `text` is not provided\n *\n * @param url - The URL to be linked.\n * @param text - The title for the link (optional).\n */\nexport function link(url: string, text?: string): string {\n return text ? `[${text}](${url})` : `<${url}>`;\n}\n\n/**\n * Create an image text.\n *\n * Markdown: ``\n *\n * @param url - The URL of the image.\n * @param text - The description for the image (optional).\n */\nexport function image(url: string, text?: string): string {\n return ``;\n}\n"],"mappings":"SAASA,YAAY;AASrB,OAAO,SAASC,MAAMA,CAACC,IAAY,EAAU;EAC3C,OAAO,IAAIA,IAAI,GAAG;AACpB;AASA,OAAO,SAASC,IAAIA,CAACD,IAAY,EAAU;EACzC,OAAO,KAAKA,IAAI,IAAI;AACtB;AASA,OAAO,SAASE,aAAaA,CAACF,IAAY,EAAU;EAClD,OAAO,KAAKA,IAAI,IAAI;AACtB;AASA,OAAO,SAASG,IAAIA,CAACH,IAAY,EAAU;EACzC,MAAMI,cAAc,GAAGN,YAAY,CAACE,IAAI,CAAC,GAAG,CAAC;EAC7C,MAAMK,SAAS,GAAG,GAAG,CAACC,MAAM,CAACF,cAAc,CAAC;EAC5C,MAAMG,YAAY,GAAGP,IAAI,CAACQ,UAAU,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE;EACpD,MAAMC,WAAW,GAAGT,IAAI,CAACU,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE;EACjD,OAAO,GAAGL,SAAS,GAAGE,YAAY,GAAGP,IAAI,GAAGS,WAAW,GAAGJ,SAAS,EAAE;AACvE;AAYA,OAAO,SAASM,IAAIA,CAACC,GAAW,EAAEZ,IAAa,EAAU;EACvD,OAAOA,IAAI,GAAG,IAAIA,IAAI,KAAKY,GAAG,GAAG,GAAG,IAAIA,GAAG,GAAG;AAChD;AAUA,OAAO,SAASC,KAAKA,CAACD,GAAW,EAAEZ,IAAa,EAAU;EACxD,OAAO,KAAKA,IAAI,IAAI,EAAE,KAAKY,GAAG,GAAG;AACnC","ignoreList":[]}
|
package/dist/types/block.d.ts
CHANGED
|
@@ -66,4 +66,20 @@ export declare function list(items: readonly string[]): string;
|
|
|
66
66
|
* @param items - The items of the list.
|
|
67
67
|
*/
|
|
68
68
|
export declare function orderedList(items: readonly string[]): string;
|
|
69
|
+
export type TaskListItem = {
|
|
70
|
+
text: string;
|
|
71
|
+
done?: boolean;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Create a task list block.
|
|
75
|
+
*
|
|
76
|
+
* Markdown:
|
|
77
|
+
* ```
|
|
78
|
+
* - [x] Done item
|
|
79
|
+
* - [ ] Pending item
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @param items - The items of the task list.
|
|
83
|
+
*/
|
|
84
|
+
export declare function taskList(items: readonly (string | TaskListItem)[]): string;
|
|
69
85
|
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { horizontalRule, heading, blockquote, orderedList, list, codeBlock } from './block';
|
|
2
|
-
export { code, italic, bold, link, image } from './inline';
|
|
1
|
+
export { horizontalRule, heading, blockquote, orderedList, list, codeBlock, taskList, } from './block';
|
|
2
|
+
export { code, italic, bold, strikethrough, link, image } from './inline';
|
|
3
3
|
export { table } from './table';
|
|
4
4
|
export { lineBreak, disclosure } from './html';
|
|
5
5
|
export { escape, joinBlocks } from './utils';
|
|
6
6
|
export type { TableOptions } from './table';
|
|
7
7
|
export type { DisclosureOptions } from './html';
|
|
8
|
+
export type { TaskListItem } from './block';
|
package/dist/types/inline.d.ts
CHANGED
|
@@ -14,6 +14,14 @@ export declare function italic(text: string): string;
|
|
|
14
14
|
* @param text - The text to be bolded.
|
|
15
15
|
*/
|
|
16
16
|
export declare function bold(text: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Create a strikethrough text.
|
|
19
|
+
*
|
|
20
|
+
* Markdown: `~~text~~`
|
|
21
|
+
*
|
|
22
|
+
* @param text - The text to be struck through.
|
|
23
|
+
*/
|
|
24
|
+
export declare function strikethrough(text: string): string;
|
|
17
25
|
/**
|
|
18
26
|
* Create a code text.
|
|
19
27
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-markdown-builder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Elegant markdown builder with minimal bundle size.",
|
|
5
5
|
"main": "dist/commonjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.mjs",
|
|
@@ -28,9 +28,12 @@
|
|
|
28
28
|
"build:commonjs": "BABEL_ENV=cjs babel src --out-dir \"dist/commonjs\" --extensions .js,.ts --out-file-extension .js --source-maps --no-comments",
|
|
29
29
|
"build:esm": "BABEL_ENV=esm babel src --out-dir \"dist/esm\" --extensions .js,.ts --out-file-extension .mjs --source-maps --no-comments",
|
|
30
30
|
"build:types": "tsc --project tsconfig.release.json --outDir \"dist/types\"",
|
|
31
|
+
"format": "prettier --write \"**/*.{js,ts,tsx}\"",
|
|
32
|
+
"format:check": "prettier --check \"**/*.{js,ts,tsx}\"",
|
|
33
|
+
"validate": "yarn typecheck && yarn lint && yarn test && yarn format:check",
|
|
34
|
+
"validate:fix": "yarn format && yarn lint --fix && yarn typecheck && yarn test && yarn build",
|
|
31
35
|
"release": "release-it",
|
|
32
|
-
"release:beta": "release-it --preRelease=beta"
|
|
33
|
-
"validate": "yarn typecheck && yarn lint && yarn test"
|
|
36
|
+
"release:beta": "release-it --preRelease=beta"
|
|
34
37
|
},
|
|
35
38
|
"keywords": [
|
|
36
39
|
"markdown",
|