From 5221b7e893e5cf8fa93a6c5a9e9c7922ccae2f2b Mon Sep 17 00:00:00 2001 From: Akash Gupta Date: Wed, 28 Feb 2024 16:17:41 +0530 Subject: [PATCH] feat: update package for prod --- package.json | 1 + src/generators/javascript/templates/index.hbs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index bb1148be..2337d980 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "bin": "./src/cli/index.js", "scripts": { "dev": "TS_NODE_FILES=true NODE_ENV=development ts-node ./src/cli", + "prod": "TS_NODE_FILES=true NODE_ENV=production ts-node ./src/cli prod", "build": "rm -rf dist && tsc && copyfiles --up 1 \"src/**/*.hbs\" dist/src/ && copyfiles \"README.*\" dist/ && copyfiles \"CHANGELOG.*\" dist/", "test": "jest --testPathIgnorePatterns 'tests/e2e/.*' 'example' --coverage", "e2e": "make e2e", diff --git a/src/generators/javascript/templates/index.hbs b/src/generators/javascript/templates/index.hbs index 67a8be8d..f573874c 100644 --- a/src/generators/javascript/templates/index.hbs +++ b/src/generators/javascript/templates/index.hbs @@ -49,6 +49,7 @@ export type ViolationHandler = ( violations: {{#if isDevelopment}}ErrorObject{{else}}any{{/if}}[] ) => void +{{#if isDevelopment}} /** * The default handler that is fired if none is supplied with setRudderTyperOptions. {{#if isBrowser}} @@ -58,7 +59,6 @@ export type ViolationHandler = ( * a warning message to the console. {{/if}} */ -{{#if isDevelopment}} export const defaultValidationErrorHandler: ViolationHandler = (message, violations) => { const msg = JSON.stringify({ type: 'RudderTyper JSON Schema Validation Error',