Skip to content

Commit

Permalink
feat: add build:strict support (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Payne authored Feb 10, 2023
1 parent db1d3e3 commit eac1167
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
9 changes: 7 additions & 2 deletions evidence_ext/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
7 changes: 5 additions & 2 deletions evidence_ext/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
16 changes: 16 additions & 0 deletions meltano.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eac1167

Please sign in to comment.