@accept-md/core 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/README.md +46 -0
  2. package/package.json +3 -2
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # @accept-md/core
2
+
3
+ Core utilities for the [accept-md](https://github.com/hemanthvalsaraj/accept-md) ecosystem: Next.js route scanning, config types, and project detection. Used by the **accept-md** CLI and tooling.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @accept-md/core
9
+ # or npm install @accept-md/core
10
+ ```
11
+
12
+ ## API
13
+
14
+ ### `scanProject(projectRoot, options?)`
15
+
16
+ Scans a Next.js project and returns all routes (App Router and/or Pages Router).
17
+
18
+ ```ts
19
+ import { scanProject } from '@accept-md/core';
20
+
21
+ const { routes, routerType } = scanProject('/path/to/next-app', {
22
+ appDir: 'app', // default
23
+ pagesDir: 'pages', // default
24
+ });
25
+ // routes: ParsedRoute[]
26
+ // routerType: 'app' | 'pages' | null
27
+ ```
28
+
29
+ ### `scanAppRouter(appDir)` / `scanPagesRouter(pagesDir)`
30
+
31
+ Scan only App Router or only Pages Router directories.
32
+
33
+ ### Types
34
+
35
+ - **`ParsedRoute`** – path, segments, router type, source path
36
+ - **`RouteSegment`** – segment name, type (page, layout, etc.), dynamic type
37
+ - **`NextMarkdownConfig`** – config shape for include/exclude, cleanSelectors, cache, transformers, etc.
38
+ - **`RouterType`** – `'app' | 'pages'`
39
+
40
+ ### Config
41
+
42
+ - **`loadConfig(projectRoot)`** – loads `accept-md.config.js` (re-exported from `accept-md-runtime` for convenience; core defines the types).
43
+
44
+ ## License
45
+
46
+ MIT · [Repository](https://github.com/hemanthvalsaraj/accept-md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@accept-md/core",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,7 +23,8 @@
23
23
  }
24
24
  },
25
25
  "files": [
26
- "dist"
26
+ "dist",
27
+ "README.md"
27
28
  ],
28
29
  "dependencies": {},
29
30
  "devDependencies": {