@sanity/pkg-utils 7.7.1 → 7.8.0
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 +12 -3
- package/dist/_chunks-cjs/index.cjs.map +1 -1
- package/dist/_chunks-es/consoleSpy.js +12 -4
- package/dist/_chunks-es/consoleSpy.js.map +1 -1
- package/dist/_chunks-es/index.js +1 -0
- package/dist/_chunks-es/index.js.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +0 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -48
- package/dist/index.d.ts +16 -48
- package/dist/index.js +1 -3
- package/package.json +3 -3
- package/tsconfig/isolated-declarations.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PluginItem } from "@babel/core";
|
|
2
2
|
import { OptimizeLodashOptions } from "@optimize-lodash/rollup-plugin";
|
|
3
3
|
import { NormalizedOutputOptions, Plugin, Plugin as RollupPlugin, TreeshakingOptions } from "rollup";
|
|
4
|
-
import { z } from "zod";
|
|
5
4
|
import { IExtractorMessagesConfig } from "@microsoft/api-extractor";
|
|
6
5
|
/**
|
|
7
6
|
* Build the distribution files of a npm package.
|
|
@@ -35,43 +34,7 @@ declare function check(options: {
|
|
|
35
34
|
strict?: boolean;
|
|
36
35
|
tsconfig?: string;
|
|
37
36
|
}): Promise<void>;
|
|
38
|
-
|
|
39
|
-
* @public
|
|
40
|
-
*/
|
|
41
|
-
declare const toggle: z.ZodUnion<[z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"off">]>;
|
|
42
|
-
/**
|
|
43
|
-
* @public
|
|
44
|
-
*/
|
|
45
|
-
type ToggleType = z.infer<typeof toggle>;
|
|
46
|
-
/**
|
|
47
|
-
* @public
|
|
48
|
-
*/
|
|
49
|
-
declare const strictOptions: z.ZodObject<{
|
|
50
|
-
noPackageJsonTypings: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"off">]>>;
|
|
51
|
-
noImplicitSideEffects: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"off">]>>;
|
|
52
|
-
noImplicitBrowsersList: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"off">]>>;
|
|
53
|
-
alwaysPackageJsonTypes: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"off">]>>;
|
|
54
|
-
alwaysPackageJsonMain: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"off">]>>;
|
|
55
|
-
alwaysPackageJsonFiles: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"off">]>>;
|
|
56
|
-
}, "strict", z.ZodTypeAny, {
|
|
57
|
-
noPackageJsonTypings: "error" | "off" | "warn";
|
|
58
|
-
noImplicitSideEffects: "error" | "off" | "warn";
|
|
59
|
-
noImplicitBrowsersList: "error" | "off" | "warn";
|
|
60
|
-
alwaysPackageJsonTypes: "error" | "off" | "warn";
|
|
61
|
-
alwaysPackageJsonMain: "error" | "off" | "warn";
|
|
62
|
-
alwaysPackageJsonFiles: "error" | "off" | "warn";
|
|
63
|
-
}, {
|
|
64
|
-
noPackageJsonTypings?: "error" | "off" | "warn" | undefined;
|
|
65
|
-
noImplicitSideEffects?: "error" | "off" | "warn" | undefined;
|
|
66
|
-
noImplicitBrowsersList?: "error" | "off" | "warn" | undefined;
|
|
67
|
-
alwaysPackageJsonTypes?: "error" | "off" | "warn" | undefined;
|
|
68
|
-
alwaysPackageJsonMain?: "error" | "off" | "warn" | undefined;
|
|
69
|
-
alwaysPackageJsonFiles?: "error" | "off" | "warn" | undefined;
|
|
70
|
-
}>;
|
|
71
|
-
/**
|
|
72
|
-
* @public
|
|
73
|
-
*/
|
|
74
|
-
type InferredStrictOptions = z.infer<typeof strictOptions>;
|
|
37
|
+
type ToggleType = 'error' | 'warn' | 'off';
|
|
75
38
|
/**
|
|
76
39
|
* @public
|
|
77
40
|
*/
|
|
@@ -80,12 +43,12 @@ interface StrictOptions {
|
|
|
80
43
|
* Disallows a top level `typings` field in `package.json` if it is equal to `exports['.'].source`.
|
|
81
44
|
* @defaultValue 'error'
|
|
82
45
|
*/
|
|
83
|
-
noPackageJsonTypings
|
|
46
|
+
noPackageJsonTypings: ToggleType;
|
|
84
47
|
/**
|
|
85
48
|
* Requires specifying `sideEffects` in `package.json`.
|
|
86
49
|
* @defaultValue 'warn'
|
|
87
50
|
*/
|
|
88
|
-
noImplicitSideEffects
|
|
51
|
+
noImplicitSideEffects: ToggleType;
|
|
89
52
|
/**
|
|
90
53
|
* Requires specifying `browserslist` in `package.json`, instead of relying on it implicitly being:
|
|
91
54
|
* @example
|
|
@@ -94,25 +57,30 @@ interface StrictOptions {
|
|
|
94
57
|
* ```
|
|
95
58
|
* @defaultValue 'warn'
|
|
96
59
|
*/
|
|
97
|
-
noImplicitBrowsersList
|
|
60
|
+
noImplicitBrowsersList: ToggleType;
|
|
98
61
|
/**
|
|
99
62
|
* If typescript is used then `types` in `package.json` should be specified for npm listings to show the TS icon.
|
|
100
63
|
* @defaultValue 'error'
|
|
101
64
|
*/
|
|
102
|
-
alwaysPackageJsonTypes
|
|
65
|
+
alwaysPackageJsonTypes: ToggleType;
|
|
103
66
|
/**
|
|
104
67
|
* A lot of analysis tooling requiers the `main` field to work (like bundlephobia) and so it's best practice to always include it
|
|
105
68
|
* @defaultValue 'error'
|
|
106
69
|
*/
|
|
107
|
-
alwaysPackageJsonMain
|
|
70
|
+
alwaysPackageJsonMain: ToggleType;
|
|
108
71
|
/**
|
|
109
72
|
* Using `.npmignore` is error prone, it's best practice to always declare `files` instead
|
|
110
73
|
* @defaultValue 'error'
|
|
111
74
|
*/
|
|
112
|
-
alwaysPackageJsonFiles
|
|
75
|
+
alwaysPackageJsonFiles: ToggleType;
|
|
76
|
+
/**
|
|
77
|
+
* It's slow to perform type checking while generating dts files, so it's best practice to disable it with a `"noCheck": true` in the tsconfig.json file used by `package.config.ts`
|
|
78
|
+
* @defaultValue 'warn'
|
|
79
|
+
*/
|
|
80
|
+
noCheckTypes: ToggleType;
|
|
113
81
|
}
|
|
114
82
|
/** @alpha */
|
|
115
|
-
declare function parseStrictOptions(input: unknown):
|
|
83
|
+
declare function parseStrictOptions(input: unknown): StrictOptions;
|
|
116
84
|
/** @public */
|
|
117
85
|
type PkgFormat = 'commonjs' | 'esm';
|
|
118
86
|
/** @public */
|
|
@@ -390,7 +358,7 @@ interface PkgConfigOptions {
|
|
|
390
358
|
/**
|
|
391
359
|
* Configure what checks are made when running `--strict` builds and checks
|
|
392
360
|
*/
|
|
393
|
-
strictOptions?: StrictOptions
|
|
361
|
+
strictOptions?: Partial<StrictOptions>;
|
|
394
362
|
/**
|
|
395
363
|
* .d.ts files can be generated either by using `@microsoft/api-extractor` or `rolldown`.
|
|
396
364
|
* `rolldown` is the faster option, but is not yet stable.
|
|
@@ -495,7 +463,7 @@ declare function parseExports(options: {
|
|
|
495
463
|
cwd: string;
|
|
496
464
|
pkg: PackageJSON;
|
|
497
465
|
strict: boolean;
|
|
498
|
-
strictOptions:
|
|
466
|
+
strictOptions: StrictOptions;
|
|
499
467
|
logger: Logger;
|
|
500
468
|
}): (PkgExport & {
|
|
501
469
|
_path: string;
|
|
@@ -553,4 +521,4 @@ declare function watch(options: {
|
|
|
553
521
|
strict?: boolean;
|
|
554
522
|
tsconfig?: string;
|
|
555
523
|
}): Promise<void>;
|
|
556
|
-
export { DEFAULT_BROWSERSLIST_QUERY,
|
|
524
|
+
export { DEFAULT_BROWSERSLIST_QUERY, PackageJSON, PkgBundle, PkgConfigOptions, PkgConfigProperty, PkgConfigPropertyResolver, PkgExport, PkgExports, PkgFormat, PkgRuleLevel, PkgRuntime, PkgTemplate, PkgTemplateDefinition, PkgTemplateFile, PkgTemplateOption, PkgTemplateResolver, PkgTemplateStringOption, ReactCompilerLogger, ReactCompilerLoggerEvent, ReactCompilerOptions, RollupPlugin, TSDocCustomTag, build, check, createLogger, defineConfig, defineTemplateOption, getExtractMessagesConfig, init, loadConfig, loadPkg, loadPkgWithReporting, parseExports, parseStrictOptions, watch };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { build } from "./_chunks-es/build.js";
|
|
2
2
|
import { check } from "./_chunks-es/check.js";
|
|
3
|
-
import { DEFAULT_BROWSERSLIST_QUERY, loadConfig, loadPkg, loadPkgWithReporting, parseExports, parseStrictOptions
|
|
3
|
+
import { DEFAULT_BROWSERSLIST_QUERY, loadConfig, loadPkg, loadPkgWithReporting, parseExports, parseStrictOptions } from "./_chunks-es/consoleSpy.js";
|
|
4
4
|
import { defineTemplateOption, init } from "./_chunks-es/init.js";
|
|
5
5
|
import { createLogger } from "./_chunks-es/isRecord.js";
|
|
6
6
|
import { getExtractMessagesConfig } from "./_chunks-es/index.js";
|
|
@@ -22,8 +22,6 @@ export {
|
|
|
22
22
|
loadPkgWithReporting,
|
|
23
23
|
parseExports,
|
|
24
24
|
parseStrictOptions,
|
|
25
|
-
strictOptions,
|
|
26
|
-
toggle,
|
|
27
25
|
watch
|
|
28
26
|
};
|
|
29
27
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/pkg-utils",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.8.0",
|
|
4
4
|
"description": "Simple utilities for modern npm packages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity-io",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"@commitlint/cli": "^19.8.1",
|
|
116
116
|
"@commitlint/config-conventional": "^19.8.1",
|
|
117
117
|
"@ianvs/prettier-plugin-sort-imports": "^4.4.2",
|
|
118
|
-
"@sanity/prettier-config": "^1.0.
|
|
118
|
+
"@sanity/prettier-config": "^1.0.5",
|
|
119
119
|
"@types/babel__core": "^7.20.5",
|
|
120
120
|
"@types/find-config": "^1.0.4",
|
|
121
121
|
"@types/fs-extra": "^11.0.4",
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"tsx": "^4.20.3",
|
|
141
141
|
"typescript": "5.8.3",
|
|
142
142
|
"vitest": "^3.2.4",
|
|
143
|
-
"@sanity/pkg-utils": "7.
|
|
143
|
+
"@sanity/pkg-utils": "7.8.0"
|
|
144
144
|
},
|
|
145
145
|
"peerDependencies": {
|
|
146
146
|
"babel-plugin-react-compiler": "*",
|