@sanity/pkg-utils 7.2.8-canary.0 → 7.2.8-canary.1
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/bin/pkg-utils.cjs +0 -1
- package/dist/_chunks-cjs/build.cjs.map +1 -1
- package/dist/_chunks-cjs/check.cjs.map +1 -1
- package/dist/_chunks-cjs/consoleSpy.cjs +72 -3
- package/dist/_chunks-cjs/consoleSpy.cjs.map +1 -1
- package/dist/_chunks-cjs/index.cjs +0 -1
- package/dist/_chunks-cjs/index.cjs.map +1 -1
- package/dist/_chunks-cjs/init.cjs.map +1 -1
- package/dist/_chunks-cjs/logger.cjs +1 -69
- package/dist/_chunks-cjs/logger.cjs.map +1 -1
- package/dist/_chunks-cjs/watch.cjs.map +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/node/build.ts +2 -1
- package/src/node/check.ts +0 -2
- package/src/node/core/config/findConfigFile.ts +0 -2
- package/src/node/core/config/index.ts +3 -3
- package/src/node/core/config/loadConfig.ts +0 -2
- package/src/node/core/config/types.ts +0 -4
- package/src/node/core/contexts/buildContext.ts +2 -3
- package/src/node/core/pkg/loadPkg.ts +0 -2
- package/src/node/core/pkg/loadPkgWithReporting.ts +0 -1
- package/src/node/core/pkg/parseExports.ts +1 -2
- package/src/node/core/pkg/validateExports.ts +1 -1
- package/src/node/core/pkg/validatePkg.ts +0 -1
- package/src/node/core/template/createFromTemplate.ts +0 -2
- package/src/node/getFilesize.ts +0 -1
- package/src/node/globFiles.ts +0 -1
- package/src/node/index.ts +64 -8
- package/src/node/init.ts +1 -3
- package/src/node/printExtractMessages.ts +1 -3
- package/src/node/printPackageTree.ts +2 -3
- package/src/node/resolveBuildContext.ts +11 -14
- package/src/node/resolveBuildTasks.ts +4 -3
- package/src/node/resolveWatchTasks.ts +4 -3
- package/src/node/strict.test-d.ts +0 -1
- package/src/node/tasks/dts/buildTypes.ts +0 -1
- package/src/node/tasks/dts/createApiExtractorConfig.ts +0 -1
- package/src/node/tasks/dts/createTSDocConfig.ts +0 -1
- package/src/node/tasks/dts/doExtract.ts +1 -1
- package/src/node/tasks/dts/dtsTask.ts +0 -1
- package/src/node/tasks/dts/extractTypes.ts +2 -1
- package/src/node/tasks/dts/getExtractMessagesConfig.ts +1 -2
- package/src/node/tasks/dts/getTargetPaths.ts +2 -1
- package/src/node/tasks/dts/printDiagnostic.ts +0 -2
- package/src/node/tasks/index.ts +4 -2
- package/src/node/tasks/rollup/resolveRollupConfig.ts +3 -1
- package/src/node/tasks/rollup/rollupTask.ts +1 -3
- package/src/node/tasks/rollup/rollupWatchTask.ts +1 -3
- package/src/node/tasks/types.ts +3 -3
- package/src/node/templates/default/template.ts +4 -7
- package/src/node/watch.ts +2 -3
- package/src/node/watchConfigFiles.ts +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/pkg-utils",
|
|
3
|
-
"version": "7.2.8-canary.
|
|
3
|
+
"version": "7.2.8-canary.1",
|
|
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.
|
|
142
|
+
"@sanity/pkg-utils": "7.2.8-canary.1"
|
|
143
143
|
},
|
|
144
144
|
"peerDependencies": {
|
|
145
145
|
"babel-plugin-react-compiler": "*",
|
package/src/node/build.ts
CHANGED
|
@@ -5,7 +5,8 @@ import {createLogger} from './logger'
|
|
|
5
5
|
import {resolveBuildContext} from './resolveBuildContext'
|
|
6
6
|
import {resolveBuildTasks} from './resolveBuildTasks'
|
|
7
7
|
import {createSpinner} from './spinner'
|
|
8
|
-
import {buildTaskHandlers
|
|
8
|
+
import {buildTaskHandlers} from './tasks'
|
|
9
|
+
import {type BuildTask, type TaskHandler} from './tasks/types'
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Build the distribution files of a npm package.
|
package/src/node/check.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export {defineConfig} from './defineConfig'
|
|
2
|
+
export {loadConfig} from './loadConfig'
|
|
3
|
+
export {resolveConfigProperty} from './resolveConfigProperty'
|
|
4
4
|
export * from './types'
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import type {PluginItem as BabelPluginItem} from '@babel/core'
|
|
2
2
|
import type {OptimizeLodashOptions} from '@optimize-lodash/rollup-plugin'
|
|
3
3
|
import type {NormalizedOutputOptions, Plugin as RollupPlugin, TreeshakingOptions} from 'rollup'
|
|
4
|
-
|
|
5
4
|
import type {StrictOptions} from '../../strict'
|
|
6
5
|
|
|
7
|
-
// re-export
|
|
8
|
-
export type {RollupPlugin, StrictOptions}
|
|
9
|
-
|
|
10
6
|
/** @public */
|
|
11
7
|
export type PkgFormat = 'commonjs' | 'esm'
|
|
12
8
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type ts from 'typescript'
|
|
2
|
-
|
|
3
2
|
import type {Logger} from '../../logger'
|
|
4
|
-
import type {PkgConfigOptions, PkgExports, PkgRuntime} from '../config'
|
|
5
|
-
import type {PackageJSON} from '../pkg'
|
|
3
|
+
import type {PkgConfigOptions, PkgExports, PkgRuntime} from '../config/types'
|
|
4
|
+
import type {PackageJSON} from '../pkg/types'
|
|
6
5
|
|
|
7
6
|
/** @internal */
|
|
8
7
|
export interface BuildFile {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {existsSync} from 'node:fs'
|
|
2
2
|
import {resolve as resolvePath} from 'node:path'
|
|
3
|
-
|
|
4
3
|
import type {Logger} from '../../logger'
|
|
5
4
|
import type {InferredStrictOptions} from '../../strict'
|
|
6
5
|
import {defaultEnding, fileEnding} from '../../tasks/dts/getTargetPaths'
|
|
7
|
-
import type {PkgExport} from '../config'
|
|
6
|
+
import type {PkgExport} from '../config/types'
|
|
8
7
|
import {isRecord} from '../isRecord'
|
|
9
8
|
import {pkgExtMap} from './pkgExt'
|
|
10
9
|
import type {PackageJSON} from './types'
|
package/src/node/getFilesize.ts
CHANGED
package/src/node/globFiles.ts
CHANGED
package/src/node/index.ts
CHANGED
|
@@ -1,15 +1,71 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
1
|
+
export {build} from './build'
|
|
2
|
+
export {check} from './check'
|
|
3
|
+
export {defineConfig} from './core/config/defineConfig'
|
|
4
|
+
export {loadConfig} from './core/config/loadConfig'
|
|
5
|
+
export {resolveConfigProperty} from './core/config/resolveConfigProperty'
|
|
6
|
+
export type {
|
|
7
|
+
PkgFormat,
|
|
8
|
+
PkgRuntime,
|
|
9
|
+
PkgExport,
|
|
10
|
+
PkgConfigPropertyResolver,
|
|
11
|
+
PkgConfigProperty,
|
|
12
|
+
PkgBundle,
|
|
13
|
+
PkgExports,
|
|
14
|
+
PkgRuleLevel,
|
|
15
|
+
TSDocCustomTag,
|
|
16
|
+
ReactCompilerOptions,
|
|
17
|
+
ReactCompilerLoggerEvent,
|
|
18
|
+
ReactCompilerLogger,
|
|
19
|
+
PkgConfigOptions,
|
|
20
|
+
} from './core/config/types'
|
|
21
|
+
export type {BuildFile, BuildContext} from './core/contexts/buildContext'
|
|
22
|
+
export {DEFAULT_BROWSERSLIST_QUERY} from './core/defaults'
|
|
23
|
+
export * from './core/isRecord'
|
|
24
|
+
export {loadPkg} from './core/pkg/loadPkg'
|
|
25
|
+
export {loadPkgWithReporting} from './core/pkg/loadPkgWithReporting'
|
|
26
|
+
export {parseExports} from './core/pkg/parseExports'
|
|
27
|
+
export {type PkgExtMap, pkgExtMap} from './core/pkg/pkgExt'
|
|
28
|
+
export * from './core/pkg/types'
|
|
29
|
+
export {createFromTemplate} from './core/template/createFromTemplate'
|
|
30
|
+
export {defineTemplateOption} from './core/template/define'
|
|
7
31
|
export {
|
|
32
|
+
type PkgTemplateFile,
|
|
33
|
+
type PkgTemplateStringOption,
|
|
34
|
+
type PkgTemplateOption,
|
|
35
|
+
type PkgTemplateDefinition,
|
|
36
|
+
type PkgTemplateResolver,
|
|
37
|
+
type PkgTemplate,
|
|
38
|
+
} from './core/template/types'
|
|
39
|
+
export {loadTSConfig} from './core/ts/loadTSConfig'
|
|
40
|
+
|
|
41
|
+
export {init} from './init'
|
|
42
|
+
export {type Logger, createLogger} from './logger'
|
|
43
|
+
export {resolveBuildTasks} from './resolveBuildTasks'
|
|
44
|
+
export {
|
|
45
|
+
type StrictOptions,
|
|
8
46
|
type InferredStrictOptions,
|
|
9
47
|
parseStrictOptions,
|
|
10
48
|
strictOptions,
|
|
11
49
|
toggle,
|
|
12
50
|
type ToggleType,
|
|
13
51
|
} from './strict'
|
|
14
|
-
export
|
|
15
|
-
export
|
|
52
|
+
export {buildTaskHandlers, watchTaskHandlers} from './tasks'
|
|
53
|
+
export {dtsTask} from './tasks/dts/dtsTask'
|
|
54
|
+
export {dtsWatchTask} from './tasks/dts/dtsWatchTask'
|
|
55
|
+
export {getExtractMessagesConfig} from './tasks/dts/getExtractMessagesConfig'
|
|
56
|
+
export type {DtsWatchTask, DtsTask, DtsResult} from './tasks/dts/types'
|
|
57
|
+
export {rollupTask} from './tasks/rollup/rollupTask'
|
|
58
|
+
export {rollupWatchTask} from './tasks/rollup/rollupWatchTask'
|
|
59
|
+
export type {
|
|
60
|
+
RollupTaskEntry,
|
|
61
|
+
RollupTask,
|
|
62
|
+
RollupWatchTask,
|
|
63
|
+
BuildTask,
|
|
64
|
+
WatchTask,
|
|
65
|
+
TaskHandler,
|
|
66
|
+
BuildTaskHandlers,
|
|
67
|
+
WatchTaskHandlers,
|
|
68
|
+
} from './tasks/types'
|
|
69
|
+
export {watch} from './watch'
|
|
70
|
+
|
|
71
|
+
export type {Plugin as RollupPlugin} from 'rollup'
|
package/src/node/init.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import {lstat} from 'node:fs/promises'
|
|
2
2
|
import {resolve} from 'node:path'
|
|
3
|
-
|
|
4
3
|
import {mkdirp} from 'mkdirp'
|
|
5
|
-
|
|
6
4
|
import {createFromTemplate} from './core/template'
|
|
7
5
|
import {fileExists} from './fileExists'
|
|
8
6
|
import {isEmptyDirectory} from './isEmptyDirectory'
|
|
9
7
|
import {createLogger} from './logger'
|
|
10
|
-
import {defaultTemplate} from './templates'
|
|
8
|
+
import {defaultTemplate} from './templates/default/template'
|
|
11
9
|
|
|
12
10
|
/** @public */
|
|
13
11
|
export async function init(options: {cwd: string; path: string}): Promise<void> {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
|
-
|
|
3
2
|
import type {ExtractorMessage} from '@microsoft/api-extractor'
|
|
4
3
|
import chalk from 'chalk'
|
|
5
|
-
|
|
6
|
-
import type {BuildContext} from './core'
|
|
4
|
+
import type {BuildContext} from './core/contexts/buildContext'
|
|
7
5
|
|
|
8
6
|
export function printExtractMessages(ctx: BuildContext, messages: ExtractorMessage[]): void {
|
|
9
7
|
const {cwd, logger} = ctx
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
|
-
|
|
3
2
|
import chalk from 'chalk'
|
|
4
3
|
import treeify from 'treeify'
|
|
5
|
-
|
|
6
|
-
import type {BuildContext
|
|
4
|
+
import type {PkgExport} from './core/config/types'
|
|
5
|
+
import type {BuildContext} from './core/contexts/buildContext'
|
|
7
6
|
import {fileExists} from './fileExists'
|
|
8
7
|
import {getFilesize} from './getFilesize'
|
|
9
8
|
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
2
|
import browserslistToEsbuild from 'browserslist-to-esbuild'
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
type BuildContext,
|
|
9
|
-
type PackageJSON,
|
|
10
|
-
type PkgConfigOptions,
|
|
11
|
-
type PkgExports,
|
|
12
|
-
type PkgRuntime,
|
|
13
|
-
} from './core'
|
|
3
|
+
import {loadTSConfig} from './core'
|
|
4
|
+
import {resolveConfigProperty} from './core/config/resolveConfigProperty'
|
|
5
|
+
import {type PkgConfigOptions, type PkgExports, type PkgRuntime} from './core/config/types'
|
|
6
|
+
import type {BuildContext} from './core/contexts/buildContext'
|
|
7
|
+
import {DEFAULT_BROWSERSLIST_QUERY} from './core/defaults'
|
|
14
8
|
import {findCommonDirPath, pathContains} from './core/findCommonPath'
|
|
9
|
+
import {parseExports} from './core/pkg/parseExports'
|
|
10
|
+
import type {PackageJSON} from './core/pkg/types'
|
|
15
11
|
import type {Logger} from './logger'
|
|
16
12
|
import {resolveBrowserTarget} from './resolveBrowserTarget'
|
|
17
13
|
import {resolveNodeTarget} from './resolveNodeTarget'
|
|
@@ -94,9 +90,10 @@ export async function resolveBuildContext(options: {
|
|
|
94
90
|
strict,
|
|
95
91
|
strictOptions,
|
|
96
92
|
logger,
|
|
97
|
-
}).reduce<PkgExports>(
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
}).reduce<PkgExports>(
|
|
94
|
+
(acc, {_path: exportPath, ...exportEntry}) => Object.assign(acc, {[exportPath]: exportEntry}),
|
|
95
|
+
{},
|
|
96
|
+
)
|
|
100
97
|
|
|
101
98
|
const exports = resolveConfigProperty(config?.exports, parsedExports)
|
|
102
99
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
|
-
|
|
3
|
-
import type {BuildContext
|
|
4
|
-
import type {BuildTask, DtsTask, RollupTask, RollupTaskEntry} from './tasks'
|
|
2
|
+
import type {PkgExport, PkgFormat, PkgRuntime} from './core/config/types'
|
|
3
|
+
import type {BuildContext} from './core/contexts/buildContext'
|
|
5
4
|
import {getTargetPaths} from './tasks/dts/getTargetPaths'
|
|
5
|
+
import type {DtsTask} from './tasks/dts/types'
|
|
6
|
+
import type {BuildTask, RollupTask, RollupTaskEntry} from './tasks/types'
|
|
6
7
|
|
|
7
8
|
/** @internal */
|
|
8
9
|
export function resolveBuildTasks(ctx: BuildContext): BuildTask[] {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
|
-
|
|
3
|
-
import type {BuildContext
|
|
4
|
-
import type {DtsWatchTask, RollupTaskEntry, RollupWatchTask, WatchTask} from './tasks'
|
|
2
|
+
import type {PkgExport, PkgFormat, PkgRuntime} from './core/config/types'
|
|
3
|
+
import type {BuildContext} from './core/contexts/buildContext'
|
|
5
4
|
import {getTargetPaths} from './tasks/dts/getTargetPaths'
|
|
5
|
+
import type {DtsWatchTask} from './tasks/dts/types'
|
|
6
|
+
import type {RollupTaskEntry, RollupWatchTask, WatchTask} from './tasks/types'
|
|
6
7
|
|
|
7
8
|
/** @internal */
|
|
8
9
|
export function resolveWatchTasks(ctx: BuildContext): WatchTask[] {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
2
|
import type {ExtractorMessage} from '@microsoft/api-extractor'
|
|
3
3
|
import {rimraf} from 'rimraf'
|
|
4
|
-
import type {BuildContext} from '../../core'
|
|
4
|
+
import type {BuildContext} from '../../core/contexts/buildContext'
|
|
5
5
|
import {buildTypes} from './buildTypes'
|
|
6
6
|
import {DtsError} from './DtsError'
|
|
7
7
|
import {extractTypes} from './extractTypes'
|
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
import {mkdirp} from 'mkdirp'
|
|
10
10
|
import * as prettier from 'prettier'
|
|
11
11
|
import type ts from 'typescript'
|
|
12
|
-
import type {
|
|
12
|
+
import type {PkgConfigOptions} from '../../core/config/types'
|
|
13
|
+
import type {BuildFile} from '../../core/contexts/buildContext'
|
|
13
14
|
import {createApiExtractorConfig} from './createApiExtractorConfig'
|
|
14
15
|
import {createTSDocConfig} from './createTSDocConfig'
|
|
15
16
|
import {extractModuleBlocksFromTypes} from './extractModuleBlocks'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type {ExtractorLogLevel, IExtractorMessagesConfig} from '@microsoft/api-extractor'
|
|
2
|
-
|
|
3
|
-
import type {PkgConfigOptions, PkgRuleLevel} from '../../core'
|
|
2
|
+
import type {PkgConfigOptions, PkgRuleLevel} from '../../core/config/types'
|
|
4
3
|
|
|
5
4
|
const LOG_LEVELS: Record<PkgRuleLevel, ExtractorLogLevel> = {
|
|
6
5
|
error: 'error' as ExtractorLogLevel.Error,
|
package/src/node/tasks/index.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {dtsTask
|
|
2
|
-
import {
|
|
1
|
+
import {dtsTask} from './dts/dtsTask'
|
|
2
|
+
import {dtsWatchTask} from './dts/dtsWatchTask'
|
|
3
|
+
import {rollupTask} from './rollup/rollupTask'
|
|
4
|
+
import {rollupWatchTask} from './rollup/rollupWatchTask'
|
|
3
5
|
import type {BuildTaskHandlers, WatchTaskHandlers} from './types'
|
|
4
6
|
|
|
5
7
|
export * from './dts'
|
|
@@ -11,7 +11,9 @@ import terser from '@rollup/plugin-terser'
|
|
|
11
11
|
import type {InputOptions, OutputOptions, Plugin} from 'rollup'
|
|
12
12
|
import esbuild from 'rollup-plugin-esbuild'
|
|
13
13
|
import {pkgExtMap as extMap} from '../../../node/core/pkg/pkgExt'
|
|
14
|
-
import {resolveConfigProperty
|
|
14
|
+
import {resolveConfigProperty} from '../../core/config/resolveConfigProperty'
|
|
15
|
+
import type {BuildContext} from '../../core/contexts/buildContext'
|
|
16
|
+
import type {PackageJSON} from '../../core/pkg/types'
|
|
15
17
|
import type {RollupTask, RollupWatchTask} from '../types'
|
|
16
18
|
|
|
17
19
|
export interface RollupConfig {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
|
-
|
|
3
2
|
import chalk from 'chalk'
|
|
4
3
|
import {rollup} from 'rollup'
|
|
5
4
|
import {Observable} from 'rxjs'
|
|
6
|
-
|
|
7
5
|
import {createConsoleSpy} from '../../consoleSpy'
|
|
8
|
-
import type {BuildContext} from '../../core'
|
|
6
|
+
import type {BuildContext} from '../../core/contexts/buildContext'
|
|
9
7
|
import type {RollupTask, TaskHandler} from '../types'
|
|
10
8
|
import {resolveRollupConfig} from './resolveRollupConfig'
|
|
11
9
|
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
|
-
|
|
3
2
|
import chalk from 'chalk'
|
|
4
|
-
import {type RollupWatcherEvent, type RollupWatchOptions
|
|
3
|
+
import {watch as rollupWatch, type RollupWatcherEvent, type RollupWatchOptions} from 'rollup'
|
|
5
4
|
import {Observable} from 'rxjs'
|
|
6
|
-
|
|
7
5
|
import type {RollupWatchTask, TaskHandler} from '../types'
|
|
8
6
|
import {resolveRollupConfig} from './resolveRollupConfig'
|
|
9
7
|
|
package/src/node/tasks/types.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type {RollupWatcherEvent} from 'rollup'
|
|
2
2
|
import type {Observable} from 'rxjs'
|
|
3
|
-
|
|
4
|
-
import type {BuildContext
|
|
5
|
-
import type {DtsResult, DtsTask, DtsWatchTask} from './dts'
|
|
3
|
+
import type {PkgRuntime} from '../core/config/types'
|
|
4
|
+
import type {BuildContext} from '../core/contexts/buildContext'
|
|
5
|
+
import type {DtsResult, DtsTask, DtsWatchTask} from './dts/types'
|
|
6
6
|
|
|
7
7
|
/** @internal */
|
|
8
8
|
export interface RollupTaskEntry {
|
|
@@ -5,13 +5,10 @@ import getLatestVersion from 'get-latest-version'
|
|
|
5
5
|
import gitUrlParse from 'git-url-parse'
|
|
6
6
|
import {outdent} from 'outdent'
|
|
7
7
|
import {format, type Config as PrettierConfig} from 'prettier'
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
type PkgTemplate,
|
|
13
|
-
type PkgTemplateFile,
|
|
14
|
-
} from '../../core'
|
|
8
|
+
import {isRecord} from '../../core/isRecord'
|
|
9
|
+
import type {PackageJSON} from '../../core/pkg/types'
|
|
10
|
+
import {defineTemplateOption} from '../../core/template/define'
|
|
11
|
+
import {type PkgTemplate, type PkgTemplateFile} from '../../core/template/types'
|
|
15
12
|
|
|
16
13
|
const RE_NAME = /^(?:@(?:[a-z0-9-*~][a-z0-9-*._~]*)\/)?[a-z0-9-~][a-z0-9-._~]*$/i
|
|
17
14
|
|
package/src/node/watch.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
|
-
|
|
3
2
|
import {switchMap} from 'rxjs'
|
|
4
|
-
|
|
5
3
|
import {loadConfig, loadPkgWithReporting} from './core'
|
|
6
4
|
import {createLogger} from './logger'
|
|
7
5
|
import {resolveBuildContext} from './resolveBuildContext'
|
|
8
6
|
import {resolveWatchTasks} from './resolveWatchTasks'
|
|
9
|
-
import {
|
|
7
|
+
import {watchTaskHandlers} from './tasks'
|
|
8
|
+
import {type TaskHandler, type WatchTask} from './tasks/types'
|
|
10
9
|
import {watchConfigFiles} from './watchConfigFiles'
|
|
11
10
|
|
|
12
11
|
/** @public */
|