@travetto/manifest
Advanced tools
Comparing version 3.0.0-rc.10 to 3.0.0-rc.11
{ | ||
"name": "@travetto/manifest", | ||
"version": "3.0.0-rc.10", | ||
"version": "3.0.0-rc.11", | ||
"description": "Manifest support", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -304,8 +304,8 @@ import { path } from './path'; | ||
*/ | ||
getLocalInputFolders(): string[] { | ||
return this.getLocalModules() | ||
.flatMap(x => | ||
(!this.manifest.monoRepo || x.sourcePath !== this.manifest.workspacePath) ? | ||
[x.sourcePath] : [...Object.keys(x.files)].filter(y => !y.startsWith('$')).map(y => path.resolve(x.sourcePath, y)) | ||
); | ||
getLocalInputFolderMapping(): [folder: string, moduleSourceRoot: string][] { | ||
return this.getLocalModules().flatMap(x => | ||
((!this.manifest.monoRepo || x.sourcePath !== this.manifest.workspacePath) ? | ||
[x.sourcePath] : [...Object.keys(x.files)].filter(y => !y.startsWith('$')).map(y => path.resolve(x.sourcePath, y)) | ||
).map(f => [f, path.resolve(x.sourceFolder)] as [string, string]) | ||
); | ||
} | ||
@@ -312,0 +312,0 @@ |
@@ -25,8 +25,11 @@ import fs from 'fs/promises'; | ||
*/ | ||
export async function watchFolders(folders: string[], onEvent: WatchEventListener, config: WatchConfig = {}): Promise<() => Promise<void>> { | ||
export async function watchFolders(folders: string[] | [folder: string, targetFolder: string][], onEvent: WatchEventListener, config: WatchConfig = {}): Promise<() => Promise<void>> { | ||
const lib = await getWatcher(); | ||
const createMissing = config.createMissing ?? false; | ||
const validFolders = new Set(folders); | ||
const validFolders = new Set(folders.map(x => typeof x === 'string' ? x : x[0])); | ||
const subs = await Promise.all(folders.map(async folder => { | ||
const subs = await Promise.all(folders.map(async value => { | ||
const folder = typeof value === 'string' ? value : value[0]; | ||
const targetFolder = typeof value === 'string' ? value : value[1]; | ||
if (await fs.stat(folder).then(() => true, () => createMissing)) { | ||
@@ -42,3 +45,3 @@ await fs.mkdir(folder, { recursive: true }); | ||
if (!config.filter || config.filter(finalEv)) { | ||
onEvent(finalEv, folder); | ||
onEvent(finalEv, targetFolder); | ||
} | ||
@@ -45,0 +48,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56116
1500