@zerolith/cli 0.1.0-alpha.4 → 0.1.0-alpha.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @zerolith/cli
2
2
 
3
- The `zerolith` command line from npm: `new`, `dev`, which serves a project with its packages resolved from `node_modules`, `serve`, `build`, which bundles and minifies an application with Rolldown compiled into the binary, `preview`, `importmap`, and `doctor`. The binary is written in Rust; this package carries none itself and depends optionally on one package per platform, so npm installs only the binary that matches the machine.
3
+ The `zerolith` command line from npm: `new`, `dev`, which serves a project with its packages resolved from `node_modules` and forwards its API to a backend, `serve`, `build`, which bundles and minifies an application with Rolldown compiled into the binary, `preview`, `importmap`, and `doctor`. The binary is written in Rust; this package carries none itself and depends optionally on one package per platform, so npm installs only the binary that matches the machine.
4
4
 
5
5
  Install it once and start a project. `new` asks a few questions, each with a default, writes the starter, and installs its dependencies, this package among them:
6
6
 
@@ -26,6 +26,12 @@ The commands are documented in the [command line guide](https://molexxxx.github.
26
26
 
27
27
  Status: alpha. The commands and their flags may change before 1.0.
28
28
 
29
+ ## Documentation
30
+
31
+ - The [command line guide](https://molexxxx.github.io/zerolith/guide/command-line/) covers every command and option, and `zerolith.json`.
32
+ - [Building and serving](https://molexxxx.github.io/zerolith/guide/deploying/) covers what the build writes and how to serve it from a static host, a web server, or a backend.
33
+ - New to zerolith? The [tutorial](https://molexxxx.github.io/zerolith/learn/) builds an app step by step, and the [playground](https://molexxxx.github.io/zerolith/playground/) runs code in the browser.
34
+
29
35
  ## License
30
36
 
31
37
  Apache-2.0. See `LICENSE`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerolith/cli",
3
- "version": "0.1.0-alpha.4",
3
+ "version": "0.1.0-alpha.5",
4
4
  "description": "The zerolith command line from npm: a production build that bundles and minifies, a dev server that serves TypeScript and JSX without a build step, import maps with integrity hashes, project checks, and the scaffold, as a prebuilt native binary for the platform npm installs on",
5
5
  "license": "Apache-2.0",
6
6
  "author": "molexxxx",
@@ -28,11 +28,13 @@
28
28
  "zerolith": "dist/bin.js"
29
29
  },
30
30
  "exports": {
31
- "./package.json": "./package.json"
31
+ "./package.json": "./package.json",
32
+ "./zerolith.schema.json": "./zerolith.schema.json"
32
33
  },
33
34
  "files": [
34
35
  "dist",
35
36
  "src",
37
+ "zerolith.schema.json",
36
38
  "LICENSE",
37
39
  "README.md"
38
40
  ],
@@ -40,11 +42,11 @@
40
42
  "build": "tsc -p tsconfig.build.json"
41
43
  },
42
44
  "optionalDependencies": {
43
- "@zerolith/cli-darwin-arm64": "0.1.0-alpha.4",
44
- "@zerolith/cli-darwin-x64": "0.1.0-alpha.4",
45
- "@zerolith/cli-linux-arm64": "0.1.0-alpha.4",
46
- "@zerolith/cli-linux-x64": "0.1.0-alpha.4",
47
- "@zerolith/cli-win32-arm64": "0.1.0-alpha.4",
48
- "@zerolith/cli-win32-x64": "0.1.0-alpha.4"
45
+ "@zerolith/cli-darwin-arm64": "0.1.0-alpha.5",
46
+ "@zerolith/cli-darwin-x64": "0.1.0-alpha.5",
47
+ "@zerolith/cli-linux-arm64": "0.1.0-alpha.5",
48
+ "@zerolith/cli-linux-x64": "0.1.0-alpha.5",
49
+ "@zerolith/cli-win32-arm64": "0.1.0-alpha.5",
50
+ "@zerolith/cli-win32-x64": "0.1.0-alpha.5"
49
51
  }
50
52
  }
@@ -0,0 +1,89 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://molexxxx.github.io/zerolith/zerolith.schema.json",
4
+ "title": "zerolith.json",
5
+ "description": "The settings zerolith dev, serve, build, and preview share. A flag given on the command line overrides the file.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string",
11
+ "description": "The schema an editor validates this file against."
12
+ },
13
+ "base": {
14
+ "type": "string",
15
+ "description": "The public path the application is served under, such as /app/, for dev, build, and preview alike. ./ makes every URL the build writes relative to the page.",
16
+ "examples": ["/", "/app/", "./"]
17
+ },
18
+ "proxy": {
19
+ "type": "object",
20
+ "description": "Paths dev, serve, and preview forward to a backend, by the path prefix they start with, such as \"/api\": \"http://127.0.0.1:3000\".",
21
+ "propertyNames": {
22
+ "pattern": "^/"
23
+ },
24
+ "additionalProperties": {
25
+ "oneOf": [
26
+ {
27
+ "type": "string",
28
+ "pattern": "^http://",
29
+ "description": "The backend's address. The request's whole path is forwarded."
30
+ },
31
+ {
32
+ "type": "object",
33
+ "additionalProperties": false,
34
+ "required": ["target"],
35
+ "properties": {
36
+ "target": {
37
+ "type": "string",
38
+ "pattern": "^http://",
39
+ "description": "The backend's address, with an optional path the forwarded path goes under."
40
+ },
41
+ "stripPrefix": {
42
+ "type": "boolean",
43
+ "default": false,
44
+ "description": "Remove the matched prefix before forwarding, so /api/notes reaches the backend as /notes."
45
+ }
46
+ }
47
+ }
48
+ ]
49
+ }
50
+ },
51
+ "dev": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "properties": {
55
+ "port": {
56
+ "type": "integer",
57
+ "minimum": 0,
58
+ "maximum": 65535,
59
+ "default": 8080,
60
+ "description": "The port zerolith dev and serve listen on."
61
+ }
62
+ }
63
+ },
64
+ "preview": {
65
+ "type": "object",
66
+ "additionalProperties": false,
67
+ "properties": {
68
+ "port": {
69
+ "type": "integer",
70
+ "minimum": 0,
71
+ "maximum": 65535,
72
+ "default": 4173,
73
+ "description": "The port zerolith preview listens on."
74
+ }
75
+ }
76
+ },
77
+ "build": {
78
+ "type": "object",
79
+ "additionalProperties": false,
80
+ "properties": {
81
+ "out": {
82
+ "type": "string",
83
+ "default": "dist",
84
+ "description": "The output folder, relative to the project unless absolute, such as the static folder of a backend next to it."
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }