@triflare/fx 1.0.2 → 2.0.0
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 +32 -0
- package/bin/fx.js +4 -1160
- package/package.json +9 -3
- package/product.yml +1 -1
- package/src/brand.js +9 -3
- package/src/build.js +2 -1
- package/src/catalog.js +117 -140
- 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/index.js +39 -0
- package/src/cli/commands/init.js +169 -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 +257 -0
- package/src/cli/define-command.js +140 -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 +194 -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 +32 -3
- package/src/config-edit.js +280 -1
- package/src/config.js +137 -3
- package/src/decompiler.js +12 -2
- package/src/extensions.js +311 -48
- package/src/index.js +21 -0
- package/src/vendor.js +1323 -0
- package/vendor/pm-packager-dist/.fx-build.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@triflare/fx",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Code PenguinMod projects with text.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
"bin": {
|
|
9
9
|
"fx": "bin/fx.js"
|
|
10
10
|
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/triflare/fx.git"
|
|
14
|
+
},
|
|
11
15
|
"exports": {
|
|
12
16
|
".": "./src/index.js",
|
|
13
17
|
"./catalog": "./src/catalog.js",
|
|
@@ -36,12 +40,14 @@
|
|
|
36
40
|
"prepack": "node scripts/build-packager.js --if-missing"
|
|
37
41
|
},
|
|
38
42
|
"dependencies": {
|
|
39
|
-
"
|
|
40
|
-
"quickjs-emscripten": "^0.32.0",
|
|
43
|
+
"@clack/prompts": "^1.8.1",
|
|
41
44
|
"@fiahfy/icns": "0.0.7",
|
|
42
45
|
"@turbowarp/sbdl": "^7.0.0",
|
|
46
|
+
"commander": "^15.0.0",
|
|
43
47
|
"cross-fetch": "^4.1.0",
|
|
48
|
+
"js-yaml": "^5.4.3",
|
|
44
49
|
"jszip": "^3.10.1",
|
|
50
|
+
"quickjs-emscripten": "^0.32.0",
|
|
45
51
|
"sha.js": "^2.4.12"
|
|
46
52
|
},
|
|
47
53
|
"devDependencies": {
|
package/product.yml
CHANGED
package/src/brand.js
CHANGED
|
@@ -62,9 +62,10 @@ const HEX_COLOR = /^#(?:[\da-f]{3}|[\da-f]{6})$/i;
|
|
|
62
62
|
// styleText only learned hex colors in Node 24.16, and engines allow any 22, so
|
|
63
63
|
// the truecolor escape is built here. The gate is styleText's own: ask it to
|
|
64
64
|
// color a marker, and stay plain when it comes back untouched.
|
|
65
|
-
function colorize(text, color, stream) {
|
|
65
|
+
function colorize(text, color, stream, force = false) {
|
|
66
66
|
if (!HEX_COLOR.test(color)) return styleText(color, text, { stream });
|
|
67
|
-
if (!styleText("red", "\u0000", { stream }).includes("\u001b"))
|
|
67
|
+
if (!force && !styleText("red", "\u0000", { stream }).includes("\u001b"))
|
|
68
|
+
return text;
|
|
68
69
|
const digits =
|
|
69
70
|
color.length === 4 ? color.slice(1).replace(/./g, "$&$&") : color.slice(1);
|
|
70
71
|
const [red, green, blue] = digits
|
|
@@ -76,7 +77,11 @@ function colorize(text, color, stream) {
|
|
|
76
77
|
// Paints a product name or command in three equal bands taken straight from the
|
|
77
78
|
// logo palette. The colors disappear when the stream can't render them, so
|
|
78
79
|
// piped output and CI logs stay plain text.
|
|
79
|
-
export function brandText(
|
|
80
|
+
export function brandText(
|
|
81
|
+
text,
|
|
82
|
+
stream = process.stdout,
|
|
83
|
+
{ force = false } = {},
|
|
84
|
+
) {
|
|
80
85
|
const { primary, secondary, tertiary } = brandingColors();
|
|
81
86
|
const palette = [primary, secondary, tertiary];
|
|
82
87
|
const chars = Array.from(text);
|
|
@@ -96,6 +101,7 @@ export function brandText(text, stream = process.stdout) {
|
|
|
96
101
|
chars.slice(start, index).join(""),
|
|
97
102
|
palette[bandFor(start)],
|
|
98
103
|
stream,
|
|
104
|
+
force,
|
|
99
105
|
),
|
|
100
106
|
);
|
|
101
107
|
start = index;
|
package/src/build.js
CHANGED
|
@@ -98,7 +98,7 @@ function resolveSources(options) {
|
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
100
|
* @param {BuildOptions} [options]
|
|
101
|
-
* @returns {{project: object, assets: Map<string, Buffer>, sb3: Buffer, config: object, fx: object, ast: object, files: string[]}}
|
|
101
|
+
* @returns {{project: object, assets: Map<string, Buffer>, sb3: Buffer, config: object, fx: object, ast: object, files: string[], warnings: string[]}}
|
|
102
102
|
*/
|
|
103
103
|
export function build(options = {}) {
|
|
104
104
|
const { dir, entries } = resolveSources(options);
|
|
@@ -155,6 +155,7 @@ export function build(options = {}) {
|
|
|
155
155
|
fx: fxConfig,
|
|
156
156
|
ast,
|
|
157
157
|
files: entries.map((e) => e.file),
|
|
158
|
+
warnings: compiler.warnings,
|
|
158
159
|
};
|
|
159
160
|
}
|
|
160
161
|
|