Skip to content

Commit e5dd465

Browse files
committed
Extensible Parsing for user specific use case
* 41d7a4a Add @vuedoc/parser/test-utils * a09ca79 Update documentation * c74a33c Upgrade to @babel/[email protected] * dbe8856 Improve parsing of variable declarations * f105a22 Refactoring project files structure * 09b9782 Add options.resolver * f1b9b15 Add support of Vue Mixins * 00a6be3 Handle ImportDeclaration for composition fname * df51bf9 Add basic plugins system * 369f242 Use EventTarget as base class for the main VuedocParser * 2307c80 Improve documentation by adding more examples * 1fe62f6 Improve parsing performance by reducing parsers instances * f32ec52 Extensible Parsing with options.composition
1 parent 945a57f commit e5dd465

File tree

221 files changed

+16234
-5661
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+16234
-5661
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
test/MethodParser.spec.js
22
test/issues.spec.js
3+
test/fake_node_modules
34
test/examples
5+
test/fixtures
46
test/tutorial
57
sample.js
68
esm/

.eslintrc.yaml

+14-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ env:
55
parser: '@typescript-eslint/parser'
66
plugins:
77
- import
8+
- unused-imports
89
- '@typescript-eslint'
910
extends:
1011
- eslint:recommended
@@ -155,11 +156,22 @@ rules:
155156
- anonymous: never
156157
named: never
157158
asyncArrow: always
159+
unused-imports/no-unused-imports: 'error'
160+
unused-imports/no-unused-vars:
161+
- warn
162+
- vars: all
163+
varsIgnorePattern: '^_'
164+
args: after-used
165+
argsIgnorePattern: '^_'
158166
overrides:
167+
- files:
168+
- '**/*.d.ts'
169+
rules:
170+
import/extensions: 'off'
171+
max-len: 'off'
172+
unused-imports/no-unused-vars: 'off'
159173
- files:
160174
- '**/test/**'
161-
env:
162-
jest: true
163175
rules:
164176
max-len: 'off'
165177
indent: 'off'

.gitignore

+1-4
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ jspm_packages
4242
# CodeLineX
4343
.codeline/
4444

45-
# vscode
46-
.vscode/
47-
4845
# Nix
4946
.nix-node
5047

@@ -55,4 +52,4 @@ jspm_packages
5552
*.pdf
5653
*.png
5754
esm/
58-
sample.js
55+
sample.js

.gitlab-ci.yml

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
image: node:lts-alpine
22

3-
include:
4-
- template: SAST.gitlab-ci.yml
5-
63
stages:
74
- tests
85
- security
@@ -33,20 +30,16 @@ tests & coverage:
3330

3431
security audit:
3532
stage: security
36-
needs: &tests-jobs
33+
needs:
3734
- code quality
3835
- dependencies outdated
3936
- tests & coverage
4037
script:
4138
- yarn audit --level high --groups dependencies
4239

43-
sast:
44-
stage: security
45-
needs: *tests-jobs
46-
4740
pages:
4841
stage: publish
49-
needs: &security-jobs
42+
needs:
5043
- tests & coverage
5144
- security audit
5245
dependencies:
@@ -63,24 +56,29 @@ pages:
6356
name: coverage report
6457
url: https://vuedoc.gitlab.io/parser
6558

66-
build:
67-
stage: tests
59+
package:
60+
stage: publish
61+
needs:
62+
- security audit
6863
script:
6964
- yarn install
7065
- yarn build
66+
- yarn pack
7167
artifacts:
7268
paths:
7369
- ./*.tgz
7470

7571
publish:
7672
stage: publish
77-
needs: *security-jobs
73+
needs:
74+
- security audit
7875
only:
7976
- tags
8077
- triggers
8178
script:
8279
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
8380
- yarn install
81+
- yarn build
8482
- yarn publish
8583
environment:
8684
name: npm

.npmignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
src
21
test
32
coverage
43
.*

.vscode/extensions.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"fabiospampinato.vscode-todo-plus",
5+
"wayou.vscode-todo-highlight",
6+
"ZixuanChen.vitest-explorer"
7+
]
8+
}

.vscode/launch.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "pwa-node",
9+
"request": "launch",
10+
"name": "Debug Current Test File",
11+
"autoAttachChildProcesses": true,
12+
"skipFiles": [
13+
"<node_internals>/**",
14+
"**/node_modules/**",
15+
"**/coverage/**",
16+
"**/esm/**"
17+
],
18+
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
19+
"args": ["run", "${relativeFile}"],
20+
"smartStep": true,
21+
"console": "integratedTerminal"
22+
}
23+
]
24+
}

.vscode/settings.json

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"todo.file.exclude": [
3+
"**/esm/**",
4+
"**/.!(todo|todos|task|tasks)/**",
5+
"**/_output/**",
6+
"**/bower_components/**",
7+
"**/build/**",
8+
"**/dist/**",
9+
"**/venv/**",
10+
"**/node_modules/**",
11+
"**/out/**",
12+
"**/output/**",
13+
"**/release/**",
14+
"**/releases/**",
15+
"**/static/**",
16+
"**/target/**",
17+
"**/third_party/**",
18+
"**/vendor/**",
19+
"**/coverage/**"
20+
],
21+
"vitest.enable": true,
22+
"vitest.showFailMessages": true,
23+
"vitest.commandLine": "yarn test",
24+
"todo.embedded.exclude": [
25+
"**/esm/**",
26+
"**/coverage/**",
27+
"**/test/spec/issues*",
28+
"**/.*",
29+
"**/.*/**",
30+
"**/_output/**",
31+
"**/bower_components/**",
32+
"**/build/**",
33+
"**/dist/**",
34+
"**/venv/**",
35+
"**/node_modules/**",
36+
"**/out/**",
37+
"**/output/**",
38+
"**/release/**",
39+
"**/releases/**",
40+
"**/static/**",
41+
"**/target/**",
42+
"**/third_party/**",
43+
"**/vendor/**",
44+
"**/CHANGELOG",
45+
"**/CHANGELOG.*",
46+
"**/*.min.*",
47+
"**/*.map",
48+
"**/*.{3ds,3g2,3gp,7z,a,aac,adp,ai,aif,aiff,alz,ape,apk,ar,arj,asf,au,avi,bak,baml,bh,bin,bk,bmp,btif,bz2,bzip2,cab,caf,cgm,class,cmx,cpio,cr2,csv,cur,dat,dcm,deb,dex,djvu,dll,dmg,dng,doc,docm,docx,dot,dotm,dra,DS_Store,dsk,dts,dtshd,dvb,dwg,dxf,ecelp4800,ecelp7470,ecelp9600,egg,eol,eot,epub,exe,f4v,fbs,fh,fla,flac,fli,flv,fpx,fst,fvt,g3,gif,graffle,gz,gzip,h261,h263,h264,icns,ico,ief,img,ipa,iso,jar,jpeg,jpg,jpgv,jpm,jxr,key,ktx,lha,lib,lvp,lz,lzh,lzma,lzo,m3u,m4a,m4v,mar,mdi,mht,mid,midi,mj2,mka,mkv,mmr,mng,mobi,mov,movie,mp3,mp4,mp4a,mpeg,mpg,mpga,mxu,nef,npx,numbers,o,oga,ogg,ogv,otf,pages,pbm,pcx,pdb,pdf,pea,pgm,pic,png,pnm,pot,potm,potx,ppa,ppam,ppm,pps,ppsm,ppsx,ppt,pptm,pptx,psd,pya,pyc,pyo,pyv,qt,rar,ras,raw,resources,rgb,rip,rlc,rmf,rmvb,rtf,rz,s3m,s7z,scpt,sgi,shar,sil,sketch,slk,smv,so,sub,swf,tar,tbz,tbz2,tga,tgz,thmx,tif,tiff,tlz,ttc,ttf,txz,udf,uvh,uvi,uvm,uvp,uvs,uvu,viv,vob,war,wav,wax,wbmp,wdp,weba,webm,webp,whl,wim,wm,wma,wmv,wmx,woff,woff2,wvx,xbm,xif,xla,xlam,xls,xlsb,xlsm,xlsx,xlt,xltm,xltx,xm,xmind,xpi,xpm,xwd,xz,z,zip,zipx}"
49+
],
50+
"todo.embedded.providers.ag.args": "",
51+
"todo.embedded.providers.ag.regex": "(?:#|// @|//|/\\*+|<!--|--|\\* @|\\{!|\\{\\{!--|\\{\\{!) *(TODO|FIXME|FIX|BUG|UGLY|HACK|IDEA|REVIEW|DEBUG|OPTIMIZE)",
52+
"todo.embedded.providers.rg.regex": "(?:#|// @|//|/\\*+|<!--|--|\\* @|\\{!|\\{\\{!--|\\{\\{!) *(TODO|FIXME|FIX|BUG|UGLY|HACK|IDEA|REVIEW|DEBUG|OPTIMIZE)",
53+
"todo.embedded.providers.rg.args": "",
54+
"todo.embedded.provider": "javascript",
55+
"files.exclude": {
56+
"**/.directory": true,
57+
"**/esm": true,
58+
"**/node_modules": true
59+
}
60+
}

CONTRIBUTING.md

+17
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,23 @@ Therefore:
3737
would have expected.
3838
* A detailed description of the behavior that you expect.
3939

40+
## Development Setup
41+
42+
1. [Install Nix Package Manager](https://nixos.org/manual/nix/stable/installation/installing-binary.html)
43+
44+
2. [Install `direnv` with your OS package manager](https://direnv.net/docs/installation.html#from-system-packages)
45+
46+
3. [Hook it `direnv` into your shell](https://direnv.net/docs/hook.html)
47+
48+
4. At the top-level of your project run:
49+
50+
```sh
51+
direnv allow
52+
```
53+
54+
> The next time your launch your terminal and enter the top-level of your
55+
> project, `direnv` will check for changes.
56+
4057
## Contribute
4158

4259
Contributions to Vuedoc Parser are welcome. Here is how you can contribute:

0 commit comments

Comments
 (0)