Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gui-environment

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gui-environment - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

dist/environment/environment.js

@@ -1,1 +0,1 @@

import{copyFile,isDirectory,isFile,readTextFile,writeTextFile}from"fs-utils-sync";import{ENVIRONMENT_NAMES,GIT_IGNORE_PATH}from"../shared/index.js";import{buildEnvironmentPath,buildFilePath,getEnvironmentName,buildGITIgnoreContent}from"../utils/index.js";import{buildIndex,buildTypes,buildEnvironment}from"../templates/index.js";import{validateSourcePath,canEnvironmentBeInitialized}from"../validations/index.js";const __installEnvironment=(i,e)=>copyFile(buildFilePath(i,e),buildFilePath(i,"environment")),__addEnvironmentToGITIgnore=e=>{if(isFile(GIT_IGNORE_PATH)){let i=readTextFile(GIT_IGNORE_PATH);var n=buildGITIgnoreContent(e,!0);i.includes(n)||(i+=n,writeTextFile(GIT_IGNORE_PATH,i))}else writeTextFile(GIT_IGNORE_PATH,buildGITIgnoreContent(e))},__init=e=>{canEnvironmentBeInitialized(buildEnvironmentPath(e)),writeTextFile(buildFilePath(e,"index"),buildIndex()),writeTextFile(buildFilePath(e,"types"),buildTypes()),ENVIRONMENT_NAMES.forEach(i=>writeTextFile(buildFilePath(e,i),buildEnvironment("production"===i))),__installEnvironment(e,"development"),__addEnvironmentToGITIgnore(e)},__install=(i,e)=>{isDirectory(buildEnvironmentPath(i))||__init(i),__installEnvironment(i,e)},executeAction=({src:i="src",init:e,development:n,staging:t,production:l})=>{validateSourcePath(i),e?__init(i):__install(i,getEnvironmentName(n,t,l))};export{executeAction};
import{copyFile,isDirectory,isFile,readTextFile,writeTextFile}from"fs-utils-sync";import{ENVIRONMENT_NAMES,GIT_IGNORE_PATH}from"../shared/index.js";import{buildEnvironmentPath,buildFilePath,getEnvironmentName,buildGITIgnoreContent}from"../utils/index.js";import{buildIndex,buildTypes,buildEnvironment}from"../templates/index.js";import{validateSourcePath,canEnvironmentBeInitialized}from"../validations/index.js";const __installEnvironment=(i,e)=>copyFile(buildFilePath(i,e),buildFilePath(i,"environment")),__addEnvironmentToGITIgnore=i=>{if(isFile(GIT_IGNORE_PATH)){let e=readTextFile(GIT_IGNORE_PATH);const n=buildGITIgnoreContent(i,!0);e.includes(n)||(e+=n,writeTextFile(GIT_IGNORE_PATH,e))}else writeTextFile(GIT_IGNORE_PATH,buildGITIgnoreContent(i))},__init=i=>{canEnvironmentBeInitialized(buildEnvironmentPath(i)),writeTextFile(buildFilePath(i,"index"),buildIndex()),writeTextFile(buildFilePath(i,"types"),buildTypes()),ENVIRONMENT_NAMES.forEach((e=>writeTextFile(buildFilePath(i,e),buildEnvironment("production"===e)))),__installEnvironment(i,"development"),__addEnvironmentToGITIgnore(i)},__install=(i,e)=>{isDirectory(buildEnvironmentPath(i))||__init(i),__installEnvironment(i,e)},executeAction=({src:i="src",init:e,development:n,staging:t,production:l})=>{validateSourcePath(i),e?__init(i):__install(i,getEnvironmentName(n,t,l))};export{executeAction};
#! /usr/bin/env node
import process from"node:process";import{parseArgs}from"argv-utils";import{executeAction}from"./environment/index.js";try{executeAction(parseArgs(process.argv)),process.exit(0)}catch(r){console.error(r),process.exit(1)}
import process from"node:process";import{parseArgs}from"argv-utils";import{executeAction}from"./environment/index.js";(()=>{try{executeAction(parseArgs(process.argv)),process.exit(0)}catch(r){console.error(r),process.exit(1)}})();

@@ -1,1 +0,1 @@

