@jsenv/core 40.2.1 → 40.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -33
- package/dist/build/build.js +369 -149
- package/dist/client/directory_listing/jsenv_core_node_modules.js +2 -2
- package/dist/client/html_syntax_error/html_syntax_error.html +1 -1
- package/dist/jsenv_core_packages.js +282 -129
- package/dist/start_dev_server/start_dev_server.js +298 -28
- package/package.json +20 -19
- package/src/build/build.js +70 -92
- package/src/build/build_specifier_manager.js +10 -29
- package/src/dev/start_dev_server.js +9 -0
- package/src/kitchen/kitchen.js +11 -0
- package/src/kitchen/url_graph/references.js +13 -13
- package/src/kitchen/url_graph/url_graph.js +21 -1
- package/src/plugins/html_syntax_error_fallback/client/html_syntax_error.html +1 -1
- package/src/plugins/html_syntax_error_fallback/jsenv_plugin_html_syntax_error_fallback.js +2 -10
- package/src/plugins/package_side_effects/jsenv_plugin_package_side_effects.js +227 -0
- package/src/plugins/plugin_controller.js +5 -2
- package/src/plugins/plugins.js +7 -0
- package/src/plugins/protocol_file/jsenv_plugin_directory_listing.js +6 -5
- package/src/plugins/protocol_file/jsenv_plugin_protocol_file.js +2 -0
package/README.md
CHANGED
|
@@ -2,50 +2,59 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@jsenv/core)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Overview
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Jsenv is a suite of tools for JavaScript projects that prioritizes standards and simplicity, making it ideal for both beginners and those who need straightforward tools.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
2. **build**; Optimizes source files into a specified directory for production.
|
|
11
|
-
3. **build server**; Serves the built files, allowing for testing and verifying the production build.
|
|
12
|
-
4. **test runner**; Runs test files concurrently, ensuring code reliability.
|
|
9
|
+
## Installation
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
```console
|
|
12
|
+
npm install --save-dev @jsenv/core
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
> **Compatibility**: Tested on Mac, Windows, and Linux with Node.js 20. Other environments are not officially tested.
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
## Documentation
|
|
17
18
|
|
|
18
|
-
For
|
|
19
|
+
For comprehensive documentation, see the full [user documentation](https://github.com/jsenv/core/blob/main/docs/users/users.md).
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
## Basic Usage
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- Extensive browser support during dev: Allows the use of various browsers beyond the latest Chrome, which is useful for reproducing browser-specific bugs. -->
|
|
23
|
+
Start a development server:
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import { startDevServer } from "@jsenv/core";
|
|
27
|
+
|
|
28
|
+
await startDevServer({
|
|
29
|
+
sourceDirectoryUrl: import.meta.resolve("./"),
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
The following commands can be used to skip the prompt
|
|
33
|
+
## Core Features
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
| ------------------------------------------- |
|
|
38
|
-
| `npm create jsenv@latest -- --web` |
|
|
39
|
-
| `npm create jsenv@latest -- --web-preact` |
|
|
40
|
-
| `npm create jsenv@latest -- --web-react` |
|
|
41
|
-
| `npm create jsenv@latest -- --node-package` |
|
|
42
|
-
-->
|
|
35
|
+
`@jsenv/core` provides four main tools:
|
|
43
36
|
|
|
44
|
-
|
|
37
|
+
1. **Dev Server**: Serves source files with live reloading to facilitate development
|
|
38
|
+
2. **Build**: Optimizes source files into a specified directory for production
|
|
39
|
+
3. **Build Server**: Serves the built files, allowing for testing and verifying the production build
|
|
40
|
+
4. **Test Runner**: Runs test files concurrently to ensure code reliability
|
|
41
|
+
|
|
42
|
+
## Key Advantages
|
|
43
|
+
|
|
44
|
+
- **Standards-first approach**: Built on web standards rather than custom abstractions
|
|
45
|
+
- **Robust versioning**: Avoids cascading hash changes during builds
|
|
46
|
+
- **Broad browser compatibility**: Works with modern and older browsers
|
|
47
|
+
- **Isolated testing**: Prevents cross-test contamination
|
|
48
|
+
- **Simple API**: Designed for clarity and ease of use
|
|
49
|
+
|
|
50
|
+
## Quick Start
|
|
51
|
+
|
|
52
|
+
The easiest way to try jsenv is with the CLI:
|
|
45
53
|
|
|
46
54
|
```console
|
|
47
|
-
|
|
55
|
+
npx @jsenv/cli
|
|
48
56
|
```
|
|
49
57
|
|
|
50
|
-
|
|
51
|
-
|
|
58
|
+
The CLI provides templates for web applications, React projects, and Node.js packages to get you started quickly.
|
|
59
|
+
|
|
60
|
+
Read more in [@jsenv/cli](https://github.com/jsenv/core/tree/main/packages/related/cli#jsenvcli).
|