@travetto/manifest
Advanced tools
Comparing version 3.0.2-rc.0 to 3.0.2-rc.1
{ | ||
"name": "@travetto/manifest", | ||
"version": "3.0.2-rc.0", | ||
"version": "3.0.2-rc.1", | ||
"description": "Support for project indexing, manifesting, along with file watching", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -119,2 +119,6 @@ <!-- This file was generated by @travetto/doc and should not be modified directly --> | ||
includeHidden?: boolean; | ||
/** | ||
* Should watching prevent normal exiting, until watch is removed? | ||
*/ | ||
persistent?: boolean; | ||
}; | ||
@@ -121,0 +125,0 @@ |
@@ -35,2 +35,6 @@ import { watch, Stats } from 'fs'; | ||
includeHidden?: boolean; | ||
/** | ||
* Should watching prevent normal exiting, until watch is removed? | ||
*/ | ||
persistent?: boolean; | ||
}; | ||
@@ -50,3 +54,3 @@ | ||
const watchPath = path.resolve(folder); | ||
const watcher = watch(watchPath, { persistent: true, encoding: 'utf8' }); | ||
const watcher = watch(watchPath, { persistent: options.persistent, encoding: 'utf8' }); | ||
const lastStats: Record<string, Stats | undefined> = {}; | ||
@@ -135,2 +139,7 @@ const invalidFilter = (el: string): boolean => | ||
// Cleanup on intent to exit | ||
if (!config.persistent) { | ||
process.on('SIGUSR2', remove); | ||
} | ||
// Cleanup on exit | ||
@@ -137,0 +146,0 @@ process.on('exit', remove); |
@@ -10,2 +10,3 @@ import ts from 'typescript'; | ||
const MANIFEST_IDX = `${MANIFEST_MOD}/__index__`; | ||
const ENTRY_POINT = 'support/entry'; | ||
@@ -34,9 +35,6 @@ const ROOT_IDX_IMPORT = `${MANIFEST_MOD}/src/root-index`; | ||
static #valid(state: TransformerState): boolean { | ||
return !state.importName.startsWith(MANIFEST_MOD) || | ||
( | ||
!state.importName.includes('/src/') && | ||
!state.importName.includes('/support/') && | ||
state.importName !== MANIFEST_IDX | ||
); | ||
static #valid({ importName: imp }: TransformerState): boolean { | ||
return !imp.startsWith(MANIFEST_MOD) ? | ||
!imp.includes(ENTRY_POINT) : | ||
!(/[/](src|support)[/]/.test(imp) || imp === MANIFEST_IDX); | ||
} | ||
@@ -43,0 +41,0 @@ |
70713
1582
274