Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setServerRef(val?: ServerLauncher) {
this.serverRef = maybe(val)
}
killNgc = () => this.ngcProcess.tapSome(ref => ref.kill())
.match({ some: maybe, none: () => maybe(process.env.PORT) })
.map(p => +p).valueOr(4200),
.tapSome(items => {
items.forEach(i => i.checked = false)
maybe(items.find(b => b.id === lang)).tapSome(b => {
sendAngularMessage(window, 'change-language', lang)
b.checked = true
})
})
}
readonly [key: string]: string
}
export interface IConfig {
readonly PORT: number
readonly NODE_DEBUG: boolean
readonly CLUSTERED_WORKERS: number
readonly DIST_FOLDER: string
readonly WWW_ROOT: string
readonly HTTP_LOGS_ENABLED: boolean
}
export const STANDARD_CONFIG: IConfig = {
NODE_DEBUG: maybe(process.env.NODE_ENV).filter(a => a === 'production').isNone(),
HTTP_LOGS_ENABLED: maybe(process.env.HTTP_LOGS_DISABLED).filter(Boolean).isNone(),
PORT: maybe(argv['port'] as string | undefined)
.match({ some: maybe, none: () => maybe(process.env.PORT) })
.map(p => +p).valueOr(4200),
CLUSTERED_WORKERS: maybe(process.env.WEB_CONCURRENCY).map(a => +a).valueOr(1),
DIST_FOLDER: resolve('dist'),
WWW_ROOT: 'wwwroot'
}
electron: {
renderer: fusebox({
target: 'browser',
output: 'dist/desktop/wwwroot/assets/js',
entry: this.aot
? this.prod ? 'ngc/esnext/electron/angular/main.aot.prod.js' : 'ngc/esnext/electron/angular/main.aot.js'
: this.prod ? 'src/electron/angular/main.prod.ts' : 'src/electron/angular/main.ts',
webIndex: { template: 'src/browser/index.pug', distFileName: '../../index.html', publicPath: '/assets/js' },
dependencies: { ignorePackages: packageJson.fusebox.ignore.browser },
codeSplitting: { useHash: false, maxPathLength: 0 },
devServer: false,
env: Object
.keys(process.env)
.filter(k => k.includes('NG_'))
.reduce((acc, curr) => ({ ...acc, [curr.replace('NG_', '')]: process.env[curr] }), {
NG_SERVER_HOST: maybe(process.env.HOSTNAME).valueOr(`http://localhost:${this.ngServerPort}`)
}),
...this.shared,
plugins: [pluginConsolidate('pug', { ...pugSharedLocals, isElectron: true }), ...this.shared.plugins]
}),
main: fusebox({
target: 'electron',
entry: 'src/electron/app.ts',
output: 'dist/desktop',
useSingleBundle: true,
devServer: false,
sourceMap: false,
dependencies: {
ignoreAllExternal: false,
ignorePackages: packageJson.fusebox.ignore.electron
},
...this.shared
maybeGet = (key: keyof IEnvironment) => maybe(this.config[key])
export interface StringDictionary {
readonly [key: string]: string
}
export interface IConfig {
readonly PORT: number
readonly NODE_DEBUG: boolean
readonly CLUSTERED_WORKERS: number
readonly DIST_FOLDER: string
readonly WWW_ROOT: string
readonly HTTP_LOGS_ENABLED: boolean
}
export const STANDARD_CONFIG: IConfig = {
NODE_DEBUG: maybe(process.env.NODE_ENV).filter(a => a === 'production').isNone(),
HTTP_LOGS_ENABLED: maybe(process.env.HTTP_LOGS_DISABLED).filter(Boolean).isNone(),
PORT: maybe(argv['port'] as string | undefined)
.match({ some: maybe, none: () => maybe(process.env.PORT) })
.map(p => +p).valueOr(4200),
CLUSTERED_WORKERS: maybe(process.env.WEB_CONCURRENCY).map(a => +a).valueOr(1),
DIST_FOLDER: resolve('dist'),
WWW_ROOT: 'wwwroot'
}
export interface StringDictionary {
readonly [key: string]: string
}
export interface IConfig {
readonly PORT: number
readonly NODE_DEBUG: boolean
readonly CLUSTERED_WORKERS: number
readonly DIST_FOLDER: string
readonly WWW_ROOT: string
readonly HTTP_LOGS_ENABLED: boolean
}
export const STANDARD_CONFIG: IConfig = {
NODE_DEBUG: maybe(process.env.NODE_ENV).filter(a => a === 'production').isNone(),
HTTP_LOGS_ENABLED: maybe(process.env.HTTP_LOGS_DISABLED).filter(Boolean).isNone(),
PORT: maybe(argv['port'] as string | undefined)
.match({ some: maybe, none: () => maybe(process.env.PORT) })
.map(p => +p).valueOr(4200),
CLUSTERED_WORKERS: maybe(process.env.WEB_CONCURRENCY).map(a => +a).valueOr(1),
DIST_FOLDER: resolve('dist'),
WWW_ROOT: 'wwwroot'
}