Skip to content

Commit 7baa52c

Browse files
committed
refactor: rewrite tags and rendering system (#59)
chore: remove useless files chore: prepare new JSDoc tags chore: update example tags chore: prepare default renderer chore: replace vue tag by three tags for prop, data, and computed chore: work on default renderer chore: remove out dated tests feat: add guessRenderer feat: add config file fix(tag): use good name for vue-computed tag chore: remove require hook for vue refactor: move vue component script extractor into file feat: remove source from doclet chore: clean some deps and jest config chore(test): prepare fixtures chore: prepare renderers chore: write unit test for renderer, but I will use Cypress for that instead chore: prepare e2e tests chore: tweak travis chore: prepare cypress chore: prepare renderers for next pr fix tests chore: remove pixi renderer because template is bugged chore: try to improve tarvis speed chore: update CHANGELOG and UPGRADE chore(test): remove tests for renderers, because Cypress will test them chore: move « guessRenderer » into core folder
1 parent 3af39c8 commit 7baa52c

Some content is hidden

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

51 files changed

+1274
-792
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,3 @@ typings/
5656

5757
# dotenv environment variables file
5858
.env
59-
60-
/example/docs/
61-
coverage

.travis.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,40 @@
1+
sudo: false
2+
dist: trusty
3+
14
language: node_js
25
node_js:
3-
- "8"
4-
- "7"
56
- "6"
7+
- "8"
8+
- "9"
9+
- "10"
10+
11+
cache:
12+
yarn: true
13+
directories:
14+
- node_modules
15+
- ~/.cache
616

717
before_install:
8-
- curl -o- -L https://yarnpkg.com/install.sh | bash
9-
- export PATH="$HOME/.yarn/bin:$PATH"
18+
- npm i -g yarn
1019

1120
install:
1221
- yarn
1322
- cd example && yarn && cd ..
23+
- yarn cypress install
1424

1525
before_script:
16-
- cd example && yarn docs && cd ..
26+
- export DISPLAY=:99.0
27+
- sh -e /etc/init.d/xvfb start
28+
- cd example
29+
- yarn jsdoc -d docs -c jsdoc.json
30+
- yarn jsdoc -d docs-docstrap -c jsdoc.json -t ./node_modules/ink-docstrap/template
31+
- yarn jsdoc -d docs-minami -c jsdoc.json -t ./node_modules/minami
32+
- yarn jsdoc -d docs-tui -c jsdoc.json -t ./node_modules/tui-jsdoc-template
33+
- cd ..
1734

1835
script:
1936
- yarn lint
20-
- yarn test
37+
- yarn test -i
38+
- yarn cypress run --browser chrome --config watchForFileChanges=false
2139

2240
after_success: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,22 @@
22

33
## 2.0.0
44

5+
### Features
6+
7+
- Added `@vue-prop` tag (#59)
8+
- Added `@vue-data` tag (#59)
9+
- Added `@vue-computed` tag (#59)
10+
- Added rendering system to support more JSDoc templates (#59)
11+
512
### Removals
613

714
- Removed `followImports` config (#53)
815
- Removed configuration system (#53)
916
- Removed source transformation (Babel) (#55)
1017
- Removed Vue component script evaluation (#57)
11-
- Removed hooks listing (#59)
18+
- Removed Vue lifecycle hooks listing (#59)
19+
- Removed `@vue` tag (#59)
20+
21+
### Internals
22+
23+
- Use [Cypress](https://cypress.io) for E2E testing (#59)

UPGRADE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,27 @@ because it is not used anymore.
3131
}
3232
}
3333
```
34+
35+
### Usage
36+
37+
You SHOULD NOT use `@vue` tag anymore.
38+
39+
Instead, you should use `@vue-prop`, `@vue-data`, and `@vue-computed` like this:
40+
41+
```vue
42+
<template>
43+
<div>Hello world</div>
44+
</template>
45+
46+
<script>
47+
/**
48+
* @vue-prop {Number} initialCounter
49+
* @vue-prop {Number} [step=1] Step
50+
* @vue-data {Number} counter - Current counter's value
51+
* @vue-computed {String} message A message
52+
*/
53+
export default {
54+
// ...
55+
}
56+
</script>
57+
```

__tests__/__snapshots__/docletHandlers.test.js.snap

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<template>
2+
<div>Hello world</div>
3+
</template>
4+
5+
<script>
6+
/**
7+
* @vue-data {String} [foo=bar] Foo description
8+
*/
9+
export default {
10+
name: 'Component',
11+
data() {
12+
return {
13+
foo: 'bar'
14+
}
15+
}
16+
}
17+
</script>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`core.extractVueScript extract script 1`] = `
4+
"
5+
/**
6+
* @vue-data {String} [foo=bar] Foo description
7+
*/
8+
export default {
9+
name: 'Component',
10+
data() {
11+
return {
12+
foo: 'bar'
13+
}
14+
}
15+
}
16+
"
17+
`;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const path = require('path')
2+
const extractVueScript = require('../../lib/core/vueScriptExtractor')
3+
4+
describe('core.extractVueScript', () => {
5+
const filename = path.join(__dirname, '__fixtures__', 'Component.vue')
6+
7+
test('extract script', () => {
8+
expect(extractVueScript(filename)).toMatchSnapshot()
9+
})
10+
})

__tests__/docletHandlers.test.js

Lines changed: 0 additions & 128 deletions
This file was deleted.

0 commit comments

Comments
 (0)