@bleedingdev/modern-js-server-utils 3.5.0-ultramodern.1 → 3.5.0-ultramodern.11

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.
@@ -74,7 +74,13 @@ const createResolvedTsgoConfig = async (appDirectory, tsconfigPath, distDir, sou
74
74
  config.compilerOptions ??= {};
75
75
  config.compilerOptions.rootDir = appDirectory;
76
76
  config.compilerOptions.outDir = distDir;
77
+ config.compilerOptions.composite = false;
78
+ config.compilerOptions.declaration = false;
79
+ config.compilerOptions.declarationMap = false;
80
+ config.compilerOptions.emitDeclarationOnly = false;
81
+ config.compilerOptions.incremental = false;
77
82
  config.compilerOptions.noEmit = false;
83
+ delete config.compilerOptions.tsBuildInfoFile;
78
84
  if (true === config.compilerOptions.allowImportingTsExtensions) config.compilerOptions.rewriteRelativeImportExtensions = true;
79
85
  config.files = filterSourceFiles(tsconfigDir, sourceDirs, config.files);
80
86
  delete config.include;
@@ -144,6 +150,20 @@ const runTsgo = (tsgoBinPath, args, options)=>new Promise((resolve, reject)=>{
144
150
  resolve(result);
145
151
  });
146
152
  });
