diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4c8ef36..551de8c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,14 +63,12 @@ jobs: env: DEBUG: "npm-groovy-lint" run: npm run test:coverage - - name: Build coverage report - run: ./node_modules/.bin/nyc report --reporter text-lcov > coverage.lcov - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: true - file: coverage.lcov - flags: unittests - verbose: true - dry_run: true - token: ${{ secrets.CODECOV_TOKEN }} # required + + # - name: Build coverage report + # run: ./node_modules/.bin/nyc report --reporter text-lcov > coverage.lcov + # - name: Upload coverage to Codecov + # uses: codecov/codecov-action@v4 + # with: + # fail_ci_if_error: true + # verbose: true + # token: ${{ secrets.CODECOV_TOKEN }} # required diff --git a/.mega-linter.yml b/.mega-linter.yml index c2309815..26fac604 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -10,6 +10,7 @@ JAVASCRIPT_DEFAULT_STYLE: prettier DISABLE_LINTERS: - JAVASCRIPT_STANDARD - MARKDOWN_MARKDOWN_LINK_CHECK + - TYPESCRIPT_STANDARD DISABLE_ERRORS_LINTERS: - REPOSITORY_SEMGREP FLAVOR_SUGGESTIONS: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 03250eef..a672c828 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,13 @@ ## Beta -## [15.0.0] 2024-26-08 +## [15.0.1] 2024-08-29 + +- Add module declaration +- Fix crash in case of parsing error (https://github.com/nvuillam/npm-groovy-lint/issues/406) +- Disable codecov + +## [15.0.0] 2024-08-26 - Convert to [ES Module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) - Upgrade to CodeNarc 3.5.0 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 03250eef..a672c828 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,7 +2,13 @@ ## Beta -## [15.0.0] 2024-26-08 +## [15.0.1] 2024-08-29 + +- Add module declaration +- Fix crash in case of parsing error (https://github.com/nvuillam/npm-groovy-lint/issues/406) +- Disable codecov + +## [15.0.0] 2024-08-26 - Convert to [ES Module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) - Upgrade to CodeNarc 3.5.0 diff --git a/eslint.config.mjs b/eslint.config.mjs index 1563b6ab..7c48fc3b 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -32,7 +32,7 @@ export default [...compat.extends("eslint:recommended"), { }, parser: babelParser, - ecmaVersion: 2018, + ecmaVersion: 2020, sourceType: "module", parserOptions: { diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 00000000..466feba9 --- /dev/null +++ b/index.d.ts @@ -0,0 +1 @@ +declare module "npm-groovy-lint"; \ No newline at end of file diff --git a/lib/java/CodeNarcServer.jar b/lib/java/CodeNarcServer.jar index 15575f5a..dc7424fb 100644 Binary files a/lib/java/CodeNarcServer.jar and b/lib/java/CodeNarcServer.jar differ diff --git a/package.json b/package.json index f19273b0..d025b628 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,10 @@ "name": "npm-groovy-lint", "version": "15.0.0", "description": "Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files", - "exports": "./index.js", + "exports": "./lib/groovy-lint.js", "type": "module", "scripts": { - "lint:fix": "eslint **/*.js --fix && prettier --write \"./lib/**/*.{js,jsx}\" --tab-width 4 --print-width 150", + "lint:fix": "eslint **/*.{js,mjs} --fix && prettier --write \"./lib/**/*.{js,jsx,mjs}\" --tab-width 4 --print-width 150", "server:run-from-source": "npm run server:kill && groovy -cp \"lib/java/*\" groovy/src/main/com/nvuillam/CodeNarcServer.groovy --server", "server:run": "npm run server:kill && java -Xms256m -Xmx2048m -jar lib/java/CodeNarcServer.jar --server", "server:build": "node scripts/build-server.js", @@ -41,6 +41,7 @@ }, "homepage": "https://github.com/nvuillam/npm-groovy-lint#readme", "files": [ + "index.d.ts", "lib" ], "bin": { diff --git a/scripts/deploy-in-vscode.js b/scripts/deploy-in-vscode.js index c5d9fdd6..197ee2f2 100644 --- a/scripts/deploy-in-vscode.js +++ b/scripts/deploy-in-vscode.js @@ -2,9 +2,8 @@ // Copy source files into vscode npm installation (avoid generate betas to test updates) // npm-groovy-lint & vscode-groovy-lint must be in the same folder, else you have to override VSCODE_GROOVY_LINT_PATH env variable - // Imports -import { existsSync, emptyDirSync, mkdirSync, copySync } from 'fs-extra'; +import fs from 'fs-extra'; console.log('---- START DEPLOY IN VSCODE INSTALLED npm-groovy-lint PACKAGE ----'); @@ -15,16 +14,16 @@ const targetPath = `${vsCodeGroovyLintPath}/server/node_modules/npm-groovy-lint` console.info(`GroovyLint: Starting copying package in vscode for testing`); // Reset target folder -if (existsSync(targetPath)) { - emptyDirSync(targetPath); +if (fs.existsSync(targetPath)) { + fs.emptyDirSync(targetPath); } else { - mkdirSync(targetPath); + fs.mkdirSync(targetPath); } // Copy files into dest folder -for (const path of ['package.json', 'README.md', 'CHANGELOG.md', 'LICENSE', 'lib']) { - copySync(path, `${targetPath}/${path}`); +for (const path of ['package.json', 'README.md', 'CHANGELOG.md', 'LICENSE', 'index.d.ts', 'lib']) { + fs.copySync(path, `${targetPath}/${path}`); } console.info(`GroovyLint: Copied files into ${targetPath}`); @@ -32,4 +31,3 @@ console.info(`GroovyLint: Copied files into ${targetPath}`); console.log('---- END DEPLOY IN VSCODE INSTALLED npm-groovy-lint PACKAGE ----\n'); process.exit(0); -