@savvy-web/rslib-builder 0.18.0 → 0.18.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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! For license information please see index.js.LICENSE.txt */
1
+ /*! LICENSE: index.js.LICENSE.txt */
2
2
  import { constants, cpSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
3
  import { dirname, isAbsolute, join, normalize, relative, resolve as external_node_path_resolve } from "node:path";
4
4
  import { defineConfig } from "@rslib/core";
@@ -548,7 +548,7 @@ class TSConfigFile {
548
548
  }
549
549
  }
550
550
  class LibraryTSConfigFile extends TSConfigFile {
551
- writeBundleTempConfig(_mode) {
551
+ writeBundleTempConfig(_mode, options) {
552
552
  const cwd = process.cwd();
553
553
  const baseConfig = this.config;
554
554
  const absoluteConfig = {
@@ -565,6 +565,9 @@ class LibraryTSConfigFile extends TSConfigFile {
565
565
  join(cwd, "node_modules/@types"),
566
566
  join(cwd, "types")
567
567
  ],
568
+ types: options?.types ?? [
569
+ "node"
570
+ ],
568
571
  declarationMap: true,
569
572
  emitDeclarationOnly: false
570
573
  },
@@ -1143,7 +1146,7 @@ async function bundleDtsFiles(options) {
1143
1146
  const bundledFiles = new Map();
1144
1147
  const apiModelPaths = new Map();
1145
1148
  let tsdocMetadataPath;
1146
- const apiModelEnabled = true === apiModel || "object" == typeof apiModel;
1149
+ const apiModelEnabled = (true === apiModel || "object" == typeof apiModel) && "dev" !== options.buildMode;
1147
1150
  const tsdocOptions = "object" == typeof apiModel ? apiModel.tsdoc : void 0;
1148
1151
  const tsdocMetadataOption = "object" == typeof apiModel ? apiModel.tsdocMetadata : void 0;
1149
1152
  const tsdocWarnings = tsdocOptions?.warnings ?? (TsDocConfigBuilder.isCI() ? "fail" : "log");
@@ -1460,7 +1463,11 @@ function runTsgo(options) {
1460
1463
  const originalCwd = process.cwd();
1461
1464
  try {
1462
1465
  process.chdir(cwd);
1463
- configTsconfigPath = TSConfigs.node.ecma.lib.writeBundleTempConfig(options.buildMode);
1466
+ const projectConfigPath = findTsConfig(cwd);
1467
+ const projectTypes = projectConfigPath ? loadTsConfig(projectConfigPath).options.types : void 0;
1468
+ configTsconfigPath = TSConfigs.node.ecma.lib.writeBundleTempConfig(options.buildMode, projectTypes ? {
1469
+ types: projectTypes
1470
+ } : void 0);
1464
1471
  } finally{
1465
1472
  process.chdir(originalCwd);
1466
1473
  }
@@ -1613,6 +1620,9 @@ function runTsgo(options) {
1613
1620
  },
1614
1621
  ...options.format && {
1615
1622
  format: options.format
1623
+ },
1624
+ ...options.buildMode && {
1625
+ buildMode: options.buildMode
1616
1626
  }
1617
1627
  });
1618
1628
  let apiModelPath;
@@ -2927,7 +2937,6 @@ if (module.exports && module.exports.__esModule && 'default' in module.exports)
2927
2937
  target: void 0,
2928
2938
  pkg
2929
2939
  }) : void 0;
2930
- const apiModelForMode = "npm" === mode ? options.apiModel : void 0;
2931
2940
  const sourceMap = "dev" === mode;
2932
2941
  const externalsConfig = options.externals && options.externals.length > 0 ? {
2933
2942
  externals: options.externals
@@ -2989,8 +2998,8 @@ if (module.exports && module.exports.__esModule && 'default' in module.exports)
2989
2998
  },
2990
2999
  buildMode: mode,
2991
3000
  format: primaryFormat,
2992
- ...void 0 !== apiModelForMode && {
2993
- apiModel: apiModelForMode
3001
+ ...void 0 !== options.apiModel && {
3002
+ apiModel: options.apiModel
2994
3003
  },
2995
3004
  ...isDualFormat && {
2996
3005
  dtsPathPrefix: primaryFormat
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@savvy-web/rslib-builder",
3
- "version": "0.18.0",
3
+ "version": "0.18.2",
4
4
  "private": false,
5
5
  "description": "RSlib-based build system for Node.js libraries with automatic package.json transformation, TypeScript declaration bundling, and multi-target support",
6
6
  "keywords": [
@@ -49,20 +49,20 @@
49
49
  "@pnpm/catalogs.protocol-parser": "^1001.0.0",
50
50
  "@pnpm/exportable-manifest": "^1000.4.1",
51
51
  "@pnpm/lockfile.fs": "^1001.1.31",
52
- "@pnpm/workspace.read-manifest": "^1000.2.10",
53
- "@typescript-eslint/parser": "^8.56.1",
52
+ "@pnpm/workspace.read-manifest": "^1000.3.0",
53
+ "@typescript-eslint/parser": "^8.57.1",
54
54
  "deep-equal": "^2.2.3",
55
- "eslint": "^10.0.2",
55
+ "eslint": "^10.0.3",
56
56
  "eslint-plugin-tsdoc": "^0.5.2",
57
57
  "glob": "^13.0.6",
58
58
  "picocolors": "^1.1.1",
59
59
  "sort-package-json": "^3.6.1",
60
- "tmp": "^0.2.5",
60
+ "tmp": "^0.2.4",
61
61
  "workspace-tools": "^0.41.0"
62
62
  },
63
63
  "peerDependencies": {
64
- "@microsoft/api-extractor": "^7.57.6",
65
- "@rslib/core": "^0.19.6",
64
+ "@microsoft/api-extractor": "^7.57.7",
65
+ "@rslib/core": "^0.20.0",
66
66
  "@types/node": "^25.2.0",
67
67
  "@typescript/native-preview": "^7.0.0-dev.20260124.1",
68
68
  "typescript": "^5.9.3"
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.57.6"
8
+ "packageVersion": "7.57.7"
9
9
  }
10
10
  ]
11
11
  }