arui-scripts 14.0.0 → 14.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.
- package/CHANGELOG.md +347 -341
- package/README.md +9 -6
- package/build/bin/index.js +0 -0
- package/build/commands/docker-build/index.js +2 -1
- package/build/commands/docker-build-compiled/index.js +2 -1
- package/build/commands/util/docker-build.d.ts +3 -2
- package/build/commands/util/docker-build.js +4 -1
- package/build/configs/app-configs/get-defaults.js +2 -0
- package/build/configs/app-configs/types.d.ts +1 -0
- package/build/configs/util/get-entry.d.ts +2 -1
- package/build/configs/util/get-entry.js +5 -4
- package/build/configs/webpack.client.d.ts +2 -0
- package/build/configs/webpack.client.dev.d.ts +2 -3
- package/build/configs/webpack.client.dev.js +3 -293
- package/build/configs/webpack.client.js +365 -0
- package/build/configs/webpack.client.prod.d.ts +1 -2
- package/build/configs/webpack.client.prod.js +2 -334
- package/build/configs/webpack.server.d.ts +2 -0
- package/build/configs/webpack.server.dev.d.ts +2 -3
- package/build/configs/webpack.server.dev.js +3 -228
- package/build/configs/webpack.server.js +239 -0
- package/build/configs/webpack.server.prod.d.ts +1 -2
- package/build/configs/webpack.server.prod.js +2 -192
- package/build/tsconfig-local.tsbuildinfo +1 -1
- package/package.json +7 -10
- package/release.config.js +1 -1
- package/build/commands/docker-build-fast/index.d.ts +0 -1
- package/build/commands/docker-build-fast/index.js +0 -90
- package/build/commands/start-vite/client.d.ts +0 -1
- package/build/commands/start-vite/client.js +0 -73
- package/build/commands/start-vite/index.d.ts +0 -1
- package/build/commands/start-vite/index.js +0 -25
- package/build/commands/util/localhost-certs.d.ts +0 -2
- package/build/commands/util/localhost-certs.js +0 -50
- package/build/commands/util/start-http2-proxy-server.d.ts +0 -7
- package/build/commands/util/start-http2-proxy-server.js +0 -40
- package/build/commands/util/vite-proxy-utils.d.ts +0 -64
- package/build/commands/util/vite-proxy-utils.js +0 -100
- package/build/configs/util/try-resolve.d.ts +0 -1
- package/build/configs/util/try-resolve.js +0 -12
- package/build/configs/vite.config.d.ts +0 -1
- package/build/configs/vite.config.js +0 -63
- package/build/configs/vite.html-template.d.ts +0 -1
- package/build/configs/vite.html-template.js +0 -16
- package/build/configs/webpack.dll.dev.d.ts +0 -3
- package/build/configs/webpack.dll.dev.js +0 -91
- package/build/templates/dockerfile-fast.template.d.ts +0 -2
- package/build/templates/dockerfile-fast.template.js +0 -32
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const path_1 = __importDefault(require("path"));
|
|
16
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
17
|
-
const app_configs_1 = __importDefault(require("../../configs/app-configs"));
|
|
18
|
-
const dockerfile_fast_template_1 = __importDefault(require("../../templates/dockerfile-fast.template"));
|
|
19
|
-
const nginx_conf_template_1 = __importDefault(require("../../templates/nginx.conf.template"));
|
|
20
|
-
const start_template_1 = __importDefault(require("../../templates/start.template"));
|
|
21
|
-
const exec_1 = __importDefault(require("../util/exec"));
|
|
22
|
-
let imageVersion = app_configs_1.default.version;
|
|
23
|
-
let imageName = app_configs_1.default.name;
|
|
24
|
-
let dockerRegistry = app_configs_1.default.dockerRegistry;
|
|
25
|
-
const commandLineArguments = process.argv.slice(3);
|
|
26
|
-
commandLineArguments.forEach(arg => {
|
|
27
|
-
let [argName, argValue] = arg.split('=');
|
|
28
|
-
argName = argName.toLowerCase().trim();
|
|
29
|
-
argValue = argValue ? argValue.trim() : '';
|
|
30
|
-
switch (argName) {
|
|
31
|
-
case 'version':
|
|
32
|
-
imageVersion = argValue;
|
|
33
|
-
break;
|
|
34
|
-
case 'name':
|
|
35
|
-
imageName = argValue;
|
|
36
|
-
break;
|
|
37
|
-
case 'registry':
|
|
38
|
-
dockerRegistry = argValue;
|
|
39
|
-
break;
|
|
40
|
-
default:
|
|
41
|
-
console.warn(`Unknown argument ${argName}`);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
const tempDirName = '.docker-build';
|
|
45
|
-
const pathToTempDir = path_1.default.join(app_configs_1.default.cwd, tempDirName);
|
|
46
|
-
const imageFullName = `${dockerRegistry ? `${dockerRegistry}/` : ''}${imageName}:${imageVersion}`;
|
|
47
|
-
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
-
try {
|
|
49
|
-
console.log(`Build docker image ${imageFullName}`);
|
|
50
|
-
console.time('Total time');
|
|
51
|
-
console.time('Setting up time');
|
|
52
|
-
// create tmp directory for docker related files
|
|
53
|
-
// We need to copy it because we will remove this directory during build process
|
|
54
|
-
yield fs_extra_1.default.emptyDir(pathToTempDir);
|
|
55
|
-
const nginxConf = app_configs_1.default.localNginxConf
|
|
56
|
-
? yield fs_extra_1.default.readFile(app_configs_1.default.localNginxConf, 'utf8')
|
|
57
|
-
: nginx_conf_template_1.default;
|
|
58
|
-
const dockerfile = app_configs_1.default.localDockerfile
|
|
59
|
-
? yield fs_extra_1.default.readFile(app_configs_1.default.localDockerfile, 'utf8')
|
|
60
|
-
: dockerfile_fast_template_1.default;
|
|
61
|
-
yield Promise.all([
|
|
62
|
-
fs_extra_1.default.writeFile(path_1.default.join(pathToTempDir, 'Dockerfile'), dockerfile, 'utf8'),
|
|
63
|
-
fs_extra_1.default.writeFile(path_1.default.join(pathToTempDir, 'nginx.conf'), nginxConf, 'utf8'),
|
|
64
|
-
fs_extra_1.default.writeFile(path_1.default.join(pathToTempDir, 'start.sh'), start_template_1.default, { encoding: 'utf8', mode: 0o555 }),
|
|
65
|
-
]);
|
|
66
|
-
console.timeEnd('Setting up time');
|
|
67
|
-
console.time('Build docker image time');
|
|
68
|
-
yield exec_1.default(`docker build -f "./${tempDirName}/Dockerfile" \\
|
|
69
|
-
--build-arg START_SH_LOCATION="./${tempDirName}/start.sh" \\
|
|
70
|
-
--build-arg NGINX_CONF_LOCATION="./${tempDirName}/nginx.conf" -t ${imageFullName} .`);
|
|
71
|
-
console.timeEnd('Build docker image time');
|
|
72
|
-
console.time('Cleanup time');
|
|
73
|
-
// remove temp directory
|
|
74
|
-
yield fs_extra_1.default.remove(pathToTempDir);
|
|
75
|
-
// guard against pushing the image during tests
|
|
76
|
-
if (!app_configs_1.default.debug) {
|
|
77
|
-
yield exec_1.default(`docker push ${imageFullName}`);
|
|
78
|
-
}
|
|
79
|
-
console.timeEnd('Cleanup time');
|
|
80
|
-
console.timeEnd('Total time');
|
|
81
|
-
}
|
|
82
|
-
catch (err) {
|
|
83
|
-
yield fs_extra_1.default.remove(pathToTempDir);
|
|
84
|
-
console.error('Error during docker-build.');
|
|
85
|
-
if (app_configs_1.default.debug) {
|
|
86
|
-
console.error(err);
|
|
87
|
-
}
|
|
88
|
-
process.exit(1);
|
|
89
|
-
}
|
|
90
|
-
}))();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const express_1 = __importDefault(require("express"));
|
|
16
|
-
const app_configs_1 = __importDefault(require("../../configs/app-configs"));
|
|
17
|
-
const vite_1 = require("vite");
|
|
18
|
-
const node_html_parser_1 = require("node-html-parser");
|
|
19
|
-
const vite_config_1 = require("../../configs/vite.config");
|
|
20
|
-
const vite_html_template_1 = require("../../configs/vite.html-template");
|
|
21
|
-
const start_http2_proxy_server_1 = require("../util/start-http2-proxy-server");
|
|
22
|
-
const vite_proxy_utils_1 = require("../util/vite-proxy-utils");
|
|
23
|
-
(function () {
|
|
24
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
const app = (0, express_1.default)();
|
|
26
|
-
const vite = yield (0, vite_1.createServer)(vite_config_1.viteConfig);
|
|
27
|
-
app.use(vite.middlewares);
|
|
28
|
-
const template = yield vite.transformIndexHtml('/', vite_html_template_1.viteHtmlTemplate);
|
|
29
|
-
const parsedTemplate = (0, node_html_parser_1.parse)(template);
|
|
30
|
-
const templateScripts = parsedTemplate.querySelectorAll('script');
|
|
31
|
-
app.use('/', (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
try {
|
|
33
|
-
(0, vite_proxy_utils_1.generateFakeWebpackAssets)();
|
|
34
|
-
const isAssetsRequest = (0, vite_proxy_utils_1.checkIfIsAssetsRequest)(req);
|
|
35
|
-
if (isAssetsRequest) {
|
|
36
|
-
(0, vite_proxy_utils_1.processAssetsRequests)(req, res);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const fetchRes = yield (0, vite_proxy_utils_1.fetchDataFromServer)(req);
|
|
40
|
-
const isHtmlResponse = (0, vite_proxy_utils_1.checkIfIsHtmlResponse)(fetchRes);
|
|
41
|
-
if (!isHtmlResponse) {
|
|
42
|
-
res
|
|
43
|
-
.status(fetchRes.status)
|
|
44
|
-
.set(fetchRes.headers)
|
|
45
|
-
.end(fetchRes.data);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const { responseRoot, headers } = (0, vite_proxy_utils_1.updateHtmlResponse)(fetchRes, templateScripts);
|
|
49
|
-
res
|
|
50
|
-
.status(fetchRes.status)
|
|
51
|
-
.set(headers)
|
|
52
|
-
.end(responseRoot.toString());
|
|
53
|
-
}
|
|
54
|
-
catch (e) {
|
|
55
|
-
res
|
|
56
|
-
.status(200)
|
|
57
|
-
.end(vite_proxy_utils_1.reloadHtmlResponse);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
}));
|
|
61
|
-
app.listen({
|
|
62
|
-
port: app_configs_1.default.clientServerPort,
|
|
63
|
-
});
|
|
64
|
-
console.log(`Client dev server is running:
|
|
65
|
-
http://localhost:${app_configs_1.default.clientServerPort}
|
|
66
|
-
https://localhost:${app_configs_1.default.viteDevPort}`);
|
|
67
|
-
});
|
|
68
|
-
})();
|
|
69
|
-
(0, start_http2_proxy_server_1.startHttp2ProxyServer)({
|
|
70
|
-
originalPort: app_configs_1.default.clientServerPort,
|
|
71
|
-
originalHost: 'localhost',
|
|
72
|
-
port: app_configs_1.default.viteDevPort,
|
|
73
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const child_process_1 = require("child_process");
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const check_required_files_1 = __importDefault(require("../util/check-required-files"));
|
|
9
|
-
process.env.BROWSERSLIST_CONFIG = process.env.BROWSERSLIST_CONFIG || require.resolve('../../../.browserslistrc');
|
|
10
|
-
if (!(0, check_required_files_1.default)()) {
|
|
11
|
-
process.exit(1);
|
|
12
|
-
}
|
|
13
|
-
const compileServer = (0, child_process_1.spawn)('node', [path_1.default.join(__dirname, '../start/server')], { stdio: 'inherit' });
|
|
14
|
-
const compileClient = (0, child_process_1.spawn)('node', [path_1.default.join(__dirname, './client')], { stdio: 'inherit' });
|
|
15
|
-
const onProcessExit = (code) => {
|
|
16
|
-
if (code !== 0) {
|
|
17
|
-
compileServer.kill();
|
|
18
|
-
compileClient.kill();
|
|
19
|
-
process.exit(code);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
compileClient.on('error', onProcessExit);
|
|
23
|
-
compileServer.on('error', onProcessExit);
|
|
24
|
-
compileServer.on('close', onProcessExit);
|
|
25
|
-
compileClient.on('close', onProcessExit);
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const cert = "-----BEGIN CERTIFICATE-----\nMIICpDCCAYwCCQCPDkY1s7gG5jANBgkqhkiG9w0BAQsFADAUMRIwEAYDVQQDDAls\nb2NhbGhvc3QwHhcNMjMwMTE5MTcyMzIyWhcNMjMwMjE4MTcyMzIyWjAUMRIwEAYD\nVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ\nCoFkT5HA9OVLWq1t7vPS9yEjDK73fdR6WAF4QuIkuvxrAAvYnTGzyLf523mOH7wZ\nzXduGWyM4oM+94tmmjpSLYC9qqY94MT7oiktjLgZ+qRzTS+rJ0bHwHvxISYFezr5\n5WfQunhV95joLviFs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7TtrZ\nu48RRSbkxelNJ2WdSJXPV2BEa7rv3X/VR0j1yJywBu6k07P5E4wWnhFugIHMQLJT\nbeSRR0LZG1NyE4TxrNHUApJeoVP3GQxCXsHwRxCNEJow81KibVepTjACpYlsCYhJ\nE4LSJQR5bDVHw147zBmNtZQ=\n-----END PRIVATE KEY-----";
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Эти сертификаты предназначены только для локальной разработки, поэтому их безопасно разместить так
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.privateKey = exports.cert = void 0;
|
|
5
|
-
exports.cert = `-----BEGIN CERTIFICATE-----
|
|
6
|
-
MIICpDCCAYwCCQCPDkY1s7gG5jANBgkqhkiG9w0BAQsFADAUMRIwEAYDVQQDDAls
|
|
7
|
-
b2NhbGhvc3QwHhcNMjMwMTE5MTcyMzIyWhcNMjMwMjE4MTcyMzIyWjAUMRIwEAYD
|
|
8
|
-
VQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ
|
|
9
|
-
CoFkT5HA9OVLWq1t7vPS9yEjDK73fdR6WAF4QuIkuvxrAAvYnTGzyLf523mOH7wZ
|
|
10
|
-
zXduGWyM4oM+94tmmjpSLYC9qqY94MT7oiktjLgZ+qRzTS+rJ0bHwHvxISYFezr5
|
|
11
|
-
5WfQunhV95joLviFs2AWHKNzl7Lud9UlLq2z0M00ebBjMztCRZIAio/ac7RGLhAQ
|
|
12
|
-
zo1+i1+g3fAXxi9m/50//qb0rEdlAo2d0Q2ePpgEbSxaIccCp8Osek4sSaA3bTl2
|
|
13
|
-
UEn/71UopYreRRfPQgXkPItX42mlyu4cMkyQNHfxwiQcrXcaFZZYPEUBWa9u7zHO
|
|
14
|
-
unI+TD/Fr0UgjWacQGQhAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAMGyF7WvhdIB
|
|
15
|
-
axdIOLuAig06VyQsI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ide/JahyIhAoGAVM+gYsj3kmsNeOR7TtrZ
|
|
47
|
-
u48RRSbkxelNJ2WdSJXPV2BEa7rv3X/VR0j1yJywBu6k07P5E4wWnhFugIHMQLJT
|
|
48
|
-
beSRR0LZG1NyE4TxrNHUApJeoVP3GQxCXsHwRxCNEJow81KibVepTjACpYlsCYhJ
|
|
49
|
-
E4LSJQR5bDVHw147zBmNtZQ=
|
|
50
|
-
-----END PRIVATE KEY-----`;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.startHttp2ProxyServer = void 0;
|
|
7
|
-
const http2_1 = __importDefault(require("http2"));
|
|
8
|
-
const http2_proxy_1 = __importDefault(require("http2-proxy"));
|
|
9
|
-
const localhost_certs_1 = require("./localhost-certs");
|
|
10
|
-
function startHttp2ProxyServer({ originalPort, originalHost, port, }) {
|
|
11
|
-
const ht2Server = http2_1.default.createSecureServer({
|
|
12
|
-
key: localhost_certs_1.privateKey,
|
|
13
|
-
cert: localhost_certs_1.cert,
|
|
14
|
-
});
|
|
15
|
-
ht2Server.on('request', (req, res) => {
|
|
16
|
-
http2_proxy_1.default.web(req, res, {
|
|
17
|
-
hostname: originalHost,
|
|
18
|
-
port: originalPort,
|
|
19
|
-
}, (err, req, res) => {
|
|
20
|
-
if (err) {
|
|
21
|
-
console.error('proxy error', err);
|
|
22
|
-
res.statusCode = 502;
|
|
23
|
-
res.end(err.toString());
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
ht2Server.on('upgrade', (req, socket, head) => {
|
|
28
|
-
http2_proxy_1.default.ws(req, socket, head, {
|
|
29
|
-
hostname: originalHost,
|
|
30
|
-
port: originalPort,
|
|
31
|
-
}, (err, req, socket, head) => {
|
|
32
|
-
if (err) {
|
|
33
|
-
console.error('proxy error', err);
|
|
34
|
-
socket.destroy();
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
ht2Server.listen(port);
|
|
39
|
-
}
|
|
40
|
-
exports.startHttp2ProxyServer = startHttp2ProxyServer;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { AxiosResponse } from 'axios';
|
|
2
|
-
import { Request, Response } from 'express-serve-static-core';
|
|
3
|
-
import { HTMLElement } from 'node-html-parser';
|
|
4
|
-
export declare function processAssetsRequests(req: Request, res: Response): void;
|
|
5
|
-
export declare function fetchDataFromServer(req: Request): Promise<AxiosResponse<any, any>>;
|
|
6
|
-
export declare function updateHtmlResponse(fetchRes: AxiosResponse, templateScripts: HTMLElement[]): {
|
|
7
|
-
responseRoot: HTMLElement;
|
|
8
|
-
headers: {
|
|
9
|
-
[x: string]: string | undefined;
|
|
10
|
-
"set-cookie"?: string[] | undefined;
|
|
11
|
-
setContentType: (value: string | number | boolean | import("axios").AxiosHeaders | string[] | null, rewrite?: boolean | ((this: import("axios").AxiosHeaders, value: string, name: string, headers: {
|
|
12
|
-
[x: string]: string | number | boolean | import("axios").AxiosHeaders | string[] | null;
|
|
13
|
-
}) => boolean) | undefined) => import("axios").AxiosHeaders;
|
|
14
|
-
getContentType: ((parser?: RegExp | undefined) => RegExpExecArray | null) | ((matcher?: ((this: import("axios").AxiosHeaders, value: string, name: string, headers: {
|
|
15
|
-
[x: string]: string | number | boolean | import("axios").AxiosHeaders | string[] | null;
|
|
16
|
-
}) => boolean) | undefined) => string | number | boolean | import("axios").AxiosHeaders | string[] | null);
|
|
17
|
-
hasContentType: (matcher?: ((this: import("axios").AxiosHeaders, value: string, name: string, headers: {
|
|
18
|
-
[x: string]: string | number | boolean | import("axios").AxiosHeaders | string[] | null;
|
|
19
|
-
}) => boolean) | undefined) => boolean;
|
|
20
|
-
setContentLength: (value: string | number | boolean | import("axios").AxiosHeaders | string[] | null, rewrite?: boolean | ((this: import("axios").AxiosHeaders, value: string, name: string, headers: {
|
|
21
|
-
[x: string]: string | number | boolean | import("axios").AxiosHeaders | string[] | null;
|
|
22
|
-
}) => boolean) | undefined) => import("axios").AxiosHeaders;
|
|
23
|
-
getContentLength: ((parser?: RegExp | undefined) => RegExpExecArray | null) | ((matcher?: ((this: import("axios").AxiosHeaders, value: string, name: string, headers: {
|
|
24
|
-
[x: string]: string | number | boolean | import("axios").AxiosHeaders | string[] | null;
|
|
25
|
-
}) => boolean) | undefined) => string | number | boolean | import("axios").AxiosHeaders | string[] | null);
|
|
26
|
-
hasContentLength: (matcher?: ((this: import("axios").AxiosHeaders, value: string, name: string, headers: {
|
|
27
|
-
[x: string]: string | number | boolean | import("axios").AxiosHeaders | string[] | null;
|
|
28
|
-
}) => boolean) | undefined) => boolean;
|
|
29
|
-
setAccept: (value: string | number | boolean | import("axios").AxiosHeaders | string[] | null, rewrite?: boolean | ((this: import("axios").AxiosHeaders, value: string, name: string, headers: {
|
|
30
|
-
[x: string]: string | number | boolean | import("axios").AxiosHeaders | string[] | null;
|
|
31
|
-
}) => boolean) | undefined) => import("axios").AxiosHeaders;
|
|
32
|
-
getAccept: ((parser?: RegExp | undefined) => RegExpExecArray | null) | ((matcher?: ((this: import("axios").AxiosHeaders, value: string, name: string, headers: {
|
|
33
|
-
[x: string]: string | number | boolean | import("axios").AxiosHeaders | string[] | null;
|
|
34
|
-
}) => boolean) | undefined) => string | number | boolean | import("axios").AxiosHeaders | string[] | null);
|
|
35
|
-
hasAccept: (matcher?: ((this: import("axios").AxiosHeaders, value: string, name: string, headers: {
|
|
36
|
-
[x: string]: string | number | boolean | import("axios").AxiosHeaders | string[] | null;
|
|
37
|
-
}) => boolean) | undefined) => boolean;
|
|
38
|
-
setUserAgent: (value: string | number | boolean | import("axios").AxiosHeaders | string[] | null, rewrite?: boolean | ((this: import("axios").AxiosHeaders, value: string, name: string, headers: {
|
|
39
|
-
[x: string]: string | number | boolean | import("axios").AxiosHeaders | string[] | null;
|
|
40
|
-
}) => boolean) | undefined) => import("axios").AxiosHeaders;
|
|
41
|
-
getUserAgent: ((parser?: RegExp | undefined) => RegExpExecArray | null) | ((matcher?: ((this: import("axios").AxiosHeaders, value: string, name: string, headers: {
|
|
42
|
-
[x: string]: string | number | boolean | import("axios").AxiosHeaders | string[] | null;
|
|
43
|
-
}) => boolean) | undefined) => string | number | boolean | import("axios").AxiosHeaders | string[] | null);
|
|
44
|
-
hasUserAgent: (matcher?: ((this: import("axios").AxiosHeaders, value: string, name: string, headers: {
|
|
45
|
-
[x: string]: string | number | boolean | import("axios").AxiosHeaders | string[] | null;
|
|
46
|
-
}) => boolean) | undefined) => boolean;
|
|
47
|
-
setContentEncoding: (value: string | number | boolean | import("axios").AxiosHeaders | string[] | null, rewrite?: boolean | ((this: import("axios").AxiosHeaders, value: string, name: string, headers: {
|
|
48
|
-
[x: string]: string | number | boolean | import("axios").AxiosHeaders | string[] | null;
|
|
49
|
-
}) => boolean) | undefined) => import("axios").AxiosHeaders;
|
|
50
|
-
getContentEncoding: ((parser?: RegExp | undefined) => RegExpExecArray | null) | ((matcher?: ((this: import("axios").AxiosHeaders, value: string, name: string, headers: {
|
|
51
|
-
[x: string]: string | number | boolean | import("axios").AxiosHeaders | string[] | null;
|
|
52
|
-
}) => boolean) | undefined) => string | number | boolean | import("axios").AxiosHeaders | string[] | null);
|
|
53
|
-
hasContentEncoding: (matcher?: ((this: import("axios").AxiosHeaders, value: string, name: string, headers: {
|
|
54
|
-
[x: string]: string | number | boolean | import("axios").AxiosHeaders | string[] | null;
|
|
55
|
-
}) => boolean) | undefined) => boolean;
|
|
56
|
-
} | {
|
|
57
|
-
[x: string]: string | undefined;
|
|
58
|
-
"set-cookie"?: string[] | undefined;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
export declare function checkIfIsHtmlResponse(fetchRes: AxiosResponse): boolean | "" | undefined;
|
|
62
|
-
export declare function checkIfIsAssetsRequest(req: Request): boolean;
|
|
63
|
-
export declare function generateFakeWebpackAssets(): void;
|
|
64
|
-
export declare const reloadHtmlResponse = "<html>\n<script type=\"text/javascript\">setTimeout(() => {window.location.reload()}, 1000)</script>\n<body>\n <h1>Getting things ready...</h1>\n</body>\n</html>";
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.reloadHtmlResponse = exports.generateFakeWebpackAssets = exports.checkIfIsAssetsRequest = exports.checkIfIsHtmlResponse = exports.updateHtmlResponse = exports.fetchDataFromServer = exports.processAssetsRequests = void 0;
|
|
16
|
-
const axios_1 = __importDefault(require("axios"));
|
|
17
|
-
const fs_1 = __importDefault(require("fs"));
|
|
18
|
-
const app_configs_1 = __importDefault(require("../../configs/app-configs"));
|
|
19
|
-
const node_html_parser_1 = require("node-html-parser");
|
|
20
|
-
const path_1 = __importDefault(require("path"));
|
|
21
|
-
// Обработчик запросов за статичными ассетами, сгенеренными серверным бандлом (favicon и тд)
|
|
22
|
-
function processAssetsRequests(req, res) {
|
|
23
|
-
const fileReadStream = fs_1.default.createReadStream(`${app_configs_1.default.serverOutputPath}${req.originalUrl}`);
|
|
24
|
-
fileReadStream.pipe(res);
|
|
25
|
-
}
|
|
26
|
-
exports.processAssetsRequests = processAssetsRequests;
|
|
27
|
-
// Получает данные из оригинального сервера, фактически проксируя текущий запрос
|
|
28
|
-
function fetchDataFromServer(req) {
|
|
29
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
return (0, axios_1.default)(`http://localhost:${app_configs_1.default.serverPort}${req.originalUrl}`, {
|
|
31
|
-
headers: req.headers,
|
|
32
|
-
method: req.method,
|
|
33
|
-
data: req,
|
|
34
|
-
maxRedirects: 0,
|
|
35
|
-
responseType: 'text',
|
|
36
|
-
transformResponse: (res) => {
|
|
37
|
-
// нам не нужно парсить ответ, если вернулся json - оставляем его просто как строку
|
|
38
|
-
return res;
|
|
39
|
-
},
|
|
40
|
-
validateStatus: function (status) {
|
|
41
|
-
// все ответы считаем валидными, нам достаточно просто проксировать статус как есть
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
exports.fetchDataFromServer = fetchDataFromServer;
|
|
48
|
-
// Вставляет в html, полученный от ssr корректные ссылки на скрипты для подключения js.
|
|
49
|
-
function updateHtmlResponse(fetchRes, templateScripts) {
|
|
50
|
-
const responseRoot = (0, node_html_parser_1.parse)(fetchRes.data);
|
|
51
|
-
const scripts = responseRoot.querySelectorAll('script');
|
|
52
|
-
let nonce = undefined;
|
|
53
|
-
scripts.forEach((appScript) => {
|
|
54
|
-
// Удаляем из ответа ссылку на фейковый js файл
|
|
55
|
-
if (appScript.getAttribute('src') === 'fake.js') {
|
|
56
|
-
appScript.parentNode.removeChild(appScript);
|
|
57
|
-
}
|
|
58
|
-
// Если приложение проставляет скриптам nonce тег - сохраняем его себе, чтобы поставить новым скриптам
|
|
59
|
-
if (appScript.getAttribute('nonce')) {
|
|
60
|
-
nonce = appScript.getAttribute('nonce');
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
const headElement = responseRoot.querySelector('head');
|
|
64
|
-
templateScripts.forEach((templateScript) => {
|
|
65
|
-
if (nonce) {
|
|
66
|
-
templateScript.setAttribute('nonce', nonce);
|
|
67
|
-
}
|
|
68
|
-
headElement === null || headElement === void 0 ? void 0 : headElement.appendChild(templateScript);
|
|
69
|
-
});
|
|
70
|
-
const headers = Object.assign({}, fetchRes.headers);
|
|
71
|
-
delete headers['content-length'];
|
|
72
|
-
return { responseRoot, headers };
|
|
73
|
-
}
|
|
74
|
-
exports.updateHtmlResponse = updateHtmlResponse;
|
|
75
|
-
// Проверят, является ли полученный ответ от сервера html
|
|
76
|
-
function checkIfIsHtmlResponse(fetchRes) {
|
|
77
|
-
return (fetchRes.status < 300 || fetchRes.status >= 400)
|
|
78
|
-
&& fetchRes.headers['content-type'] && fetchRes.headers['content-type'].indexOf('html') !== -1;
|
|
79
|
-
}
|
|
80
|
-
exports.checkIfIsHtmlResponse = checkIfIsHtmlResponse;
|
|
81
|
-
// Проверяет, является ли запрос - запросом за статичными ассетами
|
|
82
|
-
function checkIfIsAssetsRequest(req) {
|
|
83
|
-
return req.originalUrl.startsWith(`/${app_configs_1.default.assetsPath}/`);
|
|
84
|
-
}
|
|
85
|
-
exports.checkIfIsAssetsRequest = checkIfIsAssetsRequest;
|
|
86
|
-
// Создает фейковый файл с webpack-assets, который сможет использовать сервер приложения
|
|
87
|
-
function generateFakeWebpackAssets() {
|
|
88
|
-
fs_1.default.writeFileSync(path_1.default.join(app_configs_1.default.cwd, app_configs_1.default.buildPath, 'webpack-assets.json'), JSON.stringify({
|
|
89
|
-
"main": {
|
|
90
|
-
"js": ["fake.js"]
|
|
91
|
-
}
|
|
92
|
-
}), 'utf8');
|
|
93
|
-
}
|
|
94
|
-
exports.generateFakeWebpackAssets = generateFakeWebpackAssets;
|
|
95
|
-
exports.reloadHtmlResponse = `<html>
|
|
96
|
-
<script type="text/javascript">setTimeout(() => {window.location.reload()}, 1000)</script>
|
|
97
|
-
<body>
|
|
98
|
-
<h1>Getting things ready...</h1>
|
|
99
|
-
</body>
|
|
100
|
-
</html>`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tryResolve(...args: Parameters<typeof require.resolve>): string | undefined;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tryResolve = void 0;
|
|
4
|
-
function tryResolve(...args) {
|
|
5
|
-
try {
|
|
6
|
-
return require.resolve(...args);
|
|
7
|
-
}
|
|
8
|
-
catch (e) {
|
|
9
|
-
return undefined;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.tryResolve = tryResolve;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const viteConfig: import("vite").InlineConfig;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.viteConfig = void 0;
|
|
7
|
-
const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
|
|
8
|
-
const app_configs_1 = __importDefault(require("./app-configs"));
|
|
9
|
-
const plugin_react_1 = __importDefault(require("@vitejs/plugin-react"));
|
|
10
|
-
const vite_tsconfig_paths_1 = __importDefault(require("vite-tsconfig-paths"));
|
|
11
|
-
const postcss_1 = __importDefault(require("./postcss"));
|
|
12
|
-
const vite_1 = require("vite");
|
|
13
|
-
exports.viteConfig = (0, apply_overrides_1.default)('vite', {
|
|
14
|
-
server: {
|
|
15
|
-
middlewareMode: true,
|
|
16
|
-
hmr: {
|
|
17
|
-
protocol: 'ws',
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
customLogger: Object.assign(Object.assign({}, (0, vite_1.createLogger)('info')), { warn(msg) {
|
|
21
|
-
// ignore warning about css import, they are created incorrectly
|
|
22
|
-
if (!msg.includes('Default and named imports from CSS files are deprecated.')) {
|
|
23
|
-
console.log(msg);
|
|
24
|
-
}
|
|
25
|
-
} }),
|
|
26
|
-
appType: 'custom',
|
|
27
|
-
build: {
|
|
28
|
-
manifest: true,
|
|
29
|
-
rollupOptions: {
|
|
30
|
-
input: app_configs_1.default.clientEntry,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
plugins: [
|
|
34
|
-
(0, plugin_react_1.default)({
|
|
35
|
-
jsxRuntime: 'classic',
|
|
36
|
-
}),
|
|
37
|
-
(0, vite_tsconfig_paths_1.default)(),
|
|
38
|
-
],
|
|
39
|
-
resolve: {
|
|
40
|
-
alias: [
|
|
41
|
-
{
|
|
42
|
-
// vite занимается резолвингом сам, поэтому postcss-omit-import-tilda не работает
|
|
43
|
-
find: /^~(.*)$/,
|
|
44
|
-
replacement: '$1',
|
|
45
|
-
},
|
|
46
|
-
// При реквайре этого из css в вебаке оно резолвится в index.css, а в vite - в index.js
|
|
47
|
-
{
|
|
48
|
-
find: /^~?@alfalab\/core-components\/vars$/,
|
|
49
|
-
replacement: '@alfalab/core-components/vars/index.css'
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
},
|
|
53
|
-
define: {
|
|
54
|
-
global: 'window',
|
|
55
|
-
'process.env': {},
|
|
56
|
-
module: {},
|
|
57
|
-
},
|
|
58
|
-
css: {
|
|
59
|
-
postcss: {
|
|
60
|
-
plugins: postcss_1.default
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const viteHtmlTemplate: string;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.viteHtmlTemplate = void 0;
|
|
7
|
-
const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
|
|
8
|
-
const app_configs_1 = __importDefault(require("./app-configs"));
|
|
9
|
-
exports.viteHtmlTemplate = (0, apply_overrides_1.default)('viteHtml', `<!DOCTYPE html>
|
|
10
|
-
<html lang="en">
|
|
11
|
-
<head>
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
<script type="module" src="${app_configs_1.default.clientEntry}"></script>
|
|
15
|
-
</body>
|
|
16
|
-
</html>`);
|