asajs 4.1.2-indev → 4.1.3
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 +3 -1
- 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 +1 -0
- package/dist/js/compilers/bindings/Function.js +1 -0
- package/dist/js/compilers/bindings/Lexer.js +1 -0
- package/dist/js/compilers/bindings/Parser.js +3 -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 +12 -3
- 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 +9 -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/Parser.d.ts +1 -0
- package/dist/types/components/AnimationKeyframe.d.ts +4 -4
- package/package.json +1 -1
- 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/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
|
|
@@ -44,7 +44,7 @@ if (!fs.existsSync("asajs.config.js")) {
|
|
|
44
44
|
else {
|
|
45
45
|
fs.writeFileSync("asajs.config.js", [
|
|
46
46
|
'import { RandomBindingString } from "asajs"\n',
|
|
47
|
-
fs.readFileSync("node_modules/asajs/resources/example-config.js", "utf-8"),
|
|
47
|
+
fs.readFileSync(path.join(process.cwd(), "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
|
|
@@ -11,6 +11,7 @@ export class Parser {
|
|
|
11
11
|
genBindings = [];
|
|
12
12
|
output;
|
|
13
13
|
tokens;
|
|
14
|
+
static hasError = false;
|
|
14
15
|
constructor(input, cache = new Map(), tokens) {
|
|
15
16
|
this.input = input;
|
|
16
17
|
this.cache = cache;
|
|
@@ -330,6 +331,7 @@ export class Parser {
|
|
|
330
331
|
expect(kind, err) {
|
|
331
332
|
const prev = this.at() || this.last();
|
|
332
333
|
if (!prev || prev.kind !== kind) {
|
|
334
|
+
Parser.hasError = true;
|
|
333
335
|
throw new Error(`\x1b[31m${this.getPointer(prev)}\n` + `[ERROR]: ${err}\x1b[0m - Expected ${TokenKind[kind]}`);
|
|
334
336
|
}
|
|
335
337
|
}
|
|
@@ -352,3 +354,4 @@ export class Parser {
|
|
|
352
354
|
};
|
|
353
355
|
}
|
|
354
356
|
}
|
|
357
|
+
//# sourceMappingURL=Parser.js.map
|
|
@@ -8,6 +8,7 @@ import { disableRSP, enableRSP } from "./installer.js";
|
|
|
8
8
|
import { Log } from "../PreCompile.js";
|
|
9
9
|
import path from "path";
|
|
10
10
|
import { API_events } from "../../components/API.js";
|
|
11
|
+
import { Parser } from "../bindings/Parser.js";
|
|
11
12
|
async function buildUI() {
|
|
12
13
|
const build = Memory.build();
|
|
13
14
|
build.set("ui/_ui_defs.json", {
|
|
@@ -25,7 +26,7 @@ async function buildUI() {
|
|
|
25
26
|
const extend = value.extend;
|
|
26
27
|
return [extend ? key + String(extend) : key, value];
|
|
27
28
|
}))), "utf-8")
|
|
28
|
-
.then(() => Log("INFO", `${outFile} with ${Object.keys(value).length} elements created!`));
|
|
29
|
+
.then(() => Log("INFO", `${outFile.replace(/\\/g, "/")} with ${Object.keys(value).length} elements created!`));
|
|
29
30
|
build.delete(file);
|
|
30
31
|
return file;
|
|
31
32
|
}));
|
|
@@ -40,8 +41,11 @@ async function buildUI() {
|
|
|
40
41
|
BuildCache.set("version", version).then(() => Log("INFO", "version set!")),
|
|
41
42
|
fs
|
|
42
43
|
.stat(`${buildFolder}/pack_icon.png`)
|
|
43
|
-
.catch(() => fs
|
|
44
|
-
.
|
|
44
|
+
.catch(() => fs
|
|
45
|
+
.copyFile(isTestMode
|
|
46
|
+
? "resources/pack_icon.png"
|
|
47
|
+
: path.join(process.cwd(), "node_modules/asajs/resources/pack_icon.png"), `${buildFolder}/pack_icon.png`)
|
|
48
|
+
.then(() => Log("INFO", `${buildFolder}/pack_icon.png copied!`)))
|
|
45
49
|
.catch(() => Log("WARN", `cannot copy ${buildFolder}/pack_icon.png!`)),
|
|
46
50
|
]).catch(error => console.error(error));
|
|
47
51
|
return out.length;
|
|
@@ -51,6 +55,10 @@ if (isBuildMode) {
|
|
|
51
55
|
process.on("beforeExit", async () => {
|
|
52
56
|
if (first) {
|
|
53
57
|
first = false;
|
|
58
|
+
if (Parser.hasError) {
|
|
59
|
+
console.error();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
54
62
|
await createBuildFolder();
|
|
55
63
|
await buildUI();
|
|
56
64
|
if (isLinkMode)
|
|
@@ -77,3 +85,4 @@ else if (isLinkMode)
|
|
|
77
85
|
linkToGame();
|
|
78
86
|
else if (unLinked)
|
|
79
87
|
unlink();
|
|
88
|
+
//# sourceMappingURL=builder.js.map
|
package/dist/js/components/UI.js
CHANGED
|
@@ -5,8 +5,14 @@ import { Operation } from "../types/enums/Operation.js";
|
|
|
5
5
|
import { Class } from "./Class.js";
|
|
6
6
|
import { RandomString, ResolveBinding } from "./Utils.js";
|
|
7
7
|
import { RandomNamespace } from "../compilers/Random.js";
|
|
8
|
+
import nodepath from "path";
|
|
8
9
|
import util from "node:util";
|
|
9
|
-
import { config } from "../compilers/Configuration.js";
|
|
10
|
+
import { config, uiBuildFolder } from "../compilers/Configuration.js";
|
|
11
|
+
const fileExt = config.compiler?.fileExtension
|
|
12
|
+
? config.compiler.fileExtension.startsWith(".")
|
|
13
|
+
? config.compiler.fileExtension
|
|
14
|
+
: `.${config.compiler.fileExtension}`
|
|
15
|
+
: ".json";
|
|
10
16
|
export class UI extends Class {
|
|
11
17
|
type;
|
|
12
18
|
path;
|
|
@@ -32,7 +38,7 @@ export class UI extends Class {
|
|
|
32
38
|
this.name = name?.match(/^(\w|\/)+/)?.[0] || RandomString(16);
|
|
33
39
|
this.namespace = namespace || RandomNamespace();
|
|
34
40
|
if (!path)
|
|
35
|
-
this.path =
|
|
41
|
+
this.path = nodepath.join(uiBuildFolder, `${this.namespace}${fileExt}`);
|
|
36
42
|
else
|
|
37
43
|
this.path = path;
|
|
38
44
|
this.extendable = this.name.search("/") === -1;
|
|
@@ -343,3 +349,4 @@ export class ModifyUI extends UI {
|
|
|
343
349
|
return `\x1b[33mUI\x1b[0m<\x1b[92mmodify\x1b[0m> \x1b[92m"${this}\x1b[92m"\x1b[0m ${util.inspect(this.toJsonUIModify(), opts)}\n`;
|
|
344
350
|
}
|
|
345
351
|
}
|
|
352
|
+
//# 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;
|
|
@@ -15,8 +15,8 @@ export declare class AnimationKeyframe<T extends AnimType> extends Class {
|
|
|
15
15
|
clearNext(): this;
|
|
16
16
|
protected toJsonUI(): KeyframeAnimationProperties<AnimType>;
|
|
17
17
|
protected toJSON(): (Partial<import("../types/properties/element/Animation.js").DurationAnimation> & import("../types/properties/element/Animation.js").KeyframeAnimationPropertiesItem) | (Partial<import("../types/properties/element/Animation.js").AsepriteFlipBookAnimation> & import("../types/properties/element/Animation.js").KeyframeAnimationPropertiesItem) | {
|
|
18
|
-
from?: import("../types/properties/value.js").
|
|
19
|
-
to?: import("../types/properties/value.js").
|
|
18
|
+
from?: import("../types/properties/value.js").Array2<string | number> | undefined;
|
|
19
|
+
to?: import("../types/properties/value.js").Array2<string | number> | undefined;
|
|
20
20
|
duration?: import("../types/properties/value.js").Value<number> | undefined;
|
|
21
21
|
easing?: import("../types/properties/value.js").Value<string | import("../index.js").Easing> | undefined;
|
|
22
22
|
next?: import("../types/properties/value.js").Value<string | AnimationKeyframe<AnimType> | Animation<AnimType>>;
|
|
@@ -33,8 +33,8 @@ export declare class AnimationKeyframe<T extends AnimType> extends Class {
|
|
|
33
33
|
wait_until_rendered_to_play?: import("../types/properties/value.js").Value<boolean>;
|
|
34
34
|
anim_type: T;
|
|
35
35
|
} | {
|
|
36
|
-
from?: import("../types/properties/value.js").
|
|
37
|
-
to?: import("../types/properties/value.js").
|
|
36
|
+
from?: import("../types/properties/value.js").Value<number> | undefined;
|
|
37
|
+
to?: import("../types/properties/value.js").Value<number> | undefined;
|
|
38
38
|
duration?: import("../types/properties/value.js").Value<number> | undefined;
|
|
39
39
|
easing?: import("../types/properties/value.js").Value<string | import("../index.js").Easing> | undefined;
|
|
40
40
|
next?: import("../types/properties/value.js").Value<string | AnimationKeyframe<AnimType> | Animation<AnimType>>;
|
package/package.json
CHANGED
|
@@ -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;
|