pure-index
Advanced tools
Comparing version 0.0.36 to 0.0.37
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
import { getConfig } from '../src/getConfig.js' | ||
import { main } from '../src/main.js' | ||
import { baseFlow } from '../src/baseFlow.js' | ||
@@ -14,2 +14,2 @@ const config = await getConfig() | ||
await main({ config }) | ||
await baseFlow({ config }) |
{ | ||
"name": "pure-index", | ||
"type": "module", | ||
"version": "0.0.36", | ||
"version": "0.0.37", | ||
"description": "Utility for monorepos. It helps to find unused exports from packages or get a list of all unique uses of any package", | ||
@@ -6,0 +6,0 @@ "main": "./src/index.js", |
@@ -61,3 +61,3 @@ # 🌿 Pure Index | ||
"extensions": ["ts", "tsx"], | ||
"searchDir": "my-path", | ||
"dir": "my-path", | ||
"babelPlugins": ["typescript"], | ||
@@ -75,3 +75,3 @@ "batch": 100 | ||
"extensions": ["ts", "tsx"], | ||
"searchDir": "my-path", | ||
"dir": "my-path", | ||
"babelPlugins": ["typescript"], | ||
@@ -89,3 +89,3 @@ "batch": 100 | ||
extensions: ['ts', 'tsx'], | ||
searchDir: 'my-path', | ||
dir: 'my-path', | ||
babelPlugins: ['typescript'], | ||
@@ -109,3 +109,3 @@ batch: 100 | ||
- `exclude (Array<string>)` — list of directories that will be excluded when searching for imports. | ||
- `searchDir (String)` — path to the directory where imports should be searched for. | ||
- `dir (String)` — path to the directory where imports should be searched for. | ||
- `babelPlugins (Array<string>)` — list of babel plugins that will be used when parsing files. | ||
@@ -163,3 +163,3 @@ - `batch (Number)` — number of files to be traversed in parallel. Changing the value may speed up or slow down the script. Choose the value yourself. | ||
### `--search-dir, -s` | ||
### `--dir, -d` | ||
@@ -172,3 +172,3 @@ <details><summary><b>Show instructions</b></summary> | ||
- "check-exports": "pure-index", | ||
+ "check-exports": "pure-index --search-dir /Users/user/another-repo", | ||
+ "check-exports": "pure-index --dir /Users/user/another-repo", | ||
"test": "vitest" | ||
@@ -175,0 +175,0 @@ } |
@@ -16,3 +16,3 @@ import { expect, test, mock, vi } from 'vitest' | ||
exclude: 'biba,boba,.cache,www/assets,__tests__', | ||
searchDir: 'dir-from-cli' | ||
dir: 'dir-from-cli' | ||
} | ||
@@ -39,3 +39,3 @@ })) | ||
]), | ||
searchDir: 'dir-from-cli' | ||
dir: 'dir-from-cli' | ||
}) | ||
@@ -42,0 +42,0 @@ |
@@ -16,3 +16,3 @@ import { expect, test, mock, vi } from 'vitest' | ||
extensions: ['js', 'jsx'], | ||
searchDir: 'dir-from-cli' | ||
dir: 'dir-from-cli' | ||
} | ||
@@ -32,3 +32,3 @@ }) | ||
exclude: 'biba,boba,.cache,www/assets,__tests__', | ||
searchDir: 'dir-from-config' | ||
dir: 'dir-from-config' | ||
} | ||
@@ -55,3 +55,3 @@ })) | ||
]), | ||
searchDir: 'dir-from-cli' | ||
dir: 'dir-from-cli' | ||
}) | ||
@@ -58,0 +58,0 @@ |
@@ -8,3 +8,3 @@ export const CONFIG = { | ||
extensions: ['ts', 'tsx'], | ||
searchDir: 'repo-root' | ||
dir: 'repo-root' | ||
} |
@@ -16,3 +16,3 @@ import { expect, test, mock, vi } from 'vitest' | ||
extensions: ['js', 'jsx'], | ||
searchDir: 'dir-from-config' | ||
dir: 'dir-from-config' | ||
} | ||
@@ -32,3 +32,3 @@ }) | ||
exclude: new Set([...CONFIG.exclude, 'build']), | ||
searchDir: 'dir-from-config' | ||
dir: 'dir-from-config' | ||
}) | ||
@@ -35,0 +35,0 @@ |
{ | ||
"name": "package-d", | ||
"scripts": { | ||
"check-exports": "node ../../../bin/index.js -s ../monorepo/app", | ||
"check-exports-unhappy": "node ../../../bin/index.js -s ../biba", | ||
"check-exports-happy": "node ../../../bin/index.js -s ../monorepo" | ||
"check-exports": "node ../../../bin/index.js -d ../monorepo/app", | ||
"check-exports-unhappy": "node ../../../bin/index.js -d ../biba", | ||
"check-exports-happy": "node ../../../bin/index.js -d ../monorepo" | ||
} | ||
} |
@@ -12,3 +12,3 @@ import { fileTraversal } from './fileTraversal/index.js' | ||
* extensions: Array<string> | ||
* searchDir: string | ||
* dir: string | ||
* }, | ||
@@ -15,0 +15,0 @@ * }} |
@@ -12,3 +12,3 @@ import { join } from 'node:path' | ||
* extensions: Array<string> | ||
* searchDir: string | ||
* dir: string | ||
* } | ||
@@ -40,3 +40,3 @@ * pkg: { | ||
.withFullPaths() | ||
.crawl(config.searchDir) | ||
.crawl(config.dir) | ||
.sync() | ||
@@ -43,0 +43,0 @@ |
@@ -12,3 +12,3 @@ import { processBatch } from './processBatch/index.js' | ||
* extensions: Array<string> | ||
* searchDir: string | ||
* dir: string | ||
* } | ||
@@ -15,0 +15,0 @@ * pkg: { |
@@ -12,3 +12,3 @@ import { join } from 'node:path' | ||
entry: 'index.ts', | ||
searchDir: null, | ||
dir: null, | ||
exclude: new Set(['node_modules']), | ||
@@ -24,3 +24,3 @@ extensions: ['ts', 'tsx'] | ||
--extensions, -x list of file extensions to be considered during the search | ||
--search-dir, -s path to the directory where imports should be searched for | ||
--dir, -d path to the directory where imports should be searched for | ||
--babel-plugins, -p list of babel plugins that will be used when parsing files | ||
@@ -38,3 +38,3 @@ --batch, -b number of files to be traversed in parallel | ||
extensions: { type: 'string', shortFlag: 'x' }, | ||
searchDir: { type: 'string', shortFlag: 's' }, | ||
dir: { type: 'string', shortFlag: 'd' }, | ||
babelPlugins: { type: 'string', shortFlag: 'p' }, | ||
@@ -63,3 +63,3 @@ batch: { type: 'number', shortFlag: 'b' }, | ||
extensions = BASE_CONFIG.extensions, | ||
searchDir | ||
dir | ||
} = result.config | ||
@@ -82,3 +82,3 @@ | ||
: extensions, | ||
searchDir: cli.flags.searchDir || searchDir || getRepoRoot() | ||
dir: cli.flags.dir || dir || getRepoRoot() | ||
} | ||
@@ -85,0 +85,0 @@ } |
@@ -1,2 +0,1 @@ | ||
import { join } from 'node:path' | ||
import parser from '@babel/parser' | ||
@@ -10,3 +9,2 @@ | ||
* babelPlugins: Array<string> | ||
* entry: string | ||
* } | ||
@@ -21,3 +19,3 @@ * pkg: { | ||
const getExports = async ({ config, pkg }) => { | ||
const code = await readFile(join(pkg.path, config.entry)) | ||
const code = await readFile(pkg.path) | ||
const result = new ObservableSet() | ||
@@ -24,0 +22,0 @@ |
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
32155
731