@gravity-ui/app-builder 0.28.0 → 0.28.1-beta.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/README.md
CHANGED
|
@@ -81,6 +81,7 @@ export default defineConfig(
|
|
|
81
81
|
},
|
|
82
82
|
server: {
|
|
83
83
|
// server settings
|
|
84
|
+
tsconfigFileName: 'custom-tsconfig.json',
|
|
84
85
|
},
|
|
85
86
|
};
|
|
86
87
|
},
|
|
@@ -143,6 +144,8 @@ All server settings are used only in dev mode:
|
|
|
143
144
|
- `watchThrottle` (`number`) — use to add an extra throttle, or delay restarting.
|
|
144
145
|
- `inspect/inspectBrk` (`number | true`) — listen for a debugging client on specified port.
|
|
145
146
|
If specified `true`, try to listen on `9229`.
|
|
147
|
+
- `tsconfig` (`string`) — name of the tsconfig file for server build.
|
|
148
|
+
Default: `tsconfig.json`.
|
|
146
149
|
|
|
147
150
|
### Client
|
|
148
151
|
|
|
@@ -11,6 +11,7 @@ const utils_1 = require("../../../common/utils");
|
|
|
11
11
|
function buildServer(config) {
|
|
12
12
|
(0, utils_1.createRunFolder)();
|
|
13
13
|
return new Promise((resolve, reject) => {
|
|
14
|
+
const tsconfigFileName = config.server.tsconfigFileName || 'tsconfig.json';
|
|
14
15
|
const build = new controllable_script_1.ControllableScript(`
|
|
15
16
|
let ts;
|
|
16
17
|
try {
|
|
@@ -25,7 +26,11 @@ function buildServer(config) {
|
|
|
25
26
|
const {compile} = require(${JSON.stringify(require.resolve('../../../common/typescript/compile'))});
|
|
26
27
|
|
|
27
28
|
const logger = new Logger('server', ${config.verbose});
|
|
28
|
-
compile(ts, {
|
|
29
|
+
compile(ts, {
|
|
30
|
+
logger,
|
|
31
|
+
projectPath: ${JSON.stringify(paths_1.default.appServer)},
|
|
32
|
+
configFileName: ${JSON.stringify(tsconfigFileName)}
|
|
33
|
+
});
|
|
29
34
|
`, null);
|
|
30
35
|
build.start().then(() => {
|
|
31
36
|
build.onExit((code) => {
|
|
@@ -36,6 +36,7 @@ async function watchServerCompilation(config) {
|
|
|
36
36
|
const serverPath = path.resolve(paths_1.default.appDist, 'server');
|
|
37
37
|
rimraf_1.rimraf.sync(serverPath);
|
|
38
38
|
(0, utils_1.createRunFolder)();
|
|
39
|
+
const tsconfigFileName = config.server.tsconfigFileName || 'tsconfig.json';
|
|
39
40
|
const build = new controllable_script_1.ControllableScript(`
|
|
40
41
|
let ts;
|
|
41
42
|
try {
|
|
@@ -58,7 +59,8 @@ async function watchServerCompilation(config) {
|
|
|
58
59
|
onAfterFilesEmitted: () => {
|
|
59
60
|
process.send({type: 'Emitted'});
|
|
60
61
|
},
|
|
61
|
-
enableSourceMap: true
|
|
62
|
+
enableSourceMap: true,
|
|
63
|
+
tsconfigFileName: ${JSON.stringify(tsconfigFileName)}
|
|
62
64
|
}
|
|
63
65
|
);
|
|
64
66
|
`, null);
|
|
@@ -266,6 +266,11 @@ export interface ServerConfig {
|
|
|
266
266
|
watchThrottle?: number;
|
|
267
267
|
inspect?: number | true;
|
|
268
268
|
inspectBrk?: number | true;
|
|
269
|
+
/**
|
|
270
|
+
* Name of the tsconfig file for server build
|
|
271
|
+
* Default: 'tsconfig.json'
|
|
272
|
+
*/
|
|
273
|
+
tsconfigFileName?: string;
|
|
269
274
|
}
|
|
270
275
|
export interface ServiceConfig {
|
|
271
276
|
target?: 'client' | 'server';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type Typescript from 'typescript';
|
|
2
2
|
import type { Logger } from '../logger';
|
|
3
|
-
export declare function watch(ts: typeof Typescript, projectPath: string, { logger, onAfterFilesEmitted, enableSourceMap, }: {
|
|
3
|
+
export declare function watch(ts: typeof Typescript, projectPath: string, { logger, onAfterFilesEmitted, enableSourceMap, tsconfigFileName, }: {
|
|
4
4
|
logger: Logger;
|
|
5
5
|
onAfterFilesEmitted?: () => void;
|
|
6
6
|
enableSourceMap?: boolean;
|
|
7
|
+
tsconfigFileName: string;
|
|
7
8
|
}): void;
|
|
@@ -4,10 +4,10 @@ exports.watch = watch;
|
|
|
4
4
|
const transformers_1 = require("./transformers");
|
|
5
5
|
const utils_1 = require("./utils");
|
|
6
6
|
const diagnostic_1 = require("./diagnostic");
|
|
7
|
-
function watch(ts, projectPath, { logger, onAfterFilesEmitted, enableSourceMap, }) {
|
|
7
|
+
function watch(ts, projectPath, { logger, onAfterFilesEmitted, enableSourceMap, tsconfigFileName, }) {
|
|
8
8
|
logger.message('Start compilation in watch mode');
|
|
9
9
|
logger.message(`Typescript v${ts.version}`);
|
|
10
|
-
const configPath = (0, utils_1.getTsProjectConfigPath)(ts, projectPath);
|
|
10
|
+
const configPath = (0, utils_1.getTsProjectConfigPath)(ts, projectPath, tsconfigFileName);
|
|
11
11
|
const createProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram;
|
|
12
12
|
const host = ts.createWatchCompilerHost(configPath, {
|
|
13
13
|
noEmit: false,
|
package/package.json
CHANGED