From 6d0b2720875a1e18f78eb5e57dc3e15ab4906705 Mon Sep 17 00:00:00 2001 From: Zacchari Carde Date: Thu, 22 Feb 2024 15:55:30 +0100 Subject: [PATCH 1/9] feature: TextTexture handle right to left text direction --- src/textures/TextTexture.mjs | 18 ++++++++++++++++-- src/textures/TextTextureRenderer.mjs | 4 ++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/textures/TextTexture.mjs b/src/textures/TextTexture.mjs index 6d0d592c..be59f73d 100644 --- a/src/textures/TextTexture.mjs +++ b/src/textures/TextTexture.mjs @@ -84,7 +84,7 @@ export default class TextTexture extends Texture { get fontBaselineRatio() { return this._fontBaselineRatio; } - + set fontBaselineRatio(v) { if (this._fontBaselineRatio !== v) { this._fontBaselineRatio = v; @@ -466,6 +466,17 @@ export default class TextTexture extends Texture { return this._textIndent; } + set rtl(v) { + if (this._rtl !== v) { + this._rtl = v; + this._changed(); + } + } + + get rtl() { + return this._rtl; + } + get precision() { return super.precision; } @@ -541,7 +552,7 @@ export default class TextTexture extends Texture { const renderer = (args.advancedRenderer) ? new TextTextureRendererAdvanced(this.stage, canvas, args) : new TextTextureRenderer(this.stage, canvas, args); - + const p = renderer.draw(); const texParams = {}; @@ -620,6 +631,7 @@ export default class TextTexture extends Texture { if (this.highlightPaddingRight !== 0) nonDefaults["highlightPaddingRight"] = this.highlightPaddingRight; if (this.letterSpacing !== 0) nonDefaults["letterSpacing"] = this.letterSpacing; if (this.textIndent !== 0) nonDefaults["textIndent"] = this.textIndent; + if (this.rtl !== 0) nonDefaults["rtl"] = this.rtl; if (this.cutSx) nonDefaults["cutSx"] = this.cutSx; if (this.cutEx) nonDefaults["cutEx"] = this.cutEx; @@ -667,6 +679,7 @@ export default class TextTexture extends Texture { obj.highlightPaddingRight = this._highlightPaddingRight; obj.letterSpacing = this._letterSpacing; obj.textIndent = this._textIndent; + obj.rtl = this._rtl; obj.cutSx = this._cutSx; obj.cutEx = this._cutEx; obj.cutSy = this._cutSy; @@ -714,6 +727,7 @@ proto._highlightPaddingLeft = 0; proto._highlightPaddingRight = 0; proto._letterSpacing = 0; proto._textIndent = 0; +proto._rtl = 0; proto._cutSx = 0; proto._cutEx = 0; proto._cutSy = 0; diff --git a/src/textures/TextTextureRenderer.mjs b/src/textures/TextTextureRenderer.mjs index 92d6a7d6..c2201619 100644 --- a/src/textures/TextTextureRenderer.mjs +++ b/src/textures/TextTextureRenderer.mjs @@ -43,6 +43,7 @@ export default class TextTextureRenderer { this._stage.getOption('defaultFontFace'), ); this._context.textBaseline = this._settings.textBaseline; + this._context.direction = this._settings.rtl ? "rtl" : "ltr"; }; _load() { @@ -306,6 +307,9 @@ export default class TextTextureRenderer { linePositionX += ((renderInfo.innerWidth - renderInfo.lineWidths[i]) / 2); } linePositionX += renderInfo.paddingLeft; + if (this._settings.rtl) { + linePositionX += renderInfo.lineWidths[i]; + } drawLines.push({text: renderInfo.lines[i], x: linePositionX, y: linePositionY, w: renderInfo.lineWidths[i]}); } From 4a1a264328b8bfa7c535d2ff50c931ec732bdb0f Mon Sep 17 00:00:00 2001 From: Zacchari Carde <100150221+Zacchari-Carde-Wiztivi@users.noreply.github.com> Date: Fri, 23 Feb 2024 10:28:51 +0100 Subject: [PATCH 2/9] Update TextTexture.mjs --- src/textures/TextTexture.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/textures/TextTexture.mjs b/src/textures/TextTexture.mjs index be59f73d..64d8718a 100644 --- a/src/textures/TextTexture.mjs +++ b/src/textures/TextTexture.mjs @@ -84,7 +84,7 @@ export default class TextTexture extends Texture { get fontBaselineRatio() { return this._fontBaselineRatio; } - + set fontBaselineRatio(v) { if (this._fontBaselineRatio !== v) { this._fontBaselineRatio = v; From e491d82db73186c168e17d145322ce88ca82dac4 Mon Sep 17 00:00:00 2001 From: Zacchari Carde <100150221+Zacchari-Carde-Wiztivi@users.noreply.github.com> Date: Fri, 23 Feb 2024 10:29:18 +0100 Subject: [PATCH 3/9] Update TextTexture.mjs --- src/textures/TextTexture.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/textures/TextTexture.mjs b/src/textures/TextTexture.mjs index 64d8718a..547dfa78 100644 --- a/src/textures/TextTexture.mjs +++ b/src/textures/TextTexture.mjs @@ -552,7 +552,7 @@ export default class TextTexture extends Texture { const renderer = (args.advancedRenderer) ? new TextTextureRendererAdvanced(this.stage, canvas, args) : new TextTextureRenderer(this.stage, canvas, args); - + const p = renderer.draw(); const texParams = {}; From c99db287d4b39aa7b57814258785831847b4f04e Mon Sep 17 00:00:00 2001 From: Mike Ryan Date: Thu, 29 Feb 2024 08:31:05 -0800 Subject: [PATCH 4/9] Fixes issue/527 Version 2.12.1 not including typescript types Switched extension search in scripts/src-to-dist.cjs to use ".ts" and ".mts" so the types get added. --- .../scripts/src-to-dist_20240229082930.cjs | 60 +++++++++++++++ .../scripts/src-to-dist_20240229082949.cjs | 76 +++++++++++++++++++ scripts/src-to-dist.cjs | 54 ++++++++----- 3 files changed, 171 insertions(+), 19 deletions(-) create mode 100644 .history/scripts/src-to-dist_20240229082930.cjs create mode 100644 .history/scripts/src-to-dist_20240229082949.cjs diff --git a/.history/scripts/src-to-dist_20240229082930.cjs b/.history/scripts/src-to-dist_20240229082930.cjs new file mode 100644 index 00000000..c6770a32 --- /dev/null +++ b/.history/scripts/src-to-dist_20240229082930.cjs @@ -0,0 +1,60 @@ +const shell = require('shelljs'); +const ts = require('typescript'); +const path = require('path'); + +// Make sure shelljs will exit with nonzero exit code if anything fails +shell.config.fatal = true; + +// Make sure working directory is the root of the repository +shell.cd(path.join(__dirname, '..')); + +// 1. Copy all the JavaScript source code (.js / .mjs) and +// all the manually written type definition files (.d.ts / .d.mts) +console.log("Copying all JavaScript source code to ./dist..."); +shell.find('./src/') + .filter(file => { + const ext = path.extname(file); + return ['.js', '.mjs', '.d.mts', '.d.ts'].includes(ext) && !file.includes('.test.'); + }) + .forEach(file => { + const distFile = path.join('./dist', file); + shell.mkdir('-p', path.dirname(distFile)); + shell.cp(file, distFile); + }); + +// 2. Compile all TypeScript source code (.ts / .mts) in the project +console.log("Compiling all TypeScript source code to ./dist..."); + +// Read the TypeScript configuration file +const configPath = path.join(process.cwd(), 'tsconfig.build.json'); +const config = ts.readConfigFile(configPath, ts.sys.readFile).config; + +// Parse the configuration file +const parsed = ts.parseJsonConfigFileContent(config, ts.sys, path.dirname(configPath)); + +// Create a program based on the configuration +const program = ts.createProgram(parsed.fileNames, parsed.options); + +// Compile the program +const emitResult = program.emit(); + +// Get all diagnostics +const allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); + +// Print all diagnostics +allDiagnostics.forEach(diagnostic => { + if (diagnostic.file) { + const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); + const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); + console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); + } else { + console.log(ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n')); + } +}); + +// If there were errors, exit with a non-zero exit code +if (emitResult.emitSkipped) { + process.exit(1); +} + +console.log("Done!"); \ No newline at end of file diff --git a/.history/scripts/src-to-dist_20240229082949.cjs b/.history/scripts/src-to-dist_20240229082949.cjs new file mode 100644 index 00000000..b467feb3 --- /dev/null +++ b/.history/scripts/src-to-dist_20240229082949.cjs @@ -0,0 +1,76 @@ +const shell = require("shelljs"); +const ts = require("typescript"); +const path = require("path"); + +// Make sure shelljs will exit with nonzero exit code if anything fails +shell.config.fatal = true; + +// Make sure working directory is the root of the repository +shell.cd(path.join(__dirname, "..")); + +// 1. Copy all the JavaScript source code (.js / .mjs) and +// all the manually written type definition files (.d.ts / .d.mts) +console.log("Copying all JavaScript source code to ./dist..."); +shell + .find("./src/") + .filter((file) => { + const ext = path.extname(file); + return ( + [".js", ".mjs", ".mts", ".ts"].includes(ext) && !file.includes(".test.") + ); + }) + .forEach((file) => { + const distFile = path.join("./dist", file); + shell.mkdir("-p", path.dirname(distFile)); + shell.cp(file, distFile); + }); + +// 2. Compile all TypeScript source code (.ts / .mts) in the project +console.log("Compiling all TypeScript source code to ./dist..."); + +// Read the TypeScript configuration file +const configPath = path.join(process.cwd(), "tsconfig.build.json"); +const config = ts.readConfigFile(configPath, ts.sys.readFile).config; + +// Parse the configuration file +const parsed = ts.parseJsonConfigFileContent( + config, + ts.sys, + path.dirname(configPath) +); + +// Create a program based on the configuration +const program = ts.createProgram(parsed.fileNames, parsed.options); + +// Compile the program +const emitResult = program.emit(); + +// Get all diagnostics +const allDiagnostics = ts + .getPreEmitDiagnostics(program) + .concat(emitResult.diagnostics); + +// Print all diagnostics +allDiagnostics.forEach((diagnostic) => { + if (diagnostic.file) { + const { line, character } = diagnostic.file.getLineAndCharacterOfPosition( + diagnostic.start + ); + const message = ts.flattenDiagnosticMessageText( + diagnostic.messageText, + "\n" + ); + console.log( + `${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}` + ); + } else { + console.log(ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")); + } +}); + +// If there were errors, exit with a non-zero exit code +if (emitResult.emitSkipped) { + process.exit(1); +} + +console.log("Done!"); diff --git a/scripts/src-to-dist.cjs b/scripts/src-to-dist.cjs index c6770a32..b467feb3 100644 --- a/scripts/src-to-dist.cjs +++ b/scripts/src-to-dist.cjs @@ -1,24 +1,27 @@ -const shell = require('shelljs'); -const ts = require('typescript'); -const path = require('path'); +const shell = require("shelljs"); +const ts = require("typescript"); +const path = require("path"); // Make sure shelljs will exit with nonzero exit code if anything fails shell.config.fatal = true; // Make sure working directory is the root of the repository -shell.cd(path.join(__dirname, '..')); +shell.cd(path.join(__dirname, "..")); // 1. Copy all the JavaScript source code (.js / .mjs) and // all the manually written type definition files (.d.ts / .d.mts) console.log("Copying all JavaScript source code to ./dist..."); -shell.find('./src/') - .filter(file => { +shell + .find("./src/") + .filter((file) => { const ext = path.extname(file); - return ['.js', '.mjs', '.d.mts', '.d.ts'].includes(ext) && !file.includes('.test.'); + return ( + [".js", ".mjs", ".mts", ".ts"].includes(ext) && !file.includes(".test.") + ); }) - .forEach(file => { - const distFile = path.join('./dist', file); - shell.mkdir('-p', path.dirname(distFile)); + .forEach((file) => { + const distFile = path.join("./dist", file); + shell.mkdir("-p", path.dirname(distFile)); shell.cp(file, distFile); }); @@ -26,11 +29,15 @@ shell.find('./src/') console.log("Compiling all TypeScript source code to ./dist..."); // Read the TypeScript configuration file -const configPath = path.join(process.cwd(), 'tsconfig.build.json'); +const configPath = path.join(process.cwd(), "tsconfig.build.json"); const config = ts.readConfigFile(configPath, ts.sys.readFile).config; // Parse the configuration file -const parsed = ts.parseJsonConfigFileContent(config, ts.sys, path.dirname(configPath)); +const parsed = ts.parseJsonConfigFileContent( + config, + ts.sys, + path.dirname(configPath) +); // Create a program based on the configuration const program = ts.createProgram(parsed.fileNames, parsed.options); @@ -39,16 +46,25 @@ const program = ts.createProgram(parsed.fileNames, parsed.options); const emitResult = program.emit(); // Get all diagnostics -const allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); +const allDiagnostics = ts + .getPreEmitDiagnostics(program) + .concat(emitResult.diagnostics); // Print all diagnostics -allDiagnostics.forEach(diagnostic => { +allDiagnostics.forEach((diagnostic) => { if (diagnostic.file) { - const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); - const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); - console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); + const { line, character } = diagnostic.file.getLineAndCharacterOfPosition( + diagnostic.start + ); + const message = ts.flattenDiagnosticMessageText( + diagnostic.messageText, + "\n" + ); + console.log( + `${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}` + ); } else { - console.log(ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n')); + console.log(ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")); } }); @@ -57,4 +73,4 @@ if (emitResult.emitSkipped) { process.exit(1); } -console.log("Done!"); \ No newline at end of file +console.log("Done!"); From 1b95cc6f7b33235fe74aea4ee03ec0453faec3d3 Mon Sep 17 00:00:00 2001 From: Mike Ryan Date: Thu, 29 Feb 2024 08:37:41 -0800 Subject: [PATCH 5/9] Cleanup for PR Removed local history and formatting --- .../scripts/src-to-dist_20240229082930.cjs | 60 --------------- .../scripts/src-to-dist_20240229082949.cjs | 76 ------------------- .vscode/settings.json | 4 + 3 files changed, 4 insertions(+), 136 deletions(-) delete mode 100644 .history/scripts/src-to-dist_20240229082930.cjs delete mode 100644 .history/scripts/src-to-dist_20240229082949.cjs create mode 100644 .vscode/settings.json diff --git a/.history/scripts/src-to-dist_20240229082930.cjs b/.history/scripts/src-to-dist_20240229082930.cjs deleted file mode 100644 index c6770a32..00000000 --- a/.history/scripts/src-to-dist_20240229082930.cjs +++ /dev/null @@ -1,60 +0,0 @@ -const shell = require('shelljs'); -const ts = require('typescript'); -const path = require('path'); - -// Make sure shelljs will exit with nonzero exit code if anything fails -shell.config.fatal = true; - -// Make sure working directory is the root of the repository -shell.cd(path.join(__dirname, '..')); - -// 1. Copy all the JavaScript source code (.js / .mjs) and -// all the manually written type definition files (.d.ts / .d.mts) -console.log("Copying all JavaScript source code to ./dist..."); -shell.find('./src/') - .filter(file => { - const ext = path.extname(file); - return ['.js', '.mjs', '.d.mts', '.d.ts'].includes(ext) && !file.includes('.test.'); - }) - .forEach(file => { - const distFile = path.join('./dist', file); - shell.mkdir('-p', path.dirname(distFile)); - shell.cp(file, distFile); - }); - -// 2. Compile all TypeScript source code (.ts / .mts) in the project -console.log("Compiling all TypeScript source code to ./dist..."); - -// Read the TypeScript configuration file -const configPath = path.join(process.cwd(), 'tsconfig.build.json'); -const config = ts.readConfigFile(configPath, ts.sys.readFile).config; - -// Parse the configuration file -const parsed = ts.parseJsonConfigFileContent(config, ts.sys, path.dirname(configPath)); - -// Create a program based on the configuration -const program = ts.createProgram(parsed.fileNames, parsed.options); - -// Compile the program -const emitResult = program.emit(); - -// Get all diagnostics -const allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); - -// Print all diagnostics -allDiagnostics.forEach(diagnostic => { - if (diagnostic.file) { - const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); - const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); - console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); - } else { - console.log(ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n')); - } -}); - -// If there were errors, exit with a non-zero exit code -if (emitResult.emitSkipped) { - process.exit(1); -} - -console.log("Done!"); \ No newline at end of file diff --git a/.history/scripts/src-to-dist_20240229082949.cjs b/.history/scripts/src-to-dist_20240229082949.cjs deleted file mode 100644 index b467feb3..00000000 --- a/.history/scripts/src-to-dist_20240229082949.cjs +++ /dev/null @@ -1,76 +0,0 @@ -const shell = require("shelljs"); -const ts = require("typescript"); -const path = require("path"); - -// Make sure shelljs will exit with nonzero exit code if anything fails -shell.config.fatal = true; - -// Make sure working directory is the root of the repository -shell.cd(path.join(__dirname, "..")); - -// 1. Copy all the JavaScript source code (.js / .mjs) and -// all the manually written type definition files (.d.ts / .d.mts) -console.log("Copying all JavaScript source code to ./dist..."); -shell - .find("./src/") - .filter((file) => { - const ext = path.extname(file); - return ( - [".js", ".mjs", ".mts", ".ts"].includes(ext) && !file.includes(".test.") - ); - }) - .forEach((file) => { - const distFile = path.join("./dist", file); - shell.mkdir("-p", path.dirname(distFile)); - shell.cp(file, distFile); - }); - -// 2. Compile all TypeScript source code (.ts / .mts) in the project -console.log("Compiling all TypeScript source code to ./dist..."); - -// Read the TypeScript configuration file -const configPath = path.join(process.cwd(), "tsconfig.build.json"); -const config = ts.readConfigFile(configPath, ts.sys.readFile).config; - -// Parse the configuration file -const parsed = ts.parseJsonConfigFileContent( - config, - ts.sys, - path.dirname(configPath) -); - -// Create a program based on the configuration -const program = ts.createProgram(parsed.fileNames, parsed.options); - -// Compile the program -const emitResult = program.emit(); - -// Get all diagnostics -const allDiagnostics = ts - .getPreEmitDiagnostics(program) - .concat(emitResult.diagnostics); - -// Print all diagnostics -allDiagnostics.forEach((diagnostic) => { - if (diagnostic.file) { - const { line, character } = diagnostic.file.getLineAndCharacterOfPosition( - diagnostic.start - ); - const message = ts.flattenDiagnosticMessageText( - diagnostic.messageText, - "\n" - ); - console.log( - `${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}` - ); - } else { - console.log(ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")); - } -}); - -// If there were errors, exit with a non-zero exit code -if (emitResult.emitSkipped) { - process.exit(1); -} - -console.log("Done!"); diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..c35f92c8 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "local-history.enabled": 0, + "prettier.enable": false +} From 402ba21d98202bb5f97e825d3a85bf403f1f60c9 Mon Sep 17 00:00:00 2001 From: Mike Ryan Date: Thu, 29 Feb 2024 08:41:58 -0800 Subject: [PATCH 6/9] Reset so my crap's not being uploaded in PR --- .vscode/settings.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index c35f92c8..26f6c0cf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,5 @@ { "local-history.enabled": 0, - "prettier.enable": false + "prettier.enable": false, + "prettier.embeddedLanguageFormatting": "off" } From 5c01532ce3d9d7537a2853101c56e4a392622f05 Mon Sep 17 00:00:00 2001 From: Mike Ryan Date: Thu, 29 Feb 2024 08:44:35 -0800 Subject: [PATCH 7/9] Cleanup of my files Had some formatting and files that should not be here and didn't want to edit the gitignore --- .vscode/settings.json | 5 ---- scripts/src-to-dist.cjs | 54 +++++++++++++++-------------------------- 2 files changed, 19 insertions(+), 40 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 26f6c0cf..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "local-history.enabled": 0, - "prettier.enable": false, - "prettier.embeddedLanguageFormatting": "off" -} diff --git a/scripts/src-to-dist.cjs b/scripts/src-to-dist.cjs index b467feb3..87d030fd 100644 --- a/scripts/src-to-dist.cjs +++ b/scripts/src-to-dist.cjs @@ -1,27 +1,24 @@ -const shell = require("shelljs"); -const ts = require("typescript"); -const path = require("path"); +const shell = require('shelljs'); +const ts = require('typescript'); +const path = require('path'); // Make sure shelljs will exit with nonzero exit code if anything fails shell.config.fatal = true; // Make sure working directory is the root of the repository -shell.cd(path.join(__dirname, "..")); +shell.cd(path.join(__dirname, '..')); // 1. Copy all the JavaScript source code (.js / .mjs) and // all the manually written type definition files (.d.ts / .d.mts) console.log("Copying all JavaScript source code to ./dist..."); -shell - .find("./src/") - .filter((file) => { +shell.find('./src/') + .filter(file => { const ext = path.extname(file); - return ( - [".js", ".mjs", ".mts", ".ts"].includes(ext) && !file.includes(".test.") - ); + return ['.js', '.mjs', '.mts', '.ts'].includes(ext) && !file.includes('.test.'); }) - .forEach((file) => { - const distFile = path.join("./dist", file); - shell.mkdir("-p", path.dirname(distFile)); + .forEach(file => { + const distFile = path.join('./dist', file); + shell.mkdir('-p', path.dirname(distFile)); shell.cp(file, distFile); }); @@ -29,15 +26,11 @@ shell console.log("Compiling all TypeScript source code to ./dist..."); // Read the TypeScript configuration file -const configPath = path.join(process.cwd(), "tsconfig.build.json"); +const configPath = path.join(process.cwd(), 'tsconfig.build.json'); const config = ts.readConfigFile(configPath, ts.sys.readFile).config; // Parse the configuration file -const parsed = ts.parseJsonConfigFileContent( - config, - ts.sys, - path.dirname(configPath) -); +const parsed = ts.parseJsonConfigFileContent(config, ts.sys, path.dirname(configPath)); // Create a program based on the configuration const program = ts.createProgram(parsed.fileNames, parsed.options); @@ -46,25 +39,16 @@ const program = ts.createProgram(parsed.fileNames, parsed.options); const emitResult = program.emit(); // Get all diagnostics -const allDiagnostics = ts - .getPreEmitDiagnostics(program) - .concat(emitResult.diagnostics); +const allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); // Print all diagnostics -allDiagnostics.forEach((diagnostic) => { +allDiagnostics.forEach(diagnostic => { if (diagnostic.file) { - const { line, character } = diagnostic.file.getLineAndCharacterOfPosition( - diagnostic.start - ); - const message = ts.flattenDiagnosticMessageText( - diagnostic.messageText, - "\n" - ); - console.log( - `${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}` - ); + const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); + const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); + console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); } else { - console.log(ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")); + console.log(ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n')); } }); @@ -73,4 +57,4 @@ if (emitResult.emitSkipped) { process.exit(1); } -console.log("Done!"); +console.log("Done!"); \ No newline at end of file From 541b03be44d546b4776d221f98027bea18817c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fur=20Aslan?= Date: Thu, 11 Apr 2024 15:37:09 +0200 Subject: [PATCH 8/9] bumped version to 2.13.0 for the release --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 03a7a74f..9e727f15 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@lightningjs/core", - "version": "2.12.1", + "version": "2.13.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@lightningjs/core", - "version": "2.12.1", + "version": "2.13.0", "license": "Apache-2.0", "devDependencies": { "@babel/core": "^7.8.3", diff --git a/package.json b/package.json index c6ea5e38..65c6e548 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "author": "Metrological, Bas van Meurs ", "name": "@lightningjs/core", - "version": "2.12.1", + "version": "2.13.0", "license": "Apache-2.0", "type": "module", "types": "dist/src/index.d.ts", From 9a35ac618a88f55ea9a7e59f6660364489dc5aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fur=20Aslan?= Date: Thu, 11 Apr 2024 15:48:39 +0200 Subject: [PATCH 9/9] updated changelog for v2.13.0 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index edd87f30..fc9543a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v2.13.0 +*11 apr 2024* + +- Fixed an issue causing not including TypeScript types in the build. (#527) +- Enhanced handling of bidirectional text in TextTexture by setting canvas context direction to correct display of text blocks in RTL configurations. + ## v2.12.1 *07 feb 2024*