Skip to content

Commit

Permalink
YScript v2.2.1 - bug fixes
Browse files Browse the repository at this point in the history
fixed major bug that prevented yscript from being assigned to globalThis
  • Loading branch information
afkvido authored Oct 3, 2024
1 parent a641a21 commit d4cdc8d
Show file tree
Hide file tree
Showing 17 changed files with 55 additions and 38 deletions.
5 changes: 3 additions & 2 deletions dist/yscipt-es2016.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dist/yscipt-es2017.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dist/yscipt-es2018.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dist/yscipt-es2019.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dist/yscipt-es2020.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dist/yscipt-es2021.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dist/yscipt-es2022.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/yscript-esnext.min.js

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions dist/yscript.dev.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/yscript.dev.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/yscript.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ let build = true;

const banner = {
js: `/* YScript v${version} (${distro}) | Copyright (c) 2016-${new Date().getFullYear()} ProdigyPXP, Yopta.Space project, and Contributors | Licensed under the MIT license */` +
`global["yscript"]=Object.create(null);` +
`global["yscript"]["distro"]="${distro}";`,
`globalThis["yscript"]=Object.create(null);` +
`globalThis["yscript"]["distro"]="${distro}";` +
`globalThis["yscript"]["version"]="${version}";`,
css: ""
};
const bundle = true;
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ppxp/yopta",
"version": "2.2.0",
"version": "2.2.1",
"description": "YSCript - язык программирования для гопников и реальных пацанов.",
"main": "dist/yscript.min.js",
"scripts": {
Expand Down Expand Up @@ -29,14 +29,14 @@
},
"homepage": "https://github.com/ProdigyPXP/YScript",
"devDependencies": {
"@types/jest": "^29.5.1",
"@types/node": "^18.16.3",
"esbuild": "^0.17.18",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"serve": "^14.2.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
"@types/jest": "^29.5.13",
"@types/node": "^18.19.54",
"esbuild": "^0.17.19",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"serve": "^14.2.3",
"ts-node": "^10.9.2",
"typescript": "^5.6.2"
},
"files": [
"dist/**/*"
Expand Down
2 changes: 1 addition & 1 deletion scripts/prebuild.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cd ..
pnpm i
ts-node src/dictionary/prepareArrayBeforeBuild.ts
node src/dictionary/prepareArrayBeforeBuild.mjs
4 changes: 2 additions & 2 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ function deprecatedYopta (text : string, lang: "js" | "ys" = "ys") {
return compile(text, lang);
}

global["yscript"]["compile"] = compile;
global["yopta"] = deprecatedYopta;
globalThis["yscript"]["compile"] = compile;
globalThis["yopta"] = deprecatedYopta;
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Сортирует массив по самой длинной Yopta фразе перед сборкой
import * as fs from "fs";
import { dictionary } from "./dictionary";
import { dictionary } from "./dictionary.mjs";

/**
* Сортирует массив по убыванию длины Yopta перевода и сохраняет в JSON файл sortedYopta.json
* @param dictionary массив 2D массивов ключей
*/
export function sortDictionaryToFile (dictionary: string[][]): void {
export function sortDictionaryToFile (dictionary /*: string[][] */) {
dictionary.sort((a, b) => b[1].length - a[1].length);

const file = JSON.stringify(dictionary, null, '\t').replace(/\\/g, '');
Expand Down

0 comments on commit d4cdc8d

Please sign in to comment.