@berish/yarn-workspaces
Advanced tools
Comparing version 1.1.0 to 1.1.1
import { InitParams, ConfigType } from './types'; | ||
export declare const getConfig: (paths: InitParams) => ConfigType; | ||
export declare const getConfig: (params: InitParams) => ConfigType; |
@@ -6,6 +6,7 @@ "use strict"; | ||
const workspace_1 = require("./workspace"); | ||
exports.getConfig = (paths) => { | ||
helpers_1.guard(paths.appPath, paths.appPackageJson); | ||
exports.getConfig = (params) => { | ||
helpers_1.guard(params.appPath, params.appPackageJson); | ||
const config = { | ||
root: null, | ||
dependenciesTable: {}, | ||
paths: [], | ||
@@ -21,3 +22,3 @@ pathsDependencies: [], | ||
}; | ||
const { rootDirPath, workspaces } = helpers_1.getRootConfig(paths.appPath); | ||
const { rootDirPath, workspaces } = helpers_1.getRootConfig(params.appPath); | ||
const workspacesList = []; | ||
@@ -45,3 +46,3 @@ if (workspaces) { | ||
const dependenciesTable = workspace_1.buildDependenciesTable(packageEntries); | ||
const appDependencies = helpers_1.getDependenciesByPath(paths.appPackageJson); | ||
const appDependencies = helpers_1.getDependenciesByPath(params.appPackageJson); | ||
const searchResultDependenciesTable = workspace_1.searchInDependenciesTable(appDependencies, dependenciesTable, packageEntries); | ||
@@ -51,15 +52,16 @@ console.log(`Found ${packageEntries.length} path(s) with "${config.packageEntry}" entry.`); | ||
console.log(`Found ${searchResultDependenciesTable.pathsDevDependencies.length} path(s) as tree of devDependencies`); | ||
const { paths: allPaths, pathsDependencies, pathsDevDependencies, workspacesPackages, workspacesPackagesDependencies, workspacesPackagesDevDependencies, } = searchResultDependenciesTable; | ||
if (allPaths.length > 0) | ||
config.paths = allPaths; | ||
const { paths, pathsDependencies, pathsDevDependencies, workspacesPackages, workspacesPackagesDependencies, workspacesPackagesDevDependencies, } = searchResultDependenciesTable; | ||
config.dependenciesTable = dependenciesTable; | ||
if (paths.length > 0) | ||
config.paths = paths; | ||
if (pathsDependencies.length > 0) | ||
config.paths = pathsDependencies; | ||
config.pathsDependencies = pathsDependencies; | ||
if (pathsDevDependencies.length > 0) | ||
config.paths = pathsDevDependencies; | ||
config.pathsDevDependencies = pathsDevDependencies; | ||
if (workspacesPackages.length > 0) | ||
config.paths = workspacesPackages; | ||
config.workspacesPackages = workspacesPackages; | ||
if (workspacesPackagesDependencies.length > 0) | ||
config.paths = workspacesPackagesDependencies; | ||
config.workspacesPackagesDependencies = workspacesPackagesDependencies; | ||
if (workspacesPackagesDevDependencies.length > 0) | ||
config.paths = workspacesPackagesDevDependencies; | ||
config.workspacesPackagesDevDependencies = workspacesPackagesDevDependencies; | ||
console.log('Exporting Workspaces config to Webpack.'); | ||
@@ -66,0 +68,0 @@ return config; |
@@ -44,2 +44,3 @@ export declare type WorkspacesStringType = string[]; | ||
root: string; | ||
dependenciesTable: DependenciesTableType; | ||
packageEntry: string; | ||
@@ -46,0 +47,0 @@ development: boolean; |
{ | ||
"name": "@berish/yarn-workspaces", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Get config by yarn workspaces", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
Sorry, the diff of this file is not supported yet
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
33649
432