Skip to content

Commit

Permalink
closes #150 - migrate to terser over now unmaintained uglify, sets fo…
Browse files Browse the repository at this point in the history
…undation for #134 - typescript migration
  • Loading branch information
osdevisnot committed Dec 5, 2018
1 parent d50caef commit 88e4487
Show file tree
Hide file tree
Showing 8 changed files with 239 additions and 234 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ node_modules
package-lock.json
yarn.lock
.vscode
.rpt2_cache
dist
10 changes: 10 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
clearMocks: true,
coveragePathIgnorePatterns: ['/node_modules/', '/test/'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'json', 'jsx'],
testMatch: [
'**/__tests__/**/*.(js|ts)?(x)',
'**/?(*.)+(spec|test).(js|ts)?(x)'
],
transform: { '.(ts|tsx|js|jsx)': 'ts-jest' }
};
5 changes: 5 additions & 0 deletions jest.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare namespace jest {
interface Matchers<R> {
toMatchDOM(modes: any): CustomMatcher;
}
}
63 changes: 36 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,48 @@
{
"name": "superfine",
"description": "Minimal view layer for creating declarative web user interfaces.",
"version": "6.0.1",
"main": "dist/superfine.js",
"module": "src/index.js",
"license": "MIT",
"repository": "jorgebucaran/superfine",
"types": "superfine.d.ts",
"files": [
"src",
"dist",
"superfine.d.ts"
],
"author": "Jorge Bucaran",
"description": "Minimal view layer for creating declarative web user interfaces.",
"keywords": [
"superfine",
"frontend",
"virtual dom",
"vdom"
"superfine",
"vdom",
"virtual dom"
],
"repository": "jorgebucaran/superfine",
"license": "MIT",
"author": "Jorge Bucaran",
"files": [
"dist"
],
"main": "dist/superfine.js",
"module": "dist/superfine.mjs",
"types": "dist/superfine.d.ts",
"scripts": {
"test": "jest --coverage --no-cache",
"build": "npm run bundle && npm run minify",
"bundle": "rollup -i src/index.js -o dist/superfine.js -m -f umd -n superfine",
"minify": "uglifyjs dist/superfine.js -o dist/superfine.js -mc pure_funcs=['Object.defineProperty'] --source-map includeSources,url=superfine.js.map",
"prepare": "npm run build",
"release": "npm run build && npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
"prebuild": "del dist",
"build": "rollup -c",
"postbuild": "npm run test",
"prepub": "npm run setup",
"pub": "npm version patch",
"postpub": "npm publish",
"presetup": "git clean -fdX",
"setup": "npm install",
"postsetup": "npm run build",
"start": "rollup -wc",
"test": "jest --coverage --no-cache"
},
"babel": {
"presets": "env"
"prettier": {
"printWidth": 80,
"semi": true,
"singleQuote": true
},
"devDependencies": {
"babel-env": "2.4.1",
"jest": "^23.3.0",
"rollup": "^0.62.0",
"uglify-js": "^3.4.3"
"@types/jest": "^23.3.10",
"del-cli": "1.1.0",
"jest": "^23.6.0",
"rollup": "^0.67.4",
"rollup-plugin-terser": "3.0.0",
"rollup-plugin-typescript2": "0.18.0",
"ts-jest": "^23.10.5",
"typescript": "^3.2.1"
}
}
23 changes: 23 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const typescript = require('rollup-plugin-typescript2');
const terser = require('rollup-plugin-terser').terser;

export default [
{
input: 'src/superfine.ts',
output: { format: 'umd', file: 'dist/superfine.js', name: 'superfine' },
plugins: [
typescript({
tsconfigOverride: {
compilerOptions: { target: 'es5' },
include: ['src']
}
}),
terser()
]
},
{
input: 'src/superfine.ts',
output: { format: 'esm', file: 'dist/superfine.mjs' },
plugins: [typescript({ tsconfigOverride: { include: ['src'] } })]
}
];
Loading

0 comments on commit 88e4487

Please sign in to comment.