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

Bump browser TS version to 4.x by aligning browser TS version with neo4j-arc's min version #33

Merged
merged 4 commits into from
Nov 24, 2023
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
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Neo4j Browser <sup>![Node Version Badge is Missing][node version badge]</sup>
# Neo4j Browser <sup>![Node Version Badge is Missing][node version badge] ![Ts Version Badge is Missing][ts version badge]</sup>

[![npm registry][npm registry]](https://www.npmjs.com/package/neo4j-devtools-arc)

Expand All @@ -24,10 +24,19 @@ Contributions welcome! More information in our [CONTRIBUTING.md](CONTRIBUTING.md

Browser has a subproject of re-usable components bundled together and exposed as `neo4j-arc`. Rather than set up mono-repo tooling the we've set up eslint to isolate `neo4j-arc` and given it a seperate build step. Code in browser can only to import code from `neo4j-arc` through `neo4j-arc` aliases (as if it was a seperate project) and `neo4j-arc` is not allowed to import any code from outside it's own folder.

## Development
## Development <sup>![Ts Version Badge is Missing][ts version badge]</sup>

Running Neo4j Browser locally requires Node.js (^12.4.0, below 18) and for dependencies we use yarn
(`npm install -g yarn`). To install dependencies and then start the development server at `http://localhost:8080`:
> There are 2 parts within this project
>
> 1. [browser](./src/browser)
> 2. re-usable graphing library, i.e. [neo4j-arc](./src/neo4j-arc)
>
> Each mantains a separate TS version. **Browser's TS version has to align with neo4j-arc's by setting a fixed version
> at latter's lower bound**. For example, if neo4j-arc's typescript version is `"typescript": "^4.6.2"`, then the
> browser's has be to the exact version of `"typescript": "4.6.2"`

Running Neo4j Browser locally requires Node.js 16 and for dependencies we use yarn (`npm install -g yarn`). To install
dependencies and then start the development server at `http://localhost:8080`:

> To switch node version with a version manager, please try [nvm](https://qubitpi.github.io/hashicorp-aws/blog/nvm)

Expand Down Expand Up @@ -89,5 +98,7 @@ CYPRESS_BASE_URL=<url to reach the browser to test> (default http://localhost:80

Example: `CYPRESS_E2E_TEST_ENV="local" CYPRESS_BASE_URL=http://localhost:30000 cypress open --env server=4.2`

[node version badge]: https://img.shields.io/badge/NODE-≥12.4.0%20<18.0.0-339933?logo=Node.js&logoColor=white&labelColor=66cc33&style=for-the-badge
[node version badge]: https://img.shields.io/badge/NODE-≥16%20<18.0.0-339933?logo=Node.js&logoColor=white&labelColor=66cc33&style=for-the-badge
[npm registry]: https://img.shields.io/npm/v/neo4j-devtools-arc?logo=npm&style=for-the-badge

[ts version badge]: https://img.shields.io/badge/TypeScript-≥4.6.2-3178C6?style=for-the-badge&logo=typescript&logoColor=white&labelColor=358EF1
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"style-loader": "^0.23.1",
"ts-jest": "^25.0.0",
"ts-loader": "^8.0.2",
"typescript": "^3.9.5",
"typescript": "4.6.2",
"typescript-plugin-styled-components": "^1.5.0",
"url-loader": "^1.1.2",
"wait-on": "^3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/neo4j-arc/common/utils/objectUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ export function mapObjectValues<A, B>(
}

export function keys<T>(object: T): Array<keyof T> {
return Object.keys(object) as Array<keyof T>
return Object.keys(object as any) as Array<keyof T>
}
2 changes: 1 addition & 1 deletion src/neo4j-arc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neo4j-devtools-arc",
"version": "0.0.62",
"version": "0.0.63",
"main": "dist/neo4j-arc.js",
"author": "Neo4j Inc.",
"license": "GPL-3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/shared/services/bolt/driverFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const createDriverOrFailFn = (
try {
const res = neo4j.driver(url, auth, spreadOpts)
return res
} catch (e) {
} catch (e: any) {
failFn(e)
return null
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/services/bolt/globalDrivers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const buildGlobalDriversObject = async (
)
routed && (await routed.verifyConnectivity())
routingSupported = true
} catch (e) {
} catch (e: any) {
if (e && isNonSupportedRoutingSchemeError(e)) {
routingSupported = false
failFn(e)
Expand Down
2 changes: 1 addition & 1 deletion src/shared/services/commandInterpreterHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ const availableCommands = [
put(updateQueryResult(action.requestId, null, 'success'))
}
return true
} catch (error) {
} catch (error: any) {
if (!action.parentId) {
put(
frames.add({
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13900,7 +13900,12 @@ typescript-plugin-styled-components@^1.5.0:
resolved "https://registry.npmjs.org/typescript-plugin-styled-components/-/typescript-plugin-styled-components-1.6.0.tgz"
integrity sha512-cUCbOuY0iNr1JjPYC5MqCiABrfv2ouLift+7gi4vS0gBPQySUT006wHCjwzynMfU5LGMQaZqpssAgzRRjt30Ng==

typescript@^3.2.1, typescript@^3.9.3, typescript@^3.9.5:
typescript@4.6.2:
version "4.6.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.2.tgz#fe12d2727b708f4eef40f51598b3398baa9611d4"
integrity sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==

typescript@^3.2.1, typescript@^3.9.3:
version "3.9.10"
resolved "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz"
integrity "sha1-cPORCselHta+952ngAaQsZv3eLg= sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q=="
Expand Down