Skip to content

Commit e3555d1

Browse files
Initial commit
0 parents  commit e3555d1

File tree

22 files changed

+7556
-0
lines changed

22 files changed

+7556
-0
lines changed

.eslintrc.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"browser": true,
5+
"es2021": true
6+
},
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:eslint-plugin/recommended",
10+
"plugin:import/recommended"
11+
],
12+
"globals": {
13+
"Atomics": "readonly",
14+
"SharedArrayBuffer": "readonly"
15+
},
16+
"parserOptions": {
17+
"ecmaVersion": 12,
18+
"sourceType": "module"
19+
},
20+
"plugins": [
21+
"eslint-plugin",
22+
"import"
23+
],
24+
"extends": [
25+
"eslint:recommended",
26+
"plugin:eslint-plugin/recommended",
27+
"plugin:import/recommended"
28+
],
29+
"rules": {
30+
"comma-style": [1, "last"],
31+
"curly": [1, "multi-line"],
32+
"eol-last": [1, "always"],
33+
"eqeqeq": [1, "allow-null"],
34+
"func-call-spacing": 1,
35+
"no-unused-vars": 1,
36+
"indent": ["warn", "tab"],
37+
"max-len": [1, 99, 2],
38+
"no-cond-assign": [1, "always"],
39+
"no-return-assign": [1, "always"],
40+
"no-shadow": 1,
41+
"no-var": 1,
42+
"object-curly-spacing": [1, "always"],
43+
"one-var": [1, "never"],
44+
"prefer-const": 2,
45+
"quotes": [1, "double", {
46+
"allowTemplateLiterals": true,
47+
"avoidEscape": true
48+
}],
49+
"semi": [1, "never"],
50+
"eslint-plugin/consistent-output": [
51+
"warn",
52+
"always"
53+
],
54+
"eslint-plugin/meta-property-ordering": "warn",
55+
"eslint-plugin/no-deprecated-context-methods": "warn",
56+
"eslint-plugin/no-deprecated-report-api": "off",
57+
"eslint-plugin/prefer-replace-text": "warn",
58+
"eslint-plugin/report-message-format": "warn",
59+
"eslint-plugin/require-meta-schema": "warn",
60+
"eslint-plugin/require-meta-type": "warn",
61+
"import/no-extraneous-dependencies": "warn",
62+
"import/unambiguous": "off"
63+
}
64+
}

.github/workflows/docs.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Generate docs and push to another branch
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
name: Generate docs and Push
11+
steps:
12+
- name: git-checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Install all dependencies
16+
run: npm install
17+
18+
- name: Build
19+
run: npm run generate-docs # The build command of your project
20+
21+
- name: Push
22+
uses: s0/git-publish-subdir-action@develop
23+
env:
24+
REPO: self
25+
BRANCH: docs # The branch name where you want to push the assets
26+
FOLDER: docs # The directory where your assets are generated
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub will automatically add this - you don't need to bother getting a token

.github/workflows/publish.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: git-checkout
12+
uses: actions/checkout@v2
13+
14+
- name: Install all dependencies
15+
run: npm install
16+
17+
- name: Test
18+
run: npm test
19+
20+
- uses: JS-DevTools/npm-publish@v1
21+
with:
22+
token: ${{ secrets.NPM_TOKEN }}
23+
access: public

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "tagged-release"
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
tagged-release:
10+
name: "Tagged Release"
11+
runs-on: "ubuntu-latest"
12+
13+
steps:
14+
- name: git-checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Install all dependencies
18+
run: npm install
19+
20+
- name: Test
21+
run: npm test
22+
23+
- uses: "marvinpinto/action-automatic-releases@latest"
24+
with:
25+
repo_token: "${{ secrets.PAT_TOKEN }}"
26+
prerelease: false

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

.jsdoc.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"tags": {
3+
"allowUnknownTags": true,
4+
"dictionaries": ["jsdoc"]
5+
},
6+
"source": {
7+
"include": ["src", "README.md"],
8+
"includePattern": ".js$",
9+
"excludePattern": "(node_modules/|docs)"
10+
},
11+
"sourceType": "module",
12+
"plugins": [
13+
"plugins/markdown"
14+
],
15+
"templates": {
16+
"cleverLinks": false,
17+
"monospaceLinks": true,
18+
"useLongnameInNav": false,
19+
"showInheritedInNav": true
20+
},
21+
"markdown": {
22+
"idInHeadings": true
23+
},
24+
"opts": {
25+
"destination": "./docs/",
26+
"encoding": "utf8",
27+
"private": true,
28+
"recurse": true,
29+
"template": "./node_modules/docdash"
30+
},
31+
"docdash": {
32+
"sort": false,
33+
"search": true
34+
}
35+
}

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
language: node_js
2+
node_js:
3+
- node

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2019, Romain Lebesle <oss@thoughtsunificator.me> (https://thoughtsunificator.me)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included
12+
in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# message-parser
2+
3+
Enables sorting and grouping of users and channel mentions in a message.
4+
5+
## Getting started
6+
7+
### Installing
8+
9+
- ``npm install @thoughtsunificator/message-parser``
10+
11+
### Usage
12+
13+
```javascript
14+
15+
16+
```

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export { default as Parser } from "./src/parser.js"
2+
export { default as Tokenizer } from "./src/tokenizer.js"
3+
export { default as Token } from "./src/token.js"
4+
export { default as Message } from "./src/message.js"
5+
export { default as Fragment } from "./src/message/fragment.js"

0 commit comments

Comments
 (0)