@remotion/bundler 3.0.18 → 3.0.21

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.
Files changed (179) hide show
  1. package/dist/bundle-mode.d.ts.map +1 -0
  2. package/dist/bundle-mode.js.map +1 -0
  3. package/dist/bundle.js +3 -2
  4. package/dist/bundler.d.ts.map +1 -0
  5. package/dist/bundler.js.map +1 -0
  6. package/dist/copy-dir.d.ts.map +1 -0
  7. package/dist/copy-dir.js.map +1 -0
  8. package/dist/dev-middleware/compatible-api.d.ts.map +1 -0
  9. package/dist/dev-middleware/compatible-api.js.map +1 -0
  10. package/dist/dev-middleware/get-filename-from-url.d.ts.map +1 -0
  11. package/dist/dev-middleware/get-filename-from-url.js.map +1 -0
  12. package/dist/dev-middleware/get-paths.d.ts.map +1 -0
  13. package/dist/dev-middleware/get-paths.js.map +1 -0
  14. package/dist/dev-middleware/index.d.ts.map +1 -0
  15. package/dist/dev-middleware/index.js.map +1 -0
  16. package/dist/dev-middleware/is-color-supported.d.ts.map +1 -0
  17. package/dist/dev-middleware/is-color-supported.js.map +1 -0
  18. package/dist/dev-middleware/middleware.d.ts.map +1 -0
  19. package/dist/dev-middleware/middleware.js.map +1 -0
  20. package/dist/dev-middleware/range-parser.d.ts.map +1 -0
  21. package/dist/dev-middleware/range-parser.js.map +1 -0
  22. package/dist/dev-middleware/ready.d.ts.map +1 -0
  23. package/dist/dev-middleware/ready.js.map +1 -0
  24. package/dist/dev-middleware/setup-hooks.d.ts.map +1 -0
  25. package/dist/dev-middleware/setup-hooks.js.map +1 -0
  26. package/dist/dev-middleware/setup-output-filesystem.d.ts.map +1 -0
  27. package/dist/dev-middleware/setup-output-filesystem.js.map +1 -0
  28. package/dist/dev-middleware/types.d.ts.map +1 -0
  29. package/dist/dev-middleware/types.js.map +1 -0
  30. package/dist/error-overlay/entry-basic.d.ts.map +1 -0
  31. package/dist/error-overlay/entry-basic.js.map +1 -0
  32. package/dist/error-overlay/react-overlay/effects/format-warning.d.ts.map +1 -0
  33. package/dist/error-overlay/react-overlay/effects/format-warning.js.map +1 -0
  34. package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.d.ts.map +1 -0
  35. package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.js.map +1 -0
  36. package/dist/error-overlay/react-overlay/effects/proxy-console.d.ts.map +1 -0
  37. package/dist/error-overlay/react-overlay/effects/proxy-console.js.map +1 -0
  38. package/dist/error-overlay/react-overlay/effects/resolve-file-source.d.ts.map +1 -0
  39. package/dist/error-overlay/react-overlay/effects/resolve-file-source.js.map +1 -0
  40. package/dist/error-overlay/react-overlay/effects/stack-trace-limit.d.ts.map +1 -0
  41. package/dist/error-overlay/react-overlay/effects/stack-trace-limit.js.map +1 -0
  42. package/dist/error-overlay/react-overlay/effects/unhandled-error.d.ts.map +1 -0
  43. package/dist/error-overlay/react-overlay/effects/unhandled-error.js.map +1 -0
  44. package/dist/error-overlay/react-overlay/effects/unhandled-rejection.d.ts.map +1 -0
  45. package/dist/error-overlay/react-overlay/effects/unhandled-rejection.js.map +1 -0
  46. package/dist/error-overlay/react-overlay/index.d.ts.map +1 -0
  47. package/dist/error-overlay/react-overlay/index.js.map +1 -0
  48. package/dist/error-overlay/react-overlay/listen-to-runtime-errors.d.ts.map +1 -0
  49. package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js.map +1 -0
  50. package/dist/error-overlay/react-overlay/utils/get-file-source.d.ts.map +1 -0
  51. package/dist/error-overlay/react-overlay/utils/get-file-source.js.map +1 -0
  52. package/dist/error-overlay/react-overlay/utils/get-lines-around.d.ts.map +1 -0
  53. package/dist/error-overlay/react-overlay/utils/get-lines-around.js.map +1 -0
  54. package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts.map +1 -0
  55. package/dist/error-overlay/react-overlay/utils/get-source-map.js.map +1 -0
  56. package/dist/error-overlay/react-overlay/utils/get-stack-frames.d.ts.map +1 -0
  57. package/dist/error-overlay/react-overlay/utils/get-stack-frames.js.map +1 -0
  58. package/dist/error-overlay/react-overlay/utils/open-in-editor.d.ts.map +1 -0
  59. package/dist/error-overlay/react-overlay/utils/open-in-editor.js.map +1 -0
  60. package/dist/error-overlay/react-overlay/utils/parser.d.ts.map +1 -0
  61. package/dist/error-overlay/react-overlay/utils/parser.js.map +1 -0
  62. package/dist/error-overlay/react-overlay/utils/stack-frame.d.ts.map +1 -0
  63. package/dist/error-overlay/react-overlay/utils/stack-frame.js.map +1 -0
  64. package/dist/error-overlay/react-overlay/utils/unmapper.d.ts.map +1 -0
  65. package/dist/error-overlay/react-overlay/utils/unmapper.js.map +1 -0
  66. package/dist/error-overlay/remotion-overlay/AskOnDiscord.d.ts.map +1 -0
  67. package/dist/error-overlay/remotion-overlay/AskOnDiscord.js.map +1 -0
  68. package/dist/error-overlay/remotion-overlay/Button.d.ts.map +1 -0
  69. package/dist/error-overlay/remotion-overlay/Button.js.map +1 -0
  70. package/dist/error-overlay/remotion-overlay/CodeFrame.d.ts.map +1 -0
  71. package/dist/error-overlay/remotion-overlay/CodeFrame.js.map +1 -0
  72. package/dist/error-overlay/remotion-overlay/DismissButton.d.ts.map +1 -0
  73. package/dist/error-overlay/remotion-overlay/DismissButton.js.map +1 -0
  74. package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts.map +1 -0
  75. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js.map +1 -0
  76. package/dist/error-overlay/remotion-overlay/ErrorLoader.d.ts.map +1 -0
  77. package/dist/error-overlay/remotion-overlay/ErrorLoader.js.map +1 -0
  78. package/dist/error-overlay/remotion-overlay/ErrorTitle.d.ts.map +1 -0
  79. package/dist/error-overlay/remotion-overlay/ErrorTitle.js.map +1 -0
  80. package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts.map +1 -0
  81. package/dist/error-overlay/remotion-overlay/OpenInEditor.js.map +1 -0
  82. package/dist/error-overlay/remotion-overlay/Overlay.d.ts.map +1 -0
  83. package/dist/error-overlay/remotion-overlay/Overlay.js.map +1 -0
  84. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.d.ts.map +1 -0
  85. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js.map +1 -0
  86. package/dist/error-overlay/remotion-overlay/StackFrame.d.ts.map +1 -0
  87. package/dist/error-overlay/remotion-overlay/StackFrame.js.map +1 -0
  88. package/dist/error-overlay/remotion-overlay/Symbolicating.d.ts.map +1 -0
  89. package/dist/error-overlay/remotion-overlay/Symbolicating.js.map +1 -0
  90. package/dist/error-overlay/remotion-overlay/carets.d.ts.map +1 -0
  91. package/dist/error-overlay/remotion-overlay/carets.js.map +1 -0
  92. package/dist/error-overlay/remotion-overlay/format-location.d.ts.map +1 -0
  93. package/dist/error-overlay/remotion-overlay/format-location.js.map +1 -0
  94. package/dist/error-overlay/remotion-overlay/index.d.ts.map +1 -0
  95. package/dist/error-overlay/remotion-overlay/index.js.map +1 -0
  96. package/dist/esbuild-loader/index.d.ts.map +1 -0
  97. package/dist/esbuild-loader/index.js.map +1 -0
  98. package/dist/esbuild-loader/interfaces.d.ts.map +1 -0
  99. package/dist/esbuild-loader/interfaces.js.map +1 -0
  100. package/dist/fast-refresh/helpers.d.ts.map +1 -0
  101. package/dist/fast-refresh/helpers.js.map +1 -0
  102. package/dist/fast-refresh/index.d.ts.map +1 -0
  103. package/dist/fast-refresh/index.js.map +1 -0
  104. package/dist/fast-refresh/loader.d.ts.map +1 -0
  105. package/dist/fast-refresh/loader.js.map +1 -0
  106. package/dist/fast-refresh/runtime.d.ts.map +1 -0
  107. package/dist/fast-refresh/runtime.js.map +1 -0
  108. package/dist/get-latest-remotion-version.d.ts.map +1 -0
  109. package/dist/get-latest-remotion-version.js.map +1 -0
  110. package/dist/get-package-manager.d.ts.map +1 -0
  111. package/dist/get-package-manager.js.map +1 -0
  112. package/dist/get-port.d.ts.map +1 -0
  113. package/dist/get-port.js +1 -6
  114. package/dist/get-port.js.map +1 -0
  115. package/dist/homepage/homepage.d.ts +0 -1
  116. package/dist/homepage/homepage.d.ts.map +1 -0
  117. package/dist/homepage/homepage.js +2 -3
  118. package/dist/homepage/homepage.js.map +1 -0
  119. package/dist/hot-middleware/client.d.ts.map +1 -0
  120. package/dist/hot-middleware/client.js.map +1 -0
  121. package/dist/hot-middleware/index.d.ts.map +1 -0
  122. package/dist/hot-middleware/index.js.map +1 -0
  123. package/dist/hot-middleware/process-update.d.ts.map +1 -0
  124. package/dist/hot-middleware/process-update.js.map +1 -0
  125. package/dist/hot-middleware/strip-ansi.d.ts.map +1 -0
  126. package/dist/hot-middleware/strip-ansi.js.map +1 -0
  127. package/dist/hot-middleware/types.d.ts.map +1 -0
  128. package/dist/hot-middleware/types.js.map +1 -0
  129. package/dist/index-html.d.ts +1 -0
  130. package/dist/index-html.js +40 -0
  131. package/dist/index.d.ts +17 -16
  132. package/dist/index.d.ts.map +1 -0
  133. package/dist/index.js +8 -9
  134. package/dist/index.js.map +1 -0
  135. package/dist/json-parser.d.ts +7 -0
  136. package/dist/json-parser.js +177 -0
  137. package/dist/project-info.d.ts.map +1 -0
  138. package/dist/project-info.js.map +1 -0
  139. package/dist/read.d.ts +6 -0
  140. package/dist/read.js +183 -0
  141. package/dist/renderEntry.d.ts.map +1 -0
  142. package/dist/renderEntry.js +28 -21
  143. package/dist/renderEntry.js.map +1 -0
  144. package/dist/routes.d.ts +8 -0
  145. package/dist/routes.js +122 -0
  146. package/dist/serve-static.d.ts +26 -0
  147. package/dist/serve-static.js +72 -0
  148. package/dist/setup-environment.d.ts.map +1 -0
  149. package/dist/setup-environment.js.map +1 -0
  150. package/dist/start-server-pure.d.ts +8 -0
  151. package/dist/start-server-pure.js +68 -0
  152. package/dist/start-server.d.ts.map +1 -0
  153. package/dist/start-server.js.map +1 -0
  154. package/dist/static-preview.d.ts.map +1 -0
  155. package/dist/static-preview.js.map +1 -0
  156. package/dist/static-server.d.ts +0 -0
  157. package/dist/static-server.js +1 -0
  158. package/dist/test/expect-to-throw.d.ts.map +1 -0
  159. package/dist/test/expect-to-throw.js.map +1 -0
  160. package/dist/test/latest-remotion-version.test.d.ts.map +1 -0
  161. package/dist/test/latest-remotion-version.test.js.map +1 -0
  162. package/dist/test/parse-error-stack.test.d.ts.map +1 -0
  163. package/dist/test/parse-error-stack.test.js.map +1 -0
  164. package/dist/test/parse-module-not-found.test.d.ts.map +1 -0
  165. package/dist/test/parse-module-not-found.test.js.map +1 -0
  166. package/dist/test/secure-source-read.test.d.ts.map +1 -0
  167. package/dist/test/secure-source-read.test.js.map +1 -0
  168. package/dist/update-available.d.ts.map +1 -0
  169. package/dist/update-available.js.map +1 -0
  170. package/dist/webpack-cache.d.ts.map +1 -0
  171. package/dist/webpack-cache.js.map +1 -0
  172. package/dist/webpack-config.d.ts +2 -1
  173. package/dist/webpack-config.d.ts.map +1 -0
  174. package/dist/webpack-config.js +6 -14
  175. package/dist/webpack-config.js.map +1 -0
  176. package/package.json +3 -15
  177. package/dist/ts-alias-plugin.d.ts +0 -4
  178. package/dist/ts-alias-plugin.js +0 -21
  179. package/web/favicon.png +0 -0
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"}
@@ -15,16 +15,14 @@ const remotion_1 = require("remotion");
15
15
  const bundle_mode_1 = require("./bundle-mode");
