@savvy-web/bundler 2.1.0 → 2.1.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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/run.js +7 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@savvy-web/bundler",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "private": false,
5
5
  "description": "Zero-config tsdown-based bundler for Silk Suite TypeScript packages",
6
6
  "homepage": "https://github.com/savvy-web/systems/tree/main/packages/bundler",
@@ -32,7 +32,7 @@
32
32
  "./package.json": "./package.json"
33
33
  },
34
34
  "dependencies": {
35
- "@savvy-web/tsdown-plugins": "2.3.0",
35
+ "@savvy-web/tsdown-plugins": "2.4.0",
36
36
  "@tsdown/exe": "^0.22.14",
37
37
  "effect": "4.0.0-beta.101",
38
38
  "rolldown": "^1.2.0",
package/run.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineBuild, parseArgs } from "./config.js";
2
- import { BuildCollector, ConfigValidationError, ConfigValidator, ConfigValidatorLive, ReportPipelineLive, assertNoEntryCollisions, buildEmittedManifest, buildTargetGroups, computeExeFileName, createEntryName, deriveExportPaths, extractAmbientDts, normalizeExeOptions, normalizeLooseFiles, packageJsonEntries, readTsconfigJsx, removeDeclarationMaps, renderReport, resolveJsxConfig, resolveTargets, runExeBuild, runMetaPass, writeIssuesArtifact, writeResolvedTsconfig, writeTargetsBinding } from "@savvy-web/tsdown-plugins";
2
+ import { BuildCollector, ConfigValidationError, ConfigValidator, ReportPipeline, assertNoEntryCollisions, buildEmittedManifest, buildTargetGroups, computeExeFileName, createEntryName, deriveExportPaths, extractAmbientDts, normalizeExeOptions, normalizeLooseFiles, packageJsonEntries, readTsconfigJsx, removeDeclarationMaps, renderReport, resolveJsxConfig, resolveTargets, runExeBuild, runMetaPass, writeIssuesArtifact, writeResolvedTsconfig, writeTargetsBinding } from "@savvy-web/tsdown-plugins";
3
3
  import { copyFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
4
4
  import { dirname, join } from "node:path";
5
5
  import { Effect } from "effect";
@@ -32,8 +32,9 @@ function readPackageJson(cwd) {
32
32
  }
33
33
  /** Resolve the prod build groups and the target binding from publishConfig.targets (or the single-npm default). */
34
34
  function deriveProdGroups(targets, baseName) {
35
+ const effective = targets !== void 0 && Object.keys(targets).length > 0 ? targets : { npm: true };
35
36
  const resolution = resolveTargets({
36
- targets: targets !== void 0 && Object.keys(targets).length > 0 ? targets : { npm: true },
37
+ targets: effective,
37
38
  baseName
38
39
  });
39
40
  return {
@@ -87,7 +88,8 @@ async function runBuild(config, options) {
87
88
  };
88
89
  let renderAndWrite;
89
90
  try {
90
- const jsx = resolveJsxConfig((options.readTsconfigJsx ?? (() => readTsconfigJsx(cwd)))(), config.jsx);
91
+ const readJsx = options.readTsconfigJsx ?? (() => readTsconfigJsx(cwd));
92
+ const jsx = resolveJsxConfig(readJsx(), config.jsx);
91
93
  const tsconfigPath = (options.writeTsconfig ?? ((c) => writeResolvedTsconfig({
92
94
  cwd: c,
93
95
  ...jsx?.runtime === "automatic" ? {
@@ -114,7 +116,7 @@ async function runBuild(config, options) {
114
116
  osCpu: osCpuForValidate,
115
117
  ...config.meta !== void 0 && config.meta !== false ? { meta: config.meta } : {},
116
118
  ...config.looseFiles !== void 0 ? { looseFiles: config.looseFiles } : {}
117
- })).pipe(Effect.provide(ConfigValidatorLive)));
119
+ })).pipe(Effect.provide(ConfigValidator.layer)));
118
120
  const exeSpecs = config.exe !== void 0 ? normalizeExeOptions(config.exe, osCpuForValidate) : [];
119
121
  if (config.exe !== void 0 && (exeSpecs.length !== 1 || (exeSpecs[0]?.targets.length ?? 0) !== 1)) throw new Error(`exe build requires exactly one binary with one target (got ${exeSpecs.length} spec(s), ${exeSpecs[0]?.targets.length ?? 0} target(s) on the first). A package's exports["."] resolves to a single SEA — cross-platform binaries must each ship as their own per-platform package.`);
120
122
  const exeSpec = exeSpecs[0];
@@ -231,7 +233,7 @@ async function runBuild(config, options) {
231
233
  ...explicitFormat !== void 0 ? { explicitFormat } : {},
232
234
  verbose,
233
235
  noColor: process.env.NO_COLOR !== void 0 || !process.stdout.isTTY
234
- }).pipe(Effect.provide(ReportPipelineLive)));
236
+ }).pipe(Effect.provide(ReportPipeline)));
235
237
  for (const output of rendered) writeOutput(output);
236
238
  };
237
239
  if (hasJsEntries || config.exe === void 0) await build({