Skip to content

Commit

Permalink
feat(init): updated using generator-node-mdl v4.0.0 🔥
Browse files Browse the repository at this point in the history
  • Loading branch information
sharvit committed Dec 21, 2019
1 parent 02c0346 commit c51ff85
Show file tree
Hide file tree
Showing 6 changed files with 1,033 additions and 69 deletions.
3 changes: 1 addition & 2 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
"targets": { "node": 8 }
}
]
],
"plugins": ["add-module-exports"]
]
}
27 changes: 27 additions & 0 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const path = require('path');

const config = {
mode: 'production',
target: 'node',

entry: path.resolve(__dirname, '../src/index.js'),

output: {
path: path.resolve(__dirname, '../dist'),
filename: 'index.js',
library: 'node-mdl-starter',
libraryTarget: 'umd',
},

module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
],
},
};

module.exports = config;
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
},
"scripts": {
"prebuild": "rimraf dist",
"build": "yarn build:babel && yarn build:docs",
"build:babel": "babel src --out-dir dist --ignore **/*.test.js",
"build": "yarn build:webpack && yarn build:docs",
"build:webpack": "webpack --config ./config/webpack.config.js",
"build:docs": "esdoc -c ./config/esdoc.config.js",
"develop:docs": "watch \"yarn build:docs\" . --ignoreDirectoryPattern='/node_modules|docs|dist|coverage|.git|.nyc*./'",
"test:watch": "jest --config ./config/jest.config.js --watch",
Expand All @@ -33,14 +33,14 @@
],
"dependencies": {},
"devDependencies": {
"@babel/cli": "^7.5.0",
"@babel/core": "^7.5.0",
"@babel/preset-env": "^7.5.0",
"@commitlint/cli": "^8.1.0",
"@commitlint/config-conventional": "^8.1.0",
"@commitlint/travis-cli": "^8.1.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^24.8.0",
"babel-loader": "^8.0.6",
"babel-plugin-add-module-exports": "^1.0.0",
"commitlint-config-cz": "^0.12.0",
"coveralls": "^3.0.2",
Expand All @@ -57,7 +57,9 @@
"eslint-plugin-standard": "^4.0.0",
"jest": "^24.8.0",
"prettier": "^1.15.3",
"rimraf": "^3.0.0"
"rimraf": "^3.0.0",
"webpack": "^4.41.4",
"webpack-cli": "^3.3.10"
},
"optionalDependencies": {
"cz-conventional-changelog": "^3.0.2",
Expand Down
7 changes: 7 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@
* @return {String} return the recived import.
*/
export default (input = 'No args passed!') => input;

/**
* Return the passed argument as is.
* @param {String} [input='No args passed!'] input argument to return.
* @return {String} return the recived import.
*/
export const namedExport = (input = 'No args passed!') => input;
5 changes: 4 additions & 1 deletion src/index.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import nodeMdlStarter from '.';
import nodeMdlStarter, { namedExport } from './index';

test('output', () => {
expect(nodeMdlStarter('🐰')).toBe('🐰');
expect(nodeMdlStarter()).toBe('No args passed!');

expect(namedExport('🐰')).toBe('🐰');
expect(namedExport()).toBe('No args passed!');
});

0 comments on commit c51ff85

Please sign in to comment.