From eac116727bb2c5e6483f398df029813abe6fd220 Mon Sep 17 00:00:00 2001 From: Ken Payne Date: Fri, 10 Feb 2023 15:02:41 +0000 Subject: [PATCH] feat: add `build:strict` support (#11) --- evidence_ext/extension.py | 9 +++++++-- evidence_ext/main.py | 7 +++++-- meltano.yml | 16 ++++++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/evidence_ext/extension.py b/evidence_ext/extension.py index f28eff3..c03e1c2 100644 --- a/evidence_ext/extension.py +++ b/evidence_ext/extension.py @@ -88,11 +88,16 @@ def npm(self, *command_args: Any) -> None: log_subprocess_error("npm error", err, "npm invocation failed") sys.exit(err.returncode) - def build(self): + def build(self, strict: bool = False): """Run 'npm run build' in the Evidence home dir.""" with self.config.suppress_config_file(): self._npm.run_and_log(*["--prefix", self.evidence_home, "install"]) - self._npm.run_and_log(*["--prefix", self.evidence_home, "run", "build"]) + build_cmds = ["--prefix", self.evidence_home, "run"] + if strict: + build_cmds.append("build:strict") + else: + build_cmds.append("build") + self._npm.run_and_log(*build_cmds) def dev(self): """Run 'npm run dev' in the Evidence home dir.""" diff --git a/evidence_ext/main.py b/evidence_ext/main.py index 50329f5..8acc513 100644 --- a/evidence_ext/main.py +++ b/evidence_ext/main.py @@ -107,9 +107,12 @@ def npm(ctx: typer.Context, command_args: List[str]) -> None: @app.command() -def build(ctx: typer.Context) -> None: +def build( + ctx: typer.Context, + strict: bool = typer.Option(False, "--strict", help="build:strict"), +) -> None: """Build the Evidence project.""" - ext.build() + ext.build(strict=strict) @app.command() diff --git a/meltano.yml b/meltano.yml index 5a8e267..83c2065 100644 --- a/meltano.yml +++ b/meltano.yml @@ -19,6 +19,12 @@ plugins: initialize: executable: evidence_extension args: initialize + build: + executable: evidence_extension + args: build + build-strict: + executable: evidence_extension + args: build --strict settings_group_validation: - - home_dir # duckdb @@ -69,6 +75,16 @@ plugins: env: EVIDENCE_HOME description: | The directory where Evidence will store its project, configuration, logs, and other files. + - name: send_anonymous_usage_stats + label: Send Anonymous Usage Stats + kind: options + env: SEND_ANONYMOUS_USAGE_STATS + description: | + Send Evidence anonymous usage stats. + options: + - value: 'yes' + - value: 'no' + value: 'yes' - name: settings.database kind: options env: DATABASE