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
37 changes: 12 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 22.x
node-version: 24.x
cache: "npm"
cache-dependency-path: |
package-lock.json
# uv required for javascript tests
- uses: astral-sh/setup-uv@v5
- uses: astral-sh/setup-uv@v7
with:
enable-cache: false
# go needed for fake_gcs_server used by the javascript tests
Expand All @@ -60,8 +60,6 @@ jobs:
- name: Build Python client bundles
run: npm run build-python -- --no-typecheck --no-lint
- run: npm run build-package
- run: npm publish --dry-run
working-directory: dist/package
- name: Run JavaScript tests (including WebGL)
run: npm test
if: ${{ runner.os != 'macOS' }}
Expand Down Expand Up @@ -92,13 +90,13 @@ jobs:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22.x
node-version: 24.x
cache: "pnpm"
cache-dependency-path: |
examples/**/pnpm-lock.yaml
- uses: actions/setup-node@v4
with:
node-version: 22.x
node-version: 24.x
cache: "npm"
cache-dependency-path: |
package-lock.json
Expand All @@ -122,8 +120,8 @@ jobs:
strategy:
matrix:
python-version:
- "3.9"
- "3.12"
- "3.11"
- "3.13"
os:
- "ubuntu-latest"
- "windows-latest"
Expand All @@ -136,13 +134,10 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 22.x
- uses: astral-sh/setup-uv@v5
node-version: 24.x
- uses: astral-sh/setup-uv@v7
with:
enable-cache: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: ./.github/actions/setup-firefox
- name: Setup tmate session
Expand Down Expand Up @@ -185,15 +180,11 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 22.x
node-version: 24.x
cache: "npm"
- uses: astral-sh/setup-uv@v5
- uses: astral-sh/setup-uv@v7
with:
enable-cache: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Get uv cache dir
id: uv-cache
run: |
Expand Down Expand Up @@ -227,13 +218,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- uses: astral-sh/setup-uv@v7
with:
enable-cache: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@b1de5da23ed0a6d14e0aeee8ed52fdd87af2363c # v2.0.2
with:
Expand All @@ -260,7 +247,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
node-version: 24.x
registry-url: "https://registry.npmjs.org"
- uses: actions/download-artifact@v4
with:
Expand Down
28 changes: 17 additions & 11 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["import", "typescript", "oxc", "unicorn", "promise", "vitest"],
"env": {
"browser": true
"browser": true,
},
"settings": {},
"rules": {
Expand All @@ -24,28 +24,34 @@
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
"ignoreRestSiblings": true,
},
],
"no-new-array": "off",
"no-document-cookie": "off",
"@typescript-eslint/consistent-type-imports": "error"
"no-constant-condition": "off",
"@typescript-eslint/consistent-type-imports": "error",
"no-unused-expressions": "off",
"eslint-plugin-jest/no-standalone-expect": "off",
"eslint-plugin-jest/expect-expect": "off",
"eslint-plugin-jest/valid-expect": "off",
"eslint-plugin-jest/no-conditional-expect": "off",
"eslint-plugin-jest/valid-describe-callback": "off",
"@typescript-eslint/no-unsafe-declaration-merging": "off",
},
"overrides": [
{
"files": ["*.test.ts", "*.spec.ts"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
}
"@typescript-eslint/no-explicit-any": "off",
},
},
],
"ignorePatterns": [
"**/node_modules",
"**/dist",
"**/python",
"templates/neuroglancer/sliceview",
"src/third_party/jpgjs/jpg.js",
"**/templates",
"**/build",
"**/.tox",
"**/.nox",
Expand All @@ -56,6 +62,6 @@
"**/typings",
"src/mesh/draco/stub.js",
"**/tsconfig.tsbuildinfo",
"examples"
]
"examples",
],
}
3 changes: 3 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ overrides:
- files: "tsconfig.json"
options:
parser: "jsonc"
- files: ".oxlintrc.json"
options:
parser: "jsonc"
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13.9
4 changes: 0 additions & 4 deletions .style.yapf

This file was deleted.

10 changes: 2 additions & 8 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,19 @@ prune config
prune ngauth_server
prune src
prune build_tools
prune templates
prune third_party
prune typings
prune testdata
prune examples
exclude .clang-format
exclude .editorconfig
exclude .eslintignore
exclude .style.yapf
exclude cors_webserver.py
exclude gulpfile.js
exclude package.json
exclude package-lock.json
exclude tsconfig.json
exclude tslint.json
prune .github
prune *.egg-info
exclude tox.ini
exclude noxfile.py
exclude python/.pylintrc
global-exclude .gitignore
global-exclude .gitattributes
global-exclude .dockerignore
Expand All @@ -38,6 +31,7 @@ exclude .prettierignore
exclude eslint.config.js
exclude .ncurc.yml
exclude index.html
exclude rspack.config.js
exclude rspack.config.ts
exclude firebase.json
exclude .firebaserc
exclude .oxlintrc.json
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,13 @@ or within Neuroglancer, press `h` or click on the button labeled `?` in the uppe
Neuroglancer requires WebGL (2.0) and the `EXT_color_buffer_float` extension.

