-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix CDN release, setting webpack output as UMD with default library…
… name of SimpleCrypto. * CDN now have two file you may use, the distribution file and minified distribution one.
- Loading branch information
Danang Galuh Tegar Prasetyo
committed
Aug 5, 2019
1 parent
e02c6be
commit dcf75e0
Showing
11 changed files
with
162 additions
and
44 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,42 @@ | ||
## Changes Log (What's New) | ||
|
||
**What's New in 2.2.0** | ||
|
||
* Fix CDN release, setting webpack output as UMD with default library name of SimpleCrypto. | ||
* CDN now have two file you may use, the distribution file and minified distribution one. | ||
|
||
**What's New in 2.1.3** | ||
|
||
* Fix jsDelivr link | ||
|
||
**What's New in 2.1.2** | ||
|
||
* Update missing file in NPM release. | ||
|
||
**What's New in 2.1.0** | ||
|
||
* Update dependency. | ||
* Fix missing web bundler as distribution build tool for the Web (using webpack). | ||
* Use of partial import instead of full import to minimise the size of distributed build file . | ||
|
||
**What's New in 2.0.2** | ||
|
||
* Bugs fixed. | ||
* Remove gulp. | ||
|
||
**What's New in 2.0.1** | ||
|
||
* Add coverage service. | ||
|
||
**What's New in 2.0.0** | ||
|
||
* Using only these functions to encrypt or decrypt: `encrypt()` and `decrypt()` (accepts string, object, number, or boolean data type). Function `encryptObject()` and `decryptObject()` is in deprecation as these functions are enough. | ||
* Securing instance's properties from public access. Access to instance properties, like `instance.secret`, is not allowed anymore. | ||
* New TypeScript definition file of this library is now available. | ||
* Fixed documentation (typos, diction, etc). | ||
* For contributor: Using `mocha`, `chai` and `coveralls` to create full unit-testing of the library. You could see testing result on top of this README. | ||
* For contributor: Using `gulp` to compile the TypeScript source code into JavaScript ES5. | ||
|
||
**What's New in 1.0.0** | ||
|
||
* Initial release |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,42 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import UglifyJS from 'uglify-js'; | ||
|
||
const distFileLocation: fs.PathLike = path.join(__dirname, '..', 'dist', 'SimpleCrypto.js'); | ||
const minifiedDistFileLocation: fs.PathLike = path.join(__dirname, '..', 'dist', 'SimpleCrypto.min.js'); | ||
|
||
const options: UglifyJS.MinifyOptions = { | ||
toplevel: true, | ||
ie8: true, | ||
output: { | ||
beautify: false, | ||
shebang: false, | ||
preamble: `/** | ||
* MIT License | ||
* | ||
* Copyright (c) 2017 Danang Galuh Tegar Prasetyo | ||
* ------------------------------------- | ||
*/ | ||
` | ||
} | ||
}; | ||
|
||
try { | ||
let distFileContent = fs.readFileSync(distFileLocation, 'utf-8'); | ||
const result: UglifyJS.MinifyOutput = UglifyJS.minify(distFileContent, options); | ||
if (result.error) { | ||
console.log(result.error); | ||
process.exit(2); | ||
} | ||
distFileContent = distFileContent.concat(options.output.preamble); | ||
const minifiedDistFileContent = result.code; | ||
fs.writeFileSync(distFileLocation, distFileContent, { | ||
encoding: 'utf-8' | ||
}); | ||
fs.writeFileSync(minifiedDistFileLocation, minifiedDistFileContent, { | ||
encoding: 'utf-8' | ||
}); | ||
} catch (error) { | ||
console.log(error); | ||
process.exit(1); | ||
} |
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,4 +1,4 @@ | ||
import * as chai from "chai"; | ||
import chai from "chai"; | ||
|
||
import SimpleCrypto from "../src/SimpleCrypto"; | ||
|
||
|
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,4 +1,4 @@ | ||
import * as chai from "chai"; | ||
import chai from "chai"; | ||
|
||
import SimpleCrypto from "../src/SimpleCrypto"; | ||
|
||
|
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