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: sanity-io/pkg-utils
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.7
Choose a base ref
...
head repository: sanity-io/pkg-utils
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.1.0
Choose a head ref
  • 4 commits
  • 20 files changed
  • 3 contributors

Commits on Jan 2, 2023

  1. chore(deps): lock file maintenance (#36)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 2, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    73fdd0d View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4e1a4d8 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    08f005b View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a1b6956 View commit details
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,12 @@
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.1.0](https://github.com/sanity-io/pkg-utils/compare/v2.0.7...v2.1.0) (2023-01-02)

### Features

- re-export CJS in ESM wrapper (`node.import` compat) ([4e1a4d8](https://github.com/sanity-io/pkg-utils/commit/4e1a4d822114dbaff45eb5baba8729d74d5c263c))

## [2.0.7](https://github.com/sanity-io/pkg-utils/compare/v2.0.6...v2.0.7) (2023-01-02)

### Bug Fixes
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "@sanity/pkg-utils",
"version": "2.0.7",
"version": "2.1.0",
"author": "Sanity.io <hello@sanity.io>",
"license": "MIT",
"description": "Simple utilities for modern npm packages.",
7 changes: 7 additions & 0 deletions playground/dummy-commonjs/node/extra.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const cjs = require('../dist/extra')

module.exports = {
...cjs,
path: 'node/extra.js',
}
8 changes: 4 additions & 4 deletions playground/dummy-commonjs/node/extra.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as lib from '../dist/extra.js'
import cjs from '../dist/extra.js'

export const format = `node:${lib.format}`
export const path = `node:${lib.path}`
export const runtime = `node:${lib.runtime}`
export const format = cjs.format
export const runtime = cjs.runtime
export const path = 'node/extra.mjs'
7 changes: 7 additions & 0 deletions playground/dummy-commonjs/node/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const cjs = require('../dist/index')

module.exports = {
...cjs,
path: 'node/index.js',
}
8 changes: 4 additions & 4 deletions playground/dummy-commonjs/node/index.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as lib from '../dist/index.js'
import cjs from '../dist/index.js'

export const format = `node:${lib.format}`
export const path = `node:${lib.path}`
export const runtime = `node:${lib.runtime}`
export const format = cjs.format
export const runtime = cjs.runtime
export const path = 'node/index.mjs'
1 change: 0 additions & 1 deletion playground/dummy-commonjs/package.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {defineConfig} from '@sanity/pkg-utils'

export default defineConfig({
legacyExports: false,
tsconfig: 'tsconfig.dist.json',
})
20 changes: 10 additions & 10 deletions playground/dummy-commonjs/package.json
Original file line number Diff line number Diff line change
@@ -20,13 +20,13 @@
"require": "./dist/index.browser.js",
"import": "./dist/index.browser.mjs"
},
"node": {
"import": "./node/index.mjs",
"require": "./dist/index.js"
},
"source": "./src/index.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"node": {
"import": "./node/index.mjs",
"require": "./node/index.js"
},
"default": "./dist/index.mjs"
},
"./extra": {
@@ -36,13 +36,13 @@
"require": "./dist/extra.browser.js",
"import": "./dist/extra.browser.mjs"
},
"node": {
"import": "./node/extra.mjs",
"require": "./dist/extra.js"
},
"source": "./src/extra.ts",
"import": "./dist/extra.mjs",
"require": "./dist/extra.js",
"node": {
"import": "./node/extra.mjs",
"require": "./node/extra.js"
},
"default": "./dist/extra.mjs"
},
"./package.json": "./package.json"
@@ -56,10 +56,10 @@
},
"files": [
"dist",
"extra.js",
"node",
"src"
],
"scripts": {
"build": "rimraf dist extra.js && pkg build --strict && pkg --strict"
"build": "rimraf dist && pkg build --strict && pkg --strict"
}
}
7 changes: 7 additions & 0 deletions playground/dummy-module/node/extra.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const cjs = require('../dist/extra.cjs')

module.exports = {
...cjs,
path: 'node/extra.cjs',
}
8 changes: 4 additions & 4 deletions playground/dummy-module/node/extra.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as lib from '../dist/extra.cjs'
import cjs from '../dist/extra.cjs'

export const format = `node:${lib.format}`
export const path = `node:${lib.path}`
export const runtime = `node:${lib.runtime}`
export const format = cjs.format
export const runtime = cjs.runtime
export const path = 'node/extra.js'
7 changes: 7 additions & 0 deletions playground/dummy-module/node/index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const cjs = require('../dist/index.cjs')

module.exports = {
...cjs,
path: 'node/index.cjs',
}
8 changes: 4 additions & 4 deletions playground/dummy-module/node/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as lib from '../dist/index.cjs'
import cjs from '../dist/index.cjs'

export const format = `node:${lib.format}`
export const path = `node:${lib.path}`
export const runtime = `node:${lib.runtime}`
export const format = cjs.format
export const runtime = cjs.runtime
export const path = 'node/index.js'
1 change: 0 additions & 1 deletion playground/dummy-module/package.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {defineConfig} from '@sanity/pkg-utils'

export default defineConfig({
legacyExports: true,
tsconfig: 'tsconfig.dist.json',
})
21 changes: 11 additions & 10 deletions playground/dummy-module/package.json
Original file line number Diff line number Diff line change
@@ -20,13 +20,13 @@
"require": "./dist/index.browser.cjs",
"import": "./dist/index.browser.js"
},
"node": {
"import": "./node/index.js",
"require": "./dist/index.cjs"
},
"source": "./src/index.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"node": {
"import": "./node/index.js",
"require": "./node/index.cjs"
},
"default": "./dist/index.js"
},
"./extra": {
@@ -36,13 +36,13 @@
"require": "./dist/extra.browser.cjs",
"import": "./dist/extra.browser.js"
},
"node": {
"import": "./node/extra.js",
"require": "./dist/extra.cjs"
},
"source": "./src/extra.ts",
"import": "./dist/extra.js",
"require": "./dist/extra.cjs",
"node": {
"import": "./node/extra.js",
"require": "./node/extra.cjs"
},
"default": "./dist/extra.js"
},
"./package.json": "./package.json"
@@ -56,9 +56,10 @@
},
"files": [
"dist",
"extra.js"
"node",
"src"
],
"scripts": {
"build": "rimraf dist extra.js && pkg build --strict && pkg --strict"
"build": "rimraf dist && pkg build --strict && pkg --strict"
}
}
8 changes: 8 additions & 0 deletions playground/multi-export/package.json
Original file line number Diff line number Diff line change
@@ -14,13 +14,21 @@
"source": "./src/index.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"node": {
"import": "./dist/node/index.cjs.js",
"require": "./dist/index.cjs"
},
"default": "./dist/index.js"
},
"./plugin": {
"types": "./dist/plugin.d.ts",
"source": "./src/plugin.ts",
"import": "./dist/plugin.js",
"require": "./dist/plugin.cjs",
"node": {
"import": "./dist/node/plugin.cjs.js",
"require": "./dist/plugin.cjs"
},
"default": "./dist/plugin.js"
},
"./package.json": "./package.json"
Loading