Skip to content

Commit

Permalink
added: see log
Browse files Browse the repository at this point in the history
  • Loading branch information
binjospookie committed Mar 4, 2024
1 parent d2bf68f commit 2ba7b2f
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 65 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ title: Change Log
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](http://semver.org).

## 1.1.0

### Added

- `pkgName` to JS Api -> `findUnusedExports`

### Changed

- bump dev deps

## 1.0.7

### Changed
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pure-index",
"type": "module",
"version": "1.0.7",
"version": "1.1.0",
"description": "Pure Index is a tool for packages. It helps to clean your packages of unused exports with ease.",
"main": "./dist/api/index.js",
"types": "./dist/api/index.d.ts",
Expand All @@ -27,7 +27,7 @@
"node": ">= 16"
},
"devDependencies": {
"@types/node": "20.11.19",
"@types/node": "20.11.24",
"effector": "23.2.0",
"prettier": "3.2.5",
"tsup": "8.0.2",
Expand Down
5 changes: 3 additions & 2 deletions src/api/findUnusedExports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const mergeUnusedExports = (
type Params = {
entry: string;
location?: string;
pkgName?: string;
};

type ListItem = {
Expand All @@ -46,8 +47,8 @@ type ListItem = {
parserConfig?: Config['parserConfig'];
};

const findUnusedExports = async ({ entry, location = '' }: Params, list: ListItem[]) => {
const { name } = await readJSON(join(location, 'package.json'));
const findUnusedExports = async ({ entry, location = '', pkgName }: Params, list: ListItem[]) => {
const name = pkgName || (await readJSON(join(location, 'package.json'))).name;
const pkg = { name, path: join(location, entry) };

const tasks = list.map((x) =>
Expand Down
111 changes: 59 additions & 52 deletions website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/starlight": "^0.19.1",
"astro": "^4.4.1",
"@astrojs/starlight": "^0.21.1",
"astro": "^4.4.9",
"sharp": "0.33.2"
},
"volta": {
Expand Down
8 changes: 7 additions & 1 deletion website/src/content/docs/intro/js-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ Path to the package index file. Relative to the package location.
- **Required**: `false`
- **Default**: `''`

Path to the directory containing `package.json` of the package. Relative to the directory of the script call.
#### pkgName

- **Type**: `string`
- **Required**: `false`
- **Default**: `undefined`

Allows you to specify the name of the package to be searched (instead of `package.json -> name`).

#### repositories

Expand Down

0 comments on commit 2ba7b2f

Please sign in to comment.