pure-index
Advanced tools
Comparing version 0.0.37 to 0.0.38
{ | ||
"name": "pure-index", | ||
"type": "module", | ||
"version": "0.0.37", | ||
"version": "0.0.38", | ||
"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", |
@@ -1,5 +0,5 @@ | ||
import { ususedFn } from 'package-d' | ||
import { unusedFn } from 'package-d' | ||
const identity = <T>(x: T) => { | ||
ususedFn() | ||
unusedFn() | ||
return x | ||
@@ -6,0 +6,0 @@ } |
const getRoot = () => document.getElementById('root') | ||
const ususedFn = () => false | ||
const unusedFn = () => false | ||
export { getRoot, ususedFn } | ||
export { getRoot, unusedFn } |
@@ -23,3 +23,3 @@ import { join } from 'node:path' | ||
const { name } = await readJSON('package.json') | ||
const pkg = { name, path: join(process.cwd(), config.entry) } | ||
const pkg = { name, path: config.entry } | ||
const statusApi = createStatusAPI({ | ||
@@ -41,6 +41,2 @@ title: `Checking exports from the ${pkg.name} package` | ||
if (exports.size === 0) { | ||
statusApi.succeed() | ||
} | ||
if (exports.size === originalExportsSize) { | ||
@@ -47,0 +43,0 @@ statusApi.failed({ |
@@ -1,2 +0,1 @@ | ||
import { join } from 'node:path' | ||
import fs from 'node:fs/promises' | ||
@@ -11,4 +10,3 @@ import { createSpinner } from 'nanospinner' | ||
const readJSON = async filePath => | ||
JSON.parse(await readFile(join(process.cwd(), filePath))) | ||
const readJSON = async filePath => JSON.parse(await readFile(filePath)) | ||
@@ -18,2 +16,5 @@ const printError = text => | ||
const printSet = set => | ||
process.stdout.write(`${JSON.stringify([...set], undefined, 2)} \n\n`) | ||
const createStatusAPI = ({ title }) => { | ||
@@ -28,4 +29,3 @@ const spinner = createSpinner(title) | ||
if (set) { | ||
const list = [...set] | ||
process.stdout.write(`${JSON.stringify(list, undefined, 2)} \n\n`) | ||
printSet(set) | ||
} | ||
@@ -41,4 +41,3 @@ | ||
if (set) { | ||
const list = [...set] | ||
process.stdout.write(`${JSON.stringify(list, undefined, 2)} \n\n`) | ||
printSet(set) | ||
} | ||
@@ -55,1 +54,2 @@ | ||
export { ObservableSet } from './observableSet.js' | ||
export { Result } from './result.js' |
Sorry, the diff of this file is not supported yet
32288
44
741