Skip to content

Commit 6abeb1b

Browse files
committed
Commit neo4j-driver-deno to the repository
The `deno` driver is generated using a custom script made for this repository. This script doesn't have any tests linked to it. So the only way this changes are tested is by running the `deno driver` test suite. For guarantee the behaviour of this driver, we should version commit the generated driver to the repository. This changes introduce the first commited version of the driver. Adding the verification if the commited deno driver is in sync with the lite driver is also part of the this scope.
1 parent 1418f42 commit 6abeb1b

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"scripts": {
4141
"clean": "lerna clean -y && lerna run clean",
4242
"build": "lerna bootstrap --ci",
43-
"build::deno": "(cd ./packages/neo4j-driver-deno && deno run --allow-read --allow-write --allow-net ./generate.ts --version=5.0.0-dev)",
43+
"build::deno": "cd ./packages/neo4j-driver-deno && deno run --allow-read --allow-write --allow-net ./generate.ts --version=5.0.0-dev",
4444
"build::notci": "lerna bootstrap",
4545
"docs": "lerna run docs --stream --concurrency 1",
4646
"test::unit": "lerna run test::unit --stream",

packages/neo4j-driver-deno/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
lib/
21
.vscode/
2+
lib2/

packages/neo4j-driver-deno/generate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const isDir = (path: string) => {
2727
////////////////////////////////////////////////////////////////////////////////
2828
// Parse arguments
2929
const parsedArgs = parse(Deno.args, {
30-
string: ["version"],
30+
string: ["version", "output"],
3131
boolean: ["transform"], // Pass --no-transform to disable
3232
default: { transform: true },
3333
unknown: (arg) => {
@@ -42,7 +42,7 @@ const version = parsedArgs.version ?? "0.0.0dev";
4242

4343
////////////////////////////////////////////////////////////////////////////////
4444
// Clear out the destination folder
45-
const rootOutDir = "lib/";
45+
const rootOutDir = parsedArgs.output ?? "lib/";
4646
await ensureDir(rootOutDir); // Make sure it exists
4747
for await (const existingFile of Deno.readDir(rootOutDir)) {
4848
await Deno.remove(`${rootOutDir}${existingFile.name}`, { recursive: true });

testkit/build.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
Executed in Javascript driver container.
33
Responsible for building driver and test backend.
44
"""
5-
from common import is_deno, run, run_in_driver_repo, DRIVER_REPO
5+
from common import is_deno, is_team_city, run, run_in_driver_repo, DRIVER_REPO
66
import os
77

88

99
def copy_files_to_workdir():
10-
run(["mkdir", DRIVER_REPO])
11-
run(["cp", "-fr", ".", DRIVER_REPO])
10+
run(["cp", "-fr", "./", DRIVER_REPO])
1211
run(["chown", "-Rh", "driver:driver", DRIVER_REPO])
1312

1413

@@ -20,7 +19,13 @@ def init_monorepo():
2019
def clean_and_build():
2120
run_in_driver_repo(["npm", "run", "clean"], env=os.environ)
2221
run_in_driver_repo(["npm", "run", "build"], env=os.environ)
23-
run_in_driver_repo(["npm", "run", "build::deno"], env=os.environ)
22+
run_in_driver_repo(["npm", "run", "build::deno", "--",
23+
"--output=lib2/"], env=os.environ)
24+
25+
if is_deno() and is_team_city():
26+
run_in_driver_repo(["diff", "-r", "-u",
27+
"packages/neo4j-driver-deno/lib/",
28+
"packages/neo4j-driver-deno/lib2/"])
2429

2530

2631
if __name__ == "__main__":

testkit/common.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,7 @@ def is_browser():
4646

4747
def is_deno():
4848
return is_enabled(os.environ.get("TEST_DRIVER_DENO", "false"))
49+
50+
51+
def is_team_city():
52+
return is_enabled(os.environ.get("TEST_IN_TEAMCITY", "false"))

0 commit comments

Comments
 (0)