@san-siva/blogkit-md 0.2.0 → 0.2.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/dist/index.d.mts +33 -0
- package/dist/index.mjs +413 -0
- package/package.json +13 -3
- package/src/declarations.d.ts +4 -0
- package/{hooks → src/hooks}/readMarkdownFile.ts +4 -4
- package/{utils → src/utils}/parseMarkdown.ts +2 -1
- package/.prettierrc.json +0 -9
- package/eslint/common.config.ts +0 -29
- package/eslint/react.config.ts +0 -20
- package/eslint/utilities.ts +0 -236
- package/eslint.config.ts +0 -8
- package/tsconfig.json +0 -29
- package/website/app/data.ts +0 -46
- package/website/app/layout.tsx +0 -74
- package/website/app/page.tsx +0 -30
- package/website/next.config.ts +0 -9
- package/website/package-lock.json +0 -3276
- package/website/package.json +0 -25
- package/website/tsconfig.json +0 -30
- /package/{components → src/components}/BlogPost.tsx +0 -0
- /package/{index.ts → src/index.ts} +0 -0
- /package/{utils → src/utils}/extractText.ts +0 -0
- /package/{utils → src/utils}/groupSections.test.ts +0 -0
- /package/{utils → src/utils}/groupSections.ts +0 -0
- /package/{utils → src/utils}/renderMarkdown.tsx +0 -0
- /package/{utils → src/utils}/renderPhrasingContent.tsx +0 -0
package/eslint/utilities.ts
DELETED
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import eslint from '@eslint/js';
|
|
2
|
-
import type { Linter } from 'eslint';
|
|
3
|
-
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
4
|
-
import importPlugin from 'eslint-plugin-import';
|
|
5
|
-
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
6
|
-
import { configs as noAwaitInPromiseConfigs } from 'eslint-plugin-no-await-in-promise';
|
|
7
|
-
import react from 'eslint-plugin-react';
|
|
8
|
-
import reactHooks from 'eslint-plugin-react-hooks';
|
|
9
|
-
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
10
|
-
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
|
|
11
|
-
import { configs as tseslintConfigs } from 'typescript-eslint';
|
|
12
|
-
|
|
13
|
-
export const defaultExtends = [
|
|
14
|
-
eslint.configs.recommended,
|
|
15
|
-
eslintPluginUnicorn.configs.recommended,
|
|
16
|
-
eslintConfigPrettier,
|
|
17
|
-
noAwaitInPromiseConfigs.recommended,
|
|
18
|
-
...tseslintConfigs.recommended,
|
|
19
|
-
importPlugin.flatConfigs.recommended,
|
|
20
|
-
importPlugin.flatConfigs.typescript,
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
export const defaultPlugins = {
|
|
24
|
-
'simple-import-sort': simpleImportSort,
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const tsRules: Linter.RulesRecord = {
|
|
28
|
-
'@typescript-eslint/no-explicit-any': 1,
|
|
29
|
-
'@typescript-eslint/no-floating-promises': 2,
|
|
30
|
-
'@typescript-eslint/no-unused-vars': 1,
|
|
31
|
-
'@typescript-eslint/naming-convention': [
|
|
32
|
-
1,
|
|
33
|
-
{
|
|
34
|
-
selector: 'import',
|
|
35
|
-
format: ['camelCase', 'PascalCase', 'snake_case', 'UPPER_CASE'],
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
selector: 'enumMember',
|
|
39
|
-
format: ['PascalCase'],
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
selector: 'default',
|
|
43
|
-
format: ['camelCase'],
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
selector: 'variable',
|
|
47
|
-
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
selector: 'variable',
|
|
51
|
-
modifiers: ['destructured'],
|
|
52
|
-
format: ['camelCase', 'snake_case', 'UPPER_CASE', 'PascalCase'],
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
selector: 'function',
|
|
56
|
-
format: ['camelCase', 'PascalCase'],
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
selector: 'parameter',
|
|
60
|
-
format: [],
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
selector: 'memberLike',
|
|
64
|
-
modifiers: ['private'],
|
|
65
|
-
format: ['camelCase'],
|
|
66
|
-
leadingUnderscore: 'require',
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
selector: 'typeLike',
|
|
70
|
-
format: ['PascalCase'],
|
|
71
|
-
},
|
|
72
|
-
{ selector: 'property', format: [] },
|
|
73
|
-
{
|
|
74
|
-
selector: 'method',
|
|
75
|
-
format: ['PascalCase', 'camelCase', 'UPPER_CASE'],
|
|
76
|
-
leadingUnderscore: 'allowDouble',
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
'@typescript-eslint/no-use-before-define': 2,
|
|
80
|
-
'@typescript-eslint/no-unused-expressions': [
|
|
81
|
-
'error',
|
|
82
|
-
{
|
|
83
|
-
allowShortCircuit: true,
|
|
84
|
-
allowTernary: true,
|
|
85
|
-
allowTaggedTemplates: true,
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export const defaultRules: Linter.RulesRecord = {
|
|
91
|
-
...tsRules,
|
|
92
|
-
'unicorn/filename-case': [
|
|
93
|
-
'error',
|
|
94
|
-
{
|
|
95
|
-
cases: {
|
|
96
|
-
camelCase: true,
|
|
97
|
-
kebabCase: true,
|
|
98
|
-
pascalCase: true,
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
],
|
|
102
|
-
'unicorn/prevent-abbreviations': [1, { allowList: { dev: true } }],
|
|
103
|
-
'unicorn/no-array-reduce': [1],
|
|
104
|
-
'unicorn/catch-error-name': [0],
|
|
105
|
-
'unicorn/no-for-loop': [1],
|
|
106
|
-
'unicorn/no-null': [0],
|
|
107
|
-
'unicorn/prefer-string-raw': [1],
|
|
108
|
-
'unicorn/prefer-string-slice': [1],
|
|
109
|
-
'unicorn/no-negated-condition': [1],
|
|
110
|
-
'unicorn/no-array-for-each': [0],
|
|
111
|
-
'unicorn/no-array-callback-reference': [0],
|
|
112
|
-
'unicorn/no-object-as-default-parameter': [1],
|
|
113
|
-
'unicorn/prefer-math-min-max': [1],
|
|
114
|
-
'unicorn/no-process-exit': [1],
|
|
115
|
-
'unicorn/prefer-top-level-await': [1],
|
|
116
|
-
'unicorn/prefer-number-properties': [1],
|
|
117
|
-
'unicorn/consistent-function-scoping': [1],
|
|
118
|
-
'arrow-body-style': [1, 'as-needed'],
|
|
119
|
-
camelcase: 0,
|
|
120
|
-
'default-param-last': 0,
|
|
121
|
-
'import/order': 0,
|
|
122
|
-
'simple-import-sort/imports': [
|
|
123
|
-
1,
|
|
124
|
-
{
|
|
125
|
-
groups: [
|
|
126
|
-
['^react$', '^react-.*'],
|
|
127
|
-
['next', 'next-.*'],
|
|
128
|
-
[String.raw`^@?\w`],
|
|
129
|
-
[String.raw`^\.\.(?!/?$)`, String.raw`^\.\./?$`],
|
|
130
|
-
[
|
|
131
|
-
String.raw`^\./(?=.*/)(?!/?$)`,
|
|
132
|
-
String.raw`^\.(?!/?$)`,
|
|
133
|
-
String.raw`^\./?$`,
|
|
134
|
-
],
|
|
135
|
-
[String.raw`^.+\.s?css$`],
|
|
136
|
-
],
|
|
137
|
-
},
|
|
138
|
-
],
|
|
139
|
-
'simple-import-sort/exports': 1,
|
|
140
|
-
'import/no-extraneous-dependencies': 0,
|
|
141
|
-
'import/extensions': 0,
|
|
142
|
-
'import/no-cycle': [2, { ignoreExternal: true }],
|
|
143
|
-
'import/no-unresolved': 0,
|
|
144
|
-
'import/prefer-default-export': 0,
|
|
145
|
-
'max-len': 0,
|
|
146
|
-
'no-console': 0,
|
|
147
|
-
'no-delete-var': 2,
|
|
148
|
-
'no-shadow': 0,
|
|
149
|
-
'no-underscore-dangle': [2, { allow: ['_id'] }],
|
|
150
|
-
'no-unused-expressions': 2,
|
|
151
|
-
'no-unused-labels': 2,
|
|
152
|
-
'no-use-before-define': 0,
|
|
153
|
-
semi: 1,
|
|
154
|
-
quotes: [
|
|
155
|
-
1,
|
|
156
|
-
'single',
|
|
157
|
-
{
|
|
158
|
-
avoidEscape: true,
|
|
159
|
-
allowTemplateLiterals: true,
|
|
160
|
-
},
|
|
161
|
-
],
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
export const languageOptions = {
|
|
165
|
-
ecmaVersion: 2022 as const,
|
|
166
|
-
parserOptions: {
|
|
167
|
-
projectService: true,
|
|
168
|
-
defaultProject: '../tsconfig.json',
|
|
169
|
-
tsconfigRootDir: import.meta.dirname,
|
|
170
|
-
},
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
export const testFiles = [
|
|
174
|
-
'**/*.test.ts',
|
|
175
|
-
'**/*.test.tsx',
|
|
176
|
-
'**/*.test.js',
|
|
177
|
-
'**/*.test.jsx',
|
|
178
|
-
'**/*.spec.ts',
|
|
179
|
-
'**/*.spec.tsx',
|
|
180
|
-
'**/*.spec.js',
|
|
181
|
-
'**/*.spec.jsx',
|
|
182
|
-
];
|
|
183
|
-
|
|
184
|
-
export const defaultSettings = {
|
|
185
|
-
'import/resolver': {
|
|
186
|
-
typescript: {
|
|
187
|
-
project: '../tsconfig.json',
|
|
188
|
-
},
|
|
189
|
-
},
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
export const reactPlugins = {
|
|
193
|
-
...defaultPlugins,
|
|
194
|
-
react,
|
|
195
|
-
'react-hooks': reactHooks,
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
export const reactSettings = {
|
|
199
|
-
...defaultSettings,
|
|
200
|
-
react: {
|
|
201
|
-
version: 'detect',
|
|
202
|
-
pragma: 'React',
|
|
203
|
-
fragment: 'Fragment',
|
|
204
|
-
},
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
export const reactRules: Linter.RulesRecord = {
|
|
208
|
-
...defaultRules,
|
|
209
|
-
'react/jsx-uses-react': 0,
|
|
210
|
-
'react/react-in-jsx-scope': 0,
|
|
211
|
-
'react-hooks/rules-of-hooks': 2,
|
|
212
|
-
'react-hooks/exhaustive-deps': 1,
|
|
213
|
-
'eol-last': ['error', 'always'],
|
|
214
|
-
'jsx-a11y/alt-text': 0,
|
|
215
|
-
'jsx-a11y/click-events-have-key-events': 0,
|
|
216
|
-
'jsx-a11y/control-has-associated-label': 0,
|
|
217
|
-
'jsx-a11y/no-noninteractive-element-interactions': 0,
|
|
218
|
-
'jsx-a11y/no-static-element-interactions': 0,
|
|
219
|
-
'jsx-a11y/label-has-associated-control': 0,
|
|
220
|
-
'react/jsx-filename-extension': [1, { extensions: ['.tsx'] }],
|
|
221
|
-
'react/jsx-props-no-spreading': 0,
|
|
222
|
-
'react/no-unstable-nested-components': ['error', { allowAsProps: true }],
|
|
223
|
-
'react/prop-types': 0,
|
|
224
|
-
'react/require-default-props': 0,
|
|
225
|
-
'react/function-component-definition': [
|
|
226
|
-
2,
|
|
227
|
-
{ namedComponents: 'arrow-function' },
|
|
228
|
-
],
|
|
229
|
-
'react/no-unknown-property': 1,
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
export const reactExtends = [
|
|
233
|
-
react.configs.flat.recommended,
|
|
234
|
-
jsxA11y.flatConfigs?.recommended,
|
|
235
|
-
...defaultExtends,
|
|
236
|
-
];
|
package/eslint.config.ts
DELETED
package/tsconfig.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2017",
|
|
4
|
-
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"skipLibCheck": true,
|
|
7
|
-
"strict": true,
|
|
8
|
-
"noEmit": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"module": "esnext",
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"isolatedModules": true,
|
|
14
|
-
"jsx": "react-jsx",
|
|
15
|
-
"incremental": true,
|
|
16
|
-
"plugins": [{ "name": "next" }],
|
|
17
|
-
"paths": {
|
|
18
|
-
"@/*": ["./*"]
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"include": [
|
|
22
|
-
"next-env.d.ts",
|
|
23
|
-
"**/*.ts",
|
|
24
|
-
"**/*.tsx",
|
|
25
|
-
".next/types/**/*.ts",
|
|
26
|
-
".next/dev/types/**/*.ts"
|
|
27
|
-
],
|
|
28
|
-
"exclude": ["node_modules", "dist"]
|
|
29
|
-
}
|
package/website/app/data.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export const SITE_URL = 'https://blogkit-md.santhoshsiva.dev';
|
|
2
|
-
|
|
3
|
-
export type PageMeta = {
|
|
4
|
-
title: string;
|
|
5
|
-
desc: string;
|
|
6
|
-
publishedOn: string;
|
|
7
|
-
isoDate: string;
|
|
8
|
-
keywords: string[];
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const generateMetadata = (meta: PageMeta) => ({
|
|
12
|
-
title: meta.title,
|
|
13
|
-
description: meta.desc,
|
|
14
|
-
keywords: meta.keywords,
|
|
15
|
-
authors: [{ name: 'Santhosh Siva' }],
|
|
16
|
-
alternates: {
|
|
17
|
-
canonical: `${SITE_URL}/`,
|
|
18
|
-
},
|
|
19
|
-
openGraph: {
|
|
20
|
-
title: meta.title,
|
|
21
|
-
description: meta.desc,
|
|
22
|
-
type: 'website' as const,
|
|
23
|
-
url: `${SITE_URL}/`,
|
|
24
|
-
},
|
|
25
|
-
twitter: {
|
|
26
|
-
card: 'summary_large_image' as const,
|
|
27
|
-
title: meta.title,
|
|
28
|
-
description: meta.desc,
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export const BLOGKIT_MD: PageMeta = {
|
|
33
|
-
title: 'blogkit-md — Markdown to Blog',
|
|
34
|
-
desc: 'A Next.js tool that converts standard markdown files into rendered blog posts for Blogkit.',
|
|
35
|
-
publishedOn: 'March 18, 2026',
|
|
36
|
-
isoDate: '2026-03-18',
|
|
37
|
-
keywords: [
|
|
38
|
-
'markdown',
|
|
39
|
-
'blog',
|
|
40
|
-
'next.js',
|
|
41
|
-
'blogkit',
|
|
42
|
-
'react',
|
|
43
|
-
'remark',
|
|
44
|
-
'mdast',
|
|
45
|
-
],
|
|
46
|
-
};
|
package/website/app/layout.tsx
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { Metadata } from 'next';
|
|
2
|
-
import { JetBrains_Mono, Montserrat, Rubik } from 'next/font/google';
|
|
3
|
-
|
|
4
|
-
import '@san-siva/blogkit/styles.css';
|
|
5
|
-
import '@san-siva/stylekit/styles/globals.scss';
|
|
6
|
-
import styles from '@san-siva/stylekit/styles/index.module.scss';
|
|
7
|
-
|
|
8
|
-
import { SITE_URL } from './data';
|
|
9
|
-
|
|
10
|
-
const montserrat = Montserrat({
|
|
11
|
-
subsets: ['latin'] as const,
|
|
12
|
-
weight: ['400', '500', '600', '700', '800'] as const,
|
|
13
|
-
style: ['normal', 'italic'] as const,
|
|
14
|
-
variable: '--font-montserrat',
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
const rubik = Rubik({
|
|
18
|
-
subsets: ['latin'] as const,
|
|
19
|
-
weight: ['300', '400', '500', '600', '700', '800', '900'] as const,
|
|
20
|
-
style: ['normal', 'italic'] as const,
|
|
21
|
-
variable: '--font-rubik',
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const jetbrainsMono = JetBrains_Mono({
|
|
25
|
-
subsets: ['latin'] as const,
|
|
26
|
-
weight: ['400', '500', '600', '700'] as const,
|
|
27
|
-
style: ['normal', 'italic'] as const,
|
|
28
|
-
variable: '--font-jetbrains-mono',
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const TITLE = 'blogkit-md — Markdown to Blog';
|
|
32
|
-
const DESCRIPTION =
|
|
33
|
-
'A Next.js tool that converts standard markdown files into rendered blog posts for Blogkit.';
|
|
34
|
-
|
|
35
|
-
export const metadata: Metadata = {
|
|
36
|
-
title: TITLE,
|
|
37
|
-
description: DESCRIPTION,
|
|
38
|
-
keywords: [
|
|
39
|
-
'markdown',
|
|
40
|
-
'blog',
|
|
41
|
-
'next.js',
|
|
42
|
-
'blogkit',
|
|
43
|
-
'react',
|
|
44
|
-
'mdast',
|
|
45
|
-
'remark',
|
|
46
|
-
],
|
|
47
|
-
authors: [{ name: 'Santhosh Siva' }],
|
|
48
|
-
alternates: {
|
|
49
|
-
canonical: `${SITE_URL}/`,
|
|
50
|
-
},
|
|
51
|
-
openGraph: {
|
|
52
|
-
title: TITLE,
|
|
53
|
-
description: DESCRIPTION,
|
|
54
|
-
type: 'website',
|
|
55
|
-
url: `${SITE_URL}/`,
|
|
56
|
-
},
|
|
57
|
-
twitter: {
|
|
58
|
-
card: 'summary_large_image',
|
|
59
|
-
title: TITLE,
|
|
60
|
-
description: DESCRIPTION,
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
65
|
-
return (
|
|
66
|
-
<html lang="en">
|
|
67
|
-
<body
|
|
68
|
-
className={`${montserrat.variable} ${rubik.variable} ${jetbrainsMono.variable}`}
|
|
69
|
-
>
|
|
70
|
-
<div className={styles.page}>{children}</div>
|
|
71
|
-
</body>
|
|
72
|
-
</html>
|
|
73
|
-
);
|
|
74
|
-
}
|
package/website/app/page.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { Metadata } from 'next';
|
|
2
|
-
|
|
3
|
-
import { BlogPost } from '@san-siva/blogkit-md';
|
|
4
|
-
|
|
5
|
-
import { BLOGKIT_MD, SITE_URL, generateMetadata } from './data';
|
|
6
|
-
|
|
7
|
-
export const metadata: Metadata = generateMetadata(BLOGKIT_MD);
|
|
8
|
-
|
|
9
|
-
export default function Home() {
|
|
10
|
-
return (
|
|
11
|
-
<BlogPost
|
|
12
|
-
filePath="../README.md"
|
|
13
|
-
jsonLd={{
|
|
14
|
-
'@context': 'https://schema.org',
|
|
15
|
-
'@type': 'SoftwareApplication',
|
|
16
|
-
name: BLOGKIT_MD.title,
|
|
17
|
-
description: BLOGKIT_MD.desc,
|
|
18
|
-
datePublished: BLOGKIT_MD.isoDate,
|
|
19
|
-
author: {
|
|
20
|
-
'@type': 'Person',
|
|
21
|
-
name: 'Santhosh Siva',
|
|
22
|
-
url: 'https://santhoshsiva.dev',
|
|
23
|
-
},
|
|
24
|
-
url: SITE_URL,
|
|
25
|
-
applicationCategory: 'DeveloperApplication',
|
|
26
|
-
operatingSystem: 'macOS, Linux, Windows',
|
|
27
|
-
}}
|
|
28
|
-
/>
|
|
29
|
-
);
|
|
30
|
-
}
|