asajs 4.0.0-indev-3 → 4.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.
Files changed (34) hide show
  1. package/README.md +56 -2
  2. package/config.d.ts +4 -1
  3. package/dist/js/compilers/Configuration.js +2 -2
  4. package/dist/js/compilers/Memory.js +1 -1
  5. package/dist/js/compilers/PreCompile.js +12 -1
  6. package/dist/js/compilers/ui/builder.js +32 -8
  7. package/dist/js/compilers/ui/installer.js +139 -4
  8. package/dist/js/compilers/ui/linker.js +28 -10
  9. package/dist/js/compilers/ui/manifest.js +3 -2
  10. package/dist/types/compilers/PreCompile.d.ts +2 -0
  11. package/dist/types/compilers/ui/installer.d.ts +11 -1
  12. package/dist/types/compilers/ui/linker.d.ts +1 -0
  13. package/dist/types/compilers/ui/manifest.d.ts +1 -0
  14. package/dist/types/types/vanilla/intellisense.d.ts +11194 -11194
  15. package/package.json +1 -1
  16. package/resources/asajs.config.cjs +5 -2
  17. package/dist/js/compilers/RunEnd.js +0 -7
  18. package/dist/js/compilers/bindings/Funtion.js +0 -71
  19. package/dist/js/compilers/ui/builddata.js +0 -4
  20. package/dist/js/compilers/ui/config.js +0 -1
  21. package/dist/js/compilers/ui/prevdata.js +0 -8
  22. package/dist/js/config..js +0 -1
  23. package/dist/js/config.js +0 -1
  24. package/dist/js/types/config.js +0 -1
  25. package/dist/js/types/enums/SmartAnimationType.js +0 -3
  26. package/dist/types/compilers/RunEnd.d.ts +0 -1
  27. package/dist/types/compilers/bindings/Funtion.d.ts +0 -7
  28. package/dist/types/compilers/ui/builddata.d.ts +0 -1
  29. package/dist/types/compilers/ui/config.d.ts +0 -1
  30. package/dist/types/compilers/ui/prevdata.d.ts +0 -3
  31. package/dist/types/config..d.ts +0 -2
  32. package/dist/types/config.d.ts +0 -13
  33. package/dist/types/types/config.d.ts +0 -13
  34. package/dist/types/types/enums/SmartAnimationType.d.ts +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asajs",
3
- "version": "4.0.0-indev-3",
3
+ "version": "4.0.0",
4
4
  "description": "Create your Minecraft JSON-UI resource packs using JavaScript",
5
5
  "keywords": [
6
6
  "Minecraft",
@@ -4,11 +4,14 @@
4
4
  */
5
5
  export const config = {
6
6
  packinfo: {
7
- name: "AsaJS",
7
+ name: "AsaJS - Installer Test",
8
8
  description: "Create your Minecraft JSON-UI resource packs using JavaScript.",
9
+ version: [4, 0, 0],
9
10
  },
10
11
  compiler: {
11
12
  enabled: true,
12
- linked: false,
13
+ autoImport: true,
14
+ autoEnable: true,
15
+ importToPreview: false,
13
16
  },
14
17
  }
@@ -1,7 +0,0 @@
1
- import { isBuildMode } from "./Configuration.js";
2
- import { Memory } from "./Memory.js";
3
- if (isBuildMode) {
4
- process.on("beforeExit", () => {
5
- console.log(JSON.stringify(Memory.build(), null, 2));
6
- });
7
- }
@@ -1,71 +0,0 @@
1
- import { RandomBindingString } from "../../components/Utils.js";
2
- import { Parser } from "./Parser.js";
3
- export const FunctionMap = new Map();
4
- function callFn(name, ...args) {
5
- return FunctionMap.get(name)(...args);
6
- }
7
- // Default Functions
8
- FunctionMap.set("abs", number => {
9
- const randomBinding = RandomBindingString(16);
10
- return {
11
- genBindings: [{ source: `((-1 + (${number} > 0) * 2) * ${number})`, target: randomBinding }],
12
- value: randomBinding,
13
- };
14
- });
15
- FunctionMap.set("new", expression => {
16
- const randomBinding = RandomBindingString(16);
17
- return {
18
- genBindings: [{ source: expression, target: randomBinding }],
19
- value: randomBinding,
20
- };
21
- });
22
- FunctionMap.set("sqrt", number => {
23
- const rtn = RandomBindingString(16), $1 = RandomBindingString(16), $2 = RandomBindingString(16);
24
- const { genBindings: absValue, value: absRtn } = callFn("abs", number);
25
- return {
26
- genBindings: [
27
- {
28
- source: `${number} * 100 / 2`,
29
- target: $1,
30
- },
31
- ...absValue,
32
- {
33
- source: `${absRtn} > 1`,
34
- target: $2,
35
- },
36
- {
37
- source: `(${number} < 0) * -1 + (${number} > -1) * (${$2} * ((${rtn} + ${number} / ${rtn}) / 2) + (not ${$2}) * ${rtn})`,
38
- target: rtn,
39
- },
40
- ],
41
- value: rtn,
42
- };
43
- });
44
- FunctionMap.set("translatable", key => {
45
- return {
46
- value: `'%' + ${key}`,
47
- };
48
- });
49
- FunctionMap.set("bin", input => {
50
- const { ret, bindings } = Parser.intToBin(input);
51
- bindings.push({
52
- source: `'§z' + ${Array.from({ length: 30 }, (_, i) => `${ret}${30 - i - 1}`).join(" + ")}`,
53
- target: ret,
54
- });
55
- return { genBindings: bindings, value: ret };
56
- });
57
- FunctionMap.set("bind", (value, bait) => {
58
- const ret = RandomBindingString(16);
59
- if (!bait) {
60
- throw new Error("Bait is required");
61
- }
62
- return {
63
- genBindings: [{ source: `((${bait} - ${bait}) + ${value})`, target: ret }],
64
- value: ret,
65
- };
66
- });
67
- FunctionMap.set("int", input => {
68
- return {
69
- value: input,
70
- };
71
- });
@@ -1,4 +0,0 @@
1
- try {
2
- }
3
- catch (error) { }
4
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import fs from "fs";
2
- export let prevData;
3
- try {
4
- prevData = JSON.parse(fs.readFileSync("build/build.json", "utf-8"));
5
- }
6
- catch (error) {
7
- prevData = { files: [] };
8
- }
@@ -1 +0,0 @@
1
- export {};
package/dist/js/config.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export var SmartAnimation;
2
- (function (SmartAnimation) {
3
- })(SmartAnimation || (SmartAnimation = {}));
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- import { Expression, GenBinding } from "./types.js";
2
- type Callback = (...args: Expression[]) => {
3
- genBindings?: GenBinding[];
4
- value: Expression;
5
- };
6
- export declare const FunctionMap: Map<string, Callback>;
7
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export declare let prevData: {
2
- files: string[];
3
- };
@@ -1,2 +0,0 @@
1
- export interface Config {
2
- }
@@ -1,13 +0,0 @@
1
- import { Variable } from "./src/types/properties/value.js";
2
- export interface Config {
3
- compiler?: {
4
- enabled?: boolean;
5
- linked?: boolean;
6
- };
7
- packinfo?: {
8
- name?: string;
9
- description?: string;
10
- version?: [number, number, number];
11
- };
12
- global_variables?: Record<Variable, string>;
13
- }
@@ -1,13 +0,0 @@
1
- import { Variable } from "./properties/value.js";
2
- export interface Config {
3
- compiler?: {
4
- enabled?: boolean;
5
- linked?: boolean;
6
- };
7
- packinfo?: {
8
- name?: string;
9
- description?: string;
10
- version?: [number, number, number];
11
- };
12
- global_variables?: Record<Variable, string>;
13
- }
@@ -1,2 +0,0 @@
1
- export declare enum SmartAnimation {
2
- }