-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Marko.Taht <[email protected]> Co-authored-by: Lukas Hollaender <[email protected]>
- Loading branch information
1 parent
3538bf7
commit 1f23740
Showing
41 changed files
with
7,494 additions
and
3,962 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
**/*{.,-}min.js | ||
examples/PDF.js/**/* | ||
examples/css/**/* | ||
examples/html2pdf/examples.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
**/*{.,-}min.js | ||
examples/PDF.js/**/* | ||
examples/css/**/* | ||
examples/html2pdf/examples.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +1,116 @@ | ||
const inquirer = require("inquirer"); | ||
const configuration = require('./modules.conf.js'); | ||
const configuration = require("./modules.conf.js"); | ||
|
||
console.log(configuration); | ||
|
||
function uniq(a) { | ||
var prims = { "boolean": {}, "number": {}, "string": {} }, objs = []; | ||
var prims = { boolean: {}, number: {}, string: {} }, | ||
objs = []; | ||
|
||
return a.filter(function (item) { | ||
var type = typeof item; | ||
if (type in prims) | ||
return prims[type].hasOwnProperty(item) ? false : (prims[type][item] = true); | ||
else | ||
return objs.indexOf(item) >= 0 ? false : objs.push(item); | ||
}); | ||
return a.filter(function(item) { | ||
var type = typeof item; | ||
if (type in prims) | ||
if (Object.prototype.hasOwnProperty.call(prims[type], item)) { | ||
return false; | ||
} else { | ||
prims[type][item] = true; | ||
return true; | ||
} | ||
else return objs.indexOf(item) >= 0 ? false : objs.push(item); | ||
}); | ||
} | ||
|
||
function generateFileList(list) { | ||
var fileList = []; | ||
var file; | ||
for (var i = 0; i < list.length; i++) { | ||
fileList.push(list[i].name + '.js'); | ||
console.log(list[i]) | ||
console.log(configuration[list[i].name]) | ||
for (var j = 0; j < configuration[list[i]].deps.length; j++) { | ||
file = configuration[list[i]].deps[j]; | ||
configuration[file].type | ||
fileList.push(configuration[file].type + '/' + '.js'); | ||
} | ||
var fileList = []; | ||
var file; | ||
for (var i = 0; i < list.length; i++) { | ||
fileList.push(list[i].name + ".js"); | ||
console.log(list[i]); | ||
console.log(configuration[list[i].name]); | ||
for (var j = 0; j < configuration[list[i]].deps.length; j++) { | ||
file = configuration[list[i]].deps[j]; | ||
configuration[file].type; | ||
fileList.push(configuration[file].type + "/" + ".js"); | ||
} | ||
fileList = uniq(fileList); | ||
return fileList; | ||
} | ||
fileList = uniq(fileList); | ||
return fileList; | ||
} | ||
|
||
/** | ||
* Ask use a few questions on command prompt | ||
* @returns {Promise} The promise with the result of the prompt | ||
*/ | ||
function promptUser() { | ||
return inquirer.prompt([ | ||
{ | ||
type: "list", | ||
name: "env", | ||
message: "Where does your code run?", | ||
default: ["browser"], | ||
choices: [ | ||
{ name: "Browser", value: "browser" }, | ||
{ name: "Node", value: "node" } | ||
] | ||
}, | ||
{ | ||
type: "checkbox", | ||
name: "images", | ||
message: "Which ImageTypes should be supported?", | ||
default: ["jpeg_support", 'bmp_support', 'gif_support', 'webp_support'], | ||
choices: [ | ||
{ name: "Jpeg", value: "jpeg_support" }, | ||
{ name: "Bmp", value: "bmp_support" }, | ||
{ name: "Gif", value: "gif_support" }, | ||
{ name: "WebP", value: "webp_support" } | ||
] | ||
}, | ||
{ | ||
type: "checkbox", | ||
name: "modules", | ||
message: "Additional Modules", | ||
default: ['acroform', 'annotations', 'arabic', 'autoprint', 'context2d', | ||
'fileloading', 'filters', 'html', 'javascript', 'outline', | ||
'setlanguage', 'svg', 'total_pages', 'utf8', 'viewerpreferences', | ||
'xmp_metadata' | ||
], | ||
choices: [ | ||
{ name: "Acroform", value: "acroform" }, | ||
{ name: "Annotations", value: "annotations" }, | ||
{ name: "Arabic Parser", value: "arabic" }, | ||
{ name: "Autoprint", value: "autoprint" }, | ||
{ name: "Context2d", value: "context2d" }, | ||
{ name: "File Loading", value: "fileloading" }, | ||
{ name: "Filters", value: "filters" }, | ||
{ name: "HTML", value: "html" }, | ||
{ name: "Javascript", value: "javascript" }, | ||
{ name: "Outline", value: "outline" }, | ||
{ name: "Language-Tagging", value: "setlanguage" }, | ||
{ name: "SVG", value: "svg" }, | ||
{ name: "TotalPages", value: "total_pages" }, | ||
{ name: "Unicode", value: "utf8" }, | ||
{ name: "ViewerPreferences", value: "viewerpreferences" }, | ||
{ name: "XMP Metadata", value: "xmp_metadata" } | ||
] | ||
} | ||
]).then(result => { | ||
console.log(generateFileList([...result.images, ...result.modules])); | ||
return inquirer | ||
.prompt([ | ||
{ | ||
type: "list", | ||
name: "env", | ||
message: "Where does your code run?", | ||
default: ["browser"], | ||
choices: [ | ||
{ name: "Browser", value: "browser" }, | ||
{ name: "Node", value: "node" } | ||
] | ||
}, | ||
{ | ||
type: "checkbox", | ||
name: "images", | ||
message: "Which ImageTypes should be supported?", | ||
default: ["jpeg_support", "bmp_support", "gif_support", "webp_support"], | ||
choices: [ | ||
{ name: "Jpeg", value: "jpeg_support" }, | ||
{ name: "Bmp", value: "bmp_support" }, | ||
{ name: "Gif", value: "gif_support" }, | ||
{ name: "WebP", value: "webp_support" } | ||
] | ||
}, | ||
{ | ||
type: "checkbox", | ||
name: "modules", | ||
message: "Additional Modules", | ||
default: [ | ||
"acroform", | ||
"annotations", | ||
"arabic", | ||
"autoprint", | ||
"context2d", | ||
"fileloading", | ||
"filters", | ||
"html", | ||
"javascript", | ||
"outline", | ||
"setlanguage", | ||
"svg", | ||
"total_pages", | ||
"utf8", | ||
"viewerpreferences", | ||
"xmp_metadata" | ||
], | ||
choices: [ | ||
{ name: "Acroform", value: "acroform" }, | ||
{ name: "Annotations", value: "annotations" }, | ||
{ name: "Arabic Parser", value: "arabic" }, | ||
{ name: "Autoprint", value: "autoprint" }, | ||
{ name: "Context2d", value: "context2d" }, | ||
{ name: "File Loading", value: "fileloading" }, | ||
{ name: "Filters", value: "filters" }, | ||
{ name: "HTML", value: "html" }, | ||
{ name: "Javascript", value: "javascript" }, | ||
{ name: "Outline", value: "outline" }, | ||
{ name: "Language-Tagging", value: "setlanguage" }, | ||
{ name: "SVG", value: "svg" }, | ||
{ name: "TotalPages", value: "total_pages" }, | ||
{ name: "Unicode", value: "utf8" }, | ||
{ name: "ViewerPreferences", value: "viewerpreferences" }, | ||
{ name: "XMP Metadata", value: "xmp_metadata" } | ||
] | ||
} | ||
]) | ||
.then(result => { | ||
console.log(generateFileList([...result.images, ...result.modules])); | ||
}); | ||
} | ||
|
||
promptUser(); | ||
promptUser(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
const deleteFolder = require('folder-delete'); | ||
const deleteFolder = require("folder-delete"); | ||
|
||
try { | ||
deleteFolder('docs', {debugLog: false}); | ||
} catch (e) { | ||
} | ||
deleteFolder("docs", { debugLog: false }); | ||
} catch (e) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.