react-tooltip 5.26.4 → 6.0.0-beta.1179.rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +3 -1
- package/beta-release.js +81 -0
- package/dist/react-tooltip.cjs +317 -467
- package/dist/react-tooltip.cjs.map +1 -1
- package/dist/react-tooltip.d.ts +5 -82
- package/dist/react-tooltip.min.cjs +3 -2
- package/dist/react-tooltip.min.cjs.map +1 -1
- package/dist/react-tooltip.min.mjs +3 -2
- package/dist/react-tooltip.min.mjs.map +1 -1
- package/dist/react-tooltip.mjs +317 -457
- package/dist/react-tooltip.mjs.map +1 -1
- package/dist/react-tooltip.umd.js +320 -470
- package/dist/react-tooltip.umd.js.map +1 -1
- package/dist/react-tooltip.umd.min.js +3 -2
- package/dist/react-tooltip.umd.min.js.map +1 -1
- package/package.json +49 -47
- package/rollup.config.dev.mjs +88 -0
- package/rollup.config.prod.mjs +126 -0
- package/rollup.config.types.mjs +21 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// import analyze from 'rollup-plugin-analyzer'
|
|
2
|
+
import commonjs from '@rollup/plugin-commonjs'
|
|
3
|
+
import filesize from 'rollup-plugin-filesize'
|
|
4
|
+
import postcss from 'rollup-plugin-postcss'
|
|
5
|
+
import progress from 'rollup-plugin-progress'
|
|
6
|
+
import browsersync from 'rollup-plugin-browsersync'
|
|
7
|
+
import html from 'rollup-plugin-html-scaffold'
|
|
8
|
+
import replace from '@rollup/plugin-replace'
|
|
9
|
+
import copy from 'rollup-plugin-copy'
|
|
10
|
+
import { nodeResolve } from '@rollup/plugin-node-resolve'
|
|
11
|
+
import ts from '@rollup/plugin-typescript'
|
|
12
|
+
import typescript from 'typescript'
|
|
13
|
+
|
|
14
|
+
const input = ['src/index-dev.tsx']
|
|
15
|
+
|
|
16
|
+
const name = 'ReactTooltip'
|
|
17
|
+
|
|
18
|
+
const globals = {
|
|
19
|
+
react: 'React',
|
|
20
|
+
'react-dom': 'ReactDOM',
|
|
21
|
+
clsx: 'clsx',
|
|
22
|
+
'prop-types': 'PropTypes',
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const plugins = [
|
|
26
|
+
progress(),
|
|
27
|
+
html({
|
|
28
|
+
input: './public/index-rollup.html',
|
|
29
|
+
output: './build/index.html',
|
|
30
|
+
template: { appBundle: 'index.js' },
|
|
31
|
+
}),
|
|
32
|
+
replace({
|
|
33
|
+
preventAssignment: true,
|
|
34
|
+
values: {
|
|
35
|
+
'process.env.NODE_ENV': JSON.stringify('development'),
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
postcss({
|
|
39
|
+
extract: true,
|
|
40
|
+
autoModules: true,
|
|
41
|
+
include: '**/*.css',
|
|
42
|
+
extensions: ['.css'],
|
|
43
|
+
plugins: [],
|
|
44
|
+
}),
|
|
45
|
+
nodeResolve(),
|
|
46
|
+
ts({
|
|
47
|
+
typescript,
|
|
48
|
+
tsconfig: './tsconfig.json',
|
|
49
|
+
noEmitOnError: false,
|
|
50
|
+
// declaration: true,
|
|
51
|
+
// declarationDir: './build',
|
|
52
|
+
}),
|
|
53
|
+
commonjs({
|
|
54
|
+
include: 'node_modules/**',
|
|
55
|
+
}),
|
|
56
|
+
// analyze(), // to check diff of file size when bundle
|
|
57
|
+
filesize(),
|
|
58
|
+
copy({
|
|
59
|
+
// targets: [
|
|
60
|
+
// { src: 'src/assets', dest: 'build/' },
|
|
61
|
+
// { src: 'public/manifest.json', dest: 'build/' },
|
|
62
|
+
// { src: 'public/offline.html', dest: 'build/' },
|
|
63
|
+
// ],
|
|
64
|
+
targets: [{ src: 'dist/', dest: 'build/' }],
|
|
65
|
+
verbose: true,
|
|
66
|
+
}),
|
|
67
|
+
browsersync({
|
|
68
|
+
server: 'build',
|
|
69
|
+
watch: true,
|
|
70
|
+
ui: false,
|
|
71
|
+
open: false,
|
|
72
|
+
// port: 3000,
|
|
73
|
+
// ui: {
|
|
74
|
+
// port: 3001,
|
|
75
|
+
// },
|
|
76
|
+
}),
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
export default {
|
|
80
|
+
input,
|
|
81
|
+
output: {
|
|
82
|
+
file: 'build/index.js',
|
|
83
|
+
format: 'umd',
|
|
84
|
+
name,
|
|
85
|
+
globals,
|
|
86
|
+
},
|
|
87
|
+
plugins,
|
|
88
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import commonjs from '@rollup/plugin-commonjs'
|
|
2
|
+
import filesize from 'rollup-plugin-filesize'
|
|
3
|
+
import postcss from 'rollup-plugin-postcss'
|
|
4
|
+
import progress from 'rollup-plugin-progress'
|
|
5
|
+
import replace from '@rollup/plugin-replace'
|
|
6
|
+
import { nodeResolve } from '@rollup/plugin-node-resolve'
|
|
7
|
+
import ts from '@rollup/plugin-typescript'
|
|
8
|
+
import { terser } from 'rollup-plugin-terser'
|
|
9
|
+
import typescript from 'typescript'
|
|
10
|
+
import replaceBeforeSaveFile from './rollup-plugins/replace-before-save-file.js'
|
|
11
|
+
import pkg from './package.json' assert { type: 'json' }
|
|
12
|
+
|
|
13
|
+
const input = ['src/index.tsx']
|
|
14
|
+
|
|
15
|
+
const name = 'ReactTooltip'
|
|
16
|
+
|
|
17
|
+
const banner = `
|
|
18
|
+
/*
|
|
19
|
+
* React Tooltip
|
|
20
|
+
* {@link https://github.com/ReactTooltip/react-tooltip}
|
|
21
|
+
* @copyright ReactTooltip Team
|
|
22
|
+
* @license MIT
|
|
23
|
+
*/`
|
|
24
|
+
|
|
25
|
+
const external = [
|
|
26
|
+
...Object.keys(pkg.peerDependencies ?? {}),
|
|
27
|
+
...Object.keys(pkg.dependencies ?? {}),
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
const buildFormats = [
|
|
31
|
+
{
|
|
32
|
+
file: 'dist/react-tooltip.mjs',
|
|
33
|
+
format: 'es',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
file: 'dist/react-tooltip.umd.js',
|
|
37
|
+
format: 'umd',
|
|
38
|
+
globals: {
|
|
39
|
+
'@floating-ui/dom': 'FloatingUIDOM',
|
|
40
|
+
react: 'React',
|
|
41
|
+
'react-dom': 'ReactDOM',
|
|
42
|
+
clsx: 'clsx',
|
|
43
|
+
'prop-types': 'PropTypes',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
file: 'dist/react-tooltip.cjs',
|
|
48
|
+
format: 'cjs',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
file: 'dist/react-tooltip.mjs',
|
|
52
|
+
format: 'es',
|
|
53
|
+
},
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
const sharedPlugins = [
|
|
57
|
+
progress(),
|
|
58
|
+
replace({
|
|
59
|
+
preventAssignment: true,
|
|
60
|
+
values: {
|
|
61
|
+
'process.env.NODE_ENV': JSON.stringify('development'),
|
|
62
|
+
},
|
|
63
|
+
}),
|
|
64
|
+
nodeResolve(),
|
|
65
|
+
ts({
|
|
66
|
+
typescript,
|
|
67
|
+
tsconfig: './tsconfig.json',
|
|
68
|
+
noEmitOnError: false,
|
|
69
|
+
}),
|
|
70
|
+
commonjs({
|
|
71
|
+
include: 'node_modules/**',
|
|
72
|
+
}),
|
|
73
|
+
]
|
|
74
|
+
// this step is just to build the minified javascript files
|
|
75
|
+
const minifiedBuildFormats = buildFormats.map(({ file, ...rest }) => ({
|
|
76
|
+
file: file.replace(/(\.[cm]?js)$/, '.min$1'),
|
|
77
|
+
...rest,
|
|
78
|
+
minify: true,
|
|
79
|
+
plugins: [terser({ compress: { directives: false } }), filesize()],
|
|
80
|
+
}))
|
|
81
|
+
|
|
82
|
+
const allBuildFormats = [...buildFormats, ...minifiedBuildFormats]
|
|
83
|
+
|
|
84
|
+
const config = allBuildFormats.map(
|
|
85
|
+
({ file, format, globals, plugins: specificPlugins, minify }) => {
|
|
86
|
+
const plugins = [
|
|
87
|
+
...sharedPlugins,
|
|
88
|
+
postcss({
|
|
89
|
+
extract: minify ? 'react-tooltip.min.css' : 'react-tooltip.css', // this will generate a specific file and override on multiples build, but the css will be the same
|
|
90
|
+
autoModules: true,
|
|
91
|
+
include: '**/*.css',
|
|
92
|
+
extensions: ['.css'],
|
|
93
|
+
plugins: [],
|
|
94
|
+
minimize: Boolean(minify),
|
|
95
|
+
}),
|
|
96
|
+
replaceBeforeSaveFile({
|
|
97
|
+
// this only works for the react-tooltip.css because it's the first file
|
|
98
|
+
// writen in our build process before the javascript files.
|
|
99
|
+
"'react-tooltip-css-placeholder'": 'file:react-tooltip.css',
|
|
100
|
+
'"react-tooltip-css-placeholder"': 'file:react-tooltip.css',
|
|
101
|
+
"'react-tooltip-core-css-placeholder'": 'file:react-tooltip.css',
|
|
102
|
+
'"react-tooltip-core-css-placeholder"': 'file:react-tooltip.css',
|
|
103
|
+
}),
|
|
104
|
+
]
|
|
105
|
+
|
|
106
|
+
if (specificPlugins && specificPlugins.length) {
|
|
107
|
+
plugins.push(...specificPlugins)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return {
|
|
111
|
+
input,
|
|
112
|
+
output: {
|
|
113
|
+
file,
|
|
114
|
+
format,
|
|
115
|
+
name,
|
|
116
|
+
globals,
|
|
117
|
+
sourcemap: true,
|
|
118
|
+
banner,
|
|
119
|
+
},
|
|
120
|
+
external,
|
|
121
|
+
plugins,
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
export default config
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import dts from 'rollup-plugin-dts'
|
|
2
|
+
import postcss from 'rollup-plugin-postcss'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
input: './src/index.tsx',
|
|
6
|
+
output: [{ file: 'dist/react-tooltip.d.ts', format: 'es' }],
|
|
7
|
+
plugins: [
|
|
8
|
+
postcss({
|
|
9
|
+
extract: 'react-tooltip-tokens.css', // this will generate a specific file not being used, but we need this part of code
|
|
10
|
+
autoModules: true,
|
|
11
|
+
include: '**/*.css',
|
|
12
|
+
extensions: ['.css'],
|
|
13
|
+
plugins: [],
|
|
14
|
+
}),
|
|
15
|
+
dts({
|
|
16
|
+
compilerOptions: {
|
|
17
|
+
baseUrl: 'src',
|
|
18
|
+
},
|
|
19
|
+
}),
|
|
20
|
+
],
|
|
21
|
+
}
|