Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedriad1 committed Feb 21, 2024
0 parents commit aa05517
Show file tree
Hide file tree
Showing 25 changed files with 2,978 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:prettier/recommended"
],
"plugins": ["@typescript-eslint", "prettier"],
"rules": {
"prettier/prettier": [
"error",
{},
{
"usePrettierrc": true
}
]
},
"env": {
"es6": true
},
"parserOptions": {
"ecmaVersion": 2017
}
}
61 changes: 61 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on: [push]

env:
HUSKY: 0

jobs:
build:
if: github.repository == 'seemorg/markdown-parser' && (github.ref == 'refs/heads/master') && github.event_name != 'pull_request'
name: ⚒️ Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}

runs-on: ubuntu-latest
strategy:
matrix:
node: ['16.x', '18.x']

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

- name: Lint
run: yarn lint --quiet

- name: Test
run: yarn test:coverage

- name: Build
run: yarn build

test-and-publish:
name: 🎉 Publish to NPM
needs: [build]
if: github.repository == 'seemorg/markdown-parser' && (github.ref == 'refs/heads/master') && github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: 18
registry-url: https://registry.npmjs.org/

- name: Install deps (with cache)
uses: bahmutov/npm-install@v1

- name: Build
run: yarn build

- run: npx semantic-release@17
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: PR

on: [pull_request]

env:
HUSKY: 0

jobs:
build:
name: ⚒️ Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}

runs-on: ubuntu-latest
strategy:
matrix:
node: ['16.x', '18.x']

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

- name: Lint
run: yarn lint --quiet

- name: Test
run: yarn test:coverage

- name: Build
run: yarn build

size:
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v1
- uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.log
.DS_Store
node_modules
dist
coverage
.husky
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"endOfLine": "auto",
"printWidth": 80,
"semi": true,
"singleQuote": true,
"trailingComma": "es5"
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Digitalseem

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# OpenITI mARkdown Parser

A library for parsing OpenITI special [mARkdown](https://maximromanov.github.io/mARkdown/) syntax into friendly JSON format.

[![Build Status][build-badge]][build]
[![MIT License][license-badge]][license]
[![NPM Version][npm-badge]][npm]
[![Minziped Size][size-badge]][npm]
[![NPM Monthly downloads][downloads-badge]][npm]

## Installation

using npm:

```ssh
npm install @openiti/markdown-parser
```

using yarn:

```ssh
yarn add @openiti/markdown-parser
```

## Getting Started

You can use the library in your project like this:

```js
import { parseMarkdown } from '@openiti/markdown-parser';

const markdown = `
// ...
`;

const parsed = parseMarkdown(markdown);
console.log(parsed);
```

<!-- Links -->

[build-badge]: https://github.com/seemorg/markdown-parser/workflows/CI/badge.svg
[build]: https://github.com/seemorg/markdown-parser/actions?query=workflow%3ACI
[license-badge]: https://badgen.net/github/license/openiti/markdown-parser
[license]: https://github.com/seemorg/markdown-parser/blob/master/LICENSE
[npm]: https://www.npmjs.com/package/@openiti/markdown-parser
[npm-badge]: https://badgen.net/npm/v/@openiti/markdown-parser
[downloads-badge]: https://img.shields.io/npm/dm/@openiti/markdown-parser.svg
[size-badge]: https://badgen.net/packagephobia/publish/@openiti/markdown-parser
58 changes: 58 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "@openiti/markdown-parser",
"description": "A library for parsing OpenITI's mARkdown syntax",
"publishConfig": {
"access": "public"
},
"version": "1.0.0",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"module": "dist/index.mjs",
"files": [
"dist"
],
"scripts": {
"start": "tsup --watch",
"build": "tsup",
"test": "vitest run",
"test:dev": "vitest",
"test:coverage": "vitest run --coverage",
"lint": "eslint src/** test/**",
"prepare": "husky install",
"size": "size-limit",
"analyze": "size-limit --why"
},
"dependencies": {},
"devDependencies": {
"cross-fetch": "^3.1.5",
"@size-limit/preset-small-lib": "^7.0.8",
"@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0",
"@vitest/coverage-c8": "^0.24.4",
"eslint": "^8.26.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^7.0.4",
"prettier": "^2.7.1",
"rollup-plugin-analyzer": "^4.0.0",
"size-limit": "^7.0.8",
"tslib": "^2.3.1",
"tsup": "^6.3.0",
"typescript": "^4.6.2",
"vitest": "^0.24.4"
},
"size-limit": [
{
"path": "dist/index.js",
"limit": "15 KB"
},
{
"path": "dist/index.mjs",
"limit": "15 KB"
}
],
"engines": {
"node": ">=12"
}
}
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './parser';
export * from './types';
Loading

0 comments on commit aa05517

Please sign in to comment.