asajs 4.1.1 → 4.1.3-indev
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/config.d.ts +1 -0
- package/dist/js/analyzer/generate-code.js +1 -0
- package/dist/js/analyzer/generate-ui-defs.js +1 -0
- package/dist/js/analyzer/rebaseUIFiles.js +12 -25
- package/dist/js/analyzer/utils.js +1 -0
- package/dist/js/analyzer/vanilladefs.js +1 -0
- package/dist/js/compilers/Configuration.js +4 -2
- package/dist/js/compilers/FormatProperties.js +1 -0
- package/dist/js/compilers/Memory.js +1 -0
- package/dist/js/compilers/PreCompile.js +1 -0
- package/dist/js/compilers/Random.js +1 -0
- package/dist/js/compilers/bindings/Binary.js +1 -0
- package/dist/js/compilers/bindings/Checker.js +7 -0
- package/dist/js/compilers/bindings/Function.js +48 -1
- package/dist/js/compilers/bindings/Lexer.js +1 -0
- package/dist/js/compilers/bindings/Parser.js +1 -0
- package/dist/js/compilers/bindings/index.js +1 -0
- package/dist/js/compilers/bindings/types.js +1 -0
- package/dist/js/compilers/ui/buildcache.js +1 -0
- package/dist/js/compilers/ui/builder.js +1 -0
- package/dist/js/compilers/ui/installer.js +1 -0
- package/dist/js/compilers/ui/linker.js +1 -0
- package/dist/js/compilers/ui/manifest.js +1 -0
- package/dist/js/components/API.js +1 -0
- package/dist/js/components/Animation.js +1 -0
- package/dist/js/components/AnimationKeyframe.js +1 -0
- package/dist/js/components/Class.js +1 -0
- package/dist/js/components/KeyframeController.js +1 -0
- package/dist/js/components/UI.js +3 -2
- package/dist/js/components/Utils.js +1 -0
- package/dist/js/index.js +1 -0
- package/dist/js/types/enums/Anchor.js +1 -0
- package/dist/js/types/enums/AnimType.js +1 -0
- package/dist/js/types/enums/ArrayName.js +1 -0
- package/dist/js/types/enums/BagBinding.js +1 -0
- package/dist/js/types/enums/Binding.js +1 -0
- package/dist/js/types/enums/BindingCondition.js +1 -0
- package/dist/js/types/enums/BindingType.js +1 -0
- package/dist/js/types/enums/ButtonId.js +1 -0
- package/dist/js/types/enums/ClipDirection.js +1 -0
- package/dist/js/types/enums/CollectionName.js +1 -0
- package/dist/js/types/enums/Color.js +1 -0
- package/dist/js/types/enums/DebugColor.js +1 -0
- package/dist/js/types/enums/Easing.js +1 -0
- package/dist/js/types/enums/FocusNavigationMode.js +1 -0
- package/dist/js/types/enums/FontSize.js +1 -0
- package/dist/js/types/enums/FontType.js +1 -0
- package/dist/js/types/enums/GlobalVariables.js +1 -0
- package/dist/js/types/enums/GridDimensions.js +1 -0
- package/dist/js/types/enums/InputModeCondition.js +1 -0
- package/dist/js/types/enums/Items.js +1 -0
- package/dist/js/types/enums/Links.js +1 -0
- package/dist/js/types/enums/MappingType.js +1 -0
- package/dist/js/types/enums/McColor.js +1 -0
- package/dist/js/types/enums/Operation.js +1 -0
- package/dist/js/types/enums/Orientation.js +1 -0
- package/dist/js/types/enums/Renderer.js +1 -0
- package/dist/js/types/enums/Rotation.js +1 -0
- package/dist/js/types/enums/Scope.js +1 -0
- package/dist/js/types/enums/SliderName.js +1 -0
- package/dist/js/types/enums/SmartAnimation.js +1 -0
- package/dist/js/types/enums/TextAlignment.js +1 -0
- package/dist/js/types/enums/TextType.js +1 -0
- package/dist/js/types/enums/TextboxName.js +1 -0
- package/dist/js/types/enums/ToggleName.js +1 -0
- package/dist/js/types/enums/Type.js +1 -0
- package/dist/js/types/enums/index.js +1 -0
- package/dist/js/types/properties/components.js +1 -0
- package/dist/js/types/properties/element/Animation.js +1 -0
- package/dist/js/types/properties/element/Button.js +1 -0
- package/dist/js/types/properties/element/CarouselLabel.js +1 -0
- package/dist/js/types/properties/element/Collection.js +1 -0
- package/dist/js/types/properties/element/Control.js +1 -0
- package/dist/js/types/properties/element/CustomRenderer.js +1 -0
- package/dist/js/types/properties/element/Cycler.js +1 -0
- package/dist/js/types/properties/element/DataBinding.js +1 -0
- package/dist/js/types/properties/element/DropdownName.js +1 -0
- package/dist/js/types/properties/element/EditBox.js +1 -0
- package/dist/js/types/properties/element/Factory.js +1 -0
- package/dist/js/types/properties/element/Focus.js +1 -0
- package/dist/js/types/properties/element/Grid.js +1 -0
- package/dist/js/types/properties/element/GridItem.js +1 -0
- package/dist/js/types/properties/element/GridPageIndicator.js +1 -0
- package/dist/js/types/properties/element/Input.js +1 -0
- package/dist/js/types/properties/element/Layout.js +1 -0
- package/dist/js/types/properties/element/Screen.js +1 -0
- package/dist/js/types/properties/element/ScrollView.js +1 -0
- package/dist/js/types/properties/element/SelectionWheel.js +1 -0
- package/dist/js/types/properties/element/Slider.js +1 -0
- package/dist/js/types/properties/element/Sliderbox.js +1 -0
- package/dist/js/types/properties/element/Sound.js +1 -0
- package/dist/js/types/properties/element/Sprite.js +1 -0
- package/dist/js/types/properties/element/StackPanel.js +1 -0
- package/dist/js/types/properties/element/TTS.js +1 -0
- package/dist/js/types/properties/element/Tab.js +1 -0
- package/dist/js/types/properties/element/Text.js +1 -0
- package/dist/js/types/properties/element/Toggle.js +1 -0
- package/dist/js/types/properties/element/TooltipTrigger.js +1 -0
- package/dist/js/types/properties/element/index.js +1 -0
- package/dist/js/types/properties/index.js +1 -0
- package/dist/js/types/properties/value.js +1 -0
- package/dist/js/types/vanilla/index.js +1 -0
- package/dist/js/types/vanilla/intellisense.js +1 -0
- package/dist/js/types/vanilla/paths.js +1 -0
- package/dist/types/compilers/Configuration.d.ts +1 -0
- package/dist/types/compilers/bindings/Checker.d.ts +2 -0
- package/dist/types/compilers/bindings/Function.d.ts +7 -0
- package/package.json +1 -1
- package/asajs.config.js +0 -51
- package/dist/js/analyzer/custom-ui.js +0 -1
- package/dist/js/analyzer/generate-ui-code.js +0 -1
- package/dist/js/analyzer/rebase.js +0 -29
- package/dist/js/analyzer/remove-not-ui.js +0 -29
- package/dist/types/analyzer/custom-ui.d.ts +0 -1
- package/dist/types/analyzer/generate-ui-code.d.ts +0 -1
- package/dist/types/analyzer/rebase.d.ts +0 -1
- package/dist/types/analyzer/remove-not-ui.d.ts +0 -1
- /package/resources/{asajs.config.js → example-config.js} +0 -0
package/config.d.ts
CHANGED
|
@@ -9,33 +9,20 @@ export function rebaseUIFiles(pack_folder) {
|
|
|
9
9
|
ui.add("ui/_global_variables.json");
|
|
10
10
|
if (!fs.existsSync(targetDir))
|
|
11
11
|
return;
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (
|
|
19
|
-
fs.
|
|
12
|
+
for (const relativePath of ui) {
|
|
13
|
+
const fullPath = path.join(targetDir, relativePath);
|
|
14
|
+
if (fs.existsSync(fullPath) && fs.statSync(fullPath).isFile()) {
|
|
15
|
+
try {
|
|
16
|
+
const fileContent = fs.readFileSync(fullPath, "utf-8");
|
|
17
|
+
const parsedData = parse(fileContent);
|
|
18
|
+
if (parsedData !== undefined) {
|
|
19
|
+
fs.writeFileSync(fullPath, JSON.stringify(parsedData, null, 4), "utf-8");
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const normalizedPath = relativePath.split(path.sep).join("/");
|
|
25
|
-
if (ui.has(normalizedPath)) {
|
|
26
|
-
try {
|
|
27
|
-
const fileContent = fs.readFileSync(fullPath, "utf-8");
|
|
28
|
-
const parsedData = parse(fileContent);
|
|
29
|
-
if (parsedData !== undefined) {
|
|
30
|
-
fs.writeFileSync(fullPath, JSON.stringify(parsedData, null, 4), "utf-8");
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
catch (error) {
|
|
34
|
-
console.error(`Parser error: ${fullPath}`, error);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
console.error(`Parser error: ${fullPath}`, error);
|
|
37
24
|
}
|
|
38
25
|
}
|
|
39
|
-
}
|
|
40
|
-
processDirectory(targetDir);
|
|
26
|
+
}
|
|
41
27
|
}
|
|
28
|
+
//# sourceMappingURL=rebaseUIFiles.js.map
|
|
@@ -143586,3 +143586,4 @@ export const vanilladefs = {
|
|
|
143586
143586
|
}
|
|
143587
143587
|
}
|
|
143588
143588
|
};
|
|
143589
|
+
//# sourceMappingURL=vanilladefs.js.map
|
|
@@ -38,13 +38,13 @@ if (!fs.existsSync("asajs.config.js")) {
|
|
|
38
38
|
|
|
39
39
|
return \`#$\{out.join("")}\`
|
|
40
40
|
}\n`,
|
|
41
|
-
fs.readFileSync("resources/
|
|
41
|
+
fs.readFileSync("resources/example-config.js", "utf-8").replace("asajs/", "./"),
|
|
42
42
|
].join("\n"));
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
45
|
fs.writeFileSync("asajs.config.js", [
|
|
46
46
|
'import { RandomBindingString } from "asajs"\n',
|
|
47
|
-
fs.readFileSync("node_modules/asajs/resources/
|
|
47
|
+
fs.readFileSync("node_modules/asajs/resources/example-config.js", "utf-8"),
|
|
48
48
|
].join("\n"));
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -53,6 +53,7 @@ export const isBuildMode = options["build"] ?? config.compiler?.enabled ?? false
|
|
|
53
53
|
export const isLinkMode = options["link"] ?? config.compiler?.autoImport ?? false;
|
|
54
54
|
export const unLinked = options["unlink"] ?? !(config.compiler?.autoImport ?? true);
|
|
55
55
|
export const buildFolder = config.compiler?.buildFolder || "build";
|
|
56
|
+
export const uiBuildFolder = config.compiler?.uiBuildFolder || "asajs";
|
|
56
57
|
export const bindingFuntions = config.binding_functions;
|
|
57
58
|
if (!fs.existsSync(".gitignore")) {
|
|
58
59
|
fs.writeFileSync(".gitignore", "node_modules\ncustom", "utf-8");
|
|
@@ -72,3 +73,4 @@ if (config.ui_analyzer?.enabled) {
|
|
|
72
73
|
}
|
|
73
74
|
});
|
|
74
75
|
}
|
|
76
|
+
//# sourceMappingURL=Configuration.js.map
|
|
@@ -22,6 +22,13 @@ export function isCompileBinding(input) {
|
|
|
22
22
|
export function isHasBinding(input) {
|
|
23
23
|
return /#\w+/.test(input);
|
|
24
24
|
}
|
|
25
|
+
export function isBinding(input) {
|
|
26
|
+
return /^#\w+$/.test(input);
|
|
27
|
+
}
|
|
28
|
+
export function isNumber(input) {
|
|
29
|
+
return /^[+-]?(?:\d+|\d+\.\d*|\.\d+)(?:[eE][+-]?\d+)?$/.test(input);
|
|
30
|
+
}
|
|
25
31
|
export function isString(input) {
|
|
26
32
|
return /^'.+'$/.test(input);
|
|
27
33
|
}
|
|
34
|
+
//# sourceMappingURL=Checker.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RandomBindingString, RandomString, ResolveBinding } from "../../components/Utils.js";
|
|
2
2
|
import { bindingFuntions } from "../Configuration.js";
|
|
3
|
-
import { isString } from "./Checker.js";
|
|
3
|
+
import { isBinding, isNumber, isString } from "./Checker.js";
|
|
4
4
|
export const FunctionMap = new Map();
|
|
5
5
|
export const defaultFunctions = {
|
|
6
6
|
/**
|
|
@@ -117,6 +117,11 @@ export const defaultFunctions = {
|
|
|
117
117
|
value: count,
|
|
118
118
|
};
|
|
119
119
|
},
|
|
120
|
+
not_contains: (source_str, contains_str) => {
|
|
121
|
+
return {
|
|
122
|
+
value: `(${source_str} - ${contains_str}) = ${source_str}`,
|
|
123
|
+
};
|
|
124
|
+
},
|
|
120
125
|
contains: (source_str, contains_str) => {
|
|
121
126
|
return {
|
|
122
127
|
value: `not ((${source_str} - ${contains_str}) = ${source_str})`,
|
|
@@ -170,6 +175,47 @@ export const defaultFunctions = {
|
|
|
170
175
|
}
|
|
171
176
|
}
|
|
172
177
|
},
|
|
178
|
+
str_slice: (str, start, end) => {
|
|
179
|
+
const prefix = `'asajs:${RandomString(5)}:'`;
|
|
180
|
+
const genStrBinds = {
|
|
181
|
+
source: ``,
|
|
182
|
+
target: RandomBindingString(),
|
|
183
|
+
};
|
|
184
|
+
if (isBinding(str))
|
|
185
|
+
genStrBinds.source = `(${prefix} + ${str})`;
|
|
186
|
+
else if (isString(str))
|
|
187
|
+
genStrBinds.source = `${prefix.slice(0, -1)}${str.slice(1)}`;
|
|
188
|
+
else
|
|
189
|
+
throw new Error("Invalid str");
|
|
190
|
+
if (isBinding(start))
|
|
191
|
+
start = `('%.' + (${prefix.length - 2} + ${start}) + 's')`;
|
|
192
|
+
else if (isNumber(start))
|
|
193
|
+
start = `'%.${+start + prefix.length - 2}s'`;
|
|
194
|
+
else
|
|
195
|
+
throw new Error("Invalid start");
|
|
196
|
+
if (end) {
|
|
197
|
+
if (isBinding(end))
|
|
198
|
+
end = `('%.' + (${prefix.length - 2} + ${end}) + 's')`;
|
|
199
|
+
else if (isNumber(end))
|
|
200
|
+
end = `'%.${+end + prefix.length - 2}s'`;
|
|
201
|
+
else
|
|
202
|
+
throw new Error("Invalid end");
|
|
203
|
+
const sliceEnd = {
|
|
204
|
+
source: `(${end} * ${genStrBinds.target})`,
|
|
205
|
+
target: RandomBindingString(),
|
|
206
|
+
};
|
|
207
|
+
return {
|
|
208
|
+
genBindings: [genStrBinds, sliceEnd],
|
|
209
|
+
value: `${sliceEnd.target} - (${start} * ${sliceEnd.target})`,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
return {
|
|
214
|
+
genBindings: [genStrBinds],
|
|
215
|
+
value: `${genStrBinds.target} - (${start} * ${genStrBinds.target})`,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
},
|
|
173
219
|
/**
|
|
174
220
|
* Return a translatable string
|
|
175
221
|
* @param key
|
|
@@ -243,3 +289,4 @@ if (bindingFuntions)
|
|
|
243
289
|
};
|
|
244
290
|
});
|
|
245
291
|
});
|
|
292
|
+
//# sourceMappingURL=Function.js.map
|
package/dist/js/components/UI.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Class } from "./Class.js";
|
|
|
6
6
|
import { RandomString, ResolveBinding } from "./Utils.js";
|
|
7
7
|
import { RandomNamespace } from "../compilers/Random.js";
|
|
8
8
|
import util from "node:util";
|
|
9
|
-
import { config } from "../compilers/Configuration.js";
|
|
9
|
+
import { config, uiBuildFolder } from "../compilers/Configuration.js";
|
|
10
10
|
export class UI extends Class {
|
|
11
11
|
type;
|
|
12
12
|
path;
|
|
@@ -32,7 +32,7 @@ export class UI extends Class {
|
|
|
32
32
|
this.name = name?.match(/^(\w|\/)+/)?.[0] || RandomString(16);
|
|
33
33
|
this.namespace = namespace || RandomNamespace();
|
|
34
34
|
if (!path)
|
|
35
|
-
this.path =
|
|
35
|
+
this.path = `${uiBuildFolder}/${this.namespace}${config.compiler?.fileExtension ? (config.compiler.fileExtension.startsWith(".") ? config.compiler.fileExtension : `.${config.compiler.fileExtension}`) : ".json"}`;
|
|
36
36
|
else
|
|
37
37
|
this.path = path;
|
|
38
38
|
this.extendable = this.name.search("/") === -1;
|
|
@@ -343,3 +343,4 @@ export class ModifyUI extends UI {
|
|
|
343
343
|
return `\x1b[33mUI\x1b[0m<\x1b[92mmodify\x1b[0m> \x1b[92m"${this}\x1b[92m"\x1b[0m ${util.inspect(this.toJsonUIModify(), opts)}\n`;
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
+
//# sourceMappingURL=UI.js.map
|
package/dist/js/index.js
CHANGED
|
@@ -2792,3 +2792,4 @@ export var Binding;
|
|
|
2792
2792
|
Binding["EDU_AI_LESSON_CRAFTER_ON"] = "#edu_ai_lesson_crafter_on";
|
|
2793
2793
|
Binding["EDITIONS_VISIBLE_AND_NOT_REALMS_PROMO_VISIBLE"] = "#editions_visible_and_not_realms_promo_visible";
|
|
2794
2794
|
})(Binding || (Binding = {}));
|
|
2795
|
+
//# sourceMappingURL=Binding.js.map
|
|
@@ -85,3 +85,4 @@ export var GridDimensions;
|
|
|
85
85
|
GridDimensions["PROGRESSIONS_GRID_DIMENSION"] = "#progressions_grid_dimension";
|
|
86
86
|
GridDimensions["DEV_NEW_ACHIEVEMENTS_SCREENS_RADIO_DIMENSION"] = "#dev_new_achievements_screens_radio_dimension";
|
|
87
87
|
})(GridDimensions || (GridDimensions = {}));
|
|
88
|
+
//# sourceMappingURL=GridDimensions.js.map
|
|
@@ -1488,3 +1488,4 @@ export var ItemAuxID;
|
|
|
1488
1488
|
ItemAuxID[ItemAuxID["ZOMBIE_SPAWN_EGG"] = 31457280] = "ZOMBIE_SPAWN_EGG";
|
|
1489
1489
|
ItemAuxID[ItemAuxID["ZOMBIE_VILLAGER_SPAWN_EGG"] = 33488896] = "ZOMBIE_VILLAGER_SPAWN_EGG";
|
|
1490
1490
|
})(ItemAuxID || (ItemAuxID = {}));
|
|
1491
|
+
//# sourceMappingURL=Items.js.map
|
|
@@ -5,4 +5,5 @@ export declare const isBuildMode: {};
|
|
|
5
5
|
export declare const isLinkMode: {};
|
|
6
6
|
export declare const unLinked: {};
|
|
7
7
|
export declare const buildFolder: string;
|
|
8
|
+
export declare const uiBuildFolder: string;
|
|
8
9
|
export declare const bindingFuntions: Record<string, (...args: string[]) => RetBindingValue> | undefined;
|
|
@@ -6,4 +6,6 @@ export declare function isBinaryChar(char: string): boolean;
|
|
|
6
6
|
export declare function isOctalChar(char: string): boolean;
|
|
7
7
|
export declare function isCompileBinding(input: string): boolean;
|
|
8
8
|
export declare function isHasBinding(input: string): boolean;
|
|
9
|
+
export declare function isBinding(input: string): boolean;
|
|
10
|
+
export declare function isNumber(input: string): boolean;
|
|
9
11
|
export declare function isString(input: string): boolean;
|
|
@@ -63,6 +63,9 @@ export declare const defaultFunctions: {
|
|
|
63
63
|
}[];
|
|
64
64
|
value: `#${string}`;
|
|
65
65
|
};
|
|
66
|
+
not_contains: (source_str: string, contains_str: string) => {
|
|
67
|
+
value: string;
|
|
68
|
+
};
|
|
66
69
|
contains: (source_str: string, contains_str: string) => {
|
|
67
70
|
value: string;
|
|
68
71
|
};
|
|
@@ -76,6 +79,10 @@ export declare const defaultFunctions: {
|
|
|
76
79
|
}[];
|
|
77
80
|
value: string;
|
|
78
81
|
};
|
|
82
|
+
str_slice: (str: string, start: string, end: string) => {
|
|
83
|
+
genBindings: GenBinding[];
|
|
84
|
+
value: string;
|
|
85
|
+
};
|
|
79
86
|
/**
|
|
80
87
|
* Return a translatable string
|
|
81
88
|
* @param key
|
package/package.json
CHANGED
package/asajs.config.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export function RandomBindingString(length, base = 32) {
|
|
2
|
-
const chars = "0123456789abcdefghijklmnopqrstuvwxyz".slice(0, base)
|
|
3
|
-
const out = new Array()
|
|
4
|
-
|
|
5
|
-
try {
|
|
6
|
-
const buffer = new Uint8Array(length)
|
|
7
|
-
crypto.getRandomValues(buffer)
|
|
8
|
-
for (let i = 0; i < length; i++) {
|
|
9
|
-
out[i] = chars[buffer[i] % base]
|
|
10
|
-
}
|
|
11
|
-
} catch {
|
|
12
|
-
for (let i = 0; i < length; i++) {
|
|
13
|
-
out[i] = chars[Math.floor(Math.random() * base)]
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return `#${out.join("")}`
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Configuration object for the AsaJS build process.
|
|
22
|
-
* @type {import('./config.d.ts').Config}
|
|
23
|
-
*/
|
|
24
|
-
export const config = {
|
|
25
|
-
packinfo: {
|
|
26
|
-
name: "AsaJS",
|
|
27
|
-
description: "Create your Minecraft JSON-UI resource packs using JavaScript.",
|
|
28
|
-
version: [1, 0, 0],
|
|
29
|
-
},
|
|
30
|
-
compiler: {
|
|
31
|
-
enabled: true,
|
|
32
|
-
autoImport: true,
|
|
33
|
-
autoEnable: true,
|
|
34
|
-
importToPreview: false,
|
|
35
|
-
},
|
|
36
|
-
binding_functions: {
|
|
37
|
-
custom_abs: function (number) {
|
|
38
|
-
const randomAbs = RandomBindingString(16)
|
|
39
|
-
|
|
40
|
-
return {
|
|
41
|
-
generate_bindings: [
|
|
42
|
-
{
|
|
43
|
-
source_property_name: `[ abs(${number}) ]`,
|
|
44
|
-
target_property_name: randomAbs,
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
return_value: randomAbs,
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { uiFiles } from "./utils.js";
|
|
4
|
-
export function rebaseUIFiles(pack_folder) {
|
|
5
|
-
const ui = uiFiles(pack_folder);
|
|
6
|
-
const targetDir = path.join("custom", pack_folder);
|
|
7
|
-
if (!fs.existsSync(targetDir))
|
|
8
|
-
return;
|
|
9
|
-
const processDirectory = (currentDir) => {
|
|
10
|
-
const entries = fs.readdirSync(currentDir, { withFileTypes: true });
|
|
11
|
-
for (const entry of entries) {
|
|
12
|
-
const fullPath = path.join(currentDir, entry.name);
|
|
13
|
-
if (entry.isDirectory()) {
|
|
14
|
-
processDirectory(fullPath);
|
|
15
|
-
if (fs.readdirSync(fullPath).length === 0) {
|
|
16
|
-
fs.rmdirSync(fullPath);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
else if (entry.isFile()) {
|
|
20
|
-
const relativePath = fullPath.replace(targetDir + path.sep, "");
|
|
21
|
-
const normalizedPath = relativePath.split(path.sep).join("/");
|
|
22
|
-
if (!ui.has(normalizedPath)) {
|
|
23
|
-
fs.rmSync(fullPath, { force: true });
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
processDirectory(targetDir);
|
|
29
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { uiFiles } from "./utils.js";
|
|
4
|
-
export function removeNotUIFiles(pack_folder) {
|
|
5
|
-
const ui = uiFiles(pack_folder);
|
|
6
|
-
const targetDir = path.join("custom", pack_folder);
|
|
7
|
-
if (!fs.existsSync(targetDir))
|
|
8
|
-
return;
|
|
9
|
-
const processDirectory = (currentDir) => {
|
|
10
|
-
const entries = fs.readdirSync(currentDir, { withFileTypes: true });
|
|
11
|
-
for (const entry of entries) {
|
|
12
|
-
const fullPath = path.join(currentDir, entry.name);
|
|
13
|
-
if (entry.isDirectory()) {
|
|
14
|
-
processDirectory(fullPath);
|
|
15
|
-
if (fs.readdirSync(fullPath).length === 0) {
|
|
16
|
-
fs.rmdirSync(fullPath);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
else if (entry.isFile()) {
|
|
20
|
-
const relativePath = fullPath.replace(targetDir + path.sep, "");
|
|
21
|
-
const normalizedPath = relativePath.split(path.sep).join("/");
|
|
22
|
-
if (!ui.has(normalizedPath)) {
|
|
23
|
-
fs.rmSync(fullPath, { force: true });
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
processDirectory(targetDir);
|
|
29
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function rebaseUIFiles(pack_folder: string): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function removeNotUIFiles(pack_folder: string): void;
|
|
File without changes
|