TOBAGO-1633: TS hack to serve the JS files without ".js" extension
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/HackResourceExtentionFilter.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/HackResourceExtentionFilter.java
index 68aa4e9..ac3159e 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/HackResourceExtentionFilter.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/HackResourceExtentionFilter.java
@@ -30,6 +30,7 @@
 import javax.servlet.ServletResponse;
 import javax.servlet.annotation.WebFilter;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.lang.invoke.MethodHandles;
@@ -48,7 +49,7 @@
     if (LOG.isInfoEnabled()) {
       LOG.info("Filter initialized.");
     }
-    String version = Package.getPackage("org.apache.myfaces.tobago.component").getImplementationVersion();
+    final String version = Package.getPackage("org.apache.myfaces.tobago.component").getImplementationVersion();
     prefix = "/tobago/standard/tobago-bootstrap/" + version + "/js/tobago-";
   }
 
@@ -57,10 +58,27 @@
       final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain)
       throws IOException, ServletException {
     if (servletRequest instanceof HttpServletRequest && servletResponse instanceof HttpServletResponse) {
-      final HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
-      final String requestUri = ((HttpServletRequest) servletRequest).getRequestURI();
-      if (requestUri.startsWith(prefix) && !requestUri.endsWith(".js")) {
-        ((HttpServletResponse) servletResponse).sendRedirect(requestUri + ".js");
+      final HttpServletRequest request = (HttpServletRequest) servletRequest;
+      final String requestUri = request.getRequestURI();
+      if (requestUri.startsWith(prefix) && !requestUri.endsWith(".js") && !requestUri.endsWith(".map")) {
+        HttpServletRequestWrapper wrapper = new HttpServletRequestWrapper(request) {
+          @Override
+          public String getRequestURI() {
+            return super.getRequestURI() + ".js";
+          }
+          @Override
+          public String getServletPath() {
+            return super.getServletPath() + ".js";
+          }
+
+          @Override
+          public StringBuffer getRequestURL() {
+            final StringBuffer buffer = super.getRequestURL();
+            buffer.append(".js");
+            return buffer;
+          }
+        };
+        filterChain.doFilter(wrapper, servletResponse);
       } else {
         filterChain.doFilter(servletRequest, servletResponse);
       }
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/20-docker/docker.js b/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/20-docker/docker.js
index e27cfa3..6c6b579 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/20-docker/docker.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/20-docker/docker.js
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-import {Listener, Phase} from "../tobago/standard/tobago-bootstrap/5.0.0-SNAPSHOT/js/tobago-listener.js";
+import {Listener, Phase} from "../tobago/standard/tobago-bootstrap/5.0.0-SNAPSHOT/js/tobago-listener";
 
 var Demo;
 (function (Demo) {
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/20-docker/docker.ts b/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/20-docker/docker.ts
index 97d7d15..56bc053 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/20-docker/docker.ts
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/20-docker/docker.ts
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-import {Listener, Phase} from "../tobago/standard/tobago-bootstrap/5.0.0-SNAPSHOT/js/tobago-listener.js";
+import {Listener, Phase} from "../tobago/standard/tobago-bootstrap/5.0.0-SNAPSHOT/js/tobago-listener";
 
 module Demo.ToClipboardButton {
 
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/script/demo.js b/tobago-example/tobago-example-demo/src/main/webapp/script/demo.js
index 7bdf6c2..6345e55 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/script/demo.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/script/demo.js
@@ -15,9 +15,9 @@
  * limitations under the License.
  */
 
-import {Tobago} from "../tobago/standard/tobago-bootstrap/5.0.0-SNAPSHOT/js/tobago-core.js";
-import {Listener, Phase} from "../tobago/standard/tobago-bootstrap/5.0.0-SNAPSHOT/js/tobago-listener.js";
-import {Tobago4Utils} from "../tobago/standard/tobago-bootstrap/5.0.0-SNAPSHOT/js/tobago-utils.js";
+import {Tobago} from "../tobago/standard/tobago-bootstrap/5.0.0-SNAPSHOT/js/tobago-core";
+import {Listener, Phase} from "../tobago/standard/tobago-bootstrap/5.0.0-SNAPSHOT/js/tobago-listener";
+import {Tobago4Utils} from "../tobago/standard/tobago-bootstrap/5.0.0-SNAPSHOT/js/tobago-utils";
 
 const Demo = {};
 
diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-all.ts b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-all.ts
new file mode 100644
index 0000000..9b231be
--- /dev/null
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-all.ts
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import "./tobago-listener";
+import "./tobago-core";
+import "./tobago-dropdown";
+import "./tobago-calendar";
+import "./tobago-command";
+import "./tobago-file";
+import "./tobago-header-footer";
+import "./tobago-in";
+import "./tobago-jsf";
+import "./tobago-overlay";
+import "./tobago-panel";
+import "./tobago-popover";
+import "./tobago-popup";
+import "./tobago-reload";
+import "./tobago-select";
+import "./tobago-sheet";
+import "./tobago-split-layout";
+import "./tobago-stars";
+import "./tobago-suggest";
+import "./tobago-tab";
+import "./tobago-tree";
+import "./tobago-utils";
diff --git a/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml b/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
index 8fc5146..2cb11e7 100644
--- a/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
+++ b/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
@@ -65,6 +65,8 @@
           <script name="/tobago/standard/tobago-bootstrap/${project.version}/js/tobago-deltaspike.js"/>
 <!--          <script name="/tobago/standard/tobago-bootstrap/${project.version}/node_modules/@babel/polyfill/dist/polyfill.js"/>-->
 <!--          <script name="/tobago/standard/tobago-bootstrap/${project.version}/js/tobago-polyfill.js"/>-->
+          <script name="/tobago/standard/tobago-bootstrap/${project.version}/js/tobago-all.js"/>
+<!--
           <script name="/tobago/standard/tobago-bootstrap/${project.version}/js/tobago-listener.js"/>
           <script name="/tobago/standard/tobago-bootstrap/${project.version}/js/tobago-core.js"/>
           <script name="/tobago/standard/tobago-bootstrap/${project.version}/js/tobago-dropdown.js"/>
@@ -87,6 +89,7 @@
           <script name="/tobago/standard/tobago-bootstrap/${project.version}/js/tobago-tab.js"/>
           <script name="/tobago/standard/tobago-bootstrap/${project.version}/js/tobago-tree.js"/>
           <script name="/tobago/standard/tobago-bootstrap/${project.version}/js/tobago-utils.js"/>
+-->
           <script name="/tobago/pack/typeahead/0.11.1-patched-with-1212/typeahead.js"/>
           <style name="/webjars/tether/1.4.0/css/tether.css"/>
           <style name="/tobago/standard/tobago-bootstrap/${project.version}/css/tobago.css"/>