@mdream/action 2.0.0-beta.1 → 2.0.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.
Files changed (3) hide show
  1. package/README.md +71 -38
  2. package/dist/index.js +1 -1
  3. package/package.json +13 -3
package/README.md CHANGED
@@ -2,17 +2,36 @@
2
2
 
3
3
  GitHub Action that processes prerendered HTML files into `llms.txt` artifacts for CI/CD workflows.
4
4
 
5
+ ## Migrating from v1
6
+
7
+ The repository no longer provides `action.yml`.
8
+ Replace `uses: harlan-zw/mdream@...` with the [npm step](#setup) below.
9
+ Set up Node.js 24, then run the step after your site build.
10
+ Keep the step's `id` so later `steps.<id>.outputs` references still work.
11
+ Move each `with` input to an `INPUT_` environment variable.
12
+ For example, `site-name` becomes `INPUT_SITE-NAME`.
13
+ Remove `chunk-size` or `INPUT_CHUNK-SIZE`; it had no effect.
14
+ The [output names](#outputs) remain the same.
15
+
16
+ These docs cover v2.
17
+ For an earlier release, read the README at its release tag.
18
+
5
19
  ## Setup
6
20
 
7
- Add the action to any workflow step after your site build completes. Requires Node.js to be available in the runner environment.
21
+ Run the v2 package after your site build completes. Use Node.js 24 on the runner.
22
+ These examples run the npm distribution directly with `@mdream/action`.
23
+ Inputs use `INPUT_` environment variables. Output names stay the same.
8
24
 
9
25
  ```yaml
10
- - uses: harlan-zw/mdream@v1
11
- with:
12
- glob: 'dist/**/*.html'
13
- site-name: My Documentation
14
- description: Technical documentation and guides
15
- origin: 'https://mydocs.com'
26
+ - name: Generate llms.txt artifacts
27
+ run: |
28
+ npm install --prefix "$RUNNER_TEMP/mdream-action" @mdream/action
29
+ node "$RUNNER_TEMP/mdream-action/node_modules/@mdream/action/dist/index.js"
30
+ env:
31
+ INPUT_GLOB: 'dist/**/*.html'
32
+ INPUT_SITE-NAME: My Documentation
33
+ INPUT_DESCRIPTION: Technical documentation and guides
34
+ INPUT_ORIGIN: 'https://mydocs.com'
16
35
  ```
17
36
 
18
37
  ## Usage
@@ -21,12 +40,14 @@ Add the action to any workflow step after your site build completes. Requires No
21
40
 
22
41
  ```yaml
23
42
  - name: Generate llms.txt artifacts
24
- uses: harlan-zw/mdream@v1
25
- with:
26
- glob: 'dist/**/*.html'
27
- site-name: My Documentation
28
- description: Technical documentation and guides
29
- origin: 'https://mydocs.com'
43
+ run: |
44
+ npm install --prefix "$RUNNER_TEMP/mdream-action" @mdream/action
45
+ node "$RUNNER_TEMP/mdream-action/node_modules/@mdream/action/dist/index.js"
46
+ env:
47
+ INPUT_GLOB: 'dist/**/*.html'
48
+ INPUT_SITE-NAME: My Documentation
49
+ INPUT_DESCRIPTION: Technical documentation and guides
50
+ INPUT_ORIGIN: 'https://mydocs.com'
30
51
  ```
31
52
 
32
53
  Generates `llms.txt`, `llms-full.txt`, and a `md/` directory in the current working directory.
@@ -45,10 +66,14 @@ on:
45
66
  jobs:
46
67
  generate-llms-txt:
47
68
  runs-on: ubuntu-latest
69
+ permissions:
70
+ contents: write
48
71
 
49
72
  steps:
50
73
  - name: Checkout repository
51
74
  uses: actions/checkout@v4
75
+ with:
76
+ persist-credentials: false
52
77
 
53
78
  - name: Setup Node.js
54
79
  uses: actions/setup-node@v4
@@ -63,13 +88,15 @@ jobs:
63
88
 
64
89
  - name: Generate llms.txt artifacts
65
90
  id: llms
66
- uses: harlan-zw/mdream@v1
67
- with:
68
- glob: 'dist/**/*.html'
69
- site-name: My Documentation
70
- description: Technical documentation and guides
71
- origin: 'https://mydocs.com'
72
- output: dist
91
+ run: |
92
+ npm install --prefix "$RUNNER_TEMP/mdream-action" @mdream/action
93
+ node "$RUNNER_TEMP/mdream-action/node_modules/@mdream/action/dist/index.js"
94
+ env:
95
+ INPUT_GLOB: 'dist/**/*.html'
96
+ INPUT_SITE-NAME: My Documentation
97
+ INPUT_DESCRIPTION: Technical documentation and guides
98
+ INPUT_ORIGIN: 'https://mydocs.com'
99
+ INPUT_OUTPUT: dist
73
100
 
74
101
  - name: Upload llms.txt artifacts
75
102
  uses: actions/upload-artifact@v4
@@ -90,18 +117,20 @@ jobs:
90
117
 
91
118
  ### Using Outputs
92
119
 
93
- Reference the action outputs in subsequent steps:
120
+ Use the action outputs in later steps:
94
121
 
95
122
  ```yaml
96
123
  - name: Generate llms.txt artifacts
97
124
  id: llms
98
- uses: harlan-zw/mdream@v1
99
- with:
100
- glob: 'dist/**/*.html'
101
- site-name: My Docs
102
- description: My documentation site
103
- origin: 'https://mydocs.com'
104
- output: dist
125
+ run: |
126
+ npm install --prefix "$RUNNER_TEMP/mdream-action" @mdream/action
127
+ node "$RUNNER_TEMP/mdream-action/node_modules/@mdream/action/dist/index.js"
128
+ env:
129
+ INPUT_GLOB: 'dist/**/*.html'
130
+ INPUT_SITE-NAME: My Docs
131
+ INPUT_DESCRIPTION: My documentation site
132
+ INPUT_ORIGIN: 'https://mydocs.com'
133
+ INPUT_OUTPUT: dist
105
134
 
106
135
  - name: Print generated file paths
107
136
  run: |
@@ -114,13 +143,15 @@ Reference the action outputs in subsequent steps:
114
143
 
115
144
  ```yaml
116
145
  - name: Generate llms.txt artifacts
117
- uses: harlan-zw/mdream@v1
118
- with:
119
- glob: 'dist/**/*.html'
120
- site-name: My Docs
121
- description: My documentation site
122
- origin: 'https://mydocs.com'
123
- verbose: 'true'
146
+ run: |
147
+ npm install --prefix "$RUNNER_TEMP/mdream-action" @mdream/action
148
+ node "$RUNNER_TEMP/mdream-action/node_modules/@mdream/action/dist/index.js"
149
+ env:
150
+ INPUT_GLOB: 'dist/**/*.html'
151
+ INPUT_SITE-NAME: My Docs
152
+ INPUT_DESCRIPTION: My documentation site
153
+ INPUT_ORIGIN: 'https://mydocs.com'
154
+ INPUT_VERBOSE: 'true'
124
155
  ```
125
156
 
126
157
  ## API Reference
@@ -134,7 +165,6 @@ Reference the action outputs in subsequent steps:
134
165
  | `description` | Yes | | Description of your site content. Rendered as a blockquote below the site name. |
135
166
  | `origin` | Yes | | Base URL of your site (e.g., `https://mysite.com`). Used to construct full page URLs. |
136
167
  | `output` | No | `.` | Output directory for generated files. Created recursively if it does not exist. |
137
- | `chunk-size` | No | `4096` | Chunk size for streaming processing. |
138
168
  | `verbose` | No | `false` | Enable verbose logging. Prints configuration values to the action log. |
139
169
 
140
170
  ### Outputs
@@ -164,7 +194,9 @@ HTML file paths are converted to URL paths automatically:
164
194
  | `dist/docs/getting-started.html` | `/docs/getting-started` |
165
195
  | `dist/blog/2024/post.html` | `/blog/2024/post` |
166
196
 
167
- The `.html` extension is stripped. `index.html` files resolve to their parent directory path. The `origin` input is prepended to construct full URLs in the output.
197
+ The action removes the `.html` extension.
198
+ It maps `index.html` files to their parent directory path.
199
+ It adds the `origin` input before each path to form a full URL.
168
200
 
169
201
  ### Metadata Extraction
170
202
 
@@ -173,7 +205,8 @@ Metadata is extracted from each HTML file in the following priority order:
173
205
  **Title:** `<title>` tag, then `<meta property="og:title">`.
174
206
  **Description:** `<meta name="description">`, then `<meta property="og:description">`.
175
207
 
176
- Descriptions are truncated to 100 characters in the `llms.txt` listing. Full metadata is embedded as YAML frontmatter in `llms-full.txt`.
208
+ The `llms.txt` listing limits descriptions to 100 characters.
209
+ The `llms-full.txt` file includes full metadata as YAML frontmatter.
177
210
 
178
211
  ## License
179
212