Skip to content

Commit

Permalink
debugging rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
conartist6 committed Aug 25, 2018
1 parent 5ca8eec commit e6f1298
Show file tree
Hide file tree
Showing 10 changed files with 1,159 additions and 516 deletions.
9 changes: 0 additions & 9 deletions .babelrc

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.DS_Store
node_modules

/lib
/dist
/tmp

*.sublime-workspace
Expand Down
42 changes: 41 additions & 1 deletion Brocfile.js
Original file line number Diff line number Diff line change
@@ -1 +1,41 @@
module.exports = 'src'
const esTranspiler = require('broccoli-babel-transpiler');
const Rollup = require('broccoli-rollup');
const resolve = require('rollup-plugin-node-resolve');
const commonjs = require('rollup-plugin-commonjs');

let es = 'src';
es = esTranspiler(es, {
filterExtensions: ['js'],
presets: [
[
'@babel/preset-env',
{
modules: false,
},
],
],
plugins: ['@babel/plugin-external-helpers'],
});

module.exports = es;

let bundled = new Rollup(es, {
rollup: {
input: 'index.js',
output: {
file: 'sequins.js',
format: 'es',
},
plugins: [
resolve({
extensions: ['.mjs', '.js', '.json'],
}),

commonjs({
include: ['node_modules/memoizee', 'node_modules/invariant'],
}),
],
},
});

// module.exports = bundled;
23 changes: 14 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"main": "lib/index",
"scripts": {
"build": "broccoli build lib --overwrite",
"build": "broccoli build dist --overwrite",
"test": "jest"
},
"repository": {
Expand All @@ -28,15 +28,20 @@
"files": "lib",
"homepage": "https://github.com/conartist6/sequins#readme",
"devDependencies": {
"@babel/core": "^7.0.0-beta.54",
"@babel/plugin-transform-classes": "^7.0.0-beta.54",
"@babel/plugin-transform-modules-commonjs": "^7.0.0-beta.54",
"@babel/preset-env": "^7.0.0-beta.54",
"@babel/core": "^7.0.0-beta.56",
"@babel/plugin-external-helpers": "^7.0.0-rc.3",
"@babel/plugin-transform-classes": "^7.0.0-beta.56",
"@babel/plugin-transform-modules-commonjs": "^7.0.0-beta.56",
"@babel/preset-env": "7.0.0-beta.56",
"babel-core": "^7.0.0-beta.41",
"babel-jest": "^23.4.0",
"babel-plugin-transform-builtin-extend": "^1.1.2",
"broccoli": "^2.0.0-beta.2",
"jest": "^23.4.1"
"babel-jest": "^23.4.2",
"broccoli": "^2.0.0-beta.4",
"broccoli-babel-transpiler": "7.0.0-beta.4",
"broccoli-rollup": "^2.1.1",
"jest": "^23.4.2",
"rollup-plugin-babel": "^4.0.0-beta.8",
"rollup-plugin-commonjs": "^9.1.6",
"rollup-plugin-node-resolve": "^3.3.0"
},
"dependencies": {
"invariant": "^2.2.4",
Expand Down
5 changes: 4 additions & 1 deletion src/__test__/collection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ function makeTests(type, collectionSubtype) {
const flatten = makeFlatten(Collection, collectionSubtype, type);
const result = collection.flatten();
expect(result).toBeInstanceOf(CollectionConstructor);
expect(collection.flatten(true)).toBeIterable(expect.yieldsEqual(flatten(true, collection)));
const flattened = collection.flatten(true);
expect(flattened).toBeIterable();

expect(Array.from(flattened)).toEqual(Array.from(flatten(true, collection)));
});

// testMethod('mapEntries')
Expand Down
3 changes: 2 additions & 1 deletion src/__test__/helpers/make-test-method.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ class MethodTest {
_checkCollectionYields(result) {
if (this.hasOwnProperty('_expectedCollectionValues')) {
expect(result).toBeInstanceOf(this._ConstructorType);
expect(result).toBeIterable(expect.yieldsEqual(this._expectedCollectionValues));
expect(result).toBeIterable();
expect(Array.from(result)).toEqual(Array.from(this._expectedCollectionValues));
}
}

Expand Down
1 change: 0 additions & 1 deletion src/seq-factory.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Sequence from './sequence';
import { Range, Repeat } from './static';
import { isIndexed, isKeyed, isSet } from './utils/shape';

function Seq(initial) {
const seq = Sequence.from(initial);
Expand Down
2 changes: 1 addition & 1 deletion src/sequence.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { compose, map, concat } from 'iter-tools';
import { isIndexed, isKeyed, isSet, isConcrete } from './utils/shape';
import { isConcrete } from './utils/shape';
import invariant from 'invariant';
import { reverseArrayIterator } from './utils/array';
import CollectionMixin, {
Expand Down
2 changes: 0 additions & 2 deletions src/static.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { range, repeat } from 'iter-tools';
import IndexedSeq from './subtypes/sequence/indexed';

export { isMutableSeq, isKeyedSeq, isIndexedSeq } from './utils/shape';

export function Repeat(value, times = Infinity) {
return new IndexedSeq(repeat(value, times));
}
Expand Down
Loading

0 comments on commit e6f1298

Please sign in to comment.