Skip to content

Commit

Permalink
Move back from tsup/esbuild to rollup (#3720)
Browse files Browse the repository at this point in the history
* fix: bring back global rollup config

* fix: add rollup build for packages except pm

* fix: rollup global build

* fix: fix memory leak on build

* fix(character-count): revert files

* fix: builds run individual per rollup and lerna

* chore: remove old rollup

* fix(blockquote): correct the main module path

* fix(character count): bump version number
  • Loading branch information
bdbch authored Feb 8, 2023
1 parent e958128 commit 243c6ab
Show file tree
Hide file tree
Showing 159 changed files with 4,374 additions and 1,006 deletions.
1,016 changes: 961 additions & 55 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 14 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"lint:staged": "lint-staged",
"test:open": "npm run build:pm && cypress open --project tests",
"test": "npm run build:pm && cypress run --project tests",
"build": "npm run clean:packages && npm run clean:packs && lerna run build",
"build": "lerna run build",
"build:pm": "npm --prefix ./packages/pm run build",
"build:demos": "npm --prefix ./demos run build:demos",
"build:ci": "npm run build",
Expand All @@ -34,15 +34,19 @@
"prepare": "husky install"
},
"devDependencies": {
"@atomico/rollup-plugin-sizes": "^1.1.4",
"@babel/core": "^7.17.0",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
"@babel/plugin-proposal-optional-chaining": "^7.16.7",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@cypress/webpack-preprocessor": "^5.11.0",
"@lerna/batch-packages": "^3.16.0",
"@lerna/filter-packages": "^5.0.0",
"@lerna/project": "^5.0.0",
"@lerna/filter-packages": "^5.6.2",
"@lerna/project": "^5.6.2",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-node-resolve": "^13.1.3",
"@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.10.2",
"babel-loader": "^8.2.3",
Expand All @@ -57,11 +61,15 @@
"husky": "^8.0.1",
"lerna": "^5.5.1",
"lint-staged": "^13.0.3",
"minimist": "^1.2.5",
"minimist": "^1.2.7",
"rollup": "^2.67.0",
"rollup-plugin-auto-external": "^2.0.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"rollup-plugin-typescript2": "^0.31.2",
"ts-loader": "9.3.1",
"tsup": "^6.5.0",
"typescript": "4.7.4",
"typescript": "^4.5.5",
"webpack": "^5.68.0"
},
"name": "tiptap"
}
}
21 changes: 6 additions & 15 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"types": "./dist/packages/core/src/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"umd": "dist/index.umd.js",
"types": "dist/packages/core/src/index.d.ts",
"files": [
"src",
"dist"
Expand All @@ -43,17 +44,7 @@
},
"sideEffects": false,
"scripts": {
"build": "tsup"
},
"tsup": {
"entry": [
"src/index.ts"
],
"dts": true,
"splitting": true,
"format": [
"esm",
"cjs"
]
"clean": "rm -rf dist",
"build": "npm run clean && rollup -c"
}
}
}
59 changes: 59 additions & 0 deletions packages/core/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import sizes from '@atomico/rollup-plugin-sizes'
import babel from '@rollup/plugin-babel'
import commonjs from '@rollup/plugin-commonjs'
import resolve from '@rollup/plugin-node-resolve'
import autoExternal from 'rollup-plugin-auto-external'
import sourcemaps from 'rollup-plugin-sourcemaps'
import typescript from 'rollup-plugin-typescript2'

import pkg from './package.json'

export default {
input: 'src/index.ts',
output: [
{
name: pkg.name,
file: pkg.umd,
format: 'umd',
sourcemap: true,
},
{
name: pkg.name,
file: pkg.main,
format: 'cjs',
sourcemap: true,
exports: 'auto',
},
{
name: pkg.name,
file: pkg.module,
format: 'es',
sourcemap: true,
},
],
plugins: [
autoExternal({
packagePath: './package.json',
}),
sourcemaps(),
resolve(),
commonjs(),
babel({
babelHelpers: 'bundled',
exclude: '../../node_modules/**',
}),
sizes(),
typescript({
tsconfig: '../../tsconfig.json',
tsconfigOverride: {
compilerOptions: {
declaration: true,
paths: {
'@tiptap/*': ['packages/*/src'],
},
},
include: null,
},
}),
],
}
3 changes: 0 additions & 3 deletions packages/core/tsconfig.json

