From 6534c4b301eb6fa1bdb0d9f14ca1c67e5565ee70 Mon Sep 17 00:00:00 2001 From: Nell Hardcastle Date: Wed, 3 May 2023 15:07:22 -0700 Subject: [PATCH] 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 b6e7dfcc..00cab804 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 882ad280..e5fc80ef 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 00000000..47f4f2cc --- /dev/null +++ b/bids-validator/src/bids-validator.ts @@ -0,0 +1,3 @@ +import { main } from './main.ts' + +await main()