Skip to content

Commit bb66b94

Browse files
committed
fix the issues and downgrade some modules because of compatibility
1 parent 490c05a commit bb66b94

File tree

9 files changed

+1168
-185
lines changed

9 files changed

+1168
-185
lines changed

.travis.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
language: node_js
22
node_js:
33
- 14
4-
- 16
5-
- 18
64
script:
75
- jest --ci --coverage && codecov
6+
before_deploy:
7+
- npm run build
8+
deploy:
9+
- provider: npm
10+
email: $NPM_USER_EMAIL
11+
api_key: $NPM_USER_KEY
12+
skip_cleanup: true
13+
on:
14+
tags: true

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "rollup-plugin-copy-merge",
33
"description": "Copy & Merge files and folders using Rollup",
4-
"version": "0.2.0",
4+
"version": "0.3.0",
55
"author": "syJSdev <[email protected]>",
66
"repository": "syJSdev/rollup-plugin-copy-merge",
77
"main": "dist/index.commonjs.js",
@@ -22,14 +22,15 @@
2222
"@types/fs-extra": "^9.0.13",
2323
"colorette": "^2.0.17",
2424
"fs-extra": "^10.1.0",
25-
"globby": "13.1.1",
25+
"globby": "11.0.4",
2626
"is-plain-object": "^5.0.0"
2727
},
2828
"devDependencies": {
29-
"@babel/core": "^7.8.3",
30-
"@babel/preset-env": "^7.8.3",
29+
"@babel/core": "^7.18.2",
30+
"@babel/preset-env": "^7.18.2",
3131
"@rollup/plugin-babel": "^5.3.1",
32-
"babel-jest": "^28.1.0",
32+
"@rollup/plugin-commonjs": "^22.0.0",
33+
"@rollup/plugin-node-resolve": "^13.3.0",
3334
"codecov": "^3.6.1",
3435
"eslint": "^8.17.0",
3536
"eslint-config-airbnb-base": "^15.0.0",
@@ -44,8 +45,7 @@
4445
"replace-in-file": "^6.3.5",
4546
"rimraf": "^3.0.0",
4647
"rollup": "^2.75.5",
47-
"rollup-plugin-auto-external": "^2.0.0",
48-
"rollup-plugin-includepaths": "^0.2.4"
48+
"rollup-plugin-filesize": "^9.1.2"
4949
},
5050
"files": [
5151
"dist",

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![codecov](https://codecov.io/gh/syJSdev/rollup-plugin-copy-merge/branch/main/graph/badge.svg?token=RMODCAC64I)](https://codecov.io/gh/syJSdev/rollup-plugin-copy-merge)
77

88
Copy & Merge files and folders, with glob support.
9-
This plugin is extended [rollup-plugin-copy](https://github.com/syJSdev/rollup-plugin-copy) plugin which support the merge functionality.
9+
This plugin is extended [rollup-plugin-copy](https://github.com/vladshcherbin/rollup-plugin-copy) plugin which support the merge functionality.
1010
Thanks [#vladshcherbin](https://github.com/vladshcherbin)
1111

1212
## Installation

rollup.config.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
import babel from '@rollup/plugin-babel';
2-
import autoExternal from 'rollup-plugin-auto-external';
3-
import includePaths from 'rollup-plugin-includepaths';
1+
import path from 'node:path';
2+
import { babel } from '@rollup/plugin-babel';
3+
import commonjs from '@rollup/plugin-commonjs';
4+
import { nodeResolve as resolve } from '@rollup/plugin-node-resolve';
5+
import filesize from 'rollup-plugin-filesize';
6+
7+
import pkg from './package.json';
48

59
export default {
610
input: 'src/index.js',
11+
external: [...Object.keys(pkg.dependencies), 'path'],
712
output: [
813
{
914
file: 'dist/index.commonjs.js',
10-
format: 'commonjs'
15+
format: 'commonjs',
16+
exports: 'auto'
1117
},
1218
{
1319
file: 'dist/index.module.js',
14-
format: 'module'
20+
format: 'module',
21+
exports: 'auto'
1522
}
1623
],
1724
plugins: [
18-
includePaths({
19-
include: {},
20-
paths: ['src'],
21-
external: [],
22-
extensions: ['.js']
23-
}),
24-
babel({
25-
presets: [['@babel/preset-env', { targets: { node: '8.3' } }]],
26-
comments: false
27-
}),
28-
autoExternal()
25+
resolve(),
26+
commonjs(),
27+
babel({ babelHelpers: 'bundled', configFile: path.resolve(__dirname, 'babel.config.js') }),
28+
filesize()
2929
]
3030
};

src/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import path from 'path';
1+
import path from 'node:path';
22
import fs from 'fs-extra';
3-
import isObject from 'is-plain-object';
3+
import { isPlainObject } from 'is-plain-object';
44
import globby from 'globby';
55
import { bold, green, yellow } from 'colorette';
66

@@ -56,6 +56,7 @@ async function generateCopyTarget(src, dest, file, { flatten, rename, transform
5656
merge: !!file
5757
};
5858
}
59+
5960
/* eslint no-param-reassign: ["error", { "props": false }] */
6061
function concatContents(targets) {
6162
const dests = [];
@@ -113,7 +114,7 @@ export default function copy(options = {}) {
113114
if (Array.isArray(targets) && targets.length) {
114115
for (let index = 0; index < targets.length; index += 1) {
115116
const target = targets[index];
116-
if (!isObject(target)) {
117+
if (!isPlainObject(target)) {
117118
throw new Error(`${stringify(target)} target must be an object`);
118119
}
119120

src/utils/ensureTrailingNewLine.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import os from 'os';
1+
import os from 'node:os';
22

33
export default function ensureTrailingNewLine(contents) {
44
if (!contents.endsWith(os.EOL)) return contents + os.EOL;

src/utils/stringify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import util from 'util';
1+
import util from 'node:util';
22

33
export default function stringify(value) {
44
return util.inspect(value, { breakLength: Infinity });

tests/index.test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import { rollup, watch } from 'rollup';
22
import fs from 'fs-extra';
33
import replace from 'replace-in-file';
4-
import { bold, green, yellow, options } from 'colorette';
4+
import { bold, green, yellow } from 'colorette';
55
import copy from '../src';
66
import { ensureTrailingNewLine } from '../src/utils';
77

88
process.chdir(`${__dirname}/fixtures`);
99

10-
options.enabled = true;
11-
1210
function sleep(ms) {
1311
return new Promise((resolve) => {
1412
setTimeout(resolve, ms);

0 commit comments

Comments
 (0)