This file was deleted.

21 changes: 6 additions & 15 deletions packages/extension-blockquote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"types": "./dist/packages/extension-blockquote/src/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "dist/index.d.cjs",
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"umd": "dist/index.umd.js",
"types": "dist/packages/extension-blockquote/src/index.d.ts",
"files": [
"src",
"dist"
Expand All @@ -39,17 +40,7 @@
"directory": "packages/extension-blockquote"
},
"scripts": {
"build": "tsup"
},
"tsup": {
"entry": [
"src/index.ts"
],
"dts": true,
"splitting": true,
"format": [
"esm",
"cjs"
]
"clean": "rm -rf dist",
"build": "npm run clean && rollup -c"
}
}
59 changes: 59 additions & 0 deletions packages/extension-blockquote/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import sizes from '@atomico/rollup-plugin-sizes'
import babel from '@rollup/plugin-babel'
import commonjs from '@rollup/plugin-commonjs'
import resolve from '@rollup/plugin-node-resolve'
import autoExternal from 'rollup-plugin-auto-external'
import sourcemaps from 'rollup-plugin-sourcemaps'
import typescript from 'rollup-plugin-typescript2'

import pkg from './package.json'

export default {
input: 'src/index.ts',
output: [
{
name: pkg.name,
file: pkg.umd,
format: 'umd',
sourcemap: true,
},
{
name: pkg.name,
file: pkg.main,
format: 'cjs',
sourcemap: true,
exports: 'auto',
},
{
name: pkg.name,
file: pkg.module,
format: 'es',
sourcemap: true,
},
],
plugins: [
autoExternal({
packagePath: './package.json',
}),
sourcemaps(),
resolve(),
commonjs(),
babel({
babelHelpers: 'bundled',
exclude: '../../node_modules/**',
}),
sizes(),
typescript({
tsconfig: '../../tsconfig.json',
tsconfigOverride: {
compilerOptions: {
declaration: true,
paths: {
'@tiptap/*': ['packages/*/src'],
},
},
include: null,
},
}),
],
}
3 changes: 0 additions & 3 deletions packages/extension-blockquote/tsconfig.json

This file was deleted.

21 changes: 6 additions & 15 deletions packages/extension-bold/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"types": "./dist/packages/extension-bold/src/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"umd": "dist/index.umd.js",
"types": "dist/packages/extension-bold/src/index.d.ts",
"files": [
"src",
"dist"
Expand All @@ -39,17 +40,7 @@
"directory": "packages/extension-bold"
},
"scripts": {
"build": "tsup"
},
"tsup": {
"entry": [
"src/index.ts"
],
"dts": true,
"splitting": true,
"format": [
"esm",
"cjs"
]
"clean": "rm -rf dist",
"build": "npm run clean && rollup -c"
}
}
}
59 changes: 59 additions & 0 deletions packages/extension-bold/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import sizes from '@atomico/rollup-plugin-sizes'
import babel from '@rollup/plugin-babel'
import commonjs from '@rollup/plugin-commonjs'
import resolve from '@rollup/plugin-node-resolve'
import autoExternal from 'rollup-plugin-auto-external'
import sourcemaps from 'rollup-plugin-sourcemaps'
import typescript from 'rollup-plugin-typescript2'

import pkg from './package.json'

export default {
input: 'src/index.ts',
output: [
{
name: pkg.name,
file: pkg.umd,
format: 'umd',
sourcemap: true,
},
{
name: pkg.name,
file: pkg.main,
format: 'cjs',
sourcemap: true,
exports: 'auto',
},
{
name: pkg.name,
file: pkg.module,
format: 'es',
sourcemap: true,
},
],
plugins: [
autoExternal({
packagePath: './package.json',
}),
sourcemaps(),
resolve(),
commonjs(),
babel({
babelHelpers: 'bundled',
exclude: '../../node_modules/**',
}),
sizes(),
typescript({
tsconfig: '../../tsconfig.json',
tsconfigOverride: {
compilerOptions: {
declaration: true,
paths: {
'@tiptap/*': ['packages/*/src'],
},
},
include: null,
},
}),
],
}
3 changes: 0 additions & 3 deletions packages/extension-bold/tsconfig.json

This file was deleted.

Loading

0 comments on commit 243c6ab

Please sign in to comment.