To troubleshoot, check the developer console, which is accessed by the keyboard shortcut `control-shift-i` in Firefox and Chrome. If there is a message regarding failure to initialize WebGL, you can take the following steps:

- Chrome

Check `chrome://gpu` to see if your GPU is blacklisted. There may be a flag you can enable to make it work.

- Firefox

Check `about:support`. There may be webgl-related properties in `about:config` that you can change to make it work. Possible settings:

- `webgl.disable-fail-if-major-performance-caveat = true`
- `webgl.force-enabled = true`
- `webgl.msaa-force = true`
Expand All @@ -93,7 +91,6 @@ or within Neuroglancer, press `h` or click on the button labeled `?` in the uppe
As a security measure, browsers will in many prevent a webpage from accessing the true error code associated with a failed HTTP request. It is therefore often necessary to check the developer tools to see the true cause of any HTTP request error.

There are several likely causes:

- [Cross-origin resource sharing (CORS)](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)

Neuroglancer relies on cross-origin requests to retrieve data from third-party servers. As a security measure, if an appropriate `Access-Control-Allow-Origin` response header is not sent by the server, browsers prevent webpages from accessing any information about the response from a cross-origin request. In order to make the data accessible to Neuroglancer, you may need to change the cross-origin request sharing (CORS) configuration of the HTTP server.
Expand Down
17 changes: 17 additions & 0 deletions build_tools/build-package.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/**
* @license
* Copyright 2024 Google LLC
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// Builds the library package.
//
// This involves transpiling the TypeScript to JavaScript using esbuild.
Expand Down Expand Up @@ -25,6 +41,7 @@ function buildDeclarationFiles(
): void {
options = {
...options,
noEmit: false,
declaration: true,
emitDeclarationOnly: true,
};
Expand Down
20 changes: 3 additions & 17 deletions build_tools/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import { pathToFileURL } from "node:url";
import path from "path";
import { RspackCLI } from "@rspack/cli";
import type { Configuration } from "@rspack/core";
import ESLintPlugin from "eslint-rspack-plugin";
import { TsCheckerRspackPlugin } from "ts-checker-rspack-plugin";
import * as webpackMerge from "webpack-merge";
import yargs from "yargs";
import { normalizeConfigurationWithDefine } from "./rspack/configuration_with_define.js";
Expand Down Expand Up @@ -80,7 +78,7 @@ async function getWebpackConfig(
...extraConfigs: WebpackConfigurationWithDefine[]
): Promise<(...args: any[]) => Configuration> {
const configPaths = [
pathToFileURL(path.resolve(import.meta.dirname, "../rspack.config.js"))
pathToFileURL(path.resolve(import.meta.dirname, "../rspack.config.ts"))
.href,
...argv.config.map((configPath) => pathToFileURL(configPath).href),
];
Expand All @@ -107,22 +105,8 @@ async function getWebpackConfig(
if (outDir !== undefined) {
outDir = path.resolve(outDir);
}
const plugins = [];
if (argv.typecheck) {
plugins.push(new TsCheckerRspackPlugin());
}
if (argv.lint) {
plugins.push(
new ESLintPlugin({
configType: "flat",
files: ".",
threads: true,
}),
);
}
const inlineConfig = {
define: argv.define,
plugins,
output: {
path: outDir,
},
Expand Down Expand Up @@ -155,11 +139,13 @@ function parseArgs() {
type: "boolean",
default: true,
description: "Typecheck the TypeScript code.",
deprecated: "Has no effect, run typecheck separately.",
},
lint: {
type: "boolean",
default: true,
description: "Run eslint.",
deprecated: "Has no effect, run linting separately.",
},
python: {
type: "boolean",
Expand Down
8 changes: 1 addition & 7 deletions build_tools/vitest/python_tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,12 @@
*/

import { spawnSync } from "node:child_process";
import path from "node:path";

export const PYTHON_TEST_TOOLS_PATH = path.join(
import.meta.dirname,
"python_tools",
);

export async function syncPythonTools() {
// Note: For unknown reasons, using `await promisify(spawn)` in place of
// `spawnSync` causes the vitest process to exit as soon as the child
// process completes.
spawnSync("uv", ["sync", "--project", PYTHON_TEST_TOOLS_PATH], {
spawnSync("uv", ["sync", "--only-group", "vitest"], {
stdio: ["ignore", "inherit", "inherit"],
});
}
8 changes: 0 additions & 8 deletions build_tools/vitest/python_tools/pyproject.toml

This file was deleted.

Loading
Loading