Skip to content

Commit

Permalink
feat: typescript setup is enabled (#229)
Browse files Browse the repository at this point in the history
TypeScript is enabled as part of the build process. Also, one example module (popup.js) is converted to TS.
  • Loading branch information
yanaminkova authored Apr 4, 2023
1 parent a93c5ce commit 13c8a22
Show file tree
Hide file tree
Showing 12 changed files with 2,763 additions and 279 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ npm-debug.log
temp
.tmp
tests/reports
tempDist

# App files
**/styles/*.css
Expand Down
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ module.exports = function (grunt) {
dist: 'dist',
tests: 'tests',
bower: 'bower_components',
grunt: 'grunt'
grunt: 'grunt',
tempDist: 'tempDist'
}
});

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions app/scripts/popup/popup.js → app/scripts/popup/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var utils = require('../modules/utils/utils.js');

chrome.tabs.query({active: true, currentWindow: true}, function (tabs) {
window.chrome.tabs.query({active: true, currentWindow: true}, function (tabs) {
// Create a port with background page for continuous message communication
var port = utils.getPort();

Expand All @@ -23,8 +23,8 @@ chrome.tabs.query({active: true, currentWindow: true}, function (tabs) {
*/
'on-framework-information': function (message) {
var linksDom;
var library = document.querySelector('library');
var buildtime = document.querySelector('buildtime');
var library: HTMLElement = document.querySelector('library');
var buildtime: HTMLElement = document.querySelector('buildtime');

if (message.frameworkInformation.OpenUI5) {
linksDom = document.querySelector('links[openui5]');
Expand Down
9 changes: 9 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export {};

declare global {

interface Window {
chrome: any;
}

}
2 changes: 1 addition & 1 deletion grunt/browserify.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = function (grunt, config) {
dev: {
files: [{
expand: true,
cwd: '<%= app %>/scripts',
cwd: '<%= tempDist %>/scripts',
src: ['**/*.js', '!modules/**/*.js'],
dest: '<%= dist %>/scripts'
}]
Expand Down
Loading

0 comments on commit 13c8a22

Please sign in to comment.