Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: unjs/mlly
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.5.5
Choose a base ref
...
head repository: unjs/mlly
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.5.6
Choose a head ref
  • 7 commits
  • 6 files changed
  • 4 contributors

Commits on Jul 31, 2022

  1. chore(deps): update pnpm to v7.7.1 (#60)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jul 31, 2022
    Copy the full SHA
    57d5519 View commit details

Commits on Aug 3, 2022

  1. Copy the full SHA
    79a3ceb View commit details
  2. chore(deps): update all non-major dependencies (#62)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Aug 3, 2022
    Copy the full SHA
    58cb906 View commit details
  3. chore: update the lockfile

    pi0 committed Aug 3, 2022
    Copy the full SHA
    83502b4 View commit details
  4. Copy the full SHA
    7039f54 View commit details
  5. Copy the full SHA
    a699573 View commit details
  6. chore(release): 0.5.6

    pi0 committed Aug 3, 2022
    Copy the full SHA
    83e30de View commit details
Showing with 487 additions and 424 deletions.
  1. +13 −0 CHANGELOG.md
  2. +26 −4 README.md
  3. +4 −3 package.json
  4. +269 −400 pnpm-lock.yaml
  5. +65 −8 src/analyze.ts
  6. +110 −9 test/exports.test.ts
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,19 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.5.6](https://github.com/unjs/mlly/compare/v0.5.5...v0.5.6) (2022-08-03)


### Features

* `resolveModuleExportNames` and `findExportNames` ([#63](https://github.com/unjs/mlly/issues/63)) ([a699573](https://github.com/unjs/mlly/commit/a6995739fcf42f7f69b1df33caac8f5060e283d5))
* **findExports:** use acorn tokenizer to filter false positive exports ([#56](https://github.com/unjs/mlly/issues/56)) ([7039f54](https://github.com/unjs/mlly/commit/7039f54277b1791e99b4f625198dfba2dbf6fbe6))


### Bug Fixes

* **findExports:** get exports with trailing comma ([#61](https://github.com/unjs/mlly/issues/61)) ([79a3ceb](https://github.com/unjs/mlly/commit/79a3ceb5f9b831325351a411a8d1fdc0c2fb6778))

### [0.5.5](https://github.com/unjs/mlly/compare/v0.5.4...v0.5.5) (2022-07-20)


30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -29,8 +29,6 @@ import { } from 'mlly'
const { } = require('mlly')
```



## Resolving ESM modules

Several utilities to make ESM resolution easier:
@@ -286,8 +284,6 @@ const foo = await import('bar')
### `findExports`
**Note:** API Of this function might be broken in a breaking change for code matcher
```js
import { findExports } from 'mlly'

@@ -322,6 +318,32 @@ Outputs:
]
```
### `findExportNames`
Same as `findExports` but returns array of export names.
```js
import { findExportNames } from 'mlly'

// [ "foo", "bar", "baz", "default" ]
console.log(findExportNames(`
export const foo = 'bar'
export { bar, baz }
export default something
`))
```
## `resolveModuleExportNames`
Resolves module and reads its contents to extract possible export names using static analyzes.
```js
import { resolveModuleExportNames } from 'mlly'

// ["basename", "dirname", ... ]
console.log(await resolveModuleExportNames('pathe'))
```
## Evaluating Modules
Set of utilities to evaluate ESM modules using `data:` imports
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mlly",
"version": "0.5.5",
"version": "0.5.6",
"description": "Missing ECMAScript module utils for Node.js",
"repository": "unjs/mlly",
"license": "MIT",
@@ -24,7 +24,8 @@
"test": "pnpm lint && vitest run"
},
"dependencies": {
"pathe": "^0.3.2",
"acorn": "^8.8.0",
"pathe": "^0.3.3",
"pkg-types": "^0.3.3"
},
"devDependencies": {
@@ -37,5 +38,5 @@
"unbuild": "latest",
"vitest": "latest"
},
"packageManager": "pnpm@7.5.2"
"packageManager": "pnpm@7.8.0"
}
Loading