153
+ const getTsgoBinEntry = (pkg)=>{
154
+ if ('string' == typeof pkg.bin) return pkg.bin;
155
+ return pkg.bin?.tsgo;
156
+ };
157
+ const resolveTsgoBinPath = (pkgPath)=>{
158
+ const pkgDir = external_path_default().dirname(pkgPath);
159
+ const pkg = require(pkgPath);
160
+ const declaredBinEntry = getTsgoBinEntry(pkg);
161
+ const candidates = [
162
+ declaredBinEntry ? external_path_default().resolve(pkgDir, declaredBinEntry) : void 0,
163
+ external_path_default().join(pkgDir, 'bin/tsgo.js')
164
+ ].filter((candidate)=>Boolean(candidate));
165
+ return candidates.find((candidate)=>utils_namespaceObject.fs.existsSync(candidate)) ?? candidates[0];
166
+ };
147
167
  const getTsgoBinPath = (appDirectory, resolvePaths = [
148
168
  appDirectory,
149
169
  __dirname
@@ -152,7 +172,7 @@ const getTsgoBinPath = (appDirectory, resolvePaths = [
152
172
  const pkgPath = require.resolve("@typescript/native-preview/package.json", {
153
173
  paths: resolvePaths
154
174
  });
155
- return external_path_default().join(external_path_default().dirname(pkgPath), 'bin/tsgo.js');
175
+ return resolveTsgoBinPath(pkgPath);
156
176
  } catch {
157
177
  throw new Error('tsgo could not be found! Please install "@typescript/native-preview" in your project to compile BFF/server code.');
158
178
  }
@@ -29,7 +29,13 @@ const createResolvedTsgoConfig = async (appDirectory, tsconfigPath, distDir, sou
29
29
  config.compilerOptions ??= {};
30
30
  config.compilerOptions.rootDir = appDirectory;
31
31
  config.compilerOptions.outDir = distDir;
32
+ config.compilerOptions.composite = false;
33
+ config.compilerOptions.declaration = false;
34
+ config.compilerOptions.declarationMap = false;
35
+ config.compilerOptions.emitDeclarationOnly = false;
36
+ config.compilerOptions.incremental = false;
32
37
  config.compilerOptions.noEmit = false;
38
+ delete config.compilerOptions.tsBuildInfoFile;
33
39
  if (true === config.compilerOptions.allowImportingTsExtensions) config.compilerOptions.rewriteRelativeImportExtensions = true;
34
40
  config.files = filterSourceFiles(tsconfigDir, sourceDirs, config.files);
35
41
  delete config.include;
@@ -99,6 +105,20 @@ const runTsgo = (tsgoBinPath, args, options)=>new Promise((resolve, reject)=>{
99
105
  resolve(result);
100
106
  });
101
107
  });
108
+ const getTsgoBinEntry = (pkg)=>{
109
+ if ('string' == typeof pkg.bin) return pkg.bin;
110
+ return pkg.bin?.tsgo;
111
+ };
112
+ const resolveTsgoBinPath = (pkgPath)=>{
113
+ const pkgDir = path.dirname(pkgPath);
114
+ const pkg = require(pkgPath);
115
+ const declaredBinEntry = getTsgoBinEntry(pkg);
116
+ const candidates = [
117
+ declaredBinEntry ? path.resolve(pkgDir, declaredBinEntry) : void 0,
118
+ path.join(pkgDir, 'bin/tsgo.js')
119
+ ].filter((candidate)=>Boolean(candidate));
120
+ return candidates.find((candidate)=>fs.existsSync(candidate)) ?? candidates[0];
121
+ };
102
122
  const getTsgoBinPath = (appDirectory, resolvePaths = [
103
123
  appDirectory,
104
124
  __dirname
@@ -107,7 +127,7 @@ const getTsgoBinPath = (appDirectory, resolvePaths = [
107
127
  const pkgPath = require.resolve("@typescript/native-preview/package.json", {
108
128
  paths: resolvePaths
109
129
  });
110
- return path.join(path.dirname(pkgPath), 'bin/tsgo.js');
130
+ return resolveTsgoBinPath(pkgPath);
111
131
  } catch {
112
132
  throw new Error('tsgo could not be found! Please install "@typescript/native-preview" in your project to compile BFF/server code.');
113
133
  }
@@ -7,7 +7,7 @@ import { rewriteImportSpecifiers } from "./importRewriter.mjs";
7
7
  import { createTsconfigPathsMatcher, getNotAliasedPath } from "./tsconfigPathsPlugin.mjs";
8
8
  import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
9
9
  import { dirname as __rspack_dirname } from "node:path";
10
- var typescript_dirname = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
10
+ var __rspack_import_meta_dirname__ = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
11
11
  const copyFiles = async (from, to, appDirectory)=>{
12
12
  if (await fs.pathExists(from)) {
13
13
  const relativePath = path.relative(appDirectory, from);
@@ -34,7 +34,13 @@ const createResolvedTsgoConfig = async (appDirectory, tsconfigPath, distDir, sou
34
34
  config.compilerOptions ??= {};
35
35
  config.compilerOptions.rootDir = appDirectory;
36
36
  config.compilerOptions.outDir = distDir;
37
+ config.compilerOptions.composite = false;
38
+ config.compilerOptions.declaration = false;
39
+ config.compilerOptions.declarationMap = false;
40
+ config.compilerOptions.emitDeclarationOnly = false;
41
+ config.compilerOptions.incremental = false;
37
42
  config.compilerOptions.noEmit = false;
43
+ delete config.compilerOptions.tsBuildInfoFile;
38
44
  if (true === config.compilerOptions.allowImportingTsExtensions) config.compilerOptions.rewriteRelativeImportExtensions = true;
39
45
  config.files = filterSourceFiles(tsconfigDir, sourceDirs, config.files);
40
46
  delete config.include;
@@ -104,15 +110,29 @@ const runTsgo = (tsgoBinPath, args, options)=>new Promise((resolve, reject)=>{
104
110
  resolve(result);
105
111
  });
106
112
  });
113
+ const getTsgoBinEntry = (pkg)=>{
114
+ if ('string' == typeof pkg.bin) return pkg.bin;
115
+ return pkg.bin?.tsgo;
116
+ };
117
+ const resolveTsgoBinPath = (pkgPath)=>{
118
+ const pkgDir = path.dirname(pkgPath);
119
+ const pkg = require(pkgPath);
120
+ const declaredBinEntry = getTsgoBinEntry(pkg);
121
+ const candidates = [
122
+ declaredBinEntry ? path.resolve(pkgDir, declaredBinEntry) : void 0,
123
+ path.join(pkgDir, 'bin/tsgo.js')
124
+ ].filter((candidate)=>Boolean(candidate));
125
+ return candidates.find((candidate)=>fs.existsSync(candidate)) ?? candidates[0];
126
+ };
107
127
  const getTsgoBinPath = (appDirectory, resolvePaths = [
108
128
  appDirectory,
109
- typescript_dirname
129
+ __rspack_import_meta_dirname__
110
130
  ])=>{
111
131
  try {
112
132
  const pkgPath = require.resolve("@typescript/native-preview/package.json", {
113
133
  paths: resolvePaths
114
134
  });
115
- return path.join(path.dirname(pkgPath), 'bin/tsgo.js');
135
+ return resolveTsgoBinPath(pkgPath);
116
136
  } catch {
117
137
  throw new Error('tsgo could not be found! Please install "@typescript/native-preview" in your project to compile BFF/server code.');
118
138
  }
@@ -3,6 +3,11 @@ type TsgoConfig = {
3
3
  compilerOptions?: {
4
4
  allowImportingTsExtensions?: boolean;
5
5
  baseUrl?: unknown;
6
+ composite?: boolean;
7
+ declaration?: boolean;
8
+ declarationMap?: boolean;
9
+ emitDeclarationOnly?: boolean;
10
+ incremental?: boolean;
6
11
  module?: string;
7
12
  moduleResolution?: string;
8
13
  noEmit?: boolean;
@@ -10,6 +15,7 @@ type TsgoConfig = {
10
15
  outDir?: string;
11
16
  rootDir?: string;
12
17
  rewriteRelativeImportExtensions?: boolean;
18
+ tsBuildInfoFile?: string;
13
19
  verbatimModuleSyntax?: boolean;
14
20
  };
15
21
  files?: string[];
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "modern",
18
18
  "modern.js"
19
19
  ],
20
- "version": "3.5.0-ultramodern.1",
20
+ "version": "3.5.0-ultramodern.11",
21
21
  "types": "./dist/types/index.d.ts",
22
22
  "main": "./dist/cjs/index.js",
23
23
  "exports": {
@@ -40,17 +40,17 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@swc/helpers": "^0.5.23",
43
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.5.0-ultramodern.1"
43
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.5.0-ultramodern.11"
44
44
  },
45
45
  "devDependencies": {
46
- "@rslib/core": "0.23.0",
46
+ "@rslib/core": "0.23.1",
47
47
  "@types/node": "^26.0.1",
48
- "@typescript/native-preview": "7.0.0-dev.20260624.1",
49
- "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.5.0-ultramodern.1",
50
- "@scripts/rstest-config": "2.66.0"
48
+ "@typescript/native-preview": "7.0.0-dev.20260628.1",
49
+ "@scripts/rstest-config": "2.66.0",
50
+ "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.5.0-ultramodern.11"
51
51
  },
52
52
  "peerDependencies": {
53
- "@typescript/native-preview": ">=7.0.0-dev.20260624.1"
53
+ "@typescript/native-preview": ">=7.0.0-dev.20260628.1"
54
54
  },
55
55
  "peerDependenciesMeta": {
56
56
  "@typescript/native-preview": {