-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(project): re-structure project to be easy to work with going for…
…ward
- Loading branch information
Showing
30 changed files
with
17,877 additions
and
8,804 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#root = true | ||
|
||
[*] | ||
indent_style = space | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_size = 4 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,5 @@ | ||
{ | ||
"rules": { | ||
"no-restricted-globals": 0 | ||
} | ||
} |
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,7 +1,13 @@ | ||
bower_components | ||
node_modules | ||
.sass-cache | ||
coverage | ||
.nyc_output | ||
.DS_Store | ||
.tmp | ||
npm-debug.log | ||
*.zip | ||
*.log | ||
.vscode | ||
.idea | ||
dist | ||
compiled | ||
.awcache | ||
.rpt2_cache | ||
docs | ||
*.tgz |
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,5 @@ | ||
{ | ||
"singleQuote": true, | ||
"tabWidth": 4, | ||
"semi": true | ||
} |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Place Technology | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,26 @@ | ||
var fs = require('fs'); | ||
|
||
function cleanJavascriptFile(content) { | ||
content = content.replace(/^.*export.*$/mi, ''); // Remove exports | ||
content = content.replace(/^.*export.*$/mi, ''); // Remove exports | ||
content = content.replace(/^.*export.*$/mi, ''); // Remove exports | ||
content = content.replace(/^.*require.*$/mi, ''); // Remove reqires | ||
content = content.replace(/md5_1\./g, ''); // Fix reference to Md5 class | ||
content = content.replace(/\n\n/g, '\n'); // Reduce new lines | ||
return content; | ||
} | ||
|
||
console.log("Loading javascript files..."); | ||
|
||
var file_hasher = fs.readFileSync('./dist/cjs/md5_file_hasher.js').toString(); | ||
var md5 = fs.readFileSync('./dist/cjs/md5.js').toString(); | ||
var worker = fs.readFileSync('./src/worker.js').toString(); | ||
|
||
console.log("Clean javascript files..."); | ||
|
||
file_hasher = cleanJavascriptFile(file_hasher); | ||
md5 = cleanJavascriptFile(md5); | ||
|
||
console.log("Creating worker javascript..."); | ||
|
||
fs.writeFileSync('./dist/md5_worker.js', file_hasher + md5 + worker); |
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,24 @@ | ||
var fs = require('fs'); | ||
|
||
function deleteFolderRecursive(path) { | ||
if (fs.existsSync(path) && fs.lstatSync(path).isDirectory()) { | ||
fs.readdirSync(path).forEach(function(file, index){ | ||
var curPath = path + "/" + file; | ||
|
||
if (fs.lstatSync(curPath).isDirectory()) { // recurse | ||
deleteFolderRecursive(curPath); | ||
} else { // delete file | ||
fs.unlinkSync(curPath); | ||
} | ||
}); | ||
|
||
console.log(`Deleting directory "${path}"...`); | ||
fs.rmdirSync(path); | ||
} | ||
}; | ||
|
||
console.log("Cleaning working tree..."); | ||
|
||
deleteFolderRecursive("./dist"); | ||
|
||
console.log("Successfully cleaned working tree!"); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.