var ERRORS;!function(I){I.INVALID_PATH="INVALID_PATH",I.NOT_A_DIRECTORY="NOT_A_DIRECTORY",I.INVALID_ENVIRONMENT_NAME="INVALID_ENVIRONMENT_NAME",I.ENVIRONMENT_ALREADY_INITIALIZED="ENVIRONMENT_ALREADY_INITIALIZED"}(ERRORS=ERRORS||{});export{ERRORS};
var ERRORS;!function(I){I.INVALID_PATH="INVALID_PATH",I.NOT_A_DIRECTORY="NOT_A_DIRECTORY",I.INVALID_ENVIRONMENT_NAME="INVALID_ENVIRONMENT_NAME",I.ENVIRONMENT_ALREADY_INITIALIZED="ENVIRONMENT_ALREADY_INITIALIZED"}(ERRORS||(ERRORS={}));export{ERRORS};

@@ -1,2 +0,1 @@

const buildIndex=()=>{return"export * from './types';\nexport * from './environment';\n"},buildTypes=()=>{var n="\n\n";n+="/* ************************************************************************************************\n";return"\n\n/* ************************************************************************************************\n * TYPES *\n ************************************************************************************************ */\n\n/**\n * Environment Variables\n * The following environment variables are used to modify the behavior of the app based on the\n * deployment environment of the build.\n */\ninterface IEnvironment {\n // the kind of build that was performed\n production: boolean,\n\n // the current version of the GUI\n version: string,\n}\n\n\n\n\n\n/* ************************************************************************************************\n * MODULE EXPORTS *\n ************************************************************************************************ */\nexport type {\n IEnvironment,\n};\n"},buildEnvironment=n=>{var e="import { IEnvironment } from './types';\n\n";return e+"/* ************************************************************************************************\n"+" * ENVIRONMENT VARIABLES *\n"+" ************************************************************************************************ */\n"+"const ENVIRONMENT: IEnvironment = {\n"+` production: ${n},
`+" version: '1.0.0',\n"+"};\n"+"\n\n\n\n\n"+"/* ************************************************************************************************\n"+" * MODULE EXPORTS *\n"+" ************************************************************************************************ */\n"+"export {\n"+" ENVIRONMENT,\n"+"};\n"};export{buildIndex,buildTypes,buildEnvironment};
const buildIndex=()=>{let n="export * from './types';\n";return n+="export * from './environment';\n","export * from './types';\nexport * from './environment';\n"},buildTypes=()=>{let n="\n\n";return n+="/* ************************************************************************************************\n",n+=" * TYPES *\n",n+=" ************************************************************************************************ */\n\n",n+="/**\n",n+=" * Environment Variables\n",n+=" * The following environment variables are used to modify the behavior of the app based on the\n",n+=" * deployment environment of the build.\n",n+=" */\n",n+="interface IEnvironment {\n",n+=" // the kind of build that was performed\n",n+=" production: boolean,\n\n",n+=" // the current version of the GUI\n",n+=" version: string,\n",n+="}\n",n+="\n\n\n\n\n",n+="/* ************************************************************************************************\n",n+=" * MODULE EXPORTS *\n",n+=" ************************************************************************************************ */\n",n+="export type {\n",n+=" IEnvironment,\n",n+="};\n","\n\n/* ************************************************************************************************\n * TYPES *\n ************************************************************************************************ */\n\n/**\n * Environment Variables\n * The following environment variables are used to modify the behavior of the app based on the\n * deployment environment of the build.\n */\ninterface IEnvironment {\n // the kind of build that was performed\n production: boolean,\n\n // the current version of the GUI\n version: string,\n}\n\n\n\n\n\n/* ************************************************************************************************\n * MODULE EXPORTS *\n ************************************************************************************************ */\nexport type {\n IEnvironment,\n};\n"},buildEnvironment=n=>{let e="import { IEnvironment } from './types';\n\n";return e+="/* ************************************************************************************************\n",e+=" * ENVIRONMENT VARIABLES *\n",e+=" ************************************************************************************************ */\n",e+="const ENVIRONMENT: IEnvironment = {\n",e+=` production: ${n},\n`,e+=" version: '1.0.0',\n",e+="};\n",e+="\n\n\n\n\n",e+="/* ************************************************************************************************\n",e+=" * MODULE EXPORTS *\n",e+=" ************************************************************************************************ */\n",e+="export {\n",e+=" ENVIRONMENT,\n",e+="};\n",e};export{buildIndex,buildTypes,buildEnvironment};

@@ -1,3 +0,1 @@

import{normalize}from"node:path";import{encodeError}from"error-message-utils";import{ENVIRONMENT_DIR_NAME,ENVIRONMENT_FILE_EXT,ENVIRONMENT_BASE_FILE_NAME,ENVIRONMENT_NAMES,ERRORS}from"../shared/index.js";const buildEnvironmentPath=(e,n)=>normalize("string"==typeof n?e+`/${ENVIRONMENT_DIR_NAME}/`+n:e+"/"+ENVIRONMENT_DIR_NAME),__buildFileName=e=>""+e+ENVIRONMENT_FILE_EXT,buildFilePath=(e,n)=>ENVIRONMENT_NAMES.includes(n)?buildEnvironmentPath(e,__buildFileName(ENVIRONMENT_BASE_FILE_NAME+"."+n)):buildEnvironmentPath(e,__buildFileName(n)),getEnvironmentName=(e,n,i)=>{if(e)return"development";if(n)return"staging";if(i)return"production";throw new Error(encodeError("The provided environment name is invalid. Ensure to invoke the CLI with a valid environment name: gui-environment (--development | --staging | --production)",ERRORS.INVALID_ENVIRONMENT_NAME))},buildGITIgnoreContent=(e,n)=>(n?"\n":"")+`# gui-environment output
${buildFilePath(e,"environment")}
`;export{buildEnvironmentPath,buildFilePath,getEnvironmentName,buildGITIgnoreContent};
import{normalize}from"node:path";import{encodeError}from"error-message-utils";import{ENVIRONMENT_DIR_NAME,ENVIRONMENT_FILE_EXT,ENVIRONMENT_BASE_FILE_NAME,ENVIRONMENT_NAMES,ERRORS}from"../shared/index.js";const buildEnvironmentPath=(n,e)=>normalize("string"==typeof e?`${n}/${ENVIRONMENT_DIR_NAME}/${e}`:`${n}/${ENVIRONMENT_DIR_NAME}`),__buildFileName=n=>`${n}${ENVIRONMENT_FILE_EXT}`,buildFilePath=(n,e)=>ENVIRONMENT_NAMES.includes(e)?buildEnvironmentPath(n,__buildFileName(`${ENVIRONMENT_BASE_FILE_NAME}.${e}`)):buildEnvironmentPath(n,__buildFileName(e)),getEnvironmentName=(n,e,i)=>{if(n)return"development";if(e)return"staging";if(i)return"production";throw new Error(encodeError("The provided environment name is invalid. Ensure to invoke the CLI with a valid environment name: gui-environment (--development | --staging | --production)",ERRORS.INVALID_ENVIRONMENT_NAME))},buildGITIgnoreContent=(n,e)=>`${e?"\n":""}# gui-environment output\n${buildFilePath(n,"environment")}\n`;export{buildEnvironmentPath,buildFilePath,getEnvironmentName,buildGITIgnoreContent};
{
"name": "gui-environment",
"version": "1.0.1",
"version": "1.0.2",
"description": "The gui-environment package is a command-line tool that simplifies managing environment variables for your application. Easily set up different configurations based on your build mode (development or production) for a smooth development workflow.",

@@ -9,3 +9,3 @@ "main": "dist/index.js",

"scripts": {
"start": "ts-lib-builder --tsconfigPath=tsconfig.build.json",
"start": "ts-lib-builder --tsconfig=tsconfig.build.json",
"test": "echo \"Error: tests are executed with npm run test:(integration|unit)\" && exit 1",

@@ -45,3 +45,3 @@ "test:integration": "vitest run --config vitest.test-integration.config.ts",

"eslint-config-airbnb-typescript": "^18.0.0",
"ts-lib-builder": "^1.0.2",
"ts-lib-builder": "^1.0.3",
"typescript": "^5.4.5",

@@ -52,5 +52,5 @@ "vitest": "^1.6.0"

"argv-utils": "^1.0.2",
"error-message-utils": "^1.0.1",
"fs-utils-sync": "^1.0.0"
"error-message-utils": "^1.0.2",
"fs-utils-sync": "^1.0.1"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc