Skip to content

Commit 21d71fd

Browse files
authored
feat/rollup-config (#7)
* chore(linter): update romejs to biomejs * cicd(release): add semantic-release * chore(linter): update rules * docs(readme): update readme * chore(git): update gitignore * chore(package): remove shebangify * chore(package): update gitignore and package.json * chore(package): remove dep from package.json in cli * chore(rollup): implement rollup * chore(rollup): update rollup impl * fix: bundle everything together
1 parent b983780 commit 21d71fd

18 files changed

+944
-168
lines changed

.github/workflows/node.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,8 @@ jobs:
3030
- name: Install dependencies
3131
run: npm ci
3232

33-
# need to build library first
34-
- name: Build Lib project
35-
run: npm run build:libInternal && npm run build:lib
36-
37-
- name: Build CLI project
38-
run: npm run build:cli
33+
- name: Build all
34+
run: npm run build:all
3935

4036
- name: Run Library tests
4137
run: npm run test:lib
@@ -50,15 +46,15 @@ jobs:
5046
package.lock.json
5147
package.json
5248
53-
- name: Publish Library to NPM (dry run)
54-
# Only run if the commit is tagged with release/v<version>
55-
env:
56-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
57-
run: npm set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN && npm publish --dry-run
49+
# - name: Publish Library to NPM (dry run)
50+
# # Only run if the commit is tagged with v<version>
51+
# env:
52+
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
53+
# run: npm set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN && npm publish --dry-run
5854

59-
- name: Publish Library to NPM
60-
# Only run if the commit is tagged with release/v<version>
61-
if: startsWith(github.ref, 'refs/tags/release/v')
62-
env:
63-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
64-
run: npm set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN && npm publish
55+
# - name: Publish Library to NPM
56+
# # Only run if the commit is tagged with release/v<version>
57+
# if: startsWith(github.ref, 'refs/tags/v')
58+
# env:
59+
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
60+
# run: npm set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN && npm publish

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Semantic Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' # make sure it only run on main
12+
permissions:
13+
contents: write # to be able to publish a GitHub release
14+
issues: write # to be able to comment on released issues
15+
pull-requests: write # to be able to comment on released pull requests
16+
id-token: write # to enable use of OIDC for npm provenance
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
- name: Install dependencies
26+
run: npm install -g semantic-release @semantic-release/git @semantic-release/changelog @semantic-release/exec @semantic-release/npm
27+
- name: Release
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
run: npx semantic-release

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
dist
2-
node_modules
2+
node_modules
3+
packages/cli/dist
4+
packages/lib/dist
5+
packages/lib/.rollup.cache

.releaserc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/github",
7+
"@semantic-release/npm"
8+
]
9+
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ Options:
3131
import { MarkdownTable2Json, JsonLayout } from 'mdt2json';
3232

3333
const markdownString = `your_markdown_string_here`;
34-
const transpiler = new MarkdownTable2Json({markdownString, layout: JsonLayout.AoS , minify: true });
34+
const transpiler = new MarkdownTable2Json({markdownString, layout: JsonLayout.AoS , minify: true });
3535
console.log(transpiler.transform());
3636
```
3737

3838
## Use Cases
3939
- Converting markdown tables to JSON for use in your web application
40-
- Improve token efficiency of your markdown files for use in retrieval augmented generation (RAG) architecure with LLMs (Large Language Models) such as GPT-3
40+
- Improve token efficiency of your markdown files for use in retrieval augmented generation (RAG) architecture with LLMs (Large Language Models) such as GPT-3
4141

4242
## Library Internals
4343
This library works by parsing the markdown and getting the AST (Abstract Syntax Tree) of the markdown file. The AST is then traversed to find the tables in the markdown file. Once the tables are found, the tables are converted to JSON and returned.

rome.json renamed to biome.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://docs.rome.tools/schemas/12.1.0/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/1.7.0/schema.json",
33
"organizeImports": {
44
"enabled": false
55
},
@@ -19,7 +19,7 @@
1919
"enabled": true,
2020
"formatWithErrors": false,
2121
"indentStyle": "tab",
22-
"indentSize": 4,
22+
"indentWidth": 4,
2323
"lineWidth": 120,
2424
"ignore": []
2525
}

0 commit comments

Comments
 (0)