@sanity/pkg-utils 7.2.8-canary.1 → 7.2.8-canary.2

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": "7.2.8-canary.1",
3
+ "version": "7.2.8-canary.2",
4
4
  "description": "Simple utilities for modern npm packages.",
5
5
  "keywords": [
6
6
  "sanity-io",
@@ -139,7 +139,7 @@
139
139
  "ts-node": "^10.9.2",
140
140
  "typescript": "5.8.3",
141
141
  "vitest": "^3.2.4",
142
- "@sanity/pkg-utils": "7.2.8-canary.1"
142
+ "@sanity/pkg-utils": "7.2.8-canary.2"
143
143
  },
144
144
  "peerDependencies": {
145
145
  "babel-plugin-react-compiler": "*",
package/src/node/build.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import path from 'node:path'
2
2
  import {rimraf} from 'rimraf'
3
- import {loadConfig, loadPkgWithReporting} from './core'
3
+ import {loadConfig} from './core/config/loadConfig'
4
+ import {loadPkgWithReporting} from './core/pkg/loadPkgWithReporting'
4
5
  import {createLogger} from './logger'
5
6
  import {resolveBuildContext} from './resolveBuildContext'
6
7
  import {resolveBuildTasks} from './resolveBuildTasks'
package/src/node/check.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import path from 'node:path'
2
2
  import esbuild, {type BuildFailure, type Message} from 'esbuild'
3
3
  import {createConsoleSpy} from './consoleSpy'
4
- import {loadConfig, loadPkgWithReporting} from './core'
4
+ import {loadConfig} from './core/config/loadConfig'
5
+ import {loadPkgWithReporting} from './core/pkg/loadPkgWithReporting'
5
6
  import {fileExists} from './fileExists'
6
7
  import {createLogger, type Logger} from './logger'
7
8
  import {printPackageTree} from './printPackageTree'
@@ -1,4 +1,4 @@
1
- export {defineConfig} from './defineConfig'
2
- export {loadConfig} from './loadConfig'
3
- export {resolveConfigProperty} from './resolveConfigProperty'
1
+ export * from './defineConfig'
2
+ export * from './loadConfig'
3
+ export * from './resolveConfigProperty'
4
4
  export * from './types'
package/src/node/init.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import {lstat} from 'node:fs/promises'
2
2
  import {resolve} from 'node:path'
3
3
  import {mkdirp} from 'mkdirp'
4
- import {createFromTemplate} from './core/template'
4
+ import { createFromTemplate } from './core/template'
5
5
  import {fileExists} from './fileExists'
6
6
  import {isEmptyDirectory} from './isEmptyDirectory'
7
7
  import {createLogger} from './logger'
@@ -1,6 +1,5 @@
1
1
  import path from 'node:path'
2
2
  import browserslistToEsbuild from 'browserslist-to-esbuild'
3
- import {loadTSConfig} from './core'
4
3
  import {resolveConfigProperty} from './core/config/resolveConfigProperty'
5
4
  import {type PkgConfigOptions, type PkgExports, type PkgRuntime} from './core/config/types'
6
5
  import type {BuildContext} from './core/contexts/buildContext'
@@ -8,6 +7,7 @@ import {DEFAULT_BROWSERSLIST_QUERY} from './core/defaults'
8
7
  import {findCommonDirPath, pathContains} from './core/findCommonPath'
9
8
  import {parseExports} from './core/pkg/parseExports'
10
9
  import type {PackageJSON} from './core/pkg/types'
10
+ import {loadTSConfig} from './core/ts/loadTSConfig'
11
11
  import type {Logger} from './logger'
12
12
  import {resolveBrowserTarget} from './resolveBrowserTarget'
13
13
  import {resolveNodeTarget} from './resolveNodeTarget'
@@ -4,10 +4,6 @@ import {rollupTask} from './rollup/rollupTask'
4
4
  import {rollupWatchTask} from './rollup/rollupWatchTask'
5
5
  import type {BuildTaskHandlers, WatchTaskHandlers} from './types'
6
6
 
7
- export * from './dts'
8
- export * from './rollup'
9
- export * from './types'
10
-
11
7
  /** @internal */
12
8
  export const buildTaskHandlers: BuildTaskHandlers = {
13
9
  'build:dts': dtsTask,
@@ -1,4 +1,4 @@
1
- import type {RollupWatcherEvent} from 'rollup'
1
+ import type { RollupWatcherEvent } from 'rollup'
2
2
  import type {Observable} from 'rxjs'
3
3
  import type {PkgRuntime} from '../core/config/types'
4
4
  import type {BuildContext} from '../core/contexts/buildContext'
package/src/node/watch.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import path from 'node:path'
2
2
  import {switchMap} from 'rxjs'
3
- import {loadConfig, loadPkgWithReporting} from './core'
3
+ import {loadConfig} from './core/config/loadConfig'
4
+ import {loadPkgWithReporting} from './core/pkg/loadPkgWithReporting'
4
5
  import {createLogger} from './logger'
5
6
  import {resolveBuildContext} from './resolveBuildContext'
6
7
  import {resolveWatchTasks} from './resolveWatchTasks'
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.cjs","sources":["../../src/node/fileExists.ts","../../src/node/core/isRecord.ts","../../src/node/logger.ts"],"sourcesContent":["import {statSync} from 'node:fs'\n\n/** @internal */\nexport function fileExists(filePath: string): boolean {\n try {\n statSync(filePath)\n\n return true\n } catch {\n return false\n }\n}\n","/** @internal */\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return Boolean(value) && !Array.isArray(value) && typeof value === 'object'\n}\n","// oxlint-disable no-console\nimport chalk from 'chalk'\n\n/** @internal */\nexport interface Logger {\n log: (...args: unknown[]) => void\n info: (...args: unknown[]) => void\n warn: (...args: unknown[]) => void\n error: (...args: unknown[]) => void\n success: (...args: unknown[]) => void\n}\n\n/** @internal */\nexport function createLogger(): Logger {\n return {\n log: (...args) => {\n console.log(...args)\n },\n info: (...args) => {\n console.log(chalk.blue('[info]'), ...args)\n },\n warn: (...args) => {\n console.log(chalk.yellow('[warning]'), ...args)\n },\n error: (...args) => {\n console.log(chalk.red('[error]'), ...args)\n },\n success: (...args) => {\n console.log(chalk.green('[success]'), ...args)\n },\n }\n}\n"],"names":["statSync","chalk"],"mappings":";;;;;;AAGO,SAAS,WAAW,UAA2B;AAChD,MAAA;AACF,WAAAA,QAAA,SAAS,QAAQ,GAEV;AAAA,EAAA,QACD;AACC,WAAA;AAAA,EAAA;AAEX;ACVO,SAAS,SAAS,OAAkD;AAClE,SAAA,CAAA,CAAQ,SAAU,CAAC,MAAM,QAAQ,KAAK,KAAK,OAAO,SAAU;AACrE;ACUO,SAAS,eAAuB;AAC9B,SAAA;AAAA,IACL,KAAK,IAAI,SAAS;AACR,cAAA,IAAI,GAAG,IAAI;AAAA,IACrB;AAAA,IACA,MAAM,IAAI,SAAS;AACjB,cAAQ,IAAIC,eAAM,QAAA,KAAK,QAAQ,GAAG,GAAG,IAAI;AAAA,IAC3C;AAAA,IACA,MAAM,IAAI,SAAS;AACjB,cAAQ,IAAIA,eAAM,QAAA,OAAO,WAAW,GAAG,GAAG,IAAI;AAAA,IAChD;AAAA,IACA,OAAO,IAAI,SAAS;AAClB,cAAQ,IAAIA,eAAM,QAAA,IAAI,SAAS,GAAG,GAAG,IAAI;AAAA,IAC3C;AAAA,IACA,SAAS,IAAI,SAAS;AACpB,cAAQ,IAAIA,eAAM,QAAA,MAAM,WAAW,GAAG,GAAG,IAAI;AAAA,IAAA;AAAA,EAEjD;AACF;;;;"}
@@ -1,7 +0,0 @@
1
- export * from './config'
2
- export * from './contexts'
3
- export * from './defaults'
4
- export * from './isRecord'
5
- export * from './pkg'
6
- export * from './template'
7
- export * from './ts'
@@ -1,4 +0,0 @@
1
- export * from './dtsTask'
2
- export * from './dtsWatchTask'
3
- export * from './getExtractMessagesConfig'
4
- export * from './types'
@@ -1,2 +0,0 @@
1
- export * from './rollupTask'
2
- export * from './rollupWatchTask'