Skip to content

Commit

Permalink
Upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekaterina Mulyukina committed Oct 25, 2024
1 parent 7b7d0ff commit c4ce516
Show file tree
Hide file tree
Showing 5 changed files with 1,132 additions and 564 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v1
Expand All @@ -22,8 +22,8 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm install
npm run test
yarn install
yarn test
env:
CI: true

Expand All @@ -32,7 +32,7 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x]
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v1
Expand All @@ -42,7 +42,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm install
npm run test
yarn install
yarn test
env:
CI: true
20 changes: 12 additions & 8 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,22 @@ const getCommentFromSourceCode = (node, sourceCode, {
let lastComment = null;

if (node) {
const comments = sourceCode.getComments(node);
if (useLeading) {
const leadingComments = sourceCode.getCommentsBefore(node);
if (leadingComments && leadingComments.length > 0) {
const leadingCommentIndex = useFirst ? 0 : leadingComments.length - 1;

if (useLeading && comments.leading && comments.leading.length > 0) {
const leadingCommentIndex = useFirst ? 0 : comments.leading.length - 1;

lastComment = comments.leading[leadingCommentIndex].value;
lastComment = leadingComments[leadingCommentIndex].value;
}
}

if (useTrailing && comments.trailing && comments.trailing.length > 0) {
const trailingCommentIndex = useFirst ? 0 : comments.trailing.length - 1;
if (useTrailing) {
const trailingComments = sourceCode.getCommentsAfter(node);
if (trailingComments && trailingComments.length > 0) {
const trailingCommentIndex = useFirst ? 0 : trailingComments.length - 1;

lastComment = comments.trailing[trailingCommentIndex].value;
lastComment = trailingComments[trailingCommentIndex].value;
}
}
}

Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "sveltedoc-parser",
"version": "4.4.0",
"version": "5.0.0",
"description": "Generate a JSON documentation for a Svelte file",
"main": "index.js",
"types": "./typings.d.ts",
"scripts": {
"lint": "eslint ./**/*.js",
"test": "mocha ./test/**/*.spec.js",
"prepublishOnly": "npm run test && npm run lint",
"prepublishOnly": "yarn test && yarn lint",
"test:unit": "mocha ./test/unit/**/*.spec.js",
"test:integration": "mocha ./test/**/integration/**/*.spec.js",
"test:integration-overall": "mocha ./test/**/integration/overall/overall.main.spec.js",
Expand All @@ -21,7 +21,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/alexprey/sveltedoc-parser.git"
"url": "git+https://github.com/KatChaotic/sveltedoc-parser.git"
},
"keywords": [
"sveltedoc",
Expand All @@ -31,29 +31,29 @@
"parser",
"jsdoc"
],
"author": "Alexey Mulyukin",
"author": "Ekaterina Mulyukina",
"license": "MIT",
"bugs": {
"url": "https://github.com/alexprey/sveltedoc-parser/issues"
},
"homepage": "https://github.com/alexprey/sveltedoc-parser",
"dependencies": {
"espree": "9.2.0",
"eslint": "8.4.1",
"eslint": "^9.13.0",
"espree": "10.2.0",
"htmlparser2-svelte": "4.1.0"
},
"devDependencies": {
"chai": "4.1.2",
"chai": "^4.0.0",
"dirty-chai": "2.0.1",
"eslint": "8.4.1",
"eslint-plugin-chai-expect": "3.0.0",
"eslint-plugin-import": "2.25.3",
"eslint": "^9.13.0",
"eslint-plugin-chai-expect": "3.1.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.2.0",
"mocha": "9.1.3",
"glob": "7.2.0"
"eslint-plugin-promise": "7.1.0",
"glob": "^9.0.0",
"mocha": "10.7.3"
},
"engines": {
"node": ">=10.0.0"
"node": ">=18.0.0"
}
}
6 changes: 3 additions & 3 deletions test/svelte3/integration/slots/slots.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ describe('SvelteDoc v3 - Slots', () => {
text: 'string'
});

// TODO: 5.* | Backward compatibility test
if (packageConfig.version.startsWith('5.')) {
// TODO: 6.* | Backward compatibility test
if (packageConfig.version.startsWith('6.')) {
expect(slot.parameters, 'parameters field should be removed').undefined;
} else {
expect(slot.parameters, 'Should be backward compatable until 5.* version').to.deep.eq(slot.params);
expect(slot.parameters, 'Should be backward compatable until 6.* version').to.deep.eq(slot.params);
}

done();
Expand Down
Loading

0 comments on commit c4ce516

Please sign in to comment.