@jsenv/core 40.0.2 → 40.0.4
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/{js → client/autoreload}/autoreload.js +45 -2
- package/dist/{html → client/directory_listing}/directory_listing.html +2 -2
- package/dist/{js → client/directory_listing/js}/directory_listing.js +3 -3
- package/dist/js/build.js +319 -15321
- package/dist/js/start_build_server.js +8 -4
- package/dist/js/start_dev_server.js +29 -35
- package/dist/jsenv_core.js +13 -1
- package/dist/jsenv_core_packages.js +10061 -0
- package/dist/main.js +117 -0
- package/dist/plugins.js +7944 -0
- package/package.json +17 -17
- package/src/build/build.js +61 -60
- package/src/build/build_params.js +20 -0
- package/src/build/build_specifier_manager.js +10 -0
- package/src/build/build_urls_generator.js +5 -1
- package/src/build/jsenv_plugin_subbuilds.js +71 -0
- package/src/dev/start_dev_server.js +21 -7
- package/src/kitchen/fetched_content_compliance.js +7 -3
- package/src/kitchen/kitchen.js +3 -0
- package/src/plugins/autoreload/jsenv_plugin_autoreload_client.js +1 -4
- package/src/plugins/html_syntax_error_fallback/jsenv_plugin_html_syntax_error_fallback.js +4 -3
- package/src/plugins/import_meta_hot/jsenv_plugin_import_meta_hot.js +2 -3
- package/src/plugins/protocol_file/jsenv_plugin_directory_listing.js +1 -2
- package/src/plugins/ribbon/jsenv_plugin_ribbon.js +2 -2
- package/dist/js/main.js +0 -994
- package/dist/js/process_teardown_events.js +0 -1848
- /package/dist/babel_helpers/{OverloadYield → overloadYield}/OverloadYield.js +0 -0
- /package/dist/{css → client/directory_listing/css}/directory_listing.css +0 -0
- /package/dist/{other → client/directory_listing/other}/dir.png +0 -0
- /package/dist/{other → client/directory_listing/other}/file.png +0 -0
- /package/dist/{other → client/directory_listing/other}/home.svg +0 -0
- /package/dist/{html → client/html_syntax_error}/html_syntax_error.html +0 -0
- /package/dist/{js → client/import_meta_hot}/import_meta_hot.js +0 -0
- /package/dist/{js → client/inline_content}/inline_content.js +0 -0
- /package/dist/{js → client/new_stylesheet}/new_stylesheet.js +0 -0
- /package/dist/{js → client/regenerator_runtime}/regenerator_runtime.js +0 -0
- /package/dist/{js → client/ribbon}/ribbon.js +0 -0
- /package/dist/{js → client/server_events_client}/server_events_client.js +0 -0
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { assertAndNormalizeDirectoryUrl, createLogger, Abort, raceProcessTeardownEvents, createTaskLog } from "
|
|
1
|
+
import { assertAndNormalizeDirectoryUrl, createLogger, Abort, raceProcessTeardownEvents, createTaskLog, urlToExtension, urlToPathname } from "../jsenv_core_packages.js";
|
|
2
2
|
import { startServer, jsenvServiceCORS, jsenvServiceErrorHandler, jsenvAccessControlAllowedHeaders, createFileSystemFetch } from "@jsenv/server";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
|
-
import
|
|
4
|
+
import "node:path";
|
|
5
|
+
import "node:crypto";
|
|
6
|
+
import "@jsenv/ast";
|
|
7
|
+
import "@jsenv/sourcemap";
|
|
8
|
+
import "node:url";
|
|
9
|
+
import "node:module";
|
|
10
|
+
import "@jsenv/js-module-fallback";
|
|
5
11
|
import "node:process";
|
|
6
12
|
import "node:os";
|
|
7
13
|
import "node:tty";
|
|
8
14
|
import "string-width";
|
|
9
|
-
import "node:url";
|
|
10
|
-
import "@jsenv/sourcemap";
|
|
11
15
|
|
|
12
16
|
/*
|
|
13
17
|
* startBuildServer is mean to interact with the build files;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { assertAndNormalizeDirectoryUrl, createLogger, createTaskLog } from "
|
|
1
|
+
import { moveUrl, urlIsInsideOf, ensureWindowsDriveLetter, memoizeByFirstArgument, assertAndNormalizeDirectoryUrl, urlToRelativeUrl, lookupPackageDirectory, createLogger, createTaskLog, URL_META, bufferToEtag } from "../jsenv_core_packages.js";
|
|
2
2
|
import { ServerEvents, jsenvServiceCORS, jsenvAccessControlAllowedHeaders, composeTwoResponses, serveDirectory, jsenvServiceErrorHandler, startServer } from "@jsenv/server";
|
|
3
3
|
import { convertFileSystemErrorToResponseProperties } from "@jsenv/server/src/internal/convertFileSystemErrorToResponseProperties.js";
|
|
4
|
-
import { URL_META } from "./main.js";
|
|
5
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
6
|
-
import {
|
|
5
|
+
import { createEventEmitter, watchSourceFiles, createPluginStore, getCorePlugins, defaultRuntimeCompat, createKitchen, createPluginController } from "../plugins.js";
|
|
7
6
|
import { parseHtml, injectJsenvScript, stringifyHtmlAst } from "@jsenv/ast";
|
|
8
7
|
import { createRequire } from "node:module";
|
|
8
|
+
import "node:path";
|
|
9
|
+
import "node:crypto";
|
|
10
|
+
import "@jsenv/sourcemap";
|
|
11
|
+
import "node:url";
|
|
12
|
+
import "@jsenv/js-module-fallback";
|
|
9
13
|
import "node:process";
|
|
10
14
|
import "node:os";
|
|
11
15
|
import "node:tty";
|
|
12
16
|
import "string-width";
|
|
13
|
-
import "node:url";
|
|
14
|
-
import "@jsenv/sourcemap";
|
|
15
17
|
import "@jsenv/runtime-compat";
|
|
16
|
-
import "node:path";
|
|
17
|
-
import "node:crypto";
|
|
18
18
|
import "node:perf_hooks";
|
|
19
19
|
import "@jsenv/plugin-supervisor";
|
|
20
|
-
import "
|
|
20
|
+
import "../main.js";
|
|
21
21
|
|
|
22
22
|
const WEB_URL_CONVERTER = {
|
|
23
23
|
asWebUrl: (fileUrl, webServer) => {
|
|
@@ -52,7 +52,7 @@ const WEB_URL_CONVERTER = {
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
const serverEventsClientFileUrl = new URL(
|
|
55
|
-
"
|
|
55
|
+
"../client/server_events_client/server_events_client.js",
|
|
56
56
|
import.meta.url,
|
|
57
57
|
).href;
|
|
58
58
|
|
|
@@ -146,26 +146,6 @@ const jsenvPluginServerEvents = ({ clientAutoreload }) => {
|
|
|
146
146
|
};
|
|
147
147
|
};
|
|
148
148
|
|
|
149
|
-
const memoizeByFirstArgument = (compute) => {
|
|
150
|
-
const urlCache = new Map();
|
|
151
|
-
|
|
152
|
-
const fnWithMemoization = (url, ...args) => {
|
|
153
|
-
const valueFromCache = urlCache.get(url);
|
|
154
|
-
if (valueFromCache) {
|
|
155
|
-
return valueFromCache;
|
|
156
|
-
}
|
|
157
|
-
const value = compute(url, ...args);
|
|
158
|
-
urlCache.set(url, value);
|
|
159
|
-
return value;
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
fnWithMemoization.forget = () => {
|
|
163
|
-
urlCache.clear();
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
return fnWithMemoization;
|
|
167
|
-
};
|
|
168
|
-
|
|
169
149
|
const requireFromJsenv = createRequire(import.meta.url);
|
|
170
150
|
|
|
171
151
|
const parseUserAgentHeader = memoizeByFirstArgument((userAgent) => {
|
|
@@ -190,12 +170,26 @@ const parseUserAgentHeader = memoizeByFirstArgument((userAgent) => {
|
|
|
190
170
|
const EXECUTED_BY_TEST_PLAN = process.argv.includes("--jsenv-test");
|
|
191
171
|
|
|
192
172
|
/**
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
* @param {
|
|
197
|
-
* @param {string
|
|
198
|
-
* @
|
|
173
|
+
* Starts the development server.
|
|
174
|
+
*
|
|
175
|
+
* @param {Object} [params={}] - Configuration params for the dev server.
|
|
176
|
+
* @param {number} [params.port=3456] - Port number the server should listen on.
|
|
177
|
+
* @param {string} [params.hostname="localhost"] - Hostname to bind the server to.
|
|
178
|
+
* @param {boolean} [params.https=false] - Whether to use HTTPS.
|
|
179
|
+
*
|
|
180
|
+
* @returns {Promise<Object>} A promise that resolves to the server instance.
|
|
181
|
+
* @throws {Error} Will throw an error if the server fails to start or is called with unexpected params.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* // Start a basic dev server
|
|
185
|
+
* const server = await startDevServer();
|
|
186
|
+
* console.log(`Server started at ${server.origin}`);
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* // Start a server with custom params
|
|
190
|
+
* const server = await startDevServer({
|
|
191
|
+
* port: 8080,
|
|
192
|
+
* });
|
|
199
193
|
*/
|
|
200
194
|
const startDevServer = async ({
|
|
201
195
|
sourceDirectoryUrl,
|
package/dist/jsenv_core.js
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
export { INJECTIONS, build, startBuildServer, startDevServer } from "./
|
|
1
|
+
export { INJECTIONS, build, startBuildServer, startDevServer } from "./main.js";
|
|
2
2
|
import "@jsenv/sourcemap";
|
|
3
|
+
import "./jsenv_core_packages.js";
|
|
4
|
+
import "node:path";
|
|
5
|
+
import "node:fs";
|
|
6
|
+
import "node:crypto";
|
|
7
|
+
import "@jsenv/ast";
|
|
8
|
+
import "node:url";
|
|
9
|
+
import "node:module";
|
|
10
|
+
import "@jsenv/js-module-fallback";
|
|
11
|
+
import "node:process";
|
|
12
|
+
import "node:os";
|
|
13
|
+
import "node:tty";
|
|
14
|
+
import "string-width";
|