@savvy-web/tsdown-plugins 0.11.0 → 0.11.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/build/build-target-groups.js +0 -4
- package/build/target-groups.js +2 -5
- package/index.d.ts +36 -40
- package/meta/api-extractor.js +3 -2
- package/meta/tsdoc-config.js +1 -1
- package/package.json +1 -1
|
@@ -74,7 +74,6 @@ async function buildTargetGroups(options) {
|
|
|
74
74
|
...partBundledPackages !== void 0 ? { bundledPackages: partBundledPackages } : {},
|
|
75
75
|
...part.format !== void 0 ? { format: part.format } : {},
|
|
76
76
|
...options.minify !== void 0 ? { minify: options.minify } : {},
|
|
77
|
-
...options.jsx !== void 0 ? { jsx: options.jsx } : {},
|
|
78
77
|
...options.define !== void 0 ? { define: options.define } : {},
|
|
79
78
|
...part.platform !== void 0 ? { platform: part.platform } : {}
|
|
80
79
|
};
|
|
@@ -124,7 +123,6 @@ async function buildTargetGroups(options) {
|
|
|
124
123
|
...partBundleNodeModules ? { skipNodeModulesBundle: false } : {}
|
|
125
124
|
} } : {},
|
|
126
125
|
...js.cjsDefault !== void 0 ? { cjsDefault: js.cjsDefault } : {},
|
|
127
|
-
...js.jsx !== void 0 ? { inputOptions: { jsx: js.jsx } } : {},
|
|
128
126
|
plugins: [
|
|
129
127
|
...manifestPlugin ? [manifestPlugin] : [],
|
|
130
128
|
...js.format.includes("cjs") ? [nodeBuiltinDefaultInterop(), cjsDefaultInterop()] : [],
|
|
@@ -159,7 +157,6 @@ async function buildTargetGroups(options) {
|
|
|
159
157
|
dts: { alwaysBundle: dts.bundledPackages }
|
|
160
158
|
} : {}
|
|
161
159
|
} } : {},
|
|
162
|
-
...dts.jsx !== void 0 ? { inputOptions: { jsx: dts.jsx } } : {},
|
|
163
160
|
plugins: [
|
|
164
161
|
...dts.format.includes("cjs") ? [nodeBuiltinDefaultInterop(), cjsDefaultInterop()] : [],
|
|
165
162
|
...options.extraPlugins ?? [],
|
|
@@ -193,7 +190,6 @@ async function buildTargetGroups(options) {
|
|
|
193
190
|
dts: { alwaysBundle: decl.bundledPackages }
|
|
194
191
|
} : {}
|
|
195
192
|
} } : {},
|
|
196
|
-
...decl.jsx !== void 0 ? { inputOptions: { jsx: decl.jsx } } : {},
|
|
197
193
|
...options.extraPlugins !== void 0 ? { plugins: [...options.extraPlugins] } : {}
|
|
198
194
|
});
|
|
199
195
|
} catch (err) {
|
package/build/target-groups.js
CHANGED
|
@@ -34,8 +34,7 @@ function deriveTargetGroupOptions(options) {
|
|
|
34
34
|
...options.define
|
|
35
35
|
},
|
|
36
36
|
isProd,
|
|
37
|
-
...hasCjs ? { cjsDefault: true } : {}
|
|
38
|
-
...options.jsx !== void 0 ? { jsx: options.jsx } : {}
|
|
37
|
+
...hasCjs ? { cjsDefault: true } : {}
|
|
39
38
|
};
|
|
40
39
|
}
|
|
41
40
|
/** Derive the dts-pass tsdown options for one TargetGroup (bundled declarations only). */
|
|
@@ -61,7 +60,6 @@ function deriveDtsPassOptions(options) {
|
|
|
61
60
|
...options.define
|
|
62
61
|
},
|
|
63
62
|
isProd,
|
|
64
|
-
...options.jsx !== void 0 ? { jsx: options.jsx } : {},
|
|
65
63
|
...options.bundledPackages !== void 0 ? { bundledPackages: options.bundledPackages } : {}
|
|
66
64
|
};
|
|
67
65
|
}
|
|
@@ -90,8 +88,7 @@ function deriveDeclarationsPassOptions(options) {
|
|
|
90
88
|
"process.env.__PACKAGE_VERSION__": JSON.stringify(options.version),
|
|
91
89
|
...options.define
|
|
92
90
|
},
|
|
93
|
-
...options.bundledPackages !== void 0 ? { bundledPackages: options.bundledPackages } : {}
|
|
94
|
-
...options.jsx !== void 0 ? { jsx: options.jsx } : {}
|
|
91
|
+
...options.bundledPackages !== void 0 ? { bundledPackages: options.bundledPackages } : {}
|
|
95
92
|
};
|
|
96
93
|
}
|
|
97
94
|
|
package/index.d.ts
CHANGED
|
@@ -3,40 +3,6 @@ import { Plugin } from "rolldown";
|
|
|
3
3
|
import { Context, Effect, Layer, Schema } from "effect";
|
|
4
4
|
import { JsxEmit, ModuleDetectionKind, ModuleKind, ModuleResolutionKind, NewLineKind, ParsedCommandLine, ScriptTarget } from "typescript";
|
|
5
5
|
|
|
6
|
-
//#region src/jsx/config.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* Resolved JSX transform settings, mirroring the subset of rolldown's JsxOptions the bundler forwards.
|
|
9
|
-
*
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
interface JsxConfig {
|
|
13
|
-
/** "automatic" auto-imports the JSX factories (react-jsx); "classic" does not (React.createElement). */
|
|
14
|
-
readonly runtime?: "classic" | "automatic" | undefined;
|
|
15
|
-
/** The JSX import source for the automatic runtime (e.g. "react", "preact"). */
|
|
16
|
-
readonly importSource?: string | undefined;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* The jsx-relevant slice of a tsconfig's compilerOptions.
|
|
20
|
-
*
|
|
21
|
-
* @public
|
|
22
|
-
*/
|
|
23
|
-
interface TsconfigJsx {
|
|
24
|
-
readonly jsx?: string | undefined;
|
|
25
|
-
readonly jsxImportSource?: string | undefined;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Resolve the effective JSX config: an explicit override wins; otherwise infer from the tsconfig
|
|
29
|
-
* values. Returns undefined when no JSX transform is needed (preserve/none).
|
|
30
|
-
* @public
|
|
31
|
-
*/
|
|
32
|
-
declare function resolveJsxConfig(tsconfig: TsconfigJsx, override: JsxConfig | undefined): JsxConfig | undefined;
|
|
33
|
-
/**
|
|
34
|
-
* Read the jsx-relevant compilerOptions from a package's own tsconfig.json (best-effort;
|
|
35
|
-
* returns empty on absence or parse error).
|
|
36
|
-
* @public
|
|
37
|
-
*/
|
|
38
|
-
declare function readTsconfigJsx(cwd: string): TsconfigJsx;
|
|
39
|
-
//#endregion
|
|
40
6
|
//#region src/manifest/transform.d.ts
|
|
41
7
|
/** @public */
|
|
42
8
|
type Json = Record<string, unknown>;
|
|
@@ -401,8 +367,6 @@ interface DeriveOptions {
|
|
|
401
367
|
readonly format?: ReadonlyArray<BuildFormat> | undefined;
|
|
402
368
|
/** Minify prod output (prod groups only; dev is never minified). Defaults to false. */
|
|
403
369
|
readonly minify?: boolean | undefined;
|
|
404
|
-
/** JSX transform settings to forward to rolldown's inputOptions. */
|
|
405
|
-
readonly jsx?: JsxConfig | undefined;
|
|
406
370
|
/**
|
|
407
371
|
* Compile-time global replacements forwarded to the build `define`. Merged AFTER the
|
|
408
372
|
* auto-injected `process.env.__PACKAGE_VERSION__` so a user key of the same name wins.
|
|
@@ -483,8 +447,6 @@ interface DerivedTsdownOptions {
|
|
|
483
447
|
* default untouched and stay byte-identical to before.
|
|
484
448
|
*/
|
|
485
449
|
readonly cjsDefault?: boolean | undefined;
|
|
486
|
-
/** JSX transform settings to forward to rolldown's inputOptions. */
|
|
487
|
-
readonly jsx?: JsxConfig | undefined;
|
|
488
450
|
}
|
|
489
451
|
/**
|
|
490
452
|
* Derive the JS-pass tsdown options for one TargetGroup (per-module JS, no dts).
|
|
@@ -651,8 +613,6 @@ interface BuildTargetGroupsOptions {
|
|
|
651
613
|
* firing exactly once should guard the second invocation.
|
|
652
614
|
*/
|
|
653
615
|
readonly extraPlugins?: ReadonlyArray<Plugin>;
|
|
654
|
-
/** JSX transform settings forwarded to rolldown's inputOptions. */
|
|
655
|
-
readonly jsx?: JsxConfig | undefined;
|
|
656
616
|
/**
|
|
657
617
|
* Compile-time global replacements forwarded to BOTH the JS and dts passes' `define`.
|
|
658
618
|
* Build-wide (shared by every entry partition); merged after the auto-injected
|
|
@@ -1271,6 +1231,42 @@ declare function runExeBuild(options: RunExeBuildOptions): Promise<void>;
|
|
|
1271
1231
|
*/
|
|
1272
1232
|
declare function computeExeFileName(fileName: string, target: ExeTarget): string;
|
|
1273
1233
|
//#endregion
|
|
1234
|
+
//#region src/jsx/config.d.ts
|
|
1235
|
+
/**
|
|
1236
|
+
* Resolved JSX transform settings. The shape mirrors the subset of rolldown's JsxOptions, but the
|
|
1237
|
+
* bundler consumes it to populate the generated dts tsconfig's `jsx`/`jsxImportSource`, not by
|
|
1238
|
+
* forwarding it into rolldown's input options.
|
|
1239
|
+
*
|
|
1240
|
+
* @public
|
|
1241
|
+
*/
|
|
1242
|
+
interface JsxConfig {
|
|
1243
|
+
/** "automatic" auto-imports the JSX factories (react-jsx); "classic" does not (React.createElement). */
|
|
1244
|
+
readonly runtime?: "classic" | "automatic" | undefined;
|
|
1245
|
+
/** The JSX import source for the automatic runtime (e.g. "react", "preact"). */
|
|
1246
|
+
readonly importSource?: string | undefined;
|
|
1247
|
+
}
|
|
1248
|
+
/**
|
|
1249
|
+
* The jsx-relevant slice of a tsconfig's compilerOptions.
|
|
1250
|
+
*
|
|
1251
|
+
* @public
|
|
1252
|
+
*/
|
|
1253
|
+
interface TsconfigJsx {
|
|
1254
|
+
readonly jsx?: string | undefined;
|
|
1255
|
+
readonly jsxImportSource?: string | undefined;
|
|
1256
|
+
}
|
|
1257
|
+
/**
|
|
1258
|
+
* Resolve the effective JSX config: an explicit override wins; otherwise infer from the tsconfig
|
|
1259
|
+
* values. Returns undefined when no JSX transform is needed (preserve/none).
|
|
1260
|
+
* @public
|
|
1261
|
+
*/
|
|
1262
|
+
declare function resolveJsxConfig(tsconfig: TsconfigJsx, override: JsxConfig | undefined): JsxConfig | undefined;
|
|
1263
|
+
/**
|
|
1264
|
+
* Read the jsx-relevant compilerOptions from a package's own tsconfig.json (best-effort;
|
|
1265
|
+
* returns empty on absence or parse error).
|
|
1266
|
+
* @public
|
|
1267
|
+
*/
|
|
1268
|
+
declare function readTsconfigJsx(cwd: string): TsconfigJsx;
|
|
1269
|
+
//#endregion
|
|
1274
1270
|
//#region src/meta/generate.d.ts
|
|
1275
1271
|
/** @public */
|
|
1276
1272
|
interface GenerateMetaOptions {
|
package/meta/api-extractor.js
CHANGED
|
@@ -43,7 +43,8 @@ function runApiExtractor(options) {
|
|
|
43
43
|
compiler: { tsconfigFilePath: options.tsconfigPath },
|
|
44
44
|
docModel: options.emitDocModel === false ? { enabled: false } : {
|
|
45
45
|
enabled: true,
|
|
46
|
-
apiJsonFilePath: options.apiJsonPath
|
|
46
|
+
apiJsonFilePath: options.apiJsonPath,
|
|
47
|
+
includeForgottenExports: true
|
|
47
48
|
},
|
|
48
49
|
...options.tsdocMetadataPath !== void 0 ? { tsdocMetadata: {
|
|
49
50
|
enabled: true,
|
|
@@ -102,4 +103,4 @@ function runApiExtractor(options) {
|
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
//#endregion
|
|
105
|
-
export { runApiExtractor };
|
|
106
|
+
export { mapExtractorMessage, runApiExtractor };
|
package/meta/tsdoc-config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvy-web/tsdown-plugins",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Interface-only tsdown/rolldown plugin pack powering @savvy-web/bundler",
|
|
6
6
|
"homepage": "https://github.com/savvy-web/systems/tree/main/packages/tsdown-plugins",
|