zois-core 2.2.0 → 3.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/dist/assets/icons/toast-themes/abdl/bottle.svg +10 -0
- package/dist/assets/icons/toast-themes/abdl/diaper.svg +11 -0
- package/dist/assets/icons/toast-themes/abdl/heart.svg +7 -0
- package/dist/assets/icons/toast-themes/abdl/sparkle.svg +5 -0
- package/dist/assets/icons/toast-themes/abdl/star.svg +5 -0
- package/dist/assets/icons/toast-themes/abdl/teddy.svg +18 -0
- package/dist/assets/icons/toast-themes/anime/error.svg +20 -0
- package/dist/assets/icons/toast-themes/anime/info.svg +20 -0
- package/dist/assets/icons/toast-themes/anime/success.svg +16 -0
- package/dist/assets/icons/toast-themes/anime/warning.svg +19 -0
- package/dist/changelogs.js +628 -295
- package/dist/cssVars.js +46 -0
- package/dist/dialogs.js +523 -83
- package/dist/events.js +28 -6
- package/dist/index.js +27 -70
- package/dist/localization.js +250 -40
- package/dist/messaging.js +1 -1
- package/dist/migration.js +37 -0
- package/dist/modules/baseModule.js +110 -0
- package/dist/modules/index.js +4 -0
- package/dist/modules/loadingStrategy.js +20 -0
- package/dist/modules/moduleContext.js +56 -0
- package/dist/modules/modulesManager.js +175 -0
- package/dist/{modSdk.js → patching.js} +33 -9
- package/dist/rpc.js +139 -0
- package/dist/scripts/zois-core.js +18 -0
- package/dist/settings.js +90 -0
- package/dist/settingsDialog.js +1361 -0
- package/dist/shard-modules/{attributesModule.js → attributes.js} +2 -2
- package/dist/shard-modules/{shardModule.js → base.js} +2 -2
- package/dist/shard-modules/{centerModule.js → center.js} +4 -2
- package/dist/shard-modules/{clickModule.js → click.js} +2 -2
- package/dist/shard-modules/{counterUpModule.js → counterUp.js} +2 -2
- package/dist/shard-modules/{dynamicClassModule.js → dynamicClass.js} +2 -2
- package/dist/shard-modules/index.js +9 -9
- package/dist/shard-modules/{multiClickModule.js → multiClick.js} +2 -2
- package/dist/shard-modules/{styleModule.js → style.js} +2 -2
- package/dist/shard-modules/{typeModule.js → type.js} +2 -2
- package/dist/shards/backNextButton.js +173 -0
- package/dist/shards/{shard.js → base.js} +15 -15
- package/dist/shards/{buttonShard.js → button.js} +30 -52
- package/dist/shards/{cardShard.js → card.js} +4 -4
- package/dist/shards/{checkboxShard.js → checkbox.js} +6 -13
- package/dist/shards/{containerShard.js → container.js} +2 -2
- package/dist/shards/extensionsStorageBar.js +377 -0
- package/dist/shards/fileInput.js +180 -0
- package/dist/shards/flexContainer.js +30 -0
- package/dist/shards/gridContainer.js +34 -0
- package/dist/shards/{imageShard.js → image.js} +8 -6
- package/dist/shards/index.js +17 -13
- package/dist/shards/{inputShard.js → input.js} +4 -4
- package/dist/shards/{inputListShard.js → inputList.js} +22 -4
- package/dist/shards/select.js +201 -0
- package/dist/shards/svg.js +28 -0
- package/dist/shards/{tabsShard.js → tabs.js} +18 -19
- package/dist/shards/{textShard.js → text.js} +4 -4
- package/dist/shared.js +215 -0
- package/dist/styles.css +0 -51
- package/dist/subscreens/customTranslations.js +239 -0
- package/dist/subscreens/languageDetails.js +194 -0
- package/dist/subscreens/localization.js +115 -0
- package/dist/toast-themes/abdl.js +419 -0
- package/dist/toast-themes/anime.js +483 -0
- package/dist/toast-themes/base.js +40 -0
- package/dist/toast-themes/cyber.js +538 -0
- package/dist/toast-themes/default.js +282 -0
- package/dist/toastThemesDialog.js +274 -0
- package/dist/toasts.js +195 -174
- package/dist/types/cssVars.d.ts +1 -0
- package/dist/types/dialogs.d.ts +46 -18
- package/dist/types/events.d.ts +11 -2
- package/dist/types/global.d.ts +4 -3
- package/dist/types/index.d.ts +12 -19
- package/dist/types/localization.d.ts +25 -3
- package/dist/types/migration.d.ts +6 -0
- package/dist/types/modules/baseModule.d.ts +108 -0
- package/dist/types/modules/index.d.ts +4 -0
- package/dist/types/modules/loadingStrategy.d.ts +7 -0
- package/dist/types/modules/moduleContext.d.ts +9 -0
- package/dist/types/modules/modulesManager.d.ts +23 -0
- package/dist/types/{modSdk.d.ts → patching.d.ts} +2 -3
- package/dist/types/rpc.d.ts +72 -0
- package/dist/types/settings.d.ts +19 -0
- package/dist/types/settingsDialog.d.ts +4 -0
- package/dist/types/shard-modules/{attributesModule.d.ts → attributes.d.ts} +2 -2
- package/dist/types/shard-modules/{shardModule.d.ts → base.d.ts} +2 -2
- package/dist/types/shard-modules/{centerModule.d.ts → center.d.ts} +2 -1
- package/dist/types/shard-modules/{clickModule.d.ts → click.d.ts} +2 -2
- package/dist/types/shard-modules/{counterUpModule.d.ts → counterUp.d.ts} +2 -2
- package/dist/types/shard-modules/{dynamicClassModule.d.ts → dynamicClass.d.ts} +2 -2
- package/dist/types/shard-modules/index.d.ts +9 -9
- package/dist/types/shard-modules/{multiClickModule.d.ts → multiClick.d.ts} +2 -2
- package/dist/types/shard-modules/{styleModule.d.ts → style.d.ts} +2 -2
- package/dist/types/shard-modules/{typeModule.d.ts → type.d.ts} +2 -2
- package/dist/types/shards/{backNextButtonShard.d.ts → backNextButton.d.ts} +4 -3
- package/dist/types/shards/{shard.d.ts → base.d.ts} +3 -2
- package/dist/types/shards/{buttonShard.d.ts → button.d.ts} +6 -6
- package/dist/types/shards/{cardShard.d.ts → card.d.ts} +3 -3
- package/dist/types/shards/{checkboxShard.d.ts → checkbox.d.ts} +5 -5
- package/dist/types/shards/{containerShard.d.ts → container.d.ts} +2 -2
- package/dist/types/shards/extensionsStorageBar.d.ts +28 -0
- package/dist/types/shards/fileInput.d.ts +10 -0
- package/dist/types/shards/flexContainer.d.ts +14 -0
- package/dist/types/shards/gridContainer.d.ts +18 -0
- package/dist/types/shards/{imageShard.d.ts → image.d.ts} +2 -2
- package/dist/types/shards/index.d.ts +17 -13
- package/dist/types/shards/{inputShard.d.ts → input.d.ts} +3 -3
- package/dist/types/shards/{inputListShard.d.ts → inputList.d.ts} +3 -2
- package/dist/types/shards/{selectShard.d.ts → select.d.ts} +6 -4
- package/dist/types/shards/svg.d.ts +11 -0
- package/dist/types/shards/{tabsShard.d.ts → tabs.d.ts} +3 -6
- package/dist/types/shards/{textShard.d.ts → text.d.ts} +3 -3
- package/dist/types/shared.d.ts +7 -0
- package/dist/types/subscreens/customTranslations.d.ts +10 -0
- package/dist/types/subscreens/languageDetails.d.ts +14 -0
- package/dist/types/subscreens/localization.d.ts +5 -0
- package/dist/types/toast-themes/abdl.d.ts +9 -0
- package/dist/types/toast-themes/anime.d.ts +9 -0
- package/dist/types/toast-themes/base.d.ts +39 -0
- package/dist/types/toast-themes/cyber.d.ts +10 -0
- package/dist/types/toast-themes/default.d.ts +9 -0
- package/dist/types/toastThemesDialog.d.ts +1 -0
- package/dist/types/toasts.d.ts +48 -36
- package/dist/types/ui.d.ts +128 -49
- package/dist/types/validation.d.ts +5 -0
- package/dist/ui.js +414 -79
- package/dist/validation.js +79 -1
- package/dist/wardrobe.js +2 -2
- package/package.json +37 -15
- package/dist/core-subscreen/coreSubscreen.js +0 -81
- package/dist/core-subscreen/developmentSubscreen.js +0 -22
- package/dist/core-subscreen/generalSubscreen.js +0 -23
- package/dist/core-subscreen/mainSubscreen.js +0 -58
- package/dist/core-subscreen/shards/coreButtonShard.js +0 -30
- package/dist/core-subscreen/shards/coreCheckboxShard.js +0 -33
- package/dist/core-subscreen/shards/coreInputListShard.js +0 -38
- package/dist/core-subscreen/shards/coreSelectShard.js +0 -17
- package/dist/core-subscreen/shards/coreTextShard.js +0 -9
- package/dist/core-subscreen/shards/index.js +0 -5
- package/dist/core-subscreen/toastsSubscreen.js +0 -111
- package/dist/core.js +0 -192
- package/dist/shards/backNextButtonShard.js +0 -99
- package/dist/shards/selectShard.js +0 -131
- package/dist/shards/svgShard.js +0 -29
- package/dist/types/core-subscreen/coreSubscreen.d.ts +0 -15
- package/dist/types/core-subscreen/developmentSubscreen.d.ts +0 -5
- package/dist/types/core-subscreen/generalSubscreen.d.ts +0 -5
- package/dist/types/core-subscreen/mainSubscreen.d.ts +0 -6
- package/dist/types/core-subscreen/shards/coreButtonShard.d.ts +0 -5
- package/dist/types/core-subscreen/shards/coreCheckboxShard.d.ts +0 -6
- package/dist/types/core-subscreen/shards/coreInputListShard.d.ts +0 -6
- package/dist/types/core-subscreen/shards/coreSelectShard.d.ts +0 -5
- package/dist/types/core-subscreen/shards/coreTextShard.d.ts +0 -4
- package/dist/types/core-subscreen/shards/index.d.ts +0 -5
- package/dist/types/core-subscreen/toastsSubscreen.d.ts +0 -5
- package/dist/types/core.d.ts +0 -18
- package/dist/types/shards/svgShard.d.ts +0 -12
- package/scripts/zois-core.mjs +0 -184
package/scripts/zois-core.mjs
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import fs from "fs/promises";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
import { Octokit } from "@octokit/rest";
|
|
5
|
-
import { existsSync } from "fs";
|
|
6
|
-
import { simpleGit } from "simple-git";
|
|
7
|
-
import { Terminal } from "./lib/terminal.mjs";
|
|
8
|
-
|
|
9
|
-
const octokit = new Octokit();
|
|
10
|
-
const terminal = new Terminal("zois-core");
|
|
11
|
-
const git = simpleGit();
|
|
12
|
-
const args = process.argv.slice(2);
|
|
13
|
-
const command = args[0];
|
|
14
|
-
const cwd = process.cwd();
|
|
15
|
-
const CHANGELOG_CONFIG_FILE_NAME = "changelog.config.json";
|
|
16
|
-
const CHANGELOG_BUNDLE_FILE_NAME = "changelog.json";
|
|
17
|
-
|
|
18
|
-
function getArg(name) {
|
|
19
|
-
const arg = args.find((a) => a.startsWith("--" + name));
|
|
20
|
-
if (arg) return arg.slice(name.length + 3);
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
switch (command) {
|
|
25
|
-
case "generate-changelog": {
|
|
26
|
-
generateChangelog().catch((err) => {
|
|
27
|
-
terminal.error(chalk.red("Script failed:"), err.message);
|
|
28
|
-
process.exit(1);
|
|
29
|
-
});
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
default: {
|
|
33
|
-
terminal.log(chalk.red("Unknown command"), `"${chalk.cyan(command)}"`);
|
|
34
|
-
terminal.log("Available commands:")
|
|
35
|
-
terminal.log(`• ${chalk.cyan("generate-changelog")} — Generate changelog bundle`)
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async function getCommitsSince(owner, repo, sinceSha, perPage = 50) {
|
|
40
|
-
const commits = [];
|
|
41
|
-
let page = 1;
|
|
42
|
-
let hasMore = true;
|
|
43
|
-
|
|
44
|
-
try {
|
|
45
|
-
while (hasMore) {
|
|
46
|
-
const { data } = await octokit.rest.repos.listCommits({
|
|
47
|
-
owner,
|
|
48
|
-
repo,
|
|
49
|
-
sha: "HEAD",
|
|
50
|
-
per_page: perPage,
|
|
51
|
-
page: page,
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
if (data.length === 0) break;
|
|
55
|
-
|
|
56
|
-
const startIndex = data.findIndex((commit) => commit.sha === sinceSha);
|
|
57
|
-
|
|
58
|
-
if (startIndex !== -1) {
|
|
59
|
-
commits.push(...data.slice(0, startIndex + 1));
|
|
60
|
-
break;
|
|
61
|
-
} else {
|
|
62
|
-
commits.push(...data);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
page++;
|
|
66
|
-
hasMore = data.length === perPage;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return commits.map((commit) => ({
|
|
70
|
-
sha: commit.sha,
|
|
71
|
-
message: commit.commit.message,
|
|
72
|
-
date: commit.commit.author.date,
|
|
73
|
-
author: {
|
|
74
|
-
name: commit.author?.login || commit.commit.author.name,
|
|
75
|
-
avatar_url: commit.author?.avatar_url,
|
|
76
|
-
html_url: commit.author?.html_url,
|
|
77
|
-
},
|
|
78
|
-
committer: {
|
|
79
|
-
name: commit.committer?.login || commit.commit.committer.name,
|
|
80
|
-
avatar_url: commit.committer?.avatar_url,
|
|
81
|
-
}
|
|
82
|
-
}));
|
|
83
|
-
|
|
84
|
-
} catch (error) {
|
|
85
|
-
terminal.log(chalk.red("Error getting commits:"), error.message);
|
|
86
|
-
throw error;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
async function getGitRemote() {
|
|
91
|
-
try {
|
|
92
|
-
const remotes = await git.getRemotes(true);
|
|
93
|
-
const origin = remotes.find(r => r.name === "origin");
|
|
94
|
-
|
|
95
|
-
if (!origin || !origin.refs || !origin.refs.fetch) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const url = origin.refs.fetch;
|
|
100
|
-
const match = url.match(/(?:[:/])([^/]+)\/([^/]+?)(?:\.git)?$/);
|
|
101
|
-
|
|
102
|
-
if (!match) {
|
|
103
|
-
throw new Error("Git remote could not be identified:", url);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return {
|
|
107
|
-
owner: match[1],
|
|
108
|
-
name: match[2],
|
|
109
|
-
url
|
|
110
|
-
};
|
|
111
|
-
} catch (err) {
|
|
112
|
-
terminal.log(chalk.red(err));
|
|
113
|
-
return null;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
async function generateChangelog() {
|
|
118
|
-
let config;
|
|
119
|
-
if (existsSync(path.join(cwd, CHANGELOG_CONFIG_FILE_NAME))) {
|
|
120
|
-
const configText = await fs.readFile(path.join(cwd, CHANGELOG_CONFIG_FILE_NAME), "utf-8");
|
|
121
|
-
|
|
122
|
-
try {
|
|
123
|
-
config = JSON.parse(configText);
|
|
124
|
-
} catch {
|
|
125
|
-
terminal.log(chalk.red(`Failed to parse ${CHANGELOG_CONFIG_FILE_NAME}`));
|
|
126
|
-
}
|
|
127
|
-
} else {
|
|
128
|
-
terminal.log(`${CHANGELOG_CONFIG_FILE_NAME} was not detected`);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const repo = await getGitRemote();
|
|
132
|
-
if (repo === null) {
|
|
133
|
-
terminal.log(chalk.red("Git remote is not detected"));
|
|
134
|
-
process.exit(1);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
const { owner: repoOwner, name: repoName } = repo;
|
|
138
|
-
|
|
139
|
-
const fromCommit = getArg("from");
|
|
140
|
-
if (!fromCommit) {
|
|
141
|
-
terminal.log(chalk.red("--from argument not specified"));
|
|
142
|
-
process.exit(1);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
terminal.log(`Generating changelog from commit ${chalk.cyan(fromCommit)}...`);
|
|
146
|
-
|
|
147
|
-
const commits = await getCommitsSince(repoOwner, repoName, fromCommit);
|
|
148
|
-
|
|
149
|
-
const contributors = [];
|
|
150
|
-
for (const commit of commits) {
|
|
151
|
-
const name = config?.overrides?.authors?.[commit.author.name]?.name ? config.overrides.authors[commit.author.name].name : commit.author.name;
|
|
152
|
-
if (contributors.find((p) => p.name === name)) continue;
|
|
153
|
-
const avatar_url = config?.overrides?.authors?.[commit.author.name]?.avatar_url ? config.overrides.authors[commit.author.name].avatar_url : (commit.author.avatar_url ?? "https://avatars.githubusercontent.com/" + commit.author.name);
|
|
154
|
-
const is_owner = commit.author.name === repoOwner;
|
|
155
|
-
contributors.push({
|
|
156
|
-
name,
|
|
157
|
-
avatar_url,
|
|
158
|
-
is_owner
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const resultToWrite = {
|
|
163
|
-
generated_at: (new Date()).toISOString(),
|
|
164
|
-
contributors,
|
|
165
|
-
changes: commits.map((commit) => ({
|
|
166
|
-
message: commit.message,
|
|
167
|
-
sha: commit.sha,
|
|
168
|
-
author: config?.overrides?.authors?.[commit.author.name]?.name ? config.overrides.authors[commit.author.name].name : commit.author.name,
|
|
169
|
-
date: commit.date,
|
|
170
|
-
tags: [],
|
|
171
|
-
commit_url: `https://github.com/${repoOwner}/${repoName}/commit/${commit.sha}`
|
|
172
|
-
}))
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
const outputPath = path.join(cwd, CHANGELOG_BUNDLE_FILE_NAME);
|
|
176
|
-
|
|
177
|
-
await fs.writeFile(
|
|
178
|
-
outputPath,
|
|
179
|
-
JSON.stringify(resultToWrite, null, 2),
|
|
180
|
-
"utf-8"
|
|
181
|
-
);
|
|
182
|
-
|
|
183
|
-
terminal.log(`Generated changelog.json. (${commits.length} commits)`);
|
|
184
|
-
}
|