@sanity/pkg-utils 5.0.5 → 5.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/pkg-utils",
3
- "version": "5.0.5",
3
+ "version": "5.0.7",
4
4
  "description": "Simple utilities for modern npm packages.",
5
5
  "keywords": [
6
6
  "sanity-io",
@@ -60,9 +60,9 @@
60
60
  },
61
61
  "browserslist": "extends @sanity/browserslist-config",
62
62
  "dependencies": {
63
- "@babel/core": "^7.24.0",
63
+ "@babel/core": "^7.24.1",
64
64
  "@babel/types": "^7.24.0",
65
- "@microsoft/api-extractor": "^7.42.3",
65
+ "@microsoft/api-extractor": "^7.43.0",
66
66
  "@microsoft/tsdoc-config": "^0.16.2",
67
67
  "@rollup/plugin-alias": "^5.1.0",
68
68
  "@rollup/plugin-babel": "^6.0.4",
@@ -133,7 +133,7 @@
133
133
  "typescript": "^5.4.2",
134
134
  "vitest": "^1.4.0",
135
135
  "vitest-github-actions-reporter": "^0.11.1",
136
- "@sanity/pkg-utils": "5.0.5"
136
+ "@sanity/pkg-utils": "5.0.7"
137
137
  },
138
138
  "peerDependencies": {
139
139
  "typescript": "^4.7 || ^5"
@@ -1,8 +1,8 @@
1
1
  import fs from 'fs'
2
2
  import path from 'path'
3
3
 
4
- import {BuildContext, PkgExport, PkgFormat, PkgRuntime} from './core'
5
- import {BuildTask, DtsTask, RollupTask, RollupTaskEntry} from './tasks'
4
+ import type {BuildContext, PkgExport, PkgFormat, PkgRuntime} from './core'
5
+ import type {BuildTask, DtsTask, RollupTask, RollupTaskEntry} from './tasks'
6
6
 
7
7
  /** @internal */
8
8
  export function resolveBuildTasks(ctx: BuildContext): BuildTask[] {
@@ -146,7 +146,7 @@ export function resolveBuildTasks(ctx: BuildContext): BuildTask[] {
146
146
  if (relativeTargetPath) {
147
147
  fs.writeFileSync(
148
148
  path.resolve(cwd, `${exp._path}.js`),
149
- [`// AUTO-GENERATED – DO NOT EDIT`, `export * from '${relativeTargetPath}'`, ``].join(
149
+ ['// AUTO-GENERATED – DO NOT EDIT', `export * from '${relativeTargetPath}'`, ''].join(
150
150
  '\n',
151
151
  ),
152
152
  )
@@ -1,4 +1,4 @@
1
- import {IConfigFile, IExtractorMessagesConfig} from '@microsoft/api-extractor'
1
+ import type {IConfigFile, IExtractorMessagesConfig} from '@microsoft/api-extractor'
2
2
  import path from 'path'
3
3
 
4
4
  export function createApiExtractorConfig(options: {
@@ -1,12 +1,12 @@
1
- import {ExtractorMessage} from '@microsoft/api-extractor'
1
+ import type {ExtractorMessage} from '@microsoft/api-extractor'
2
2
  import path from 'path'
3
3
  import rimraf from 'rimraf'
4
4
 
5
- import {BuildContext} from '../../core'
5
+ import type {BuildContext} from '../../core'
6
6
  import {buildTypes} from './buildTypes'
7
7
  import {DtsError} from './DtsError'
8
8
  import {extractTypes} from './extractTypes'
9
- import {DtsResult, DtsTask, DtsWatchTask} from './types'
9
+ import type {DtsResult, DtsTask, DtsWatchTask} from './types'
10
10
 
11
11
  /**
12
12
  * - Build type definitions to a temporary directory using TypeScript compiler.
@@ -2,17 +2,17 @@ import chalk from 'chalk'
2
2
  import {Observable} from 'rxjs'
3
3
 
4
4
  import {printExtractMessages} from '../../printExtractMessages'
5
- import {TaskHandler} from '../types'
5
+ import type {TaskHandler} from '../types'
6
6
  import {doExtract} from './doExtract'
7
7
  import {DtsError} from './DtsError'
8
- import {DtsResult, DtsTask} from './types'
8
+ import type {DtsResult, DtsTask} from './types'
9
9
 
10
10
  /** @internal */
11
11
  export const dtsTask: TaskHandler<DtsTask, DtsResult> = {
12
12
  name: (_ctx, task) =>
13
13
  [
14
- `Build type definitions...`,
15
- ` entries:`,
14
+ 'Build type definitions...',
15
+ ' entries:',
16
16
  ...task.entries.map((entry) =>
17
17
  [
18
18
  ` - ${chalk.cyan(entry.importId)}: `,
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  Extractor,
3
3
  ExtractorConfig,
4
- ExtractorMessage,
5
- ExtractorResult,
4
+ type ExtractorMessage,
5
+ type ExtractorResult,
6
6
  } from '@microsoft/api-extractor'
7
7
  import fs from 'fs/promises'
8
8
  import {mkdirp} from 'mkdirp'
9
9
  import path from 'path'
10
10
  import prettier from 'prettier'
11
11
 
12
- import {BuildFile, PkgConfigOptions} from '../../core'
12
+ import type {BuildFile, PkgConfigOptions} from '../../core'
13
13
  import {createApiExtractorConfig} from './createApiExtractorConfig'
14
14
  import {createTSDocConfig} from './createTSDocConfig'
15
15
  import {extractModuleBlocksFromTypes} from './extractModuleBlocks'
@@ -6,11 +6,11 @@ import {nodeResolve} from '@rollup/plugin-node-resolve'
6
6
  import replace from '@rollup/plugin-replace'
7
7
  import terser from '@rollup/plugin-terser'
8
8
  import path from 'path'
9
- import {InputOptions, OutputOptions, Plugin} from 'rollup'
9
+ import type {InputOptions, OutputOptions, Plugin} from 'rollup'
10
10
  import esbuild from 'rollup-plugin-esbuild'
11
11
 
12
- import {BuildContext, resolveConfigProperty} from '../../core'
13
- import {RollupTask, RollupWatchTask} from '../types'
12
+ import {type BuildContext, resolveConfigProperty} from '../../core'
13
+ import type {RollupTask, RollupWatchTask} from '../types'
14
14
 
15
15
  export interface RollupConfig {
16
16
  inputOptions: InputOptions
@@ -58,7 +58,7 @@ export function resolveRollupConfig(
58
58
  ? {...replacements}
59
59
  : {
60
60
  'process.env.PKG_FILE_PATH': (arg) => {
61
- const sourcePath = './' + path.relative(cwd, arg)
61
+ const sourcePath = `./${path.relative(cwd, arg)}`
62
62
  const entry = entries.find((e) => e.source === sourcePath)
63
63
 
64
64
  if (!entry) {