This is an automated email from the ASF dual-hosted git repository. thiagohp pushed a commit to branch feature/coffeescript-to-typescript in repository https://gitbox.apache.org/repos/asf/tapestry-5.git
commit a50136fb5ec867ab5154d30b33e212a54761899a Author: Thiago H. de Paula Figueiredo <[email protected]> AuthorDate: Wed May 7 10:11:14 2025 -0300 TAP5-2804: more little fixes --- build.gradle | 1 - tapestry-core/src/main/typescript/package.json | 14 +++++++------- .../src/t5/beanvalidator/beanvalidator-validation.ts | 6 +++--- .../src/main/typescript/src/t5/core/exception-frame.ts | 5 ----- tapestry-core/src/main/typescript/src/t5/core/fields.ts | 2 +- tapestry-core/src/main/typescript/src/t5/core/init.ts | 5 ----- tapestry-core/src/main/typescript/src/t5/core/localdate.ts | 5 ----- .../src/main/typescript/src/t5/core/messages-amd.ts | 4 +++- tapestry-core/src/main/typescript/src/t5/core/palette.ts | 7 ++++--- .../main/typescript/src/t5/core/t5-core-dom-prototype.ts | 2 +- .../src/main/typescript/src/t5/core/validation.ts | 6 ------ tapestry-core/src/main/typescript/tsconfig.json | 5 +++-- 12 files changed, 22 insertions(+), 40 deletions(-) diff --git a/build.gradle b/build.gradle index 53a8f8edb..f318ae411 100755 --- a/build.gradle +++ b/build.gradle @@ -551,7 +551,6 @@ task zippedSources(type: Zip) { description "Creates a combined Zip file of all sub-project's sources" group "Release artifact" - dependsOn("tapestry-beanvalidator:compileCoffeeScript") dependsOn("tapestry-core:compileTypeScript") destinationDirectory = buildDir diff --git a/tapestry-core/src/main/typescript/package.json b/tapestry-core/src/main/typescript/package.json index 2171b0df8..ef01b264d 100644 --- a/tapestry-core/src/main/typescript/package.json +++ b/tapestry-core/src/main/typescript/package.json @@ -12,13 +12,13 @@ }, "scripts": { "build": "npm run build-es-module; npm run build-amd", - "build-es-module": "npx tsc --outDir ../resources/META-INF/assets/es-modules/t5/; npm run rename-es-module;", - "build-amd": "npx tsc --module amd --outDir ../resources/META-INF/modules/t5/; npm run rename-amd;", - "clean-amd": "rm -rf ../resources/META-INF/modules/t5/core/*; rm -rf ../resources/META-INF/modules/t5/beanvalidation/*;", - "clean-es-module": "rm -rf ../resources/META-INF/assets/es-modules/t5/core/*; ../resources/META-INF/assets/es-modules/t5/beanvalidation/*", - "clean": "npm run clean-amd; npm run clean-es-module", - "rename-amd": "mv ../resources/META-INF/modules/t5/core/messages-amd.js ../resources/META-INF/modules/t5/core/messages.js", - "rename-es-module": "mv ../resources/META-INF/assets/es-modules/t5/core/messages-es-module.js ../resources/META-INF/assets/es-modules/t5/core/messages.js", + "build-es-module": "npx tsc --outDir ../resources/META-INF/assets/es-modules/t5/; npm run adjust-es-module;", + "build-amd": "npx tsc --module amd --outDir ../resources/META-INF/modules/t5/; npm run adjust-amd;", + "clean-amd": "rm -rf ../resources/META-INF/modules/t5/core/*.js; rm -rf ../resources/META-INF/modules/t5/beanvalidation/*.js;", + "clean-es-module": "rm -rf ../resources/META-INF/assets/es-modules/t5/core/*.js; ../resources/META-INF/assets/es-modules/t5/beanvalidation/*.js", + "clean": "npm run clean-amd; npm run clean-es-module; npm run clean-docs;", + "adjust-amd": "mv ../resources/META-INF/modules/t5/core/messages-amd.js ../resources/META-INF/modules/t5/core/messages.js; rm ../resources/META-INF/modules/t5/core/messages-es-module.js;", + "adjust-es-module": "mv ../resources/META-INF/assets/es-modules/t5/core/messages-es-module.js ../resources/META-INF/assets/es-modules/t5/core/messages.js; rm ../resources/META-INF/assets/es-modules/t5/core/messages-amd.js", "docs": "typedoc", "clean-docs": "rm -rf docs" }, diff --git a/tapestry-core/src/main/typescript/src/t5/beanvalidator/beanvalidator-validation.ts b/tapestry-core/src/main/typescript/src/t5/beanvalidator/beanvalidator-validation.ts index 3b90ed085..aa5779148 100644 --- a/tapestry-core/src/main/typescript/src/t5/beanvalidator/beanvalidator-validation.ts +++ b/tapestry-core/src/main/typescript/src/t5/beanvalidator/beanvalidator-validation.ts @@ -22,9 +22,9 @@ * Supports extra validations related to the beanvalidator module. */ import _ from "underscore"; -import dom from "t5/core/dom.js" -import events from "t5/core/events.js" -import utils from "t5/core/utils.js" +import dom from "t5/core/dom" +import events from "t5/core/events" +import utils from "t5/core/utils" import validation from "t5/core/validation"; // @ts-ignore diff --git a/tapestry-core/src/main/typescript/src/t5/core/exception-frame.ts b/tapestry-core/src/main/typescript/src/t5/core/exception-frame.ts index 356f2fa6a..d6f6f2153 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/exception-frame.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/exception-frame.ts @@ -1,8 +1,3 @@ -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md - */ // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at diff --git a/tapestry-core/src/main/typescript/src/t5/core/fields.ts b/tapestry-core/src/main/typescript/src/t5/core/fields.ts index e6d33c157..badcab15e 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/fields.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/fields.ts @@ -25,7 +25,7 @@ import events from "t5/core/events"; import dom from "t5/core/dom"; import utils from "t5/core/utils"; import forms from "t5/core/forms"; -import { ElementWrapper, EventWrapper }from "t5/core/types"; +import { ElementWrapper, EventWrapper } from "t5/core/types"; let exports_; const ensureFieldId = function(field: ElementWrapper): string { diff --git a/tapestry-core/src/main/typescript/src/t5/core/init.ts b/tapestry-core/src/main/typescript/src/t5/core/init.ts index 883d8ff18..b047f0fe5 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/init.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/init.ts @@ -1,8 +1,3 @@ -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md - */ // Copyright 2012, 2025 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/tapestry-core/src/main/typescript/src/t5/core/localdate.ts b/tapestry-core/src/main/typescript/src/t5/core/localdate.ts index 2d0a59a6b..1573bcf32 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/localdate.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/localdate.ts @@ -1,8 +1,3 @@ -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md - */ // Copyright 2013, 2025 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/tapestry-core/src/main/typescript/src/t5/core/messages-amd.ts b/tapestry-core/src/main/typescript/src/t5/core/messages-amd.ts index ed4571b6c..2e578d4dd 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/messages-amd.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/messages-amd.ts @@ -16,7 +16,7 @@ /** * ## t5/core/messages * - *For all of these modules, we've turned off CoffeeScript's normal outer function + * For all of these modules, we've turned off CoffeeScript's normal outer function * wrapper, as each module is just a call to `define()` with a function that fulfills * the same purpose. This one is different, as it is necessary to compute one of the dependencies. * On the server `t5/core/messages/<locale>` is actually generated dynamically, as is a simple @@ -41,6 +41,7 @@ // @ts-ignore define(["t5/core/messages/" + locale, "underscore", "t5/core/console"], function(messages, _, console) { var get; + // @ts-ignore get = function(key) { var value; value = messages[key]; @@ -51,6 +52,7 @@ return "[[Missing Key: '" + key + "']]"; } }; + // @ts-ignore get.keys = function() { return _.keys(messages); }; diff --git a/tapestry-core/src/main/typescript/src/t5/core/palette.ts b/tapestry-core/src/main/typescript/src/t5/core/palette.ts index e9dc2d991..f589563f6 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/palette.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/palette.ts @@ -34,6 +34,7 @@ class PaletteController { hidden: ElementWrapper; moveUp: ElementWrapper; moveDown: ElementWrapper; + select: ElementWrapper; deselect: ElementWrapper; reorder: boolean; valueToOrderIndex: {}; @@ -44,7 +45,7 @@ class PaletteController { this.available = this.container.findFirst(".palette-available select")!; this.hidden = this.container.findFirst("input[type=hidden]")!; - this.selected = this.container.findFirst("[data-action=select]")!; + this.select = this.container.findFirst("[data-action=select]")!; this.deselect = this.container.findFirst("[data-action=deselect]")!; this.moveUp = this.container.findFirst("[data-action=move-up]")!; @@ -137,7 +138,7 @@ class PaletteController { }); // @ts-ignore - this.selected.on("click", () => { + this.select.on("click", () => { this.doSelect(); return false; }); @@ -179,7 +180,7 @@ class PaletteController { // should be enabled and which disabled. updateButtons() { // @ts-ignore - this.selected.element.disabled = this.available.element.selectedIndex < 0; + this.select.element.disabled = this.available.element.selectedIndex < 0; // @ts-ignore const nothingSelected = this.selected.element.selectedIndex < 0; diff --git a/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-prototype.ts b/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-prototype.ts index ee4dd9ed3..67334457d 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-prototype.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-prototype.ts @@ -120,7 +120,7 @@ const onevent = function(elements: HTMLElement[], eventNames: string[], match: s // @ts-ignore eventWrapper = new PrototypeEventWrapper(prototypeEvent); // @ts-ignore - result = prototypeEvent.stopped ? false : handler.call(elementWrapper, eventWrapper, eventWrapper.memo); + result = prototypeEvent.stopped ? false : handler.call(elementWrapper.element, elementWrapper, eventWrapper, eventWrapper.memo); if (result === false) { prototypeEvent.stop(); } diff --git a/tapestry-core/src/main/typescript/src/t5/core/validation.ts b/tapestry-core/src/main/typescript/src/t5/core/validation.ts index 1a8dffded..721333c60 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/validation.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/validation.ts @@ -1,9 +1,3 @@ -/* - * decaffeinate suggestions: - * DS101: Remove unnecessary use of Array.from - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md - */ // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at diff --git a/tapestry-core/src/main/typescript/tsconfig.json b/tapestry-core/src/main/typescript/tsconfig.json index 43c0714b5..927c678ee 100644 --- a/tapestry-core/src/main/typescript/tsconfig.json +++ b/tapestry-core/src/main/typescript/tsconfig.json @@ -40,11 +40,12 @@ "include": [ "src/**/*.ts" ], - "exclude": ["node_modules", ".vscode", "src/t5/core/messages-amd.ts"], + "exclude": ["node_modules", ".vscode"], "typedocOptions": { "entryPoints": [ - "src/t5/core/*.ts" + "src/t5/core/*.ts", + "src/t5/beanvalidator/*.ts" ], "out": "docs/" // <--- output directory }
