From 6534c4b301eb6fa1bdb0d9f14ca1c67e5565ee70 Mon Sep 17 00:00:00 2001 From: Nell Hardcastle Date: Wed, 3 May 2023 15:07:22 -0700 Subject: [PATCH 1/3] feat(schema): Move the CLI entrypoint into src for bundling --- bids-validator/bids-validator-deno | 3 +-- bids-validator/build.ts | 3 ++- bids-validator/src/bids-validator.ts | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 bids-validator/src/bids-validator.ts diff --git a/bids-validator/bids-validator-deno b/bids-validator/bids-validator-deno index b6e7dfccc..00cab8044 100755 --- a/bids-validator/bids-validator-deno +++ b/bids-validator/bids-validator-deno @@ -1,4 +1,3 @@ #!/bin/env -S deno run --allow-read --allow-write --allow-env --allow-net --allow-run -import { main } from './src/main.ts' +import './src/run.ts' -await main() diff --git a/bids-validator/build.ts b/bids-validator/build.ts index 882ad280e..e5fc80ef4 100755 --- a/bids-validator/build.ts +++ b/bids-validator/build.ts @@ -8,6 +8,7 @@ import * as esbuild from 'https://deno.land/x/esbuild@v0.17.5/mod.js' import { parse } from 'https://deno.land/std@0.175.0/flags/mod.ts' const MAIN_ENTRY = 'src/main.ts' +const CLI_ENTRY = 'src/bids-validator.ts' const httpPlugin = { name: 'http', @@ -43,7 +44,7 @@ const flags = parse(Deno.args, { const result = await esbuild.build({ format: 'esm', - entryPoints: [MAIN_ENTRY], + entryPoints: [MAIN_ENTRY, CLI_ENTRY], bundle: true, outdir: 'dist/validator', minify: flags.minify, diff --git a/bids-validator/src/bids-validator.ts b/bids-validator/src/bids-validator.ts new file mode 100644 index 000000000..47f4f2cc0 --- /dev/null +++ b/bids-validator/src/bids-validator.ts @@ -0,0 +1,3 @@ +import { main } from './main.ts' + +await main() From c1c7ce310ce53944fbd10317fc2ac8dd35089219 Mon Sep 17 00:00:00 2001 From: Nell Hardcastle Date: Wed, 3 May 2023 15:10:37 -0700 Subject: [PATCH 2/3] feat(ci): Include command line build in CI artifacts branch --- .github/workflows/deno_tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deno_tests.yml b/.github/workflows/deno_tests.yml index 1762887ef..059226dce 100644 --- a/.github/workflows/deno_tests.yml +++ b/.github/workflows/deno_tests.yml @@ -74,7 +74,8 @@ jobs: - name: Commit to new branch run: | mv main/main.js . - git add main.js + mv main/bids-validator.js . + git add main.js bids-validator.js git commit -m "BLD: $VERSION [skip ci]" || true - name: Push run: git push origin deno-build From 0e061f58318c31cafb5c7f13b64fa8fdc175a387 Mon Sep 17 00:00:00 2001 From: Nell Hardcastle Date: Wed, 3 May 2023 15:17:30 -0700 Subject: [PATCH 3/3] fix(schema): Fix entrypoint script call --- bids-validator/bids-validator-deno | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bids-validator/bids-validator-deno b/bids-validator/bids-validator-deno index 00cab8044..79c1d9170 100755 --- a/bids-validator/bids-validator-deno +++ b/bids-validator/bids-validator-deno @@ -1,3 +1,3 @@ #!/bin/env -S deno run --allow-read --allow-write --allow-env --allow-net --allow-run -import './src/run.ts' +import './src/bids-validator.ts'