Skip to content

Commit

Permalink
Update latest rollup version to 2 (#9)
Browse files Browse the repository at this point in the history
* update latest rollup version to 2

* drop support for node.js v8
  • Loading branch information
h-ikeda authored Aug 28, 2020
1 parent 042a6f6 commit 43a48d0
Show file tree
Hide file tree
Showing 7 changed files with 2,044 additions and 2,149 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
node-version: [10.x, 12.x, 14.x]

steps:
- uses: actions/checkout@v1
Expand Down
4,046 changes: 1,949 additions & 2,097 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rollup-plugin-vuedoc",
"version": "0.3.0",
"version": "0.4.0",
"description": "Rollup plugin to generate markdown documentation from Vue.js component source with @vuedoc/md.",
"main": "src/index.js",
"directories": {
Expand Down Expand Up @@ -30,14 +30,14 @@
},
"homepage": "https://github.com/h-ikeda/rollup-plugin-vuedoc#readme",
"devDependencies": {
"jest": "^24.9.0",
"rollup": "^1.19.2",
"jest": "^26.4.2",
"rollup": "^2.26.6",
"rollup-1.19.2": "npm:rollup@1.19.2"
},
"dependencies": {
"@vuedoc/md": "^1.6.0"
},
"peerDependencies": {
"rollup": "^1.19.2"
"rollup": ">= 1.19.2"
}
}
13 changes: 12 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,18 @@ module.exports = function vuedoc(options = {}) {
return {
name: 'vuedoc',
async buildStart({ input }) {
this.vuedocInput = dirname(resolve(input));
if (Array.isArray(input) && input.length > 1) {
const chars = [];
for (let i = input[0].length - 1; i >= 0; --i) {
chars.unshift(input.map((pinput) => pinput.slice(i, i + 1)));
}
this.vuedocInput = resolve(chars
.filter((pchars) => pchars.every((pchar) => (pchar === pchars[0])))
.map(([pchar]) => pchar)
.join(''));
} else {
this.vuedocInput = dirname(resolve(Array.isArray(input) && input[0] || input));
}
this.vuedocIndices = [];
},
async transform(code, id) {
Expand Down
4 changes: 3 additions & 1 deletion test/latest.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const { rollup } = require('rollup');
const tests = require('./tests');

describe('rollup-plugin-vuedoc with latest rollup', tests(rollup));
describe('rollup-plugin-vuedoc with latest rollup', tests(rollup, {
assetObject: () => expect.objectContaining({ type: 'asset' }),
}));
4 changes: 3 additions & 1 deletion test/legacy.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const { rollup } = require('rollup-1.19.2');
const tests = require('./tests');

describe('rollup-plugin-vuedoc with legacy rollup (v1.19.2)', tests(rollup));
describe('rollup-plugin-vuedoc with legacy rollup (v1.19.2)', tests(rollup, {
assetObject: () => expect.objectContaining({ isAsset: true }),
}));
Loading

0 comments on commit 43a48d0

Please sign in to comment.