Skip to content
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
15 changes: 0 additions & 15 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: current
registry-url: https://registry.npmjs.org/
- uses: browser-actions/setup-chrome@latest
- run: bash .ci/build.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: current
- uses: browser-actions/setup-chrome@latest
- run: bash .ci/build.sh
env:
Expand Down
40 changes: 20 additions & 20 deletions README_Dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,41 @@ To run all tests and required builds, use the shorthand command `bt` to build an

This library is built with `tsc` and `webpack` and outputs the following assets:

- `/dist` folder - for further development in a non-browser environment (e.g. NodeJS/TypeScript context)
- `tsserval.js` - the uncompressed browser javascript source
- `tsserval.min.js` - the compressed browser javascript source
- Additional files (map files, licenses, ...)
- `/dist` folder - for further development in a non-browser environment (e.g. NodeJS/TypeScript context)
- `tsserval.js` - the uncompressed browser javascript source
- `tsserval.min.js` - the compressed browser javascript source
- Additional files (map files, licenses, ...)

## Build Scripts

Various build scripts are available over the `npm run` commands:

- `bt` builds all assets and runs all tests in a smart order (without doing too many things if tests break)
- `build` compiles all sources, tests to /dist and packs them browser-friendly to /lib-web
- `build:node` compiles all TypeScript sources via `tsc` from /src to /dist and checks circular dependencies on /dist
- `build:test` compiles all TypeScript tests via `tsc` from /test to /dist-test
- `bundle` creates browser-friendly assets
- `bundle:lib` bundles compiled distribution files to a browser-friendly asset via `webpack` from /dist to /lib-web (tsserval.js)
- `bundle:min` bundles compiled distribution files to a compressed/minified browser-friendly asset via `webpack` from /dist to /lib-web (tsserval.min.js)
- `bundle:test` bundles compiled test files to a browser-friendly form via `webpack` from /dist-test to /lib-web
- `build:ci` is meant as build command for the pipeline and effectively runs `build` with a step in between, which replaces the runtime version informations in the respective file
- `bt` builds all assets and runs all tests in a smart order (without doing too many things if tests break)
- `build` compiles all sources, tests to /dist and packs them browser-friendly to /lib-web
- `build:node` compiles all TypeScript sources via `tsc` from /src to /dist and checks circular dependencies on /dist
- `build:test` compiles all TypeScript tests via `tsc` from /test to /dist-test
- `bundle` creates browser-friendly assets
- `bundle:lib` bundles compiled distribution files to a browser-friendly asset via `webpack` from /dist to /lib-web (tsserval.js)
- `bundle:min` bundles compiled distribution files to a compressed/minified browser-friendly asset via `webpack` from /dist to /lib-web (tsserval.min.js)
- `bundle:test` bundles compiled test files to a browser-friendly form via `webpack` from /dist-test to /lib-web
- `build:ci` is meant as build command for the pipeline and effectively runs `build` with a step in between, which replaces the runtime version informations in the respective file

## Test Setup

Tests are written in TypeScript and executed in NodeJS and browser environments.

- NodeJS tests are executed with the `mocha` testrunner and `node-ts` as TypeScript environment. Thus, running the NodeJS tests do not require a `build` step as `node-ts` is coping with the TypeScript compilation internally.
- Browser tests are executed with `bt-runner` which uses `chromedriver` to test the bundled assets in compressed and uncompressed variants within the browser environment. The browser tests do not automatically `bundle` new builds, thus a browser build must be triggered before the browser tests.
- NodeJS tests are executed with the `mocha` testrunner and `node-ts` as TypeScript environment. Thus, running the NodeJS tests do not require a `build` step as `node-ts` is coping with the TypeScript compilation internally.
- Browser tests are executed with `bt-runner` which uses `chromedriver` to test the bundled assets in compressed and uncompressed variants within the browser environment. The browser tests do not automatically `bundle` new builds, thus a browser build must be triggered before the browser tests.

## Test Scripts

Various test scripts are available over the `npm run` commands:

- `bt` builds all assets and runs all tests in a smart order (without doing too many things if tests break)
- `test` runs all tests, first NodeJS then browser environment
- `test:node` runs NodeJS tests with `node-ts`
- `test:web` runs the tests on a browser environment with `bt-runner`
- `test:server` runs a keep-alive version of `bt-runner` which can be used for debugging
- `bt` builds all assets and runs all tests in a smart order (without doing too many things if tests break)
- `test` runs all tests, first NodeJS then browser environment
- `test:node` runs NodeJS tests with `node-ts`
- `test:web` runs the tests on a browser environment with `bt-runner`
- `test:server` runs a keep-alive version of `bt-runner` which can be used for debugging

## Deployment

Expand Down
23 changes: 23 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// @ts-check

import { configs } from "@js-soft/eslint-config-ts"
import { globalIgnores } from "eslint/config"
import tseslint from "typescript-eslint"

export default tseslint.config(globalIgnores(["**/dist", "**/dist-test", "**/lib-web", "**/node_modules"]), {
extends: [configs.base, configs.mocha],
languageOptions: {
parserOptions: {
project: ["./tsconfig.eslint.json", "./tsconfig.json", "./test/tsconfig.json"]
}
},
files: ["**/*.ts"],
rules: {
"jest/expect-expect": [
"error",
{
assertFunctionNames: ["expect", "expectValid*", "expectThrows*"]
}
]
}
})
Loading
Loading