Skip to content

Commit 5c45674

Browse files
author
Dimitri Kopriwa
committed
test(index): fix wrong import
1 parent c165d2a commit 5c45674

File tree

7 files changed

+36
-122
lines changed

7 files changed

+36
-122
lines changed

.ncurc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const { createConfig } = require('@rollup-umd/ncu');
2+
module.exports = createConfig();

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ coverage/
2121
docs/
2222
reports/
2323
/styleguide
24+
.ncurc.js
File renamed without changes.

internals/testing/test-bundler.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

package.json

Lines changed: 30 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -102,53 +102,42 @@
102102
}
103103
},
104104
"devDependencies": {
105-
"@babel/cli": "^7.2.0",
106-
"@babel/core": "^7.2.2",
105+
"@babel/cli": "^7.4.4",
106+
"@babel/core": "^7.4.5",
107107
"@babel/plugin-external-helpers": "^7.2.0",
108-
"@babel/plugin-proposal-class-properties": "^7.2.1",
109-
"@babel/plugin-proposal-decorators": "^7.2.2",
108+
"@babel/plugin-proposal-class-properties": "^7.4.4",
109+
"@babel/plugin-proposal-decorators": "^7.4.4",
110110
"@babel/plugin-proposal-json-strings": "^7.2.0",
111-
"@babel/plugin-proposal-object-rest-spread": "^7.2.0",
111+
"@babel/plugin-proposal-object-rest-spread": "^7.4.4",
112112
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
113113
"@babel/plugin-syntax-import-meta": "^7.2.0",
114-
"@babel/plugin-transform-modules-commonjs": "^7.2.0",
115-
"@babel/preset-env": "^7.2.0",
116-
"@bootstrap-styled/documentation": "^1.1.1",
117-
"@rollup-umd/documentation": "^1.2.0",
118-
"@semantic-release/changelog": "^3.0.0",
119-
"@semantic-release/git": "^7.0.5",
120-
"@semantic-release/github": "^5.2.1",
121-
"@semantic-release/npm": "^5.1.2",
122-
"babel-core": "^7.0.0-bridge.0",
123-
"babel-eslint": "^10.0.1",
124-
"babel-jest": "^23.6.0",
125-
"babel-loader": "^8.0.4",
126-
"babel-plugin-add-module-exports": "^1.0.0",
114+
"@babel/plugin-transform-modules-commonjs": "^7.4.4",
115+
"@babel/preset-env": "^7.4.5",
116+
"@bootstrap-styled/documentation": "^2.0.0",
117+
"@rollup-umd/documentation": "^2.0.5",
118+
"@rollup-umd/ncu": "^1.0.9",
119+
"@rollup-umd/rollup": "^1.0.13",
120+
"@semantic-release/changelog": "^3.0.4",
121+
"@semantic-release/git": "^7.0.12",
122+
"@semantic-release/github": "^5.4.0",
123+
"@semantic-release/npm": "^5.1.9",
124+
"babel-eslint": "^10.0.2",
125+
"babel-jest": "^24.8.0",
126+
"babel-loader": "^8.0.6",
127+
"babel-plugin-add-module-exports": "^1.0.2",
127128
"babel-plugin-array-includes": "^2.0.3",
128129
"babel-plugin-dynamic-import-node": "^2.2.0",
129130
"eslint": "^5.10.0",
130131
"eslint-config-airbnb-base": "^13.1.0",
131-
"eslint-plugin-import": "^2.14.0",
132-
"jest-cli": "^23.6.0",
132+
"eslint-plugin-import": "^2.17.3",
133+
"jest-cli": "^24.8.0",
133134
"jest-sonar-reporter": "^2.0.0",
134135
"lint-staged": "^8.1.0",
135136
"pre-commit": "^1.2.2",
136-
"react-styleguidist": "^8.0.6",
137+
"react-styleguidist": "^9.1.7",
137138
"rimraf": "^2.6.2",
138-
"rollup": "^0.68.0",
139-
"rollup-plugin-babel": "^4.1.0",
140-
"rollup-plugin-cleanup": "^3.0.0",
141-
"rollup-plugin-commonjs": "^9.2.0",
142-
"rollup-plugin-inject": "^2.2.0",
143-
"rollup-plugin-json": "^3.1.0",
144-
"rollup-plugin-node-builtins": "^2.1.2",
145-
"rollup-plugin-node-resolve": "^4.0.0",
146-
"rollup-plugin-replace": "^2.1.0",
147-
"rollup-plugin-terser": "^3.0.0",
148-
"rollup-plugin-visualizer": "^0.9.2",
149-
"rollup-watch": "^4.3.1",
139+
"rollup": "^1.15.6",
150140
"semantic-release": "^15.13.0",
151-
"sinon": "^7.2.2",
152141
"toctoc": "^0.3.2",
153142
"webpack": "^4.27.1"
154143
},
@@ -157,6 +146,10 @@
157146
"<rootDir>/src/"
158147
],
159148
"testURL": "http://localhost/",
149+
"transformIgnorePatterns": [
150+
"<rootDir>/node_modules",
151+
"<rootDir>/internals"
152+
],
160153
"testPathIgnorePatterns": [
161154
"<rootDir>/dist/",
162155
"<rootDir>/lib/"
@@ -168,9 +161,9 @@
168161
"coverageThreshold": {
169162
"global": {
170163
"statements": 96,
171-
"branches": 79,
172-
"functions": 90,
173-
"lines": 95
164+
"branches": 84,
165+
"functions": 91,
166+
"lines": 96
174167
}
175168
},
176169
"moduleDirectories": [

rollup.config.js

Lines changed: 2 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,2 @@
1-
/* eslint-disable flowtype-errors/show-errors, no-console, import/extensions */
2-
import nodeResolve from 'rollup-plugin-node-resolve';
3-
import replace from 'rollup-plugin-replace';
4-
import commonjs from 'rollup-plugin-commonjs';
5-
import inject from 'rollup-plugin-inject';
6-
import babel from 'rollup-plugin-babel';
7-
import json from 'rollup-plugin-json';
8-
import { terser } from 'rollup-plugin-terser';
9-
import cleanup from 'rollup-plugin-cleanup';
10-
import visualizer from 'rollup-plugin-visualizer';
11-
import pkg from './package.json';
12-
import declination from './declination.json';
13-
const processShim = '\0process-shim';
14-
const prod = process.env.PRODUCTION;
15-
const mode = prod ? 'production' : 'development';
16-
const { external, globals } = declination;
17-
18-
console.log(`Creating ${mode} bundle...`);
19-
20-
const output = prod ? [
21-
{
22-
name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.min.js`, format: 'umd', sourcemap: true,
23-
},
24-
{
25-
name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.cjs.min.js`, format: 'cjs', sourcemap: true,
26-
},
27-
{
28-
name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.esm.js`, format: 'es', sourcemap: true,
29-
},
30-
] : [
31-
{
32-
name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.js`, format: 'umd', sourcemap: true,
33-
},
34-
{
35-
name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.cjs.js`, format: 'cjs', sourcemap: true,
36-
},
37-
{
38-
name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.esm.js`, format: 'es', sourcemap: true,
39-
},
40-
];
41-
const plugins = [
42-
// Unlike Webpack and Browserify, Rollup doesn't automatically shim Node
43-
// builtins like `process`. This ad-hoc plugin creates a 'virtual module'
44-
// which includes a shim containing just the parts the bundle needs.
45-
{
46-
resolveId(importee) {
47-
if (importee === processShim) return importee;
48-
return null;
49-
},
50-
load(id) {
51-
if (id === processShim) return 'export default { argv: [], env: {} }';
52-
return null;
53-
},
54-
},
55-
nodeResolve({
56-
browser: true,
57-
}),
58-
commonjs({
59-
include: 'node_modules/**',
60-
}),
61-
replace({
62-
'process.env.NODE_ENV': JSON.stringify(prod ? 'production' : 'development'),
63-
}),
64-
inject({
65-
process: processShim,
66-
}),
67-
babel({
68-
babelrc: false,
69-
exclude: 'node_modules/**',
70-
}),
71-
json(),
72-
cleanup(),
73-
];
74-
75-
export default output.map((o) => ({
76-
input: 'src/index.js',
77-
external,
78-
output: o,
79-
plugins: prod ? plugins.concat([terser(), visualizer({ filename: './bundle-stats.html' })]) : plugins,
80-
}));
1+
const { createConfig } = require('@rollup-umd/rollup');
2+
module.exports = createConfig();

src/tests/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const exports = require('../index');
1+
const exports = require('..');
22

33
describe('exports', () => {
44
Object.keys(exports).forEach((key) => {

0 commit comments

Comments
 (0)