mail-monster-lib 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +4 -0
- package/package.json +28 -0
- package/tests/tsc.test.ts +23 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 henry@create-flow.ai
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mail-monster-lib",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Typescript library for Flow AI's MailMonster",
|
|
5
|
+
"main": "./dist/mail-monster-lib.min.js",
|
|
6
|
+
"types": "./dist/mail-monster-lib.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "npm run tslint && tsc",
|
|
9
|
+
"dev:watch": "nodemon --exec 'npm run dev || exit 1'",
|
|
10
|
+
"tslint": "tslint --project .",
|
|
11
|
+
"build": "npm run dev && uglifyjs ./dist/mail-monster-lib.js -o ./dist/mail-monster-lib.min.js",
|
|
12
|
+
"test": "npm run clean && jest && npm run demo:test && npm run clean",
|
|
13
|
+
"test:coverage": "npm run clean && jest --coverage && npm run demo:test && npm run clean",
|
|
14
|
+
"clean": "rm -rf dist",
|
|
15
|
+
"demo:test": "npm run build && cd demo && npm install && npm run add-self && npm test"
|
|
16
|
+
},
|
|
17
|
+
"author": "henry@create-flow.ai",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/jest": "^23.3.7",
|
|
21
|
+
"jest": "^23.6.0",
|
|
22
|
+
"nodemon": "^1.17.5",
|
|
23
|
+
"ts-jest": "^23.10.4",
|
|
24
|
+
"tslint": "^5.10.0",
|
|
25
|
+
"typescript": "^2.9.2",
|
|
26
|
+
"uglify-js": "^3.4.9"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { exec } from 'child_process';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import 'jest';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
|
|
6
|
+
const TSC_COMMONJS_PATH = path.resolve(__dirname, '../dist/mail-monster-lib.js');
|
|
7
|
+
const TSC_COMMONJS_SOURCEMAP_PATH = path.resolve(__dirname, '../dist/mail-monster-lib.js.map');
|
|
8
|
+
|
|
9
|
+
describe('tsc bundle result', () => {
|
|
10
|
+
test('should generate mail-monster-lib.js and mail-monster-lib.js.map for commonjs modules', (done) => {
|
|
11
|
+
// Run tsc in child process
|
|
12
|
+
const forked = exec('npm run dev', (err, stdout, stderr) => {
|
|
13
|
+
if (err) {
|
|
14
|
+
throw err;
|
|
15
|
+
done();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
expect(fs.existsSync(TSC_COMMONJS_PATH)).toBeTruthy();
|
|
19
|
+
expect(fs.existsSync(TSC_COMMONJS_SOURCEMAP_PATH)).toBeTruthy();
|
|
20
|
+
done();
|
|
21
|
+
});
|
|
22
|
+
}, 10000); // Need extra time to run tsc command
|
|
23
|
+
});
|