Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bump dependencies, fix tests, fix imports from deps #261

Merged
merged 10 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# https://jstools.dev/eslint-config/

root: true
extends: "@jsdevtools"
extends: "./eslint-config/lib/index.js"
env:
node: true
browser: true
53 changes: 6 additions & 47 deletions .github/workflows/CI-CD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ jobs:
- macos-latest
- windows-latest
node:
- 16
# - 18 TODO bring this back
- 20

steps:
- name: Checkout source
Expand All @@ -33,7 +32,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'npm'
cache: "npm"

- name: Install dependencies
run: npm ci
Expand All @@ -53,52 +52,13 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true

browser_tests:
name: Browser Tests
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest # Chrome, Firefox, Safari (TODO)
# - windows-latest # Internet Explorer, Edge

steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 12
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm run coverage:browser

- name: Combine code coverage data into a single file
shell: bash
run: |
ls -Rlh coverage/*/lcov.info
cat coverage/*/lcov.info > ./coverage/lcov.info

- name: Send code coverage results to Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true

coverage:
name: Code Coverage
runs-on: ubuntu-latest
timeout-minutes: 10
needs:
- node_tests
- browser_tests
steps:
- name: Let Coveralls know that all tests have finished
uses: coverallsapp/[email protected]
Expand All @@ -113,17 +73,16 @@ jobs:
timeout-minutes: 10
needs:
- node_tests
- browser_tests

steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 12
cache: 'npm'
node-version: 20
cache: "npm"

- name: Install dependencies
run: npm ci
Expand Down
16 changes: 16 additions & 0 deletions build-website.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {build} from "esbuild";
import {polyfillNode} from "esbuild-plugin-polyfill-node";

await build({
entryPoints: ["online/src/js/index.js"],
bundle: true,
minify: true,
sourcemap: 'external',
target: 'chrome60',
outfile: "online/js/bundle.js",
plugins: [
polyfillNode({
// Options (optional)
}),
],
});
69 changes: 69 additions & 0 deletions eslint-config/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"use strict";

const universalRules = require("./universal-rules");
const universalJSDocRules = require("./universal-jsdoc-rules");
const javascriptRules = require("./javascript-rules");
const javascriptJSDocRules = require("./javascript-jsdoc-rules");
const javascriptTestRules = require("./javascript-test-rules");

module.exports = {
plugins: [
"jsdoc",
],
overrides: [
/**
* JavaScript source files
*/
{
files: ["**/*.{js,jsx}"],
excludedFiles: "test/**",
parserOptions: {
sourceType: "script",
ecmaVersion: 2020,
ecmaFeatures: {
jsx: true,
},
},
plugins: [
"jsdoc",
],
env: {
es2020: true,
commonjs: true,
"shared-node-browser": true,
},
rules: {
...universalRules,
...universalJSDocRules,
...javascriptRules,
...javascriptJSDocRules,
}
},

/**
* JavaScript test files
*/
{
files: ["test/**/*.{js,jsx}"],
parserOptions: {
sourceType: "script",
ecmaVersion: 2020,
},
ecmaFeatures: {
jsx: true,
},
env: {
es2020: true,
commonjs: true,
"shared-node-browser": true,
mocha: true,
jasmine: true,
},
rules: {
...universalRules,
...javascriptRules,
...javascriptTestRules,
}
},
],
};
36 changes: 36 additions & 0 deletions eslint-config/lib/javascript-jsdoc-rules.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"use strict";

/**
* JSDoc rules for JavaScript and TypeScript
*/
module.exports = {
/**
* @see https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-types
*/
"jsdoc/check-types": "warn",

/**
* @see https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-undefined-types
*/
"jsdoc/no-undefined-types": "warn",

/**
* @see https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param-type
*/
"jsdoc/require-param-type": "warn",

/**
* @see https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-property-type
*/
"jsdoc/require-property-type": "warn",

/**
* @see https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-returns-type
*/
"jsdoc/require-returns-type": "warn",

/**
* @see https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-valid-types
*/
"jsdoc/valid-types": "warn",
};
Loading
Loading