@triflare/fx 1.0.3 → 2.1.0-beta.1
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 +59 -0
- package/bin/fx.js +4 -1162
- package/package.json +8 -4
- package/product.yml +1 -1
- package/src/brand.js +9 -3
- package/src/catalog.js +103 -0
- package/src/cli/commands/build.js +98 -0
- package/src/cli/commands/catalog.js +42 -0
- package/src/cli/commands/check.js +44 -0
- package/src/cli/commands/completion.js +54 -0
- package/src/cli/commands/decompile.js +266 -0
- package/src/cli/commands/dev.js +179 -0
- package/src/cli/commands/extension.js +110 -0
- package/src/cli/commands/feature.js +114 -0
- package/src/cli/commands/fmt.js +173 -0
- package/src/cli/commands/index.js +45 -0
- package/src/cli/commands/init.js +169 -0
- package/src/cli/commands/lint.js +270 -0
- package/src/cli/commands/package.js +137 -0
- package/src/cli/commands/sprite/add.js +85 -0
- package/src/cli/commands/sprite/build.js +62 -0
- package/src/cli/commands/sprite/helpers.js +66 -0
- package/src/cli/commands/sprite/index.js +29 -0
- package/src/cli/commands/sprite/list.js +31 -0
- package/src/cli/commands/sprite/remove.js +51 -0
- package/src/cli/commands/vendor/add.js +98 -0
- package/src/cli/commands/vendor/helpers.js +50 -0
- package/src/cli/commands/vendor/index.js +39 -0
- package/src/cli/commands/vendor/install.js +64 -0
- package/src/cli/commands/vendor/list.js +45 -0
- package/src/cli/commands/vendor/migrate.js +47 -0
- package/src/cli/commands/vendor/outdated.js +51 -0
- package/src/cli/commands/vendor/remove.js +34 -0
- package/src/cli/commands/vendor/update.js +49 -0
- package/src/cli/commands/vendor/verify.js +44 -0
- package/src/cli/completion/bash.js +10 -0
- package/src/cli/completion/fish.js +9 -0
- package/src/cli/completion/index.js +97 -0
- package/src/cli/completion/zsh.js +11 -0
- package/src/cli/context.js +270 -0
- package/src/cli/define-command.js +147 -0
- package/src/cli/errors.js +111 -0
- package/src/cli/format.js +31 -0
- package/src/cli/prompts.js +183 -0
- package/src/cli/reporter.js +203 -0
- package/src/cli/run.js +248 -0
- package/src/cli/templates/index.js +112 -0
- package/src/cli/theme.js +84 -0
- package/src/compiler.js +133 -0
- package/src/config-edit.js +399 -1
- package/src/config.js +174 -4
- package/src/decompiler.js +45 -0
- package/src/extensions.js +72 -19
- package/src/features.js +339 -0
- package/src/formatter.js +499 -0
- package/src/index.js +31 -0
- package/src/lexer.js +45 -4
- package/src/lint/analyze.js +1414 -0
- package/src/lint/config-file.js +97 -0
- package/src/lint/config.js +174 -0
- package/src/lint/rules.js +461 -0
- package/src/linter.js +220 -0
- package/src/merge.js +109 -0
- package/src/parser.js +53 -13
- package/src/project.js +7 -87
- package/src/vendor.js +1323 -0
- package/vendor/pm-packager-dist/.fx-build.json +1 -1
- package/vendor/tempvars/fx-tempvars.js +321 -0
package/README.md
CHANGED
|
@@ -16,6 +16,8 @@ Code PenguinMod projects with text.
|
|
|
16
16
|
- [Highlights](#highlights)
|
|
17
17
|
- [Overview](#overview)
|
|
18
18
|
- [Usage](#usage)
|
|
19
|
+
- [Formatting](#formatting)
|
|
20
|
+
- [Vendoring Extensions](#vendoring-extensions)
|
|
19
21
|
- [Installation](#installation)
|
|
20
22
|
- [Feedback and Contributing](#feedback-and-contributing)
|
|
21
23
|
|
|
@@ -53,6 +55,63 @@ $ fx build
|
|
|
53
55
|
extensions: (none)
|
|
54
56
|
```
|
|
55
57
|
|
|
58
|
+
<!-- coderabbit-ai-generated:v1 -->
|
|
59
|
+
|
|
60
|
+
<!-- coderabbit-ai-generated-section:v1:1f825081f9f722158035083df5b16f42120cc5fbd7d56eb25c770f3c64e339b2 -->
|
|
61
|
+
|
|
62
|
+
## Formatting
|
|
63
|
+
|
|
64
|
+
Run `fx fmt` to format every `.tfx` source in the current directory, or pass a file or directory:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
fx fmt
|
|
68
|
+
fx fmt src/main.tfx
|
|
69
|
+
fx fmt src/ --check
|
|
70
|
+
cat src/main.tfx | fx fmt --stdin
|
|
71
|
+
fx fmt src/main.tfx --stdout
|
|
72
|
+
fx fmt --check --json
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
- `--check` leaves files untouched and exits with status 1 if formatting is needed (0 if already formatted).
|
|
76
|
+
- `--stdin` reads source from standard input and writes formatted source to standard output; it takes no file argument. With `--check`, it checks the input instead.
|
|
77
|
+
- `--stdout` writes formatted source for a single file to standard output without changing the file. It cannot be combined with `--check`.
|
|
78
|
+
- `--json` returns a structured result, including formatted code for `--stdin` and `--stdout` output.
|
|
79
|
+
|
|
80
|
+
Formatting is idempotent: running it twice produces no further changes. It preserves comments, declaration order, and project data, normalizes whitespace and line endings, and does not compile the project. Files with parse errors are left untouched.
|
|
81
|
+
|
|
82
|
+
## Vendoring Extensions
|
|
83
|
+
|
|
84
|
+
<!-- /coderabbit-ai-generated:v1 -->
|
|
85
|
+
|
|
86
|
+
Extension URLs are mutable and can disappear, so Fx can commit a verified copy of every extension instead. Declare them under `vendor:` in `fx.yml`; order is load order:
|
|
87
|
+
|
|
88
|
+
```yaml
|
|
89
|
+
vendorDir: extensions # default
|
|
90
|
+
vendor:
|
|
91
|
+
signals: https://example.com/signals.js
|
|
92
|
+
xterm:
|
|
93
|
+
url: http://localhost:8080/xterm.js
|
|
94
|
+
volatile: true
|
|
95
|
+
mything: ./src/mything.js
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`fx vendor install <url|path> --as <name>` copies the source to `extensions/`, records its SHA-256 in `fx.lock`, and adds it to `fx.yml`. Builds load the vendored copy and embed its source, so no network access is needed after installation. Remote entries fail if their hash changes; `volatile` entries (such as localhost URLs) warn instead. Local paths remain the source of truth and are re-copied on each build with a generated-file header.
|
|
99
|
+
|
|
100
|
+
`vendorDir` must be a directory inside the project directory.
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
fx vendor install # restore from fx.lock, fetching only missing files
|
|
104
|
+
fx vendor update [name] # show a diff and write updated files and fx.lock
|
|
105
|
+
fx vendor update [name] --dry-run # preview changes without writing
|
|
106
|
+
fx vendor outdated # compare upstream with fx.lock
|
|
107
|
+
fx vendor verify # check files against fx.lock, offline
|
|
108
|
+
fx vendor remove <name>
|
|
109
|
+
fx vendor list [--json]
|
|
110
|
+
fx vendor migrate # move project.extensions under vendor:
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
`fx vendor migrate` writes `fx.yml.bak` first and shows the config diff. Builds only offer migration when running in a terminal; use `--no-upgrade-prompt` or `FX_NO_PROMPT=1` to keep the legacy `project.extensions` behavior.
|
|
114
|
+
|
|
56
115
|
## Installation
|
|
57
116
|
|
|
58
117
|
**Requirements:**
|