@sanity/pkg-utils 7.2.10-canary.0 → 7.2.10-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/dist/_chunks-cjs/index.cjs +10 -105
- package/dist/_chunks-cjs/index.cjs.map +1 -1
- package/dist/_chunks-cjs/resolveRolldownConfig.cjs +114 -0
- package/dist/_chunks-cjs/resolveRolldownConfig.cjs.map +1 -0
- package/dist/_chunks-es/index.js +2311 -0
- package/dist/_chunks-es/index.js.map +1 -0
- package/dist/_chunks-es/resolveRolldownConfig.js +117 -0
- package/dist/_chunks-es/resolveRolldownConfig.js.map +1 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.d.cts +1 -1
- package/dist/index.d.cts +486 -443
- package/dist/index.d.ts +486 -443
- package/dist/index.js +1 -2389
- package/dist/index.js.map +1 -1
- package/package.json +7 -8
- package/src/cli/buildAction.ts +0 -21
- package/src/cli/checkAction.ts +0 -14
- package/src/cli/handleError.ts +0 -11
- package/src/cli/index.ts +0 -65
- package/src/cli/initAction.ts +0 -13
- package/src/cli/watchAction.ts +0 -14
- package/src/global.ts +0 -5
- package/src/node/__snapshots__/strict.test.ts.snap +0 -154
- package/src/node/build.ts +0 -100
- package/src/node/check.ts +0 -188
- package/src/node/consoleSpy.ts +0 -39
- package/src/node/core/config/defineConfig.ts +0 -6
- package/src/node/core/config/findConfigFile.ts +0 -31
- package/src/node/core/config/index.ts +0 -4
- package/src/node/core/config/loadConfig.ts +0 -37
- package/src/node/core/config/resolveConfigProperty.ts +0 -15
- package/src/node/core/config/types.ts +0 -315
- package/src/node/core/contexts/buildContext.ts +0 -32
- package/src/node/core/contexts/index.ts +0 -1
- package/src/node/core/defaults.ts +0 -4
- package/src/node/core/findCommonPath.ts +0 -35
- package/src/node/core/isRecord.ts +0 -4
- package/src/node/core/pkg/helpers.ts +0 -36
- package/src/node/core/pkg/index.ts +0 -5
- package/src/node/core/pkg/loadPkg.ts +0 -21
- package/src/node/core/pkg/loadPkgWithReporting.ts +0 -154
- package/src/node/core/pkg/parseExports.ts +0 -233
- package/src/node/core/pkg/pkgExt.ts +0 -22
- package/src/node/core/pkg/types.ts +0 -60
- package/src/node/core/pkg/validateExports.ts +0 -30
- package/src/node/core/pkg/validatePkg.ts +0 -82
- package/src/node/core/template/createFromTemplate.ts +0 -84
- package/src/node/core/template/define.ts +0 -6
- package/src/node/core/template/index.ts +0 -3
- package/src/node/core/template/types.ts +0 -45
- package/src/node/core/ts/index.ts +0 -1
- package/src/node/core/ts/loadTSConfig.ts +0 -19
- package/src/node/fileExists.ts +0 -12
- package/src/node/getFilesize.ts +0 -8
- package/src/node/globFiles.ts +0 -6
- package/src/node/index.ts +0 -48
- package/src/node/init.ts +0 -54
- package/src/node/isEmptyDirectory.ts +0 -5
- package/src/node/logger.ts +0 -32
- package/src/node/printExtractMessages.ts +0 -59
- package/src/node/printPackageTree.ts +0 -95
- package/src/node/resolveBrowserTarget.ts +0 -17
- package/src/node/resolveBuildContext.ts +0 -202
- package/src/node/resolveBuildTasks.ts +0 -199
- package/src/node/resolveNodeTarget.ts +0 -9
- package/src/node/resolveWatchTasks.ts +0 -132
- package/src/node/spinner.ts +0 -17
- package/src/node/strict.test-d.ts +0 -6
- package/src/node/strict.ts +0 -84
- package/src/node/tasks/dts/DtsError.ts +0 -11
- package/src/node/tasks/dts/buildTypes.ts +0 -42
- package/src/node/tasks/dts/createApiExtractorConfig.ts +0 -67
- package/src/node/tasks/dts/createTSDocConfig.ts +0 -53
- package/src/node/tasks/dts/doExtract.ts +0 -80
- package/src/node/tasks/dts/dtsTask.ts +0 -50
- package/src/node/tasks/dts/dtsWatchTask.ts +0 -165
- package/src/node/tasks/dts/extractModuleBlocks.ts +0 -45
- package/src/node/tasks/dts/extractTypes.ts +0 -128
- package/src/node/tasks/dts/getExtractMessagesConfig.ts +0 -109
- package/src/node/tasks/dts/getTargetPaths.ts +0 -72
- package/src/node/tasks/dts/printDiagnostic.ts +0 -42
- package/src/node/tasks/dts/types.ts +0 -30
- package/src/node/tasks/index.ts +0 -19
- package/src/node/tasks/rolldown/resolveRolldownConfig.ts +0 -202
- package/src/node/tasks/rolldown/rolldownDtsTask.ts +0 -155
- package/src/node/tasks/rollup/resolveRollupConfig.ts +0 -264
- package/src/node/tasks/rollup/rollupTask.ts +0 -154
- package/src/node/tasks/rollup/rollupWatchTask.ts +0 -77
- package/src/node/tasks/types.ts +0 -69
- package/src/node/templates/default/index.ts +0 -1
- package/src/node/templates/default/template.ts +0 -547
- package/src/node/templates/index.ts +0 -1
- package/src/node/watch.ts +0 -66
- package/src/node/watchConfigFiles.ts +0 -53
- package/src/node/watchFiles.ts +0 -31
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
//#region src/node/build.d.ts
|
|
1
|
+
import type {PluginItem} from '@babel/core'
|
|
2
|
+
import type {IExtractorMessagesConfig} from '@microsoft/api-extractor'
|
|
3
|
+
import type {OptimizeLodashOptions} from '@optimize-lodash/rollup-plugin'
|
|
4
|
+
import type {NormalizedOutputOptions, TreeshakingOptions} from 'rollup'
|
|
5
|
+
import {Plugin as RollupPlugin} from 'rollup'
|
|
6
|
+
import {z} from 'zod'
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Build the distribution files of a npm package.
|
|
@@ -25,267 +24,218 @@ import { IExtractorMessagesConfig } from "@microsoft/api-extractor";
|
|
|
25
24
|
*
|
|
26
25
|
* @public
|
|
27
26
|
*/
|
|
28
|
-
declare function build(options: {
|
|
29
|
-
cwd: string
|
|
30
|
-
emitDeclarationOnly?: boolean
|
|
31
|
-
strict?: boolean
|
|
32
|
-
tsconfig?: string
|
|
33
|
-
clean?: boolean
|
|
34
|
-
}): Promise<void
|
|
35
|
-
|
|
36
|
-
//#region src/node/check.d.ts
|
|
27
|
+
export declare function build(options: {
|
|
28
|
+
cwd: string
|
|
29
|
+
emitDeclarationOnly?: boolean
|
|
30
|
+
strict?: boolean
|
|
31
|
+
tsconfig?: string
|
|
32
|
+
clean?: boolean
|
|
33
|
+
}): Promise<void>
|
|
34
|
+
|
|
37
35
|
/** @public */
|
|
38
|
-
declare function check(options: {
|
|
39
|
-
cwd: string
|
|
40
|
-
strict?: boolean
|
|
41
|
-
tsconfig?: string
|
|
42
|
-
}): Promise<void
|
|
43
|
-
|
|
44
|
-
//#region src/node/strict.d.ts
|
|
45
|
-
/**
|
|
46
|
-
* @public
|
|
47
|
-
*/
|
|
48
|
-
declare const toggle: z.ZodUnion<[z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"off">]>;
|
|
49
|
-
/**
|
|
50
|
-
* @public
|
|
51
|
-
*/
|
|
52
|
-
type ToggleType = z.infer<typeof toggle>;
|
|
53
|
-
/**
|
|
54
|
-
* @public
|
|
55
|
-
*/
|
|
56
|
-
declare const strictOptions: z.ZodObject<{
|
|
57
|
-
noPackageJsonTypings: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"off">]>>;
|
|
58
|
-
noImplicitSideEffects: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"off">]>>;
|
|
59
|
-
noImplicitBrowsersList: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"off">]>>;
|
|
60
|
-
alwaysPackageJsonTypes: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"off">]>>;
|
|
61
|
-
alwaysPackageJsonMain: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"off">]>>;
|
|
62
|
-
alwaysPackageJsonFiles: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"off">]>>;
|
|
63
|
-
}, "strict", z.ZodTypeAny, {
|
|
64
|
-
noPackageJsonTypings: "error" | "warn" | "off";
|
|
65
|
-
noImplicitSideEffects: "error" | "warn" | "off";
|
|
66
|
-
noImplicitBrowsersList: "error" | "warn" | "off";
|
|
67
|
-
alwaysPackageJsonTypes: "error" | "warn" | "off";
|
|
68
|
-
alwaysPackageJsonMain: "error" | "warn" | "off";
|
|
69
|
-
alwaysPackageJsonFiles: "error" | "warn" | "off";
|
|
70
|
-
}, {
|
|
71
|
-
noPackageJsonTypings?: "error" | "warn" | "off" | undefined;
|
|
72
|
-
noImplicitSideEffects?: "error" | "warn" | "off" | undefined;
|
|
73
|
-
noImplicitBrowsersList?: "error" | "warn" | "off" | undefined;
|
|
74
|
-
alwaysPackageJsonTypes?: "error" | "warn" | "off" | undefined;
|
|
75
|
-
alwaysPackageJsonMain?: "error" | "warn" | "off" | undefined;
|
|
76
|
-
alwaysPackageJsonFiles?: "error" | "warn" | "off" | undefined;
|
|
77
|
-
}>;
|
|
78
|
-
/**
|
|
79
|
-
* @public
|
|
80
|
-
*/
|
|
81
|
-
type InferredStrictOptions = z.infer<typeof strictOptions>;
|
|
82
|
-
/**
|
|
83
|
-
* @public
|
|
84
|
-
*/
|
|
85
|
-
interface StrictOptions {
|
|
86
|
-
/**
|
|
87
|
-
* Disallows a top level `typings` field in `package.json` if it is equal to `exports['.'].source`.
|
|
88
|
-
* @defaultValue 'error'
|
|
89
|
-
*/
|
|
90
|
-
noPackageJsonTypings?: ToggleType;
|
|
91
|
-
/**
|
|
92
|
-
* Requires specifying `sideEffects` in `package.json`.
|
|
93
|
-
* @defaultValue 'warn'
|
|
94
|
-
*/
|
|
95
|
-
noImplicitSideEffects?: ToggleType;
|
|
96
|
-
/**
|
|
97
|
-
* Requires specifying `browserslist` in `package.json`, instead of relying on it implicitly being:
|
|
98
|
-
* @example
|
|
99
|
-
* ```
|
|
100
|
-
* "browserslist": "extends @sanity/browserslist-config"
|
|
101
|
-
* ```
|
|
102
|
-
* @defaultValue 'warn'
|
|
103
|
-
*/
|
|
104
|
-
noImplicitBrowsersList?: ToggleType;
|
|
105
|
-
/**
|
|
106
|
-
* If typescript is used then `types` in `package.json` should be specified for npm listings to show the TS icon.
|
|
107
|
-
* @defaultValue 'error'
|
|
108
|
-
*/
|
|
109
|
-
alwaysPackageJsonTypes?: ToggleType;
|
|
110
|
-
/**
|
|
111
|
-
* A lot of analysis tooling requiers the `main` field to work (like bundlephobia) and so it's best practice to always include it
|
|
112
|
-
* @defaultValue 'error'
|
|
113
|
-
*/
|
|
114
|
-
alwaysPackageJsonMain?: ToggleType;
|
|
115
|
-
/**
|
|
116
|
-
* Using `.npmignore` is error prone, it's best practice to always declare `files` instead
|
|
117
|
-
* @defaultValue 'error'
|
|
118
|
-
*/
|
|
119
|
-
alwaysPackageJsonFiles?: ToggleType;
|
|
120
|
-
}
|
|
36
|
+
export declare function check(options: {
|
|
37
|
+
cwd: string
|
|
38
|
+
strict?: boolean
|
|
39
|
+
tsconfig?: string
|
|
40
|
+
}): Promise<void>
|
|
41
|
+
|
|
121
42
|
/** @alpha */
|
|
122
|
-
declare function
|
|
123
|
-
|
|
124
|
-
//#region src/node/core/config/types.d.ts
|
|
125
|
-
/** @public */
|
|
126
|
-
type PkgFormat = 'commonjs' | 'esm';
|
|
127
|
-
/** @public */
|
|
128
|
-
type PkgRuntime = '*' | 'browser' | 'node';
|
|
43
|
+
export declare function createLogger(): Logger
|
|
44
|
+
|
|
129
45
|
/** @public */
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
_exported?: boolean;
|
|
133
|
-
browser?: {
|
|
134
|
-
source: string;
|
|
135
|
-
import?: string;
|
|
136
|
-
require?: string;
|
|
137
|
-
};
|
|
138
|
-
node?: {
|
|
139
|
-
source?: string;
|
|
140
|
-
import?: string;
|
|
141
|
-
require?: string;
|
|
142
|
-
};
|
|
143
|
-
types?: string;
|
|
144
|
-
source: string;
|
|
145
|
-
import?: string;
|
|
146
|
-
require?: string;
|
|
147
|
-
default: string;
|
|
148
|
-
}
|
|
46
|
+
export declare const DEFAULT_BROWSERSLIST_QUERY: string[]
|
|
47
|
+
|
|
149
48
|
/** @public */
|
|
150
|
-
|
|
49
|
+
export declare function defineConfig<const T extends PkgConfigOptions>(configOptions: T): T
|
|
50
|
+
|
|
151
51
|
/** @public */
|
|
152
|
-
|
|
52
|
+
export declare function defineTemplateOption<T>(option: PkgTemplateOption<T>): PkgTemplateOption<T>
|
|
53
|
+
|
|
54
|
+
declare type DtsType = 'api-extractor' | 'rolldown'
|
|
55
|
+
|
|
56
|
+
/** @alpha */
|
|
57
|
+
export declare function getExtractMessagesConfig(options: {
|
|
58
|
+
rules: NonNullable<PkgConfigOptions['extract']>['rules']
|
|
59
|
+
disabled?: boolean
|
|
60
|
+
}): IExtractorMessagesConfig
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
export declare type InferredStrictOptions = z.infer<typeof strictOptions>
|
|
66
|
+
|
|
153
67
|
/** @public */
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
68
|
+
export declare function init(options: {cwd: string; path: string}): Promise<void>
|
|
69
|
+
|
|
70
|
+
/** @alpha */
|
|
71
|
+
export declare function loadConfig(options: {cwd: string}): Promise<PkgConfigOptions | undefined>
|
|
72
|
+
|
|
73
|
+
/** @internal */
|
|
74
|
+
export declare function loadPkg(options: {cwd: string}): Promise<PackageJSON>
|
|
75
|
+
|
|
76
|
+
/** @alpha */
|
|
77
|
+
export declare function loadPkgWithReporting(options: {
|
|
78
|
+
cwd: string
|
|
79
|
+
logger: Logger
|
|
80
|
+
strict: boolean
|
|
81
|
+
}): Promise<PackageJSON>
|
|
82
|
+
|
|
83
|
+
/** @alpha */
|
|
84
|
+
declare interface Logger {
|
|
85
|
+
log: (...args: unknown[]) => void
|
|
86
|
+
info: (...args: unknown[]) => void
|
|
87
|
+
warn: (...args: unknown[]) => void
|
|
88
|
+
error: (...args: unknown[]) => void
|
|
89
|
+
success: (...args: unknown[]) => void
|
|
159
90
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
91
|
+
|
|
92
|
+
/** @alpha */
|
|
93
|
+
export declare interface PackageJSON {
|
|
94
|
+
type?: 'commonjs' | 'module'
|
|
95
|
+
version: string
|
|
96
|
+
private?: boolean
|
|
97
|
+
author?:
|
|
98
|
+
| string
|
|
99
|
+
| {
|
|
100
|
+
name: string
|
|
101
|
+
email?: string
|
|
102
|
+
url?: string
|
|
103
|
+
}
|
|
104
|
+
name: string
|
|
105
|
+
description?: string
|
|
106
|
+
keywords?: string[]
|
|
107
|
+
bin?: Record<string, string>
|
|
108
|
+
dependencies?: Record<string, string | undefined>
|
|
109
|
+
devDependencies?: Record<string, string | undefined>
|
|
110
|
+
peerDependencies?: Record<string, string | undefined>
|
|
111
|
+
exports?: Record<
|
|
112
|
+
string,
|
|
113
|
+
| `./${string}.json`
|
|
114
|
+
| `./${string}.css`
|
|
115
|
+
| {
|
|
116
|
+
source?: string
|
|
117
|
+
types?: string
|
|
118
|
+
browser?: {
|
|
119
|
+
source: string
|
|
120
|
+
import?: string
|
|
121
|
+
require?: string
|
|
122
|
+
}
|
|
123
|
+
node?: {
|
|
124
|
+
source?: string
|
|
125
|
+
module?: string
|
|
126
|
+
import?: string
|
|
127
|
+
require?: string
|
|
128
|
+
}
|
|
129
|
+
module?: string
|
|
130
|
+
import?: string
|
|
131
|
+
require?: string
|
|
132
|
+
default: string
|
|
133
|
+
}
|
|
134
|
+
| {
|
|
135
|
+
types?: string
|
|
136
|
+
svelte: string
|
|
137
|
+
default?: string
|
|
138
|
+
}
|
|
139
|
+
>
|
|
140
|
+
main?: string
|
|
141
|
+
browser?: Record<string, string>
|
|
142
|
+
source?: string
|
|
143
|
+
module?: string
|
|
144
|
+
types?: string
|
|
145
|
+
files?: string[]
|
|
146
|
+
scripts?: Record<string, string | undefined>
|
|
147
|
+
browserslist?: string | string[]
|
|
148
|
+
sideEffects?: boolean | string[]
|
|
149
|
+
engines?: {
|
|
150
|
+
node?: string
|
|
151
|
+
npm?: string
|
|
152
|
+
}
|
|
153
|
+
repository?:
|
|
154
|
+
| string
|
|
155
|
+
| {
|
|
156
|
+
type: 'git'
|
|
157
|
+
url: string
|
|
158
|
+
}
|
|
159
|
+
bugs?:
|
|
160
|
+
| string
|
|
161
|
+
| {
|
|
162
|
+
url: string
|
|
163
|
+
email?: string
|
|
164
|
+
}
|
|
165
|
+
homepage?: string
|
|
166
|
+
license?: string
|
|
163
167
|
}
|
|
168
|
+
|
|
169
|
+
/** @alpha */
|
|
170
|
+
export declare function parseExports(options: {
|
|
171
|
+
cwd: string
|
|
172
|
+
pkg: PackageJSON
|
|
173
|
+
strict: boolean
|
|
174
|
+
strictOptions: InferredStrictOptions
|
|
175
|
+
logger: Logger
|
|
176
|
+
}): (PkgExport & {
|
|
177
|
+
_path: string
|
|
178
|
+
})[]
|
|
179
|
+
|
|
180
|
+
/** @alpha */
|
|
181
|
+
export declare function parseStrictOptions(input: unknown): InferredStrictOptions
|
|
182
|
+
|
|
164
183
|
/** @public */
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
allowMultiple?: boolean;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Until these types are on npm: https://github.com/facebook/react/blob/0bc30748730063e561d87a24a4617526fdd38349/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts#L39-L122
|
|
174
|
-
* @alpha
|
|
175
|
-
*/
|
|
176
|
-
interface ReactCompilerOptions {
|
|
177
|
-
logger?: ReactCompilerLogger | null;
|
|
178
|
-
panicThreshold?: 'ALL_ERRORS' | 'CRITICAL_ERRORS' | 'NONE';
|
|
179
|
-
compilationMode?: 'infer' | 'syntax' | 'annotation' | 'all';
|
|
180
|
-
runtimeModule?: string | null | undefined;
|
|
181
|
-
/**
|
|
182
|
-
* By default React Compiler will skip compilation of code that suppresses the default
|
|
183
|
-
* React ESLint rules, since this is a strong indication that the code may be breaking React rules
|
|
184
|
-
* in some way.
|
|
185
|
-
*
|
|
186
|
-
* Use eslintSuppressionRules to pass a custom set of rule names: any code which suppresses the
|
|
187
|
-
* provided rules will skip compilation. To disable this feature (never bailout of compilation
|
|
188
|
-
* even if the default ESLint is suppressed), pass an empty array.
|
|
189
|
-
*/
|
|
190
|
-
eslintSuppressionRules?: Array<string> | null | undefined;
|
|
191
|
-
sources?: Array<string> | ((filename: string) => boolean) | null;
|
|
192
|
-
/**
|
|
193
|
-
* The minimum major version of React that the compiler should emit code for. If the target is 19
|
|
194
|
-
* or higher, the compiler emits direct imports of React runtime APIs needed by the compiler. On
|
|
195
|
-
* versions prior to 19, an extra runtime package react-compiler-runtime is necessary to provide
|
|
196
|
-
* a userspace approximation of runtime APIs.
|
|
197
|
-
*/
|
|
198
|
-
target: '17' | '18' | '19';
|
|
184
|
+
export declare interface PkgBundle {
|
|
185
|
+
source: string
|
|
186
|
+
import?: string
|
|
187
|
+
require?: string
|
|
188
|
+
runtime?: PkgRuntime
|
|
199
189
|
}
|
|
200
|
-
|
|
201
|
-
* @alpha
|
|
202
|
-
* Represents 'events' that may occur during compilation. Events are only
|
|
203
|
-
* recorded when a logger is set (through the config).
|
|
204
|
-
* These are the different types of events:
|
|
205
|
-
* CompileError:
|
|
206
|
-
* Forget skipped compilation of a function / file due to a known todo,
|
|
207
|
-
* invalid input, or compiler invariant being broken.
|
|
208
|
-
* CompileSuccess:
|
|
209
|
-
* Forget successfully compiled a function.
|
|
210
|
-
* PipelineError:
|
|
211
|
-
* Unexpected errors that occurred during compilation (e.g. failures in
|
|
212
|
-
* babel or other unhandled exceptions).
|
|
213
|
-
*/
|
|
214
|
-
type ReactCompilerLoggerEvent = {
|
|
215
|
-
kind: 'CompileError';
|
|
216
|
-
fnLoc: unknown;
|
|
217
|
-
detail: unknown;
|
|
218
|
-
} | {
|
|
219
|
-
kind: 'CompileDiagnostic';
|
|
220
|
-
fnLoc: unknown;
|
|
221
|
-
detail: unknown;
|
|
222
|
-
} | {
|
|
223
|
-
kind: 'CompileSuccess';
|
|
224
|
-
fnLoc: unknown;
|
|
225
|
-
fnName: string | null;
|
|
226
|
-
memoSlots: number;
|
|
227
|
-
memoBlocks: number;
|
|
228
|
-
memoValues: number;
|
|
229
|
-
prunedMemoBlocks: number;
|
|
230
|
-
prunedMemoValues: number;
|
|
231
|
-
} | {
|
|
232
|
-
kind: 'PipelineError';
|
|
233
|
-
fnLoc: unknown;
|
|
234
|
-
data: string;
|
|
235
|
-
};
|
|
236
|
-
/**
|
|
237
|
-
* @alpha
|
|
238
|
-
*/
|
|
239
|
-
type ReactCompilerLogger = {
|
|
240
|
-
logEvent: (filename: string | null, event: ReactCompilerLoggerEvent) => void;
|
|
241
|
-
};
|
|
242
|
-
type DtsType = 'api-extractor' | 'rolldown';
|
|
190
|
+
|
|
243
191
|
/** @public */
|
|
244
|
-
interface PkgConfigOptions {
|
|
192
|
+
export declare interface PkgConfigOptions {
|
|
245
193
|
/** @alpha */
|
|
246
194
|
babel?: {
|
|
247
|
-
plugins?: PluginItem[] | null | undefined
|
|
195
|
+
plugins?: PluginItem[] | null | undefined
|
|
248
196
|
/** @alpha */
|
|
249
|
-
reactCompiler?: boolean
|
|
197
|
+
reactCompiler?: boolean
|
|
250
198
|
/** @alpha */
|
|
251
|
-
styledComponents?:
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
199
|
+
styledComponents?:
|
|
200
|
+
| boolean
|
|
201
|
+
| {
|
|
202
|
+
/** @defaultValue true */
|
|
203
|
+
displayName?: boolean
|
|
204
|
+
/**
|
|
205
|
+
* @defaultValue []
|
|
206
|
+
* @example ["\@xstyled/styled-components", "\@xstyled/styled-components/*"]
|
|
207
|
+
*/
|
|
208
|
+
topLevelImportPaths?: string[]
|
|
209
|
+
/** @defaultValue true */
|
|
210
|
+
ssr?: boolean
|
|
211
|
+
/** @defaultValue fale */
|
|
212
|
+
fileName?: boolean
|
|
213
|
+
/** @defaultValue ["index"] */
|
|
214
|
+
meaninglessFileNames?: string[]
|
|
215
|
+
/** @defaultValue true */
|
|
216
|
+
minify?: boolean
|
|
217
|
+
/** @defaultValue false */
|
|
218
|
+
transpileTemplateLiterals?: boolean
|
|
219
|
+
namespace?: string
|
|
220
|
+
/** @defaultValue true */
|
|
221
|
+
pure?: boolean
|
|
222
|
+
}
|
|
223
|
+
}
|
|
274
224
|
/**
|
|
275
225
|
* Configure the React Compiler.
|
|
276
226
|
* To enable it, either:
|
|
277
227
|
* - set `babel.reactCompiler` to `true`
|
|
278
228
|
* - add a `react-compiler` export condition, before any `browser`, `require` or `import` conditions. After any `react-server` and `node` conditions
|
|
279
229
|
* @alpha */
|
|
280
|
-
reactCompilerOptions?: ReactCompilerOptions
|
|
281
|
-
bundles?: PkgBundle[]
|
|
230
|
+
reactCompilerOptions?: ReactCompilerOptions
|
|
231
|
+
bundles?: PkgBundle[]
|
|
282
232
|
/** @alpha */
|
|
283
|
-
define?: Record<string, string | number | boolean | undefined | null
|
|
233
|
+
define?: Record<string, string | number | boolean | undefined | null>
|
|
284
234
|
/**
|
|
285
235
|
* Directory of distributed & bundled files.
|
|
286
236
|
*/
|
|
287
|
-
dist?: string
|
|
288
|
-
exports?: PkgConfigProperty<PkgExports
|
|
237
|
+
dist?: string
|
|
238
|
+
exports?: PkgConfigProperty<PkgExports>
|
|
289
239
|
/**
|
|
290
240
|
* Runs `@microsoft/api-extractor` to check that TSDoc tags are valid, and release tags are correct.
|
|
291
241
|
* This is useful for packages that need to be consumed by TSDoc-based tooling.
|
|
@@ -295,7 +245,7 @@ interface PkgConfigOptions {
|
|
|
295
245
|
/**
|
|
296
246
|
* @defaultValue true
|
|
297
247
|
*/
|
|
298
|
-
enabled?: boolean
|
|
248
|
+
enabled?: boolean
|
|
299
249
|
/**
|
|
300
250
|
* Packages in `devDependencies` that are not in `external` are automatically added to the `bundledPackages` config.
|
|
301
251
|
* You can exclude a package from being bundled by using a callback:
|
|
@@ -303,21 +253,21 @@ interface PkgConfigOptions {
|
|
|
303
253
|
* bundledPackages: (prev) => prev.filter(package => package !== 'sanity')
|
|
304
254
|
* ```
|
|
305
255
|
*/
|
|
306
|
-
bundledPackages?: PkgConfigProperty<string[]
|
|
307
|
-
customTags?: TSDocCustomTag[]
|
|
256
|
+
bundledPackages?: PkgConfigProperty<string[]>
|
|
257
|
+
customTags?: TSDocCustomTag[]
|
|
308
258
|
rules?: {
|
|
309
259
|
/**
|
|
310
260
|
* @deprecated as it's no longer needed since TypeScript 5.5 https://github.com/microsoft/TypeScript/issues/42873
|
|
311
261
|
*/
|
|
312
|
-
'ae-forgotten-export'?: never
|
|
313
|
-
'ae-incompatible-release-tags'?: PkgRuleLevel
|
|
314
|
-
'ae-internal-missing-underscore'?: PkgRuleLevel
|
|
315
|
-
'ae-missing-release-tag'?: PkgRuleLevel
|
|
316
|
-
'tsdoc-link-tag-unescaped-text'?: PkgRuleLevel
|
|
317
|
-
'tsdoc-undefined-tag'?: PkgRuleLevel
|
|
318
|
-
'tsdoc-unsupported-tag'?: PkgRuleLevel
|
|
319
|
-
}
|
|
320
|
-
}
|
|
262
|
+
'ae-forgotten-export'?: never
|
|
263
|
+
'ae-incompatible-release-tags'?: PkgRuleLevel
|
|
264
|
+
'ae-internal-missing-underscore'?: PkgRuleLevel
|
|
265
|
+
'ae-missing-release-tag'?: PkgRuleLevel
|
|
266
|
+
'tsdoc-link-tag-unescaped-text'?: PkgRuleLevel
|
|
267
|
+
'tsdoc-undefined-tag'?: PkgRuleLevel
|
|
268
|
+
'tsdoc-unsupported-tag'?: PkgRuleLevel
|
|
269
|
+
}
|
|
270
|
+
}
|
|
321
271
|
/**
|
|
322
272
|
* Packages to exclude from bundles.
|
|
323
273
|
* Provide an array to merge with default exclusions, use a function to replace them:
|
|
@@ -325,45 +275,45 @@ interface PkgConfigOptions {
|
|
|
325
275
|
* exclude: (prev) => prev.filter(package => package !== 'foo')
|
|
326
276
|
* ```
|
|
327
277
|
*/
|
|
328
|
-
external?: PkgConfigProperty<string[]
|
|
278
|
+
external?: PkgConfigProperty<string[]>
|
|
329
279
|
/**
|
|
330
280
|
* Defaults to `"automatic"`
|
|
331
281
|
*/
|
|
332
|
-
jsx?: 'transform' | 'preserve' | 'automatic'
|
|
282
|
+
jsx?: 'transform' | 'preserve' | 'automatic'
|
|
333
283
|
/**
|
|
334
284
|
* Defaults to `"createElement"`
|
|
335
285
|
*/
|
|
336
|
-
jsxFactory?: string
|
|
286
|
+
jsxFactory?: string
|
|
337
287
|
/**
|
|
338
288
|
* Defaults to `"Fragment"`
|
|
339
289
|
*/
|
|
340
|
-
jsxFragment?: string
|
|
290
|
+
jsxFragment?: string
|
|
341
291
|
/**
|
|
342
292
|
* Defaults to `"react"`
|
|
343
293
|
*/
|
|
344
|
-
jsxImportSource?: string
|
|
294
|
+
jsxImportSource?: string
|
|
345
295
|
/**
|
|
346
296
|
* @deprecated no longer supported
|
|
347
297
|
*/
|
|
348
|
-
legacyExports?: never
|
|
349
|
-
minify?: boolean
|
|
298
|
+
legacyExports?: never
|
|
299
|
+
minify?: boolean
|
|
350
300
|
/** @alpha */
|
|
351
301
|
rollup?: {
|
|
352
|
-
plugins?: PkgConfigProperty<
|
|
353
|
-
output?: Partial<NormalizedOutputOptions
|
|
302
|
+
plugins?: PkgConfigProperty<RollupPlugin[]>
|
|
303
|
+
output?: Partial<NormalizedOutputOptions>
|
|
354
304
|
/**
|
|
355
305
|
* Default options are `preset: 'recommended'` and `propertyReadSideEffects: false`
|
|
356
306
|
* @alpha
|
|
357
307
|
*/
|
|
358
|
-
treeshake?: TreeshakingOptions
|
|
308
|
+
treeshake?: TreeshakingOptions
|
|
359
309
|
/** @alpha */
|
|
360
|
-
experimentalLogSideEffects?: boolean
|
|
310
|
+
experimentalLogSideEffects?: boolean
|
|
361
311
|
/**
|
|
362
312
|
* Adds [hash] to chunk filenames, generally only useful if `@sanity/pkg-utils` is used to deploy a package directly to a CDN.
|
|
363
313
|
* It's not needed when publishing to npm for consumption by other libraries, bundlers and frameworks.
|
|
364
314
|
* @defaultValue false
|
|
365
315
|
*/
|
|
366
|
-
hashChunkFileNames?: boolean
|
|
316
|
+
hashChunkFileNames?: boolean
|
|
367
317
|
/**
|
|
368
318
|
* Optimizes lodash imports using `@optimize-lodash/rollup-plugin` when set to `true`.
|
|
369
319
|
* It's enabled if `lodash` is found in `dependencies` or `peerDependencies`.
|
|
@@ -371,209 +321,302 @@ interface PkgConfigOptions {
|
|
|
371
321
|
* @defaultValue true
|
|
372
322
|
* @alpha
|
|
373
323
|
*/
|
|
374
|
-
optimizeLodash?: boolean | OptimizeLodashOptions
|
|
375
|
-
}
|
|
324
|
+
optimizeLodash?: boolean | OptimizeLodashOptions
|
|
325
|
+
}
|
|
376
326
|
/**
|
|
377
327
|
* Default runtime of package exports
|
|
378
328
|
*/
|
|
379
|
-
runtime?: PkgRuntime
|
|
380
|
-
sourcemap?: boolean
|
|
329
|
+
runtime?: PkgRuntime
|
|
330
|
+
sourcemap?: boolean
|
|
381
331
|
/**
|
|
382
332
|
* Directory of source files.
|
|
383
333
|
*/
|
|
384
|
-
src?: string
|
|
385
|
-
tsconfig?: string
|
|
334
|
+
src?: string
|
|
335
|
+
tsconfig?: string
|
|
386
336
|
/**
|
|
387
337
|
* Configure what checks are made when running `--strict` builds and checks
|
|
388
338
|
*/
|
|
389
|
-
strictOptions?: StrictOptions
|
|
339
|
+
strictOptions?: StrictOptions
|
|
390
340
|
/**
|
|
391
341
|
* .d.ts files can be generated either by using `@microsoft/api-extractor` or `rolldown`.
|
|
392
342
|
* `rolldown` is the faster option, but is not yet stable.
|
|
393
343
|
* @defaultValue 'api-extractor'
|
|
394
344
|
*/
|
|
395
|
-
dts?: DtsType
|
|
345
|
+
dts?: DtsType
|
|
396
346
|
}
|
|
397
|
-
|
|
398
|
-
//#region src/node/core/config/defineConfig.d.ts
|
|
347
|
+
|
|
399
348
|
/** @public */
|
|
400
|
-
declare
|
|
401
|
-
|
|
402
|
-
//#region src/node/core/config/loadConfig.d.ts
|
|
403
|
-
/** @alpha */
|
|
404
|
-
declare function loadConfig(options: {
|
|
405
|
-
cwd: string;
|
|
406
|
-
}): Promise<PkgConfigOptions | undefined>;
|
|
407
|
-
//#endregion
|
|
408
|
-
//#region src/node/core/defaults.d.ts
|
|
349
|
+
export declare type PkgConfigProperty<T> = PkgConfigPropertyResolver<T> | T
|
|
350
|
+
|
|
409
351
|
/** @public */
|
|
410
|
-
declare
|
|
411
|
-
|
|
412
|
-
//#region src/node/core/pkg/types.d.ts
|
|
413
|
-
/** @alpha */
|
|
414
|
-
interface PackageJSON {
|
|
415
|
-
type?: 'commonjs' | 'module';
|
|
416
|
-
version: string;
|
|
417
|
-
private?: boolean;
|
|
418
|
-
author?: string | {
|
|
419
|
-
name: string;
|
|
420
|
-
email?: string;
|
|
421
|
-
url?: string;
|
|
422
|
-
};
|
|
423
|
-
name: string;
|
|
424
|
-
description?: string;
|
|
425
|
-
keywords?: string[];
|
|
426
|
-
bin?: Record<string, string>;
|
|
427
|
-
dependencies?: Record<string, string | undefined>;
|
|
428
|
-
devDependencies?: Record<string, string | undefined>;
|
|
429
|
-
peerDependencies?: Record<string, string | undefined>;
|
|
430
|
-
exports?: Record<string, `./${string}.json` | `./${string}.css` | {
|
|
431
|
-
source?: string;
|
|
432
|
-
types?: string;
|
|
433
|
-
browser?: {
|
|
434
|
-
source: string;
|
|
435
|
-
import?: string;
|
|
436
|
-
require?: string;
|
|
437
|
-
};
|
|
438
|
-
node?: {
|
|
439
|
-
source?: string;
|
|
440
|
-
module?: string;
|
|
441
|
-
import?: string;
|
|
442
|
-
require?: string;
|
|
443
|
-
};
|
|
444
|
-
module?: string;
|
|
445
|
-
import?: string;
|
|
446
|
-
require?: string;
|
|
447
|
-
default: string;
|
|
448
|
-
} | {
|
|
449
|
-
types?: string;
|
|
450
|
-
svelte: string;
|
|
451
|
-
default?: string;
|
|
452
|
-
}>;
|
|
453
|
-
main?: string;
|
|
454
|
-
browser?: Record<string, string>;
|
|
455
|
-
source?: string;
|
|
456
|
-
module?: string;
|
|
457
|
-
types?: string;
|
|
458
|
-
files?: string[];
|
|
459
|
-
scripts?: Record<string, string | undefined>;
|
|
460
|
-
browserslist?: string | string[];
|
|
461
|
-
sideEffects?: boolean | string[];
|
|
462
|
-
engines?: {
|
|
463
|
-
node?: string;
|
|
464
|
-
npm?: string;
|
|
465
|
-
};
|
|
466
|
-
repository?: string | {
|
|
467
|
-
type: 'git';
|
|
468
|
-
url: string;
|
|
469
|
-
};
|
|
470
|
-
bugs?: string | {
|
|
471
|
-
url: string;
|
|
472
|
-
email?: string;
|
|
473
|
-
};
|
|
474
|
-
homepage?: string;
|
|
475
|
-
license?: string;
|
|
476
|
-
}
|
|
477
|
-
//#endregion
|
|
478
|
-
//#region src/node/core/pkg/loadPkg.d.ts
|
|
479
|
-
/** @internal */
|
|
480
|
-
declare function loadPkg(options: {
|
|
481
|
-
cwd: string;
|
|
482
|
-
}): Promise<PackageJSON>;
|
|
483
|
-
//#endregion
|
|
484
|
-
//#region src/node/logger.d.ts
|
|
485
|
-
/** @alpha */
|
|
486
|
-
interface Logger {
|
|
487
|
-
log: (...args: unknown[]) => void;
|
|
488
|
-
info: (...args: unknown[]) => void;
|
|
489
|
-
warn: (...args: unknown[]) => void;
|
|
490
|
-
error: (...args: unknown[]) => void;
|
|
491
|
-
success: (...args: unknown[]) => void;
|
|
492
|
-
}
|
|
493
|
-
/** @alpha */
|
|
494
|
-
declare function createLogger(): Logger;
|
|
495
|
-
//#endregion
|
|
496
|
-
//#region src/node/core/pkg/loadPkgWithReporting.d.ts
|
|
497
|
-
/** @alpha */
|
|
498
|
-
declare function loadPkgWithReporting(options: {
|
|
499
|
-
cwd: string;
|
|
500
|
-
logger: Logger;
|
|
501
|
-
strict: boolean;
|
|
502
|
-
}): Promise<PackageJSON>;
|
|
503
|
-
//#endregion
|
|
504
|
-
//#region src/node/core/pkg/parseExports.d.ts
|
|
505
|
-
/** @alpha */
|
|
506
|
-
declare function parseExports(options: {
|
|
507
|
-
cwd: string;
|
|
508
|
-
pkg: PackageJSON;
|
|
509
|
-
strict: boolean;
|
|
510
|
-
strictOptions: InferredStrictOptions;
|
|
511
|
-
logger: Logger;
|
|
512
|
-
}): (PkgExport & {
|
|
513
|
-
_path: string;
|
|
514
|
-
})[];
|
|
515
|
-
//#endregion
|
|
516
|
-
//#region src/node/core/template/types.d.ts
|
|
352
|
+
export declare type PkgConfigPropertyResolver<T> = (prev: T) => T
|
|
353
|
+
|
|
517
354
|
/** @public */
|
|
518
|
-
interface
|
|
519
|
-
|
|
520
|
-
|
|
355
|
+
export declare interface PkgExport {
|
|
356
|
+
/** @internal */
|
|
357
|
+
_exported?: boolean
|
|
358
|
+
browser?: {
|
|
359
|
+
source: string
|
|
360
|
+
import?: string
|
|
361
|
+
require?: string
|
|
362
|
+
}
|
|
363
|
+
node?: {
|
|
364
|
+
source?: string
|
|
365
|
+
import?: string
|
|
366
|
+
require?: string
|
|
367
|
+
}
|
|
368
|
+
types?: string
|
|
369
|
+
source: string
|
|
370
|
+
import?: string
|
|
371
|
+
require?: string
|
|
372
|
+
default: string
|
|
521
373
|
}
|
|
374
|
+
|
|
522
375
|
/** @public */
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
type: 'string';
|
|
526
|
-
description: string;
|
|
527
|
-
initial?: T | ((options: Record<string, any>) => T);
|
|
528
|
-
parse?: (v: string) => T | null;
|
|
529
|
-
validate?: (v: string) => string | true;
|
|
376
|
+
export declare interface PkgExports {
|
|
377
|
+
[path: string]: PkgExport
|
|
530
378
|
}
|
|
379
|
+
|
|
380
|
+
/** @public */
|
|
381
|
+
export declare type PkgFormat = 'commonjs' | 'esm'
|
|
382
|
+
|
|
383
|
+
/** @public */
|
|
384
|
+
export declare type PkgRuleLevel = 'error' | 'warn' | 'info' | 'off'
|
|
385
|
+
|
|
386
|
+
/** @public */
|
|
387
|
+
export declare type PkgRuntime = '*' | 'browser' | 'node'
|
|
388
|
+
|
|
531
389
|
/** @public */
|
|
532
|
-
type
|
|
390
|
+
export declare type PkgTemplate = PkgTemplateDefinition | PkgTemplateResolver
|
|
391
|
+
|
|
533
392
|
/** @public */
|
|
534
|
-
interface PkgTemplateDefinition {
|
|
535
|
-
options: PkgTemplateStringOption<any>[]
|
|
393
|
+
export declare interface PkgTemplateDefinition {
|
|
394
|
+
options: PkgTemplateStringOption<any>[]
|
|
536
395
|
features: {
|
|
537
|
-
name: string
|
|
538
|
-
optional: boolean
|
|
539
|
-
initial: boolean
|
|
540
|
-
}[]
|
|
541
|
-
getFiles: (
|
|
396
|
+
name: string
|
|
397
|
+
optional: boolean
|
|
398
|
+
initial: boolean
|
|
399
|
+
}[]
|
|
400
|
+
getFiles: (
|
|
401
|
+
options: Record<string, any>,
|
|
402
|
+
features: Record<string, boolean>,
|
|
403
|
+
) => Promise<PkgTemplateFile[]>
|
|
542
404
|
}
|
|
405
|
+
|
|
543
406
|
/** @public */
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
}) => PkgTemplateDefinition | Promise<PkgTemplateDefinition>;
|
|
407
|
+
export declare interface PkgTemplateFile {
|
|
408
|
+
name: string
|
|
409
|
+
contents: string
|
|
410
|
+
}
|
|
411
|
+
|
|
550
412
|
/** @public */
|
|
551
|
-
type
|
|
552
|
-
|
|
553
|
-
//#region src/node/core/template/define.d.ts
|
|
413
|
+
export declare type PkgTemplateOption<T = string> = PkgTemplateStringOption<T>
|
|
414
|
+
|
|
554
415
|
/** @public */
|
|
555
|
-
declare
|
|
556
|
-
|
|
557
|
-
|
|
416
|
+
export declare type PkgTemplateResolver = (options: {
|
|
417
|
+
cwd: string
|
|
418
|
+
/** @internal */
|
|
419
|
+
logger: Logger
|
|
420
|
+
packagePath: string
|
|
421
|
+
}) => PkgTemplateDefinition | Promise<PkgTemplateDefinition>
|
|
422
|
+
|
|
558
423
|
/** @public */
|
|
559
|
-
declare
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
424
|
+
export declare interface PkgTemplateStringOption<T = string> {
|
|
425
|
+
name: string
|
|
426
|
+
type: 'string'
|
|
427
|
+
description: string
|
|
428
|
+
initial?: T | ((options: Record<string, any>) => T)
|
|
429
|
+
parse?: (v: string) => T | null
|
|
430
|
+
validate?: (v: string) => string | true
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* @alpha
|
|
435
|
+
*/
|
|
436
|
+
export declare type ReactCompilerLogger = {
|
|
437
|
+
logEvent: (filename: string | null, event: ReactCompilerLoggerEvent) => void
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* @alpha
|
|
442
|
+
* Represents 'events' that may occur during compilation. Events are only
|
|
443
|
+
* recorded when a logger is set (through the config).
|
|
444
|
+
* These are the different types of events:
|
|
445
|
+
* CompileError:
|
|
446
|
+
* Forget skipped compilation of a function / file due to a known todo,
|
|
447
|
+
* invalid input, or compiler invariant being broken.
|
|
448
|
+
* CompileSuccess:
|
|
449
|
+
* Forget successfully compiled a function.
|
|
450
|
+
* PipelineError:
|
|
451
|
+
* Unexpected errors that occurred during compilation (e.g. failures in
|
|
452
|
+
* babel or other unhandled exceptions).
|
|
453
|
+
*/
|
|
454
|
+
export declare type ReactCompilerLoggerEvent =
|
|
455
|
+
| {
|
|
456
|
+
kind: 'CompileError'
|
|
457
|
+
fnLoc: unknown
|
|
458
|
+
detail: unknown
|
|
459
|
+
}
|
|
460
|
+
| {
|
|
461
|
+
kind: 'CompileDiagnostic'
|
|
462
|
+
fnLoc: unknown
|
|
463
|
+
detail: unknown
|
|
464
|
+
}
|
|
465
|
+
| {
|
|
466
|
+
kind: 'CompileSuccess'
|
|
467
|
+
fnLoc: unknown
|
|
468
|
+
fnName: string | null
|
|
469
|
+
memoSlots: number
|
|
470
|
+
memoBlocks: number
|
|
471
|
+
memoValues: number
|
|
472
|
+
prunedMemoBlocks: number
|
|
473
|
+
prunedMemoValues: number
|
|
474
|
+
}
|
|
475
|
+
| {
|
|
476
|
+
kind: 'PipelineError'
|
|
477
|
+
fnLoc: unknown
|
|
478
|
+
data: string
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Until these types are on npm: https://github.com/facebook/react/blob/0bc30748730063e561d87a24a4617526fdd38349/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts#L39-L122
|
|
483
|
+
* @alpha
|
|
484
|
+
*/
|
|
485
|
+
export declare interface ReactCompilerOptions {
|
|
486
|
+
logger?: ReactCompilerLogger | null
|
|
487
|
+
panicThreshold?: 'ALL_ERRORS' | 'CRITICAL_ERRORS' | 'NONE'
|
|
488
|
+
compilationMode?: 'infer' | 'syntax' | 'annotation' | 'all'
|
|
489
|
+
runtimeModule?: string | null | undefined
|
|
490
|
+
/**
|
|
491
|
+
* By default React Compiler will skip compilation of code that suppresses the default
|
|
492
|
+
* React ESLint rules, since this is a strong indication that the code may be breaking React rules
|
|
493
|
+
* in some way.
|
|
494
|
+
*
|
|
495
|
+
* Use eslintSuppressionRules to pass a custom set of rule names: any code which suppresses the
|
|
496
|
+
* provided rules will skip compilation. To disable this feature (never bailout of compilation
|
|
497
|
+
* even if the default ESLint is suppressed), pass an empty array.
|
|
498
|
+
*/
|
|
499
|
+
eslintSuppressionRules?: Array<string> | null | undefined
|
|
500
|
+
sources?: Array<string> | ((filename: string) => boolean) | null
|
|
501
|
+
/**
|
|
502
|
+
* The minimum major version of React that the compiler should emit code for. If the target is 19
|
|
503
|
+
* or higher, the compiler emits direct imports of React runtime APIs needed by the compiler. On
|
|
504
|
+
* versions prior to 19, an extra runtime package react-compiler-runtime is necessary to provide
|
|
505
|
+
* a userspace approximation of runtime APIs.
|
|
506
|
+
*/
|
|
507
|
+
target: '17' | '18' | '19'
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export {RollupPlugin}
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* @public
|
|
514
|
+
*/
|
|
515
|
+
export declare interface StrictOptions {
|
|
516
|
+
/**
|
|
517
|
+
* Disallows a top level `typings` field in `package.json` if it is equal to `exports['.'].source`.
|
|
518
|
+
* @defaultValue 'error'
|
|
519
|
+
*/
|
|
520
|
+
noPackageJsonTypings?: ToggleType
|
|
521
|
+
/**
|
|
522
|
+
* Requires specifying `sideEffects` in `package.json`.
|
|
523
|
+
* @defaultValue 'warn'
|
|
524
|
+
*/
|
|
525
|
+
noImplicitSideEffects?: ToggleType
|
|
526
|
+
/**
|
|
527
|
+
* Requires specifying `browserslist` in `package.json`, instead of relying on it implicitly being:
|
|
528
|
+
* @example
|
|
529
|
+
* ```
|
|
530
|
+
* "browserslist": "extends @sanity/browserslist-config"
|
|
531
|
+
* ```
|
|
532
|
+
* @defaultValue 'warn'
|
|
533
|
+
*/
|
|
534
|
+
noImplicitBrowsersList?: ToggleType
|
|
535
|
+
/**
|
|
536
|
+
* If typescript is used then `types` in `package.json` should be specified for npm listings to show the TS icon.
|
|
537
|
+
* @defaultValue 'error'
|
|
538
|
+
*/
|
|
539
|
+
alwaysPackageJsonTypes?: ToggleType
|
|
540
|
+
/**
|
|
541
|
+
* A lot of analysis tooling requiers the `main` field to work (like bundlephobia) and so it's best practice to always include it
|
|
542
|
+
* @defaultValue 'error'
|
|
543
|
+
*/
|
|
544
|
+
alwaysPackageJsonMain?: ToggleType
|
|
545
|
+
/**
|
|
546
|
+
* Using `.npmignore` is error prone, it's best practice to always declare `files` instead
|
|
547
|
+
* @defaultValue 'error'
|
|
548
|
+
*/
|
|
549
|
+
alwaysPackageJsonFiles?: ToggleType
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* @public
|
|
554
|
+
*/
|
|
555
|
+
export declare const strictOptions: z.ZodObject<
|
|
556
|
+
{
|
|
557
|
+
noPackageJsonTypings: z.ZodDefault<
|
|
558
|
+
z.ZodUnion<[z.ZodLiteral<'error'>, z.ZodLiteral<'warn'>, z.ZodLiteral<'off'>]>
|
|
559
|
+
>
|
|
560
|
+
noImplicitSideEffects: z.ZodDefault<
|
|
561
|
+
z.ZodUnion<[z.ZodLiteral<'error'>, z.ZodLiteral<'warn'>, z.ZodLiteral<'off'>]>
|
|
562
|
+
>
|
|
563
|
+
noImplicitBrowsersList: z.ZodDefault<
|
|
564
|
+
z.ZodUnion<[z.ZodLiteral<'error'>, z.ZodLiteral<'warn'>, z.ZodLiteral<'off'>]>
|
|
565
|
+
>
|
|
566
|
+
alwaysPackageJsonTypes: z.ZodDefault<
|
|
567
|
+
z.ZodUnion<[z.ZodLiteral<'error'>, z.ZodLiteral<'warn'>, z.ZodLiteral<'off'>]>
|
|
568
|
+
>
|
|
569
|
+
alwaysPackageJsonMain: z.ZodDefault<
|
|
570
|
+
z.ZodUnion<[z.ZodLiteral<'error'>, z.ZodLiteral<'warn'>, z.ZodLiteral<'off'>]>
|
|
571
|
+
>
|
|
572
|
+
alwaysPackageJsonFiles: z.ZodDefault<
|
|
573
|
+
z.ZodUnion<[z.ZodLiteral<'error'>, z.ZodLiteral<'warn'>, z.ZodLiteral<'off'>]>
|
|
574
|
+
>
|
|
575
|
+
},
|
|
576
|
+
'strict',
|
|
577
|
+
z.ZodTypeAny,
|
|
578
|
+
{
|
|
579
|
+
noPackageJsonTypings: 'error' | 'warn' | 'off'
|
|
580
|
+
noImplicitSideEffects: 'error' | 'warn' | 'off'
|
|
581
|
+
noImplicitBrowsersList: 'error' | 'warn' | 'off'
|
|
582
|
+
alwaysPackageJsonTypes: 'error' | 'warn' | 'off'
|
|
583
|
+
alwaysPackageJsonMain: 'error' | 'warn' | 'off'
|
|
584
|
+
alwaysPackageJsonFiles: 'error' | 'warn' | 'off'
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
noPackageJsonTypings?: 'error' | 'warn' | 'off' | undefined
|
|
588
|
+
noImplicitSideEffects?: 'error' | 'warn' | 'off' | undefined
|
|
589
|
+
noImplicitBrowsersList?: 'error' | 'warn' | 'off' | undefined
|
|
590
|
+
alwaysPackageJsonTypes?: 'error' | 'warn' | 'off' | undefined
|
|
591
|
+
alwaysPackageJsonMain?: 'error' | 'warn' | 'off' | undefined
|
|
592
|
+
alwaysPackageJsonFiles?: 'error' | 'warn' | 'off' | undefined
|
|
593
|
+
}
|
|
594
|
+
>
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* @public
|
|
598
|
+
*/
|
|
599
|
+
export declare const toggle: z.ZodUnion<
|
|
600
|
+
[z.ZodLiteral<'error'>, z.ZodLiteral<'warn'>, z.ZodLiteral<'off'>]
|
|
601
|
+
>
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* @public
|
|
605
|
+
*/
|
|
606
|
+
export declare type ToggleType = z.infer<typeof toggle>
|
|
607
|
+
|
|
572
608
|
/** @public */
|
|
573
|
-
declare
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
|
|
609
|
+
export declare interface TSDocCustomTag {
|
|
610
|
+
name: string
|
|
611
|
+
syntaxKind: 'block' | 'modifier'
|
|
612
|
+
allowMultiple?: boolean
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/** @public */
|
|
616
|
+
export declare function watch(options: {
|
|
617
|
+
cwd: string
|
|
618
|
+
strict?: boolean
|
|
619
|
+
tsconfig?: string
|
|
620
|
+
}): Promise<void>
|
|
621
|
+
|
|
622
|
+
export {}
|