@remotion/bundler 4.0.0-imgloading.2 → 4.0.0-lambda.3
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/dist/bundle-mode.d.ts.map +1 -0
- package/dist/bundle-mode.js.map +1 -0
- package/dist/bundle.d.ts +7 -0
- package/dist/bundle.js +77 -0
- package/dist/bundler.d.ts.map +1 -0
- package/dist/bundler.js.map +1 -0
- package/dist/copy-dir.d.ts.map +1 -0
- package/dist/copy-dir.js.map +1 -0
- package/dist/dev-middleware/compatible-api.d.ts +1 -0
- package/dist/dev-middleware/compatible-api.d.ts.map +1 -0
- package/dist/dev-middleware/compatible-api.js.map +1 -0
- package/dist/dev-middleware/get-filename-from-url.d.ts.map +1 -0
- package/dist/dev-middleware/get-filename-from-url.js.map +1 -0
- package/dist/dev-middleware/get-paths.d.ts.map +1 -0
- package/dist/dev-middleware/get-paths.js.map +1 -0
- package/dist/dev-middleware/index.d.ts.map +1 -0
- package/dist/dev-middleware/index.js.map +1 -0
- package/dist/dev-middleware/is-color-supported.d.ts.map +1 -0
- package/dist/dev-middleware/is-color-supported.js +5 -1
- package/dist/dev-middleware/is-color-supported.js.map +1 -0
- package/dist/dev-middleware/middleware.d.ts.map +1 -0
- package/dist/dev-middleware/middleware.js.map +1 -0
- package/dist/dev-middleware/range-parser.d.ts.map +1 -0
- package/dist/dev-middleware/range-parser.js.map +1 -0
- package/dist/dev-middleware/ready.d.ts.map +1 -0
- package/dist/dev-middleware/ready.js.map +1 -0
- package/dist/dev-middleware/setup-hooks.d.ts.map +1 -0
- package/dist/dev-middleware/setup-hooks.js.map +1 -0
- package/dist/dev-middleware/setup-output-filesystem.d.ts.map +1 -0
- package/dist/dev-middleware/setup-output-filesystem.js.map +1 -0
- package/dist/dev-middleware/types.d.ts.map +1 -0
- package/dist/dev-middleware/types.js.map +1 -0
- package/dist/error-overlay/entry-basic.d.ts.map +1 -0
- package/dist/error-overlay/entry-basic.js.map +1 -0
- package/dist/error-overlay/react-overlay/effects/format-warning.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/effects/format-warning.js.map +1 -0
- package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.js.map +1 -0
- package/dist/error-overlay/react-overlay/effects/proxy-console.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/effects/proxy-console.js.map +1 -0
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.js.map +1 -0
- package/dist/error-overlay/react-overlay/effects/stack-trace-limit.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/effects/stack-trace-limit.js.map +1 -0
- package/dist/error-overlay/react-overlay/effects/unhandled-error.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/effects/unhandled-error.js.map +1 -0
- package/dist/error-overlay/react-overlay/effects/unhandled-rejection.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/effects/unhandled-rejection.js.map +1 -0
- package/dist/error-overlay/react-overlay/index.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/index.js.map +1 -0
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/get-file-source.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/get-file-source.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/get-lines-around.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/get-lines-around.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/get-source-map.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/open-in-editor.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/open-in-editor.js +5 -1
- package/dist/error-overlay/react-overlay/utils/open-in-editor.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/parser.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/parser.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/stack-frame.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/stack-frame.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/unmapper.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/unmapper.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/AskOnDiscord.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/AskOnDiscord.js +1 -1
- package/dist/error-overlay/remotion-overlay/AskOnDiscord.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/Button.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/Button.js +1 -1
- package/dist/error-overlay/remotion-overlay/Button.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/CodeFrame.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +2 -2
- package/dist/error-overlay/remotion-overlay/CodeFrame.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/DismissButton.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/DismissButton.js +1 -1
- package/dist/error-overlay/remotion-overlay/DismissButton.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +2 -2
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorLoader.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +4 -4
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorTitle.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorTitle.js +1 -1
- package/dist/error-overlay/remotion-overlay/ErrorTitle.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +1 -1
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/Overlay.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/Overlay.js +1 -1
- package/dist/error-overlay/remotion-overlay/Overlay.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +1 -1
- package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/StackFrame.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/StackFrame.js +2 -2
- package/dist/error-overlay/remotion-overlay/StackFrame.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/Symbolicating.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/Symbolicating.js +1 -1
- package/dist/error-overlay/remotion-overlay/Symbolicating.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/carets.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/carets.js +2 -2
- package/dist/error-overlay/remotion-overlay/carets.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/format-location.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/format-location.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/index.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/index.js +2 -2
- package/dist/error-overlay/remotion-overlay/index.js.map +1 -0
- package/dist/esbuild-loader/index.d.ts.map +1 -0
- package/dist/esbuild-loader/index.js.map +1 -0
- package/dist/esbuild-loader/interfaces.d.ts.map +1 -0
- package/dist/esbuild-loader/interfaces.js.map +1 -0
- package/dist/fast-refresh/helpers.d.ts.map +1 -0
- package/dist/fast-refresh/helpers.js.map +1 -0
- package/dist/fast-refresh/index.d.ts.map +1 -0
- package/dist/fast-refresh/index.js.map +1 -0
- package/dist/fast-refresh/loader.d.ts.map +1 -0
- package/dist/fast-refresh/loader.js.map +1 -0
- package/dist/fast-refresh/runtime.d.ts.map +1 -0
- package/dist/fast-refresh/runtime.js.map +1 -0
- package/dist/get-latest-remotion-version.d.ts.map +1 -0
- package/dist/get-latest-remotion-version.js.map +1 -0
- package/dist/get-package-manager.d.ts.map +1 -0
- package/dist/get-package-manager.js.map +1 -0
- package/dist/get-port.d.ts.map +1 -0
- package/dist/get-port.js +20 -23
- package/dist/get-port.js.map +1 -0
- package/dist/homepage/homepage.d.ts +0 -1
- package/dist/homepage/homepage.d.ts.map +1 -0
- package/dist/homepage/homepage.js +5 -6
- package/dist/homepage/homepage.js.map +1 -0
- package/dist/hot-middleware/client.d.ts.map +1 -0
- package/dist/hot-middleware/client.js.map +1 -0
- package/dist/hot-middleware/index.d.ts.map +1 -0
- package/dist/hot-middleware/index.js.map +1 -0
- package/dist/hot-middleware/process-update.d.ts.map +1 -0
- package/dist/hot-middleware/process-update.js +2 -2
- package/dist/hot-middleware/process-update.js.map +1 -0
- package/dist/hot-middleware/strip-ansi.d.ts.map +1 -0
- package/dist/hot-middleware/strip-ansi.js.map +1 -0
- package/dist/hot-middleware/types.d.ts.map +1 -0
- package/dist/hot-middleware/types.js.map +1 -0
- package/dist/index-html.d.ts +1 -0
- package/dist/index-html.js +40 -0
- package/dist/index.d.ts +18 -17
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -11
- package/dist/index.js.map +1 -0
- package/dist/json-parser.d.ts +7 -0
- package/dist/json-parser.js +177 -0
- package/dist/p-limit.d.ts +1 -0
- package/dist/p-limit.js +57 -0
- package/dist/project-info.d.ts.map +1 -0
- package/dist/project-info.js.map +1 -0
- package/dist/read.d.ts +6 -0
- package/dist/read.js +183 -0
- package/dist/renderEntry.d.ts.map +1 -0
- package/dist/renderEntry.js +51 -38
- package/dist/renderEntry.js.map +1 -0
- package/dist/routes.d.ts +8 -0
- package/dist/routes.js +122 -0
- package/dist/serve-static.d.ts +26 -0
- package/dist/serve-static.js +72 -0
- package/dist/setup-environment.d.ts.map +1 -0
- package/dist/setup-environment.js.map +1 -0
- package/dist/start-server-pure.d.ts +8 -0
- package/dist/start-server-pure.js +68 -0
- package/dist/start-server.d.ts +6 -6
- package/dist/start-server.d.ts.map +1 -0
- package/dist/start-server.js +4 -4
- package/dist/start-server.js.map +1 -0
- package/dist/static-preview.d.ts.map +1 -0
- package/dist/static-preview.js.map +1 -0
- package/dist/static-server.d.ts +0 -0
- package/dist/static-server.js +1 -0
- package/dist/test/expect-to-throw.d.ts.map +1 -0
- package/dist/test/expect-to-throw.js.map +1 -0
- package/dist/test/latest-remotion-version.test.d.ts.map +1 -0
- package/dist/test/latest-remotion-version.test.js.map +1 -0
- package/dist/test/parse-error-stack.test.d.ts.map +1 -0
- package/dist/test/parse-error-stack.test.js.map +1 -0
- package/dist/test/parse-module-not-found.test.d.ts.map +1 -0
- package/dist/test/parse-module-not-found.test.js.map +1 -0
- package/dist/test/secure-source-read.test.d.ts.map +1 -0
- package/dist/test/secure-source-read.test.js.map +1 -0
- package/dist/update-available.d.ts.map +1 -0
- package/dist/update-available.js.map +1 -0
- package/dist/webpack-cache.d.ts.map +1 -0
- package/dist/webpack-cache.js.map +1 -0
- package/dist/webpack-config.d.ts +2 -1
- package/dist/webpack-config.d.ts.map +1 -0
- package/dist/webpack-config.js +11 -21
- package/dist/webpack-config.js.map +1 -0
- package/package.json +4 -18
- package/web/favicon.png +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
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.indexHtml = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const indexHtml = (staticHash, baseDir, editorName) => `
|
|
9
|
+
<!DOCTYPE html>
|
|
10
|
+
<html lang="en">
|
|
11
|
+
<head>
|
|
12
|
+
<meta charset="UTF-8" />
|
|
13
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
14
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
15
|
+
<link rel="icon" type="image/png" href="/remotion.png" />
|
|
16
|
+
<title>Remotion Preview</title>
|
|
17
|
+
</head>
|
|
18
|
+
<body>
|
|
19
|
+
<script>window.remotion_staticBase = "${staticHash}";</script>
|
|
20
|
+
<div id="video-container"></div>
|
|
21
|
+
<div id="explainer-container"></div>
|
|
22
|
+
${editorName
|
|
23
|
+
? `<script>window.remotion_editorName = "${editorName}";</script>`
|
|
24
|
+
: '<script>window.remotion_editorName = null;</script>'}
|
|
25
|
+
<script>window.remotion_projectName = ${JSON.stringify(path_1.default.basename(process.cwd()))};</script>
|
|
26
|
+
<script>window.remotion_cwd = ${JSON.stringify(process.cwd())};</script>
|
|
27
|
+
|
|
28
|
+
<div id="container"></div>
|
|
29
|
+
<div id="menuportal-0"></div>
|
|
30
|
+
<div id="menuportal-1"></div>
|
|
31
|
+
<div id="menuportal-2"></div>
|
|
32
|
+
<div id="menuportal-3"></div>
|
|
33
|
+
<div id="menuportal-4"></div>
|
|
34
|
+
<div id="menuportal-5"></div>
|
|
35
|
+
<div id="remotion-error-overlay"></div>
|
|
36
|
+
<script src="${baseDir}bundle.js"></script>
|
|
37
|
+
</body>
|
|
38
|
+
</html>
|
|
39
|
+
`.trim();
|
|
40
|
+
exports.indexHtml = indexHtml;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import esbuild = require('esbuild');
|
|
2
|
+
import webpack = require('webpack');
|
|
2
3
|
export declare const BundlerInternals: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
esbuild: typeof esbuild;
|
|
5
|
+
webpackConfig: ({ entry, userDefinedComponent, outDir, environment, webpackOverride, onProgressUpdate, enableCaching, inputProps, envVariables, maxTimelineTracks, entryPoints, }: {
|
|
6
|
+
entry: string;
|
|
7
|
+
userDefinedComponent: string;
|
|
8
|
+
outDir: string;
|
|
9
|
+
environment: "development" | "production";
|
|
10
|
+
webpackOverride: import("remotion").WebpackOverrideFn;
|
|
11
|
+
onProgressUpdate?: ((f: number) => void) | undefined;
|
|
12
|
+
enableCaching?: boolean | undefined;
|
|
13
|
+
inputProps: object;
|
|
14
|
+
envVariables: Record<string, string>;
|
|
15
|
+
maxTimelineTracks: number;
|
|
16
|
+
entryPoints: string[];
|
|
17
|
+
}) => webpack.Configuration;
|
|
18
|
+
indexHtml: (staticHash: string, baseDir: string, editorName: string | null) => string;
|
|
10
19
|
cacheExists: (environment: "development" | "production", inputProps: object | null) => boolean;
|
|
11
20
|
clearCache: (environment: "development" | "production", inputProps: object | null) => Promise<void>;
|
|
12
|
-
getLatestRemotionVersion: () => Promise<any>;
|
|
13
|
-
getPackageManager: () => import("./get-package-manager").PackageManager | "unknown";
|
|
14
|
-
lockFilePaths: {
|
|
15
|
-
manager: import("./get-package-manager").PackageManager;
|
|
16
|
-
path: string;
|
|
17
|
-
}[];
|
|
18
|
-
esbuild: typeof esbuild;
|
|
19
21
|
};
|
|
20
|
-
export { bundle } from './
|
|
21
|
-
export {
|
|
22
|
-
export type { ProjectInfo } from './project-info';
|
|
22
|
+
export { bundle } from './bundle';
|
|
23
|
+
export { webpack };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAKnC,OAAO,OAAO,GAAG,QAAQ,SAAS,CAAC,CAAC;AAEpC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;CAS5B,CAAC;AAEF,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AACrD,YAAY,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bundle = exports.BundlerInternals = void 0;
|
|
4
|
-
const
|
|
5
|
-
const get_package_manager_1 = require("./get-package-manager");
|
|
6
|
-
const start_server_1 = require("./start-server");
|
|
3
|
+
exports.webpack = exports.bundle = exports.BundlerInternals = void 0;
|
|
4
|
+
const index_html_1 = require("./index-html");
|
|
7
5
|
const webpack_cache_1 = require("./webpack-cache");
|
|
6
|
+
const webpack_config_1 = require("./webpack-config");
|
|
8
7
|
const esbuild = require("esbuild");
|
|
8
|
+
const webpack = require("webpack");
|
|
9
|
+
exports.webpack = webpack;
|
|
9
10
|
exports.BundlerInternals = {
|
|
10
|
-
|
|
11
|
+
esbuild,
|
|
12
|
+
webpackConfig: webpack_config_1.webpackConfig,
|
|
13
|
+
indexHtml: index_html_1.indexHtml,
|
|
11
14
|
cacheExists: webpack_cache_1.cacheExists,
|
|
12
15
|
clearCache: webpack_cache_1.clearCache,
|
|
13
|
-
getLatestRemotionVersion: get_latest_remotion_version_1.getLatestRemotionVersion,
|
|
14
|
-
getPackageManager: get_package_manager_1.getPackageManager,
|
|
15
|
-
lockFilePaths: get_package_manager_1.lockFilePaths,
|
|
16
|
-
esbuild,
|
|
17
16
|
};
|
|
18
|
-
var
|
|
19
|
-
Object.defineProperty(exports, "bundle", { enumerable: true, get: function () { return
|
|
17
|
+
var bundle_1 = require("./bundle");
|
|
18
|
+
Object.defineProperty(exports, "bundle", { enumerable: true, get: function () { return bundle_1.bundle; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAmC;AACnC,+EAAuE;AACvE,+DAAuE;AACvE,iDAA2C;AAC3C,mDAAwD;AACxD,mCAAoC;AAEvB,QAAA,gBAAgB,GAAG;IAC/B,WAAW,EAAX,0BAAW;IACX,WAAW,EAAX,2BAAW;IACX,UAAU,EAAV,0BAAU;IACV,wBAAwB,EAAxB,sDAAwB;IACxB,iBAAiB,EAAjB,uCAAiB;IACjB,aAAa,EAAb,mCAAa;IACb,OAAO;IACP,SAAS,EAAT,oBAAS;CACT,CAAC;AAEF,qCAAiC;AAAzB,iGAAA,MAAM,OAAA"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* body-parser
|
|
3
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
4
|
+
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
*/
|
|
7
|
+
'use strict';
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
/**
|
|
10
|
+
* Module dependencies.
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
13
|
+
const bytes = require('bytes');
|
|
14
|
+
const contentType = require('content-type');
|
|
15
|
+
const createError = require('http-errors');
|
|
16
|
+
const debug = require('debug')('body-parser:json');
|
|
17
|
+
const read = require('../read');
|
|
18
|
+
const typeis = require('type-is');
|
|
19
|
+
/**
|
|
20
|
+
* Module exports.
|
|
21
|
+
*/
|
|
22
|
+
module.exports = json;
|
|
23
|
+
/**
|
|
24
|
+
* RegExp to match the first non-space in a string.
|
|
25
|
+
*
|
|
26
|
+
* Allowed whitespace is defined in RFC 7159:
|
|
27
|
+
*
|
|
28
|
+
* ws = *(
|
|
29
|
+
* %x20 / ; Space
|
|
30
|
+
* %x09 / ; Horizontal tab
|
|
31
|
+
* %x0A / ; Line feed or New line
|
|
32
|
+
* %x0D ) ; Carriage return
|
|
33
|
+
*/
|
|
34
|
+
const FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/; // eslint-disable-line no-control-regex
|
|
35
|
+
/**
|
|
36
|
+
* Create a middleware to parse JSON bodies.
|
|
37
|
+
*
|
|
38
|
+
* @param {object} [options]
|
|
39
|
+
* @return {function}
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
function json() {
|
|
43
|
+
const limit = 100 * 1024 * 1024;
|
|
44
|
+
const inflate = true;
|
|
45
|
+
const strict = true;
|
|
46
|
+
const type = 'application/json';
|
|
47
|
+
const verify = false;
|
|
48
|
+
if (verify !== false && typeof verify !== 'function') {
|
|
49
|
+
throw new TypeError('option verify must be function');
|
|
50
|
+
}
|
|
51
|
+
// create the appropriate type checking function
|
|
52
|
+
const shouldParse = typeof type === 'function' ? type : typeChecker(type);
|
|
53
|
+
function parse(body) {
|
|
54
|
+
if (body.length === 0) {
|
|
55
|
+
// special-case empty json body, as it's a common client-side mistake
|
|
56
|
+
// TODO: maybe make this configurable or part of "strict" option
|
|
57
|
+
return {};
|
|
58
|
+
}
|
|
59
|
+
if (strict) {
|
|
60
|
+
const first = firstchar(body);
|
|
61
|
+
if (first !== '{' && first !== '[') {
|
|
62
|
+
debug('strict violation');
|
|
63
|
+
throw createStrictSyntaxError(body, first);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
debug('parse json');
|
|
68
|
+
return JSON.parse(body);
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
throw normalizeJsonSyntaxError(e, {
|
|
72
|
+
message: e.message,
|
|
73
|
+
stack: e.stack,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return function jsonParser(req, res) {
|
|
78
|
+
// skip requests without bodies
|
|
79
|
+
if (!typeis.hasBody(req)) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
// determine if request should be parsed
|
|
83
|
+
if (!shouldParse(req)) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
// assert charset per RFC 7159 sec 8.1
|
|
87
|
+
const charset = getCharset(req) || 'utf-8';
|
|
88
|
+
if (charset.slice(0, 4) !== 'utf-') {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
// read
|
|
92
|
+
read(req, res, parse, {
|
|
93
|
+
encoding: charset,
|
|
94
|
+
inflate,
|
|
95
|
+
limit,
|
|
96
|
+
verify,
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Create strict violation syntax error matching native error.
|
|
102
|
+
*
|
|
103
|
+
* @param {string} str
|
|
104
|
+
* @param {string} char
|
|
105
|
+
* @return {Error}
|
|
106
|
+
* @private
|
|
107
|
+
*/
|
|
108
|
+
function createStrictSyntaxError(str, char) {
|
|
109
|
+
const index = str.indexOf(char);
|
|
110
|
+
const partial = index !== -1 ? str.substring(0, index) + '#' : '';
|
|
111
|
+
try {
|
|
112
|
+
JSON.parse(partial);
|
|
113
|
+
/* istanbul ignore next */ throw new SyntaxError('strict violation');
|
|
114
|
+
}
|
|
115
|
+
catch (e) {
|
|
116
|
+
return normalizeJsonSyntaxError(e, {
|
|
117
|
+
message: e.message.replace('#', char),
|
|
118
|
+
stack: e.stack,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Get the first non-whitespace character in a string.
|
|
124
|
+
*
|
|
125
|
+
* @param {string} str
|
|
126
|
+
* @return {function}
|
|
127
|
+
* @private
|
|
128
|
+
*/
|
|
129
|
+
function firstchar(str) {
|
|
130
|
+
const match = FIRST_CHAR_REGEXP.exec(str);
|
|
131
|
+
return match ? match[1] : undefined;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Get the charset of a request.
|
|
135
|
+
*
|
|
136
|
+
* @param {object} req
|
|
137
|
+
* @api private
|
|
138
|
+
*/
|
|
139
|
+
function getCharset(req) {
|
|
140
|
+
try {
|
|
141
|
+
return (contentType.parse(req).parameters.charset || '').toLowerCase();
|
|
142
|
+
}
|
|
143
|
+
catch (e) {
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Normalize a SyntaxError for JSON.parse.
|
|
149
|
+
*
|
|
150
|
+
* @param {SyntaxError} error
|
|
151
|
+
* @param {object} obj
|
|
152
|
+
* @return {SyntaxError}
|
|
153
|
+
*/
|
|
154
|
+
function normalizeJsonSyntaxError(error, obj) {
|
|
155
|
+
const keys = Object.getOwnPropertyNames(error);
|
|
156
|
+
for (let i = 0; i < keys.length; i++) {
|
|
157
|
+
const key = keys[i];
|
|
158
|
+
if (key !== 'stack' && key !== 'message') {
|
|
159
|
+
delete error[key];
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
// replace stack before message for Node.js 0.10 and below
|
|
163
|
+
error.stack = obj.stack.replace(error.message, obj.message);
|
|
164
|
+
error.message = obj.message;
|
|
165
|
+
return error;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Get the simple type checker.
|
|
169
|
+
*
|
|
170
|
+
* @param {string} type
|
|
171
|
+
* @return {function}
|
|
172
|
+
*/
|
|
173
|
+
function typeChecker(type) {
|
|
174
|
+
return function checkType(req) {
|
|
175
|
+
return Boolean(typeis(req, type));
|
|
176
|
+
};
|
|
177
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pLimit: (concurrency: number) => <Arguments extends unknown[], ReturnType_1>(fn: (..._arguments: Arguments) => ReturnType_1 | PromiseLike<ReturnType_1>, ...args: Arguments) => Promise<ReturnType_1>;
|
package/dist/p-limit.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pLimit = void 0;
|
|
4
|
+
const pLimit = (concurrency) => {
|
|
5
|
+
const queue = [];
|
|
6
|
+
let activeCount = 0;
|
|
7
|
+
const next = () => {
|
|
8
|
+
var _a;
|
|
9
|
+
activeCount--;
|
|
10
|
+
if (queue.length > 0) {
|
|
11
|
+
(_a = queue.shift()) === null || _a === void 0 ? void 0 : _a();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const run = async (fn, resolve, ...args) => {
|
|
15
|
+
activeCount++;
|
|
16
|
+
// eslint-disable-next-line require-await
|
|
17
|
+
const result = (async () => fn(...args))();
|
|
18
|
+
resolve(result);
|
|
19
|
+
try {
|
|
20
|
+
await result;
|
|
21
|
+
}
|
|
22
|
+
catch (_a) { }
|
|
23
|
+
next();
|
|
24
|
+
};
|
|
25
|
+
const enqueue = (fn, resolve, ...args) => {
|
|
26
|
+
queue.push(() => run(fn, resolve, ...args));
|
|
27
|
+
(async () => {
|
|
28
|
+
var _a;
|
|
29
|
+
// This function needs to wait until the next microtask before comparing
|
|
30
|
+
// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously
|
|
31
|
+
// when the run function is dequeued and called. The comparison in the if-statement
|
|
32
|
+
// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.
|
|
33
|
+
await Promise.resolve();
|
|
34
|
+
if (activeCount < concurrency && queue.length > 0) {
|
|
35
|
+
(_a = queue.shift()) === null || _a === void 0 ? void 0 : _a();
|
|
36
|
+
}
|
|
37
|
+
})();
|
|
38
|
+
};
|
|
39
|
+
const generator = (fn, ...args) => new Promise((resolve) => {
|
|
40
|
+
enqueue(fn, resolve, ...args);
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperties(generator, {
|
|
43
|
+
activeCount: {
|
|
44
|
+
get: () => activeCount,
|
|
45
|
+
},
|
|
46
|
+
pendingCount: {
|
|
47
|
+
get: () => queue.length,
|
|
48
|
+
},
|
|
49
|
+
clearQueue: {
|
|
50
|
+
value: () => {
|
|
51
|
+
queue.length = 0;
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
return generator;
|
|
56
|
+
};
|
|
57
|
+
exports.pLimit = pLimit;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-info.d.ts","sourceRoot":"","sources":["../src/project-info.ts"],"names":[],"mappings":"AAGA,oBAAY,WAAW,GAAG;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,QAAQ,WAAW,CAapD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-info.js","sourceRoot":"","sources":["../src/project-info.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA8B;AAC9B,gDAAwB;AAOjB,MAAM,cAAc,GAAG,GAAyB,EAAE;;IACxD,MAAM,cAAc,GAAG,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACnE,OAAO,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,MAAA,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,eAAU,EAAC,CAAC,CAAC,CAAC,mCAAI,IAAI,CAAC;IAEpE,OAAO,OAAO,CAAC,OAAO,CAAC;QACtB,SAAS;QACT,iBAAiB,EAAE,SAAS;YAC3B,CAAC,CAAC,cAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC;YACzC,CAAC,CAAC,IAAI;KACP,CAAC,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,cAAc,kBAazB"}
|
package/dist/read.d.ts
ADDED
package/dist/read.js
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* body-parser
|
|
3
|
+
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
4
|
+
* MIT Licensed
|
|
5
|
+
*/
|
|
6
|
+
'use strict';
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
/**
|
|
9
|
+
* Module dependencies.
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
const createError = require('http-errors');
|
|
13
|
+
const destroy = require('destroy');
|
|
14
|
+
const getBody = require('raw-body');
|
|
15
|
+
const iconv = require('iconv-lite');
|
|
16
|
+
const onFinished = require('on-finished');
|
|
17
|
+
const unpipe = require('unpipe');
|
|
18
|
+
const zlib = require('zlib');
|
|
19
|
+
/**
|
|
20
|
+
* Module exports.
|
|
21
|
+
*/
|
|
22
|
+
module.exports = read;
|
|
23
|
+
/**
|
|
24
|
+
* Read a request into a buffer and parse.
|
|
25
|
+
*
|
|
26
|
+
* @param {object} req
|
|
27
|
+
* @param {object} res
|
|
28
|
+
* @param {function} next
|
|
29
|
+
* @param {function} parse
|
|
30
|
+
* @param {function} debug
|
|
31
|
+
* @param {object} options
|
|
32
|
+
* @private
|
|
33
|
+
*/
|
|
34
|
+
function read(req, res, parse, debug, options) {
|
|
35
|
+
let length;
|
|
36
|
+
const opts = options;
|
|
37
|
+
let stream;
|
|
38
|
+
// flag as parsed
|
|
39
|
+
req._body = true;
|
|
40
|
+
// read options
|
|
41
|
+
const encoding = opts.encoding !== null ? opts.encoding : null;
|
|
42
|
+
const { verify } = opts;
|
|
43
|
+
try {
|
|
44
|
+
// get the content stream
|
|
45
|
+
stream = contentstream(req, debug, opts.inflate);
|
|
46
|
+
length = stream.length;
|
|
47
|
+
stream.length = undefined;
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
return next(err);
|
|
51
|
+
}
|
|
52
|
+
// set raw-body options
|
|
53
|
+
opts.length = length;
|
|
54
|
+
opts.encoding = verify ? null : encoding;
|
|
55
|
+
// assert charset is supported
|
|
56
|
+
if (opts.encoding === null &&
|
|
57
|
+
encoding !== null &&
|
|
58
|
+
!iconv.encodingExists(encoding)) {
|
|
59
|
+
return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
|
|
60
|
+
charset: encoding.toLowerCase(),
|
|
61
|
+
type: 'charset.unsupported',
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
// read body
|
|
65
|
+
debug('read body');
|
|
66
|
+
getBody(stream, opts, (error, body) => {
|
|
67
|
+
if (error) {
|
|
68
|
+
let _error;
|
|
69
|
+
if (error.type === 'encoding.unsupported') {
|
|
70
|
+
// echo back charset
|
|
71
|
+
_error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
|
|
72
|
+
charset: encoding.toLowerCase(),
|
|
73
|
+
type: 'charset.unsupported',
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
// set status code on error
|
|
78
|
+
_error = createError(400, error);
|
|
79
|
+
}
|
|
80
|
+
// unpipe from stream and destroy
|
|
81
|
+
if (stream !== req) {
|
|
82
|
+
unpipe(req);
|
|
83
|
+
destroy(stream, true);
|
|
84
|
+
}
|
|
85
|
+
// read off entire request
|
|
86
|
+
dump(req, function onfinished() {
|
|
87
|
+
next(createError(400, _error));
|
|
88
|
+
});
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
// verify
|
|
92
|
+
if (verify) {
|
|
93
|
+
try {
|
|
94
|
+
debug('verify body');
|
|
95
|
+
verify(req, res, body, encoding);
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
next(createError(403, err, {
|
|
99
|
+
body,
|
|
100
|
+
type: err.type || 'entity.verify.failed',
|
|
101
|
+
}));
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// parse
|
|
106
|
+
let str = body;
|
|
107
|
+
try {
|
|
108
|
+
debug('parse body');
|
|
109
|
+
str =
|
|
110
|
+
typeof body !== 'string' && encoding !== null
|
|
111
|
+
? iconv.decode(body, encoding)
|
|
112
|
+
: body;
|
|
113
|
+
req.body = parse(str);
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
next(createError(400, err, {
|
|
117
|
+
body: str,
|
|
118
|
+
type: err.type || 'entity.parse.failed',
|
|
119
|
+
}));
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
next();
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Get the content stream of the request.
|
|
127
|
+
*
|
|
128
|
+
* @param {object} req
|
|
129
|
+
* @param {function} debug
|
|
130
|
+
* @param {boolean} [inflate=true]
|
|
131
|
+
* @return {object}
|
|
132
|
+
* @api private
|
|
133
|
+
*/
|
|
134
|
+
function contentstream(req, debug, inflate) {
|
|
135
|
+
const encoding = (req.headers['content-encoding'] || 'identity').toLowerCase();
|
|
136
|
+
const length = req.headers['content-length'];
|
|
137
|
+
let stream;
|
|
138
|
+
debug('content-encoding "%s"', encoding);
|
|
139
|
+
if (inflate === false && encoding !== 'identity') {
|
|
140
|
+
throw createError(415, 'content encoding unsupported', {
|
|
141
|
+
encoding,
|
|
142
|
+
type: 'encoding.unsupported',
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
switch (encoding) {
|
|
146
|
+
case 'deflate':
|
|
147
|
+
stream = zlib.createInflate();
|
|
148
|
+
debug('inflate body');
|
|
149
|
+
req.pipe(stream);
|
|
150
|
+
break;
|
|
151
|
+
case 'gzip':
|
|
152
|
+
stream = zlib.createGunzip();
|
|
153
|
+
debug('gunzip body');
|
|
154
|
+
req.pipe(stream);
|
|
155
|
+
break;
|
|
156
|
+
case 'identity':
|
|
157
|
+
stream = req;
|
|
158
|
+
stream.length = length;
|
|
159
|
+
break;
|
|
160
|
+
default:
|
|
161
|
+
throw createError(415, 'unsupported content encoding "' + encoding + '"', {
|
|
162
|
+
encoding,
|
|
163
|
+
type: 'encoding.unsupported',
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return stream;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Dump the contents of a request.
|
|
170
|
+
*
|
|
171
|
+
* @param {object} req
|
|
172
|
+
* @param {function} callback
|
|
173
|
+
* @api private
|
|
174
|
+
*/
|
|
175
|
+
function dump(req, callback) {
|
|
176
|
+
if (onFinished.isFinished(req)) {
|
|
177
|
+
callback(null);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
onFinished(req, callback);
|
|
181
|
+
req.resume();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderEntry.d.ts","sourceRoot":"","sources":["../src/renderEntry.tsx"],"names":[],"mappings":"AAcA,OAAO,EACN,WAAW,EAOX,MAAM,UAAU,CAAC;AAgLlB,eAAO,MAAM,sBAAsB,UAAW,WAAW,SAGxD,CAAC"}
|