Skip to content

Commit

Permalink
Build compose, isStamp, isComposable to the module root (#233)
Browse files Browse the repository at this point in the history
* Build compose, isStamp, isComposable to the module root. Add tests for it.

* Update docs.

* Minor changes to README

* Fixing the API.md minor issues.

* Remove stampit.isStamp/isComposable. Minor improvements. More tests.

* Minor simplifications.

* JSDoc improvement in compose.js
  • Loading branch information
koresar authored and FredyC committed Sep 21, 2016
1 parent 57b5758 commit 6dfcc8f
Show file tree
Hide file tree
Showing 11 changed files with 273 additions and 107 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -1,3 +1,7 @@
##### Dev-only source code
/*.js
/*.js.map

##### SouceLab
buildconfig.env
server.js
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -4,7 +4,7 @@

**Create objects from reusable, composable behaviors**

Stamps are [standardised](https://github.com/stampit-org/stamp-specification) composable factory functions. **Stampit** is an [infected compose](https://medium.com/@koresar/fun-with-stamps-episode-8-tracking-and-overriding-composition-573aa85ba622).
Stamps are [standardised](https://github.com/stampit-org/stamp-specification) composable factory functions. **Stampit** is an [infected compose](https://medium.com/@koresar/fun-with-stamps-episode-8-tracking-and-overriding-composition-573aa85ba622) featuring friendly handy API.


## Simplest Example
Expand Down Expand Up @@ -51,7 +51,7 @@ npm install stampit
```


## Examples
## API

See the [API](docs/API.md).

Expand Down
70 changes: 58 additions & 12 deletions build/index.js
Expand Up @@ -20,30 +20,76 @@ const moduleName = 'stampit';
function execute() {
return Promise.all([
makeBundle(
{format: 'es6', ext: '.mjs'}
{
format: 'es6',
ext: '.mjs',
dest: 'dist',
moduleName: 'stampit'
}
),
makeBundle(
{
format: 'cjs',
ext: '.js',
babelPlugins: es2015Plugins,
dest: 'dist',
moduleName: 'stampit'
}
),
makeBundle(
{
format: 'cjs', ext: '.js',
babelPlugins: es2015Plugins
format: 'cjs',
ext: '.es5.js',
babelPlugins: es2015Plugins,
dest: 'dist',
moduleName: 'stampit'
}
),
makeBundle(
{
format: 'cjs', ext: '.es5.js',
babelPlugins: es2015Plugins
format: 'umd',
ext: '.full.js',
babelPlugins: es2015Plugins,
dest: 'dist',
moduleName: 'stampit'
}
),
makeBundle(
{
format: 'umd',
ext: '.full.min.js',
minify: true,
babelPlugins: es2015Plugins,
dest: 'dist',
moduleName: 'stampit'
}
),

makeBundle(
{
format: 'cjs',
ext: '.js',
babelPlugins: es2015Plugins,
dest: '.',
moduleName: 'compose'
}
),
makeBundle(
{
format: 'umd', ext: '.full.js',
babelPlugins: es2015Plugins
format: 'cjs',
ext: '.js',
babelPlugins: es2015Plugins,
dest: '.',
moduleName: 'isStamp'
}
),
makeBundle(
{
format: 'umd', ext: '.full.min.js', minify: true,
babelPlugins: es2015Plugins
format: 'cjs',
ext: '.js',
babelPlugins: es2015Plugins,
dest: '.',
moduleName: 'isComposable'
}
)
]);
Expand Down Expand Up @@ -74,7 +120,7 @@ function makeBundle(config) {
const isCJS = config.format === 'cjs';

const inputConfig = {
entry: 'src/stampit.js',
entry: `src/${config.moduleName}.js`,
plugins: [
babel({
babelrc: false,
Expand Down Expand Up @@ -102,10 +148,10 @@ function makeBundle(config) {
}

const outputConfig = {
dest: `dist/${moduleName}${config.ext}`,
dest: `${config.dest}/${config.moduleName}${config.ext}`,
format: config.format,
sourceMap: !config.minify,
moduleName: moduleName,
moduleName: config.moduleName,
exports: 'named'
};

Expand Down

0 comments on commit 6dfcc8f

Please sign in to comment.