16
16
  const homepage_1 = require("./homepage/homepage");
17
17
  remotion_1.Internals.CSSUtils.injectCSS(remotion_1.Internals.CSSUtils.makeDefaultCSS(null, '#fff'));
18
- const Root = remotion_1.Internals.getRoot();
19
- if (!Root) {
20
- throw new Error('Root has not been registered.');
21
- }
22
- const handle = (0, remotion_1.delayRender)('Loading root component');
23
18
  const GetVideo = ({ state }) => {
24
19
  const video = remotion_1.Internals.useVideo();
25
20
  const compositions = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
26
- const [Component, setComponent] = (0, react_1.useState)(null);
27
21
  const portalContainer = (0, react_1.useRef)(null);
22
+ const [handle] = (0, react_1.useState)(() => (0, remotion_1.delayRender)('Wait for Composition' + JSON.stringify(state)));
23
+ (0, react_1.useEffect)(() => {
24
+ return () => (0, remotion_1.continueRender)(handle);
25
+ }, [handle]);
28
26
  (0, react_1.useEffect)(() => {
29
27
  var _a;
30
28
  if (state.type !== 'composition') {
@@ -38,26 +36,14 @@ const GetVideo = ({ state }) => {
38
36
  compositions.setCurrentComposition((_a = foundComposition === null || foundComposition === void 0 ? void 0 : foundComposition.id) !== null && _a !== void 0 ? _a : null);
39
37
  }
40
38
  }, [compositions, compositions.compositions, state, video]);
41
- const fetchComponent = (0, react_1.useCallback)(() => {
42
- if (!video) {
43
- throw new Error('Expected to have video');
44
- }
45
- const Comp = video.component;
46
- setComponent(Comp);
47
- }, [video]);
48
- (0, react_1.useEffect)(() => {
49
- if (video) {
50
- fetchComponent();
51
- }
52
- }, [fetchComponent, video]);
53
39
  (0, react_1.useEffect)(() => {
54
40
  if (state.type === 'evaluation') {
55
41
  (0, remotion_1.continueRender)(handle);
56
42
  }
57
- else if (Component) {
43
+ else if (video) {
58
44
  (0, remotion_1.continueRender)(handle);
59
45
  }
60
- }, [Component, state.type]);
46
+ }, [handle, state.type, video]);
61
47
  (0, react_1.useEffect)(() => {
62
48
  if (!video) {
63
49
  return;
@@ -89,10 +75,28 @@ let cleanupVideoContainer = () => {
89
75
  let cleanupExplainerContainer = () => {
90
76
  explainerContainer.innerHTML = '';
91
77
  };
78
+ const waitForRootHandle = (0, remotion_1.delayRender)('Loading root component');
79
+ const WaitForRoot = () => {
80
+ const [Root, setRoot] = (0, react_1.useState)(() => remotion_1.Internals.getRoot());
81
+ (0, react_1.useEffect)(() => {
82
+ if (Root) {
83
+ (0, remotion_1.continueRender)(waitForRootHandle);
84
+ return;
85
+ }
86
+ const cleanup = remotion_1.Internals.waitForRoot((NewRoot) => {
87
+ setRoot(() => NewRoot);
88
+ });
89
+ return () => cleanup();
90
+ }, [Root]);
91
+ if (Root === null) {
92
+ return null;
93
+ }
94
+ return (0, jsx_runtime_1.jsx)(Root, {});
95
+ };
92
96
  const renderContent = () => {
93
97
  const bundleMode = (0, bundle_mode_1.getBundleMode)();
94
98
  if (bundleMode.type === 'composition' || bundleMode.type === 'evaluation') {
95
- const markup = ((0, jsx_runtime_1.jsxs)(remotion_1.Internals.RemotionRoot, { children: [(0, jsx_runtime_1.jsx)(Root, {}), (0, jsx_runtime_1.jsx)(GetVideo, { state: bundleMode })] }));
99
+ const markup = ((0, jsx_runtime_1.jsxs)(remotion_1.Internals.RemotionRoot, { children: [(0, jsx_runtime_1.jsx)(WaitForRoot, {}), (0, jsx_runtime_1.jsx)(GetVideo, { state: bundleMode })] }));
96
100
  if (client_1.default.createRoot) {
97
101
  const root = client_1.default.createRoot(videoContainer);
98
102
  root.render(markup);
@@ -144,6 +148,9 @@ const setBundleModeAndUpdate = (state) => {
144
148
  exports.setBundleModeAndUpdate = setBundleModeAndUpdate;
145
149
  if (typeof window !== 'undefined') {
146
150
  window.getStaticCompositions = () => {
151
+ if (!remotion_1.Internals.getRoot()) {
152
+ throw new Error('registerRoot() was never called. 1. Make sure you specified the correct entrypoint for your bundle. 2. If your registerRoot() call is deferred, use the delayRender/continueRender pattern to tell Remotion to wait.');
153
+ }
147
154
  if (!remotion_1.Internals.compositionsRef.current) {
148
155
  throw new Error('Unexpectedly did not have a CompositionManager');
149
156
  }
@@ -0,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CAAC;QACnC,CAAC,CAAC;KACF;AACF,CAAC,CAAC;AAEF,aAAa,EAAE,CAAC;AAET,MAAM,sBAAsB,GAAG,CAAC,KAAkB,EAAE,EAAE;IAC5D,IAAA,2BAAa,EAAC,KAAK,CAAC,CAAC;IACrB,aAAa,EAAE,CAAC;AACjB,CAAC,CAAC;AAHW,QAAA,sBAAsB,0BAGjC;AAEF,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAClC,MAAM,CAAC,qBAAqB,GAAG,GAAoB,EAAE;QACpD,IAAI,CAAC,oBAAS,CAAC,eAAe,CAAC,OAAO,EAAE;YACvC,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;SAClE;QAED,OAAO,oBAAS,CAAC,eAAe,CAAC,OAAO;aACtC,eAAe,EAAE;aACjB,GAAG,CAAC,CAAC,CAAC,EAAiB,EAAE;YACzB,OAAO;gBACN,YAAY,EAAE,CAAC,CAAC,YAAY;gBAC5B,gBAAgB,EAAE,CAAC,CAAC,gBAAgB;gBACpC,GAAG,EAAE,CAAC,CAAC,GAAG;gBACV,MAAM,EAAE,CAAC,CAAC,MAAM;gBAChB,EAAE,EAAE,CAAC,CAAC,EAAE;gBACR,KAAK,EAAE,CAAC,CAAC,KAAK;aACd,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,CAAC,WAAW,GAAG,GAAG,CAAC;IACzB,MAAM,CAAC,aAAa,GAAG,8BAAsB,CAAC;CAC9C"}
@@ -0,0 +1,8 @@
1
+ import { IncomingMessage, ServerResponse } from 'http';
2
+ export declare const handleUpdate: (_: IncomingMessage, response: ServerResponse) => Promise<void>;
3
+ export declare const handleFallback: (hash: string, _: IncomingMessage, response: ServerResponse) => Promise<void>;
4
+ export declare const handleProjectInfo: (_: IncomingMessage, response: ServerResponse) => Promise<void>;
5
+ export declare const handleFileSource: (search: string, _: IncomingMessage, response: ServerResponse) => Promise<void>;
6
+ export declare const handleOpenInEditor: (req: IncomingMessage, res: ServerResponse) => Promise<void>;
7
+ export declare const handleFavicon: (_: IncomingMessage, response: ServerResponse) => void;
8
+ export declare const handleRoutes: (hash: string, request: IncomingMessage, response: ServerResponse) => void | Promise<void>;
package/dist/routes.js ADDED
@@ -0,0 +1,122 @@
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.handleRoutes = exports.handleFavicon = exports.handleOpenInEditor = exports.handleFileSource = exports.handleProjectInfo = exports.handleFallback = exports.handleUpdate = void 0;
7
+ const fs_1 = require("fs");
8
+ const path_1 = __importDefault(require("path"));
9
+ const url_1 = require("url");
10
+ const get_file_source_1 = require("./error-overlay/react-overlay/utils/get-file-source");
11
+ const open_in_editor_1 = require("./error-overlay/react-overlay/utils/open-in-editor");
12
+ const project_info_1 = require("./project-info");
13
+ const static_preview_1 = require("./static-preview");
14
+ const update_available_1 = require("./update-available");
15
+ const handleUpdate = async (_, response) => {
16
+ const data = await (0, update_available_1.isUpdateAvailableWithTimeout)();
17
+ response.setHeader('content-type', 'application/json');
18
+ response.writeHead(200);
19
+ response.end(JSON.stringify(data));
20
+ };
21
+ exports.handleUpdate = handleUpdate;
22
+ const editorGuess = (0, open_in_editor_1.guessEditor)();
23
+ const handleFallback = async (hash, _, response) => {
24
+ const edit = await editorGuess;
25
+ const displayName = (0, open_in_editor_1.getDisplayNameForEditor)(edit[0]);
26
+ response.setHeader('content-type', 'text/html');
27
+ response.writeHead(200);
28
+ response.end((0, static_preview_1.indexHtml)(hash, '/', displayName));
29
+ };
30
+ exports.handleFallback = handleFallback;
31
+ const handleProjectInfo = async (_, response) => {
32
+ const data = await (0, project_info_1.getProjectInfo)();
33
+ response.setHeader('content-type', 'application/json');
34
+ response.writeHead(200);
35
+ response.end(JSON.stringify(data));
36
+ };
37
+ exports.handleProjectInfo = handleProjectInfo;
38
+ const handleFileSource = async (search, _, response) => {
39
+ if (!search.startsWith('?')) {
40
+ throw new Error('query must start with ?');
41
+ }
42
+ const query = new url_1.URLSearchParams(search);
43
+ const f = query.get('f');
44
+ if (typeof f !== 'string') {
45
+ throw new Error('must pass `f` parameter');
46
+ }
47
+ const data = await (0, get_file_source_1.getFileSource)(decodeURIComponent(f));
48
+ response.writeHead(200);
49
+ response.write(data);
50
+ return response.end();
51
+ };
52
+ exports.handleFileSource = handleFileSource;
53
+ const handleOpenInEditor = async (req, res) => {
54
+ try {
55
+ const b = await new Promise((_resolve) => {
56
+ let data = '';
57
+ req.on('data', (chunk) => {
58
+ data += chunk;
59
+ });
60
+ req.on('end', () => {
61
+ _resolve(data.toString());
62
+ });
63
+ });
64
+ const body = JSON.parse(b);
65
+ if (!('stack' in body)) {
66
+ throw new TypeError('Need to pass stack');
67
+ }
68
+ const stack = body.stack;
69
+ const guess = await editorGuess;
70
+ const didOpen = await (0, open_in_editor_1.launchEditor)({
71
+ colNumber: stack.originalColumnNumber,
72
+ editor: guess[0],
73
+ fileName: path_1.default.resolve(process.cwd(), stack.originalFileName),
74
+ lineNumber: stack.originalLineNumber,
75
+ vsCodeNewWindow: false,
76
+ });
77
+ res.setHeader('content-type', 'application/json');
78
+ res.writeHead(200);
79
+ res.end(JSON.stringify({
80
+ success: didOpen,
81
+ }));
82
+ }
83
+ catch (err) {
84
+ res.setHeader('content-type', 'application/json');
85
+ res.writeHead(200);
86
+ res.end(JSON.stringify({
87
+ success: false,
88
+ }));
89
+ }
90
+ };
91
+ exports.handleOpenInEditor = handleOpenInEditor;
92
+ const handleFavicon = (_, response) => {
93
+ const filePath = path_1.default.join(__dirname, '..', 'web', 'favicon.png');
94
+ const stat = (0, fs_1.statSync)(filePath);
95
+ response.writeHead(200, {
96
+ 'Content-Type': 'image/png',
97
+ 'Content-Length': stat.size,
98
+ });
99
+ const readStream = (0, fs_1.createReadStream)(filePath);
100
+ readStream.pipe(response);
101
+ };
102
+ exports.handleFavicon = handleFavicon;
103
+ const handleRoutes = (hash, request, response) => {
104
+ const url = new URL(request.url, 'http://localhost');
105
+ if (url.pathname === '/api/update') {
106
+ return (0, exports.handleUpdate)(request, response);
107
+ }
108
+ if (url.pathname === '/api/project-info') {
109
+ return (0, exports.handleProjectInfo)(request, response);
110
+ }
111
+ if (url.pathname === '/api/file-source') {
112
+ return (0, exports.handleFileSource)(url.search, request, response);
113
+ }
114
+ if (url.pathname === '/api/open-in-editor') {
115
+ return (0, exports.handleOpenInEditor)(request, response);
116
+ }
117
+ if (url.pathname === '/remotion.png') {
118
+ return (0, exports.handleFavicon)(request, response);
119
+ }
120
+ return (0, exports.handleFallback)(hash, request, response);
121
+ };
122
+ exports.handleRoutes = handleRoutes;
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * serve-static
3
+ * Copyright(c) 2010 Sencha Inc.
4
+ * Copyright(c) 2011 TJ Holowaychuk
5
+ * Copyright(c) 2014-2016 Douglas Christopher Wilson
6
+ * MIT Licensed
7
+ */
8
+ import { IncomingMessage, ServerResponse } from 'http';
9
+ /**
10
+ * @param {string} root
11
+ * @param {object} [options]
12
+ * @return {function}
13
+ * @public
14
+ */
15
+ export declare const serveStatic: (root: string, options: {
16
+ cacheControl: true;
17
+ dotfiles: 'allow';
18
+ etag: true;
19
+ extensions: false;
20
+ fallthrough: false;
21
+ immutable: false;
22
+ index: false;
23
+ lastModified: true;
24
+ maxAge: 0;
25
+ redirect: true;
26
+ }) => (req: IncomingMessage, res: ServerResponse) => void;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ /*!
3
+ * serve-static
4
+ * Copyright(c) 2010 Sencha Inc.
5
+ * Copyright(c) 2011 TJ Holowaychuk
6
+ * Copyright(c) 2014-2016 Douglas Christopher Wilson
7
+ * MIT Licensed
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.serveStatic = void 0;
11
+ const path_1 = require("path");
12
+ const send = require('send');
13
+ /**
14
+ * @param {string} root
15
+ * @param {object} [options]
16
+ * @return {function}
17
+ * @public
18
+ */
19
+ const serveStatic = (root, options) => {
20
+ if (!root) {
21
+ throw new TypeError('root path required');
22
+ }
23
+ if (typeof root !== 'string') {
24
+ throw new TypeError('root path must be a string');
25
+ }
26
+ // copy options object
27
+ const opts = Object.create(options || null);
28
+ // headers listener
29
+ const { setHeaders } = opts;
30
+ if (setHeaders && typeof setHeaders !== 'function') {
31
+ throw new TypeError('option setHeaders must be function');
32
+ }
33
+ // setup options for send
34
+ opts.maxage = opts.maxage || opts.maxAge || 0;
35
+ opts.root = (0, path_1.resolve)(root);
36
+ return function (req, res) {
37
+ if (req.method !== 'GET' && req.method !== 'HEAD') {
38
+ // method not allowed
39
+ res.statusCode = 405;
40
+ res.setHeader('Allow', 'GET, HEAD');
41
+ res.setHeader('Content-Length', '0');
42
+ res.end();
43
+ return;
44
+ }
45
+ let path = new URL(req.url, 'http://localhost').pathname;
46
+ // make sure redirect occurs at mount
47
+ if (path === '/' && path.substr(-1) !== '/') {
48
+ path = '';
49
+ }
50
+ // create send stream
51
+ const stream = send(req, path, opts);
52
+ // add directory handler
53
+ stream.on('directory', () => {
54
+ res.writeHead(500);
55
+ res.write('Is a directory');
56
+ res.end();
57
+ });
58
+ // add headers listener
59
+ if (setHeaders) {
60
+ stream.on('headers', setHeaders);
61
+ }
62
+ // forward errors
63
+ stream.on('error', (err) => {
64
+ res.writeHead(500);
65
+ res.write(err.toString());
66
+ res.end();
67
+ });
68
+ // pipe
69
+ stream.pipe(res);
70
+ };
71
+ };
72
+ exports.serveStatic = serveStatic;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-environment.d.ts","sourceRoot":"","sources":["../src/setup-environment.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-environment.js","sourceRoot":"","sources":["../src/setup-environment.ts"],"names":[],"mappings":";;AAAA,uCAAmC;AAEnC,oBAAS,CAAC,iBAAiB,EAAE,CAAC;AAC9B,oBAAS,CAAC,iBAAiB,EAAE,CAAC;AAC9B,oBAAS,CAAC,qBAAqB,EAAE,CAAC;AAElC,oBAAS,CAAC,QAAQ,CAAC,SAAS,CAAC;;;;;;;CAO5B,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { WebpackOverrideFn } from 'remotion';
2
+ export declare const startServerPure: (entry: string, userDefinedComponent: string, options?: {
3
+ webpackOverride?: WebpackOverrideFn;
4
+ inputProps?: object;
5
+ envVariables?: Record<string, string>;
6
+ port: number | null;
7
+ maxTimelineTracks?: number;
8
+ }) => Promise<number>;
@@ -0,0 +1,68 @@
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.startServerPure = void 0;
7
+ const crypto_1 = __importDefault(require("crypto"));
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const http_1 = __importDefault(require("http"));
10
+ const os_1 = __importDefault(require("os"));
11
+ const path_1 = __importDefault(require("path"));
12
+ const remotion_1 = require("remotion");
13
+ const webpack_1 = __importDefault(require("webpack"));
14
+ const dev_middleware_1 = require("./dev-middleware");
15
+ const get_port_1 = require("./get-port");
16
+ const hot_middleware_1 = require("./hot-middleware");
17
+ const routes_1 = require("./routes");
18
+ const webpack_config_1 = require("./webpack-config");
19
+ const startServerPure = async (entry, userDefinedComponent, options) => {
20
+ var _a, _b, _c, _d, _e;
21
+ const tmpDir = await fs_1.default.promises.mkdtemp(path_1.default.join(os_1.default.tmpdir(), 'react-motion-graphics'));
22
+ const config = (0, webpack_config_1.webpackConfig)({
23
+ entry,
24
+ userDefinedComponent,
25
+ outDir: tmpDir,
26
+ environment: 'development',
27
+ webpackOverride: (_a = options === null || options === void 0 ? void 0 : options.webpackOverride) !== null && _a !== void 0 ? _a : remotion_1.Internals.getWebpackOverrideFn(),
28
+ inputProps: (_b = options === null || options === void 0 ? void 0 : options.inputProps) !== null && _b !== void 0 ? _b : {},
29
+ envVariables: (_c = options === null || options === void 0 ? void 0 : options.envVariables) !== null && _c !== void 0 ? _c : {},
30
+ maxTimelineTracks: (_d = options === null || options === void 0 ? void 0 : options.maxTimelineTracks) !== null && _d !== void 0 ? _d : 15,
31
+ });
32
+ const compiler = (0, webpack_1.default)(config);
33
+ const hash = `/static-${crypto_1.default.randomBytes(6).toString('hex')}`;
34
+ /**
35
+ * TODO: Put static server
36
+ */
37
+ const wdmMiddleware = (0, dev_middleware_1.wdm)(compiler);
38
+ const whm = (0, hot_middleware_1.webpackHotMiddleware)(compiler);
39
+ const server = http_1.default.createServer((request, response) => {
40
+ new Promise((resolve) => {
41
+ wdmMiddleware(request, response, () => {
42
+ resolve();
43
+ });
44
+ })
45
+ .then(() => {
46
+ return new Promise((resolve) => {
47
+ whm(request, response, () => {
48
+ resolve();
49
+ });
50
+ });
51
+ })
52
+ .then(() => {
53
+ (0, routes_1.handleRoutes)(hash, request, response);
54
+ })
55
+ .catch((err) => {
56
+ response.setHeader('content-type', 'application/json');
57
+ response.writeHead(500);
58
+ response.end(JSON.stringify({
59
+ err: err.message,
60
+ }));
61
+ });
62
+ });
63
+ const desiredPort = (_e = options === null || options === void 0 ? void 0 : options.port) !== null && _e !== void 0 ? _e : undefined;
64
+ const port = await (0, get_port_1.getDesiredPort)(desiredPort, 3000, 3100);
65
+ server.listen(port);
66
+ return port;
67
+ };
68
+ exports.startServerPure = startServerPure;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start-server.d.ts","sourceRoot":"","sources":["../src/start-server.ts"],"names":[],"mappings":"AAKA,OAAO,EAAY,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAiBtD,eAAO,MAAM,WAAW,UAChB,MAAM,wBACS,MAAM;;;;;;kBAQ1B,QAAQ,MAAM,CA+HhB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start-server.js","sourceRoot":"","sources":["../src/start-server.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,sDAA8B;AAC9B,4CAA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,IAAI,EAAE,IAAI,CAAC,CAAC;IAE3D,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACjB,OAAO,IAAI,CAAC;AACb,CAAC,CAAC;AAzIW,QAAA,WAAW,eAyItB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static-preview.d.ts","sourceRoot":"","sources":["../src/static-preview.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,eACT,MAAM,WACT,MAAM,cACH,MAAM,GAAG,IAAI,WAqClB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static-preview.js","sourceRoot":"","sources":["../src/static-preview.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAEjB,MAAM,SAAS,GAAG,CACxB,UAAkB,EAClB,OAAe,EACf,UAAyB,EACxB,EAAE,CACH;;;;;;;;;;;4CAW2C,UAAU;;;IAInD,UAAU;IACT,CAAC,CAAC,yCAAyC,UAAU,aAAa;IAClE,CAAC,CAAC,qDACJ;0CACwC,IAAI,CAAC,SAAS,CACrD,cAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAC5B;kCAC+B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;;;;;;;;;;iBAU9C,OAAO;;;CAGvB,CAAC,IAAI,EAAE,CAAC;AAxCI,QAAA,SAAS,aAwCb"}
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expect-to-throw.d.ts","sourceRoot":"","sources":["../../src/test/expect-to-throw.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,SAAU,QAAQ,OAAO,MAAM,SAWxD,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expect-to-throw.js","sourceRoot":"","sources":["../../src/test/expect-to-throw.ts"],"names":[],"mappings":";;;AAAO,MAAM,aAAa,GAAG,CAAC,IAAc,EAAE,GAAW,EAAE,EAAE;IAC5D,wEAAwE;IACxE,qDAAqD;IACrD,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7B,mBAAmB;IACnB,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAElD,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAE1B,mBAAmB;IACnB,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;AAC7B,CAAC,CAAC;AAXW,QAAA,aAAa,iBAWxB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latest-remotion-version.test.d.ts","sourceRoot":"","sources":["../../src/test/latest-remotion-version.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latest-remotion-version.test.js","sourceRoot":"","sources":["../../src/test/latest-remotion-version.test.ts"],"names":[],"mappings":";;AAAA,gFAAwE;AAExE,IAAI,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;IAC3D,MAAM,CAAC,MAAM,IAAA,sDAAwB,GAAE,CAAC,CAAC,OAAO,CAC/C,kCAAkC,CAClC,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-error-stack.test.d.ts","sourceRoot":"","sources":["../../src/test/parse-error-stack.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-error-stack.test.js","sourceRoot":"","sources":["../../src/test/parse-error-stack.test.ts"],"names":[],"mappings":";;AAAA,8GAA0G;AAE1G,MAAM,OAAO,GACZ,g0CAAg0C,CAAC;AACl0C,MAAM,KAAK,GACV,u0CAAu0C,CAAC;AAEz0C,IAAI,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAC9B,MAAM,CACL,IAAA,oDAAyB,EAAC;QACzB,KAAK;QACL,OAAO;QACP,IAAI,EAAE,OAAO;KACb,CAAC,CACF,CAAC,OAAO,CAAC;QACT,QAAQ,EAAE,+DAA+D;QACzE,UAAU,EAAE,EAAE;QACd,YAAY,EAAE,EAAE;QAChB,OAAO,EACN,qKAAqK;KACtK,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-module-not-found.test.d.ts","sourceRoot":"","sources":["../../src/test/parse-module-not-found.test.ts"],"names":[],"mappings":""}