Skip to content

Commit

Permalink
fix: add gulp dependency for inline html
Browse files Browse the repository at this point in the history
  • Loading branch information
JAHMCRIBM committed Sep 12, 2024
1 parent 37cbc7e commit 0c102e2
Show file tree
Hide file tree
Showing 7 changed files with 5,669 additions and 189 deletions.
20 changes: 20 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"settingsInheritedFrom": "whitesource-config/whitesource-config@master",
"minSeverityLevel": "NONE",
"remediateSettings": {
"enableRenovate": true,
"extends": ["config:base"],
"packageRules": [
{
"matchPackagePatterns": ["*"],
"groupName": "all-upgrades",
"separateMinorPatch": true,
"separateMultipleMajor": true
},
{
"matchPackageNames": ["gulp"],
"enabled": false
}
]
}
}
2 changes: 1 addition & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ execSync('npm run build:esm', {stdio: 'inherit'});

console.info('Building UI');
execSync('npm run build:ui', {stdio: 'inherit'});
const htmlText = fs.readFileSync('./ui/dist/index.html', {encoding: 'utf8'});
const htmlText = fs.readFileSync('./ui/dist/inline/index.html', {encoding: 'utf8'});
fs.writeFileSync('./dist/esm/constants/banner.js', `export const connectInstallerBanner = \'${htmlText.replace(/\\/g, '\\\\').replace(/\'/g, '\\\'').replace(/\r?\n|\r/g, '')}\';`);

console.info('Building JS bundle');
Expand Down
2 changes: 1 addition & 1 deletion src/request/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ class RequestHandler implements types.RequestHandler {
/** Define timeout behavior */
async handleTimeout (timeout: types.ConnectError): Promise<void> {
/**
* Return error message from strategy. Otherwise do some debugging first.
* Return error message from strategy. Otherwise, do some debugging first.
*/
if (timeout.error.user_message !== 'timeout') {
throw new Error(timeout.error.user_message);
Expand Down
17 changes: 17 additions & 0 deletions ui/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const gulp = require("gulp");
const inlinesource = require("gulp-inline-source");
const replace = require("gulp-replace");

gulp.task("default", () => {
return gulp
.src("./dist/*.html")
.pipe(replace('.js"></script>', '.js" inline></script>'))
.pipe(replace('rel="stylesheet">', 'rel="stylesheet" inline>'))
.pipe(
inlinesource({
compress: false,
ignore: ["png"],
})
)
.pipe(gulp.dest("./dist/inline"));
});
Loading

0 comments on commit 0c102e2

Please sign in to comment.