Skip to content

Commit

Permalink
chore: use vite/vitest in place of esbuild/karma+jasmine
Browse files Browse the repository at this point in the history
Neuroglancer can now be used as a regular NPM dependency with vite, parcel, or
webpack as the bundler (but unfortunately not esbuild due to
evanw/esbuild#795), and can be installed as a
dependency via a git URL.

Node.js import/export conditions are now used to enable/disable layer types and
datasources, which can be configured by dependent projects rather than when
Neuroglancer itself is built/published.

The Python tests accept a `--build-client` option to run the dev server
automatically rather than requiring a pre-built Python Neuroglancer client.
  • Loading branch information
jbms committed Feb 20, 2024
1 parent 405557f commit 8f504d2
Show file tree
Hide file tree
Showing 552 changed files with 41,905 additions and 16,515 deletions.
11 changes: 11 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,14 @@ node_modules
dist
python
templates/neuroglancer/sliceview
src/third_party/jpgjs/jpg.js
templates
build
.tox
.nox
/lib
python
config
typings
src/mesh/draco/stub.js
tsconfig.tsbuildinfo
19 changes: 0 additions & 19 deletions .eslintrc

This file was deleted.

67 changes: 67 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
root: true
parser: "@typescript-eslint/parser"
plugins:
- "@typescript-eslint"
- "import"
settings:
"import/parsers":
"@typescript-eslint/parser": [".ts", ".tsx"]
"import/resolver":
"typescript":
"node":
extends:
- "eslint:recommended"
- "plugin:@typescript-eslint/eslint-recommended"
- "plugin:@typescript-eslint/recommended"
- "plugin:import/recommended"
rules:
"@typescript-eslint/no-explicit-any": "off"
"@typescript-eslint/explicit-module-boundary-types": "off"
"@typescript-eslint/no-non-null-assertion": "off"
"@typescript-eslint/no-inferrable-types": "off"
"@typescript-eslint/no-this-alias": "off"
"@typescript-eslint/no-empty-function": "off"
"@typescript-eslint/no-empty-interface": "off"
"prefer-const":
- "error"
- destructuring: "all"
"no-constant-condition": "off"
"@typescript-eslint/no-unused-vars":
- "error"
- argsIgnorePattern: "^_"
ignoreRestSiblings: true
"@typescript-eslint/ban-types":
- "error"
- types:
# unban Function
"Function": false
extendDefaults: true
"no-unsafe-finally": "off"
"require-yield": "off"
"no-inner-declarations": "off"
"import/no-named-as-default-member": "off"
"import/no-cycle": "error"
"@typescript-eslint/consistent-type-imports": "error"
"import/no-unresolved": "error"
"import/no-extraneous-dependencies": "error"
"import/first": "error"
"import/order":
- "error"
- groups:
- "builtin"
- "external"
- "internal"
alphabetize:
order: "asc"
orderImportKind: "asc"
overrides:
- files:
- "src/**/*"
rules:
"no-restricted-imports":
- "error"
- patterns:
- group:
- "./"
- "../"
message: "Relative imports are not allowed."
12 changes: 2 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,7 @@ jobs:
run: npm run build-python -- --no-typecheck
- uses: ./.github/actions/setup-firefox
- name: Run JavaScript tests (including WebGL)
# Swiftshader, used by Chrome headless, crashes when running Neuroglancer
# tests.
#
# The only reliable headless configuration is Firefox on Linux under
# xvfb-run, which uses Mesa software rendering.
if: startsWith(runner.os, 'Linux')
run: xvfb-run --auto-servernum --server-args='-screen 0 1024x768x24' npm run test -- --browsers Firefox
- name: Run JavaScript tests (excluding WebGL)
if: ${{ !startsWith(runner.os, 'Linux') }}
run: npm run test -- --browsers ChromeHeadless --define=NEUROGLANCER_SKIP_WEBGL_TESTS
run: npm test
- name: Run JavaScript benchmarks
run: npm run benchmark

Expand All @@ -63,6 +54,7 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
node-version:
- "20.x"
os:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/node_modules/
node_modules
/dist/
/trans
/build/
Expand All @@ -18,3 +18,5 @@ tsconfig.tsbuildinfo
.nox
.pytest_cache
/ngauth_server/secrets/
.eslintcache
/lib
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
/python/
/third_party/jpgjs/jpg.js
/testdata/*.json
.parcel-cache
dist
/lib
4 changes: 4 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
overrides:
- files: ".parcelrc"
options:
parser: "json5"
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ All submissions, including submissions by project members, require review.
### Coding Style

For consistency, please ensure that all TypeScript/JavaScript files
are linted with Biome and formatted by `prettier`.
are linted with `eslint` and formatted by `prettier`.

You can check for lint/format issues with:

Expand Down
68 changes: 0 additions & 68 deletions biome.json

This file was deleted.

Loading

0 comments on commit 8f504d2

Please sign